C++ template code generation Error: use of 'some_variable' before deduction of 'auto' - c++17

I ran into some issues with this specific code. The problem has most likely something to do with pointer to member of type Harry stored in a tuple, and a vector with Harrytype variable since all other more simple variants do work.
The error that I get with g++:
main.cpp: In instantiation of 'abra(const std::vector<A>&, const std::tuple<_Elements ...>&) [with A = Harry; B = {int Harry::*, int* Harry::*}]::<lambda(const auto:1&)> [with auto:1 = int Harry::*]':
main.cpp:10:13: required from 'void tuple_foreach_constexpr(const std::tuple<T ...>&, F) [with long unsigned int i = 0; long unsigned int size = 2; F = abra(const std::vector<A>&, const std::tuple<_Elements ...>&) [with A = Harry; B = {int Harry::*, int* Harry::*}]::<lambda(const auto:1&)>; T = {int Harry::*, int* Harry::*}]'
main.cpp:17:82: required from 'void tuple_foreach_constexpr(const std::tuple<_Elements ...>&, F) [with F = abra(const std::vector<A>&, const std::tuple<_Elements ...>&) [with A = Harry; B = {int Harry::*, int* Harry::*}]::<lambda(const auto:1&)>; T = {int Harry::*, int* Harry::*}]'
main.cpp:29:32: required from 'void abra(const std::vector<A>&, const std::tuple<_Elements ...>&) [with A = Harry; B = {int Harry::*, int* Harry::*}]'
main.cpp:56:27: required from here
main.cpp:31:82: error: use of 'a' before deduction of 'auto'
if constexpr(std::is_pointer<typename std::remove_reference<decltype(a.*x)>::type>::value)
^
main.cpp:33:30: error: invalid type argument of unary '*' (have 'int')
std::cout << *(a.*x) << std::endl;
^~~~~~~
main.cpp:6:6: error: 'void tuple_foreach_constexpr(const std::tuple<T ...>&, F) [with long unsigned int i = 1; long unsigned int size = 2; F = abra(const std::vector<A>&, const std::tuple<_Elements ...>&) [with A = Harry; B = {int Harry::*, int* Harry::*}]::<lambda(const auto:1&)>; T = {int Harry::*, int* Harry::*}]', declared using local type 'abra(const std::vector<A>&, const std::tuple<_Elements ...>&) [with A = Harry; B = {int Harry::*, int* Harry::*}]::<lambda(const auto:1&)>', is used but never defined [-fpermissive]
void tuple_foreach_constexpr(const std::tuple<T...>& tuple, F func)
^~~~~~~~~~~~~~~~~~~~~~~
code:
#include <iostream>
#include <tuple>
#include <vector>
template<size_t i, size_t size, typename F, typename... T>
void tuple_foreach_constexpr(const std::tuple<T...>& tuple, F func)
{
if constexpr(i<size)
{
func(std::get<i>(tuple));
tuple_foreach_constexpr<i+1, size, F, T...>(tuple, func);
}
}
template<typename F, typename... T>
void tuple_foreach_constexpr(const std::tuple<T...>& tuple, F func)
{
tuple_foreach_constexpr<0, std::tuple_size<std::tuple<T...>>::value, F, T...>(tuple, func);
}
template<typename A, typename... B>
void abra
(
const std::vector<A>& a_vector,
const std::tuple<B...>& b_tuple
)
{
for(const auto& a : a_vector)
{
tuple_foreach_constexpr(b_tuple, [&a](const auto &x)
{
if constexpr(std::is_pointer<typename std::remove_reference<decltype(a.*x)>::type>::value)
{
std::cout << *(a.*x) << std::endl;
}
else
{
std::cout << a.*x << std::endl;
} // this does NOT work
//std::cout << a.*x << std::endl; // this does work
});
}
}
struct Harry
{
int a;
int* b;
};
int main()
{
int m = 20;
std::vector<Harry> h_vector = {Harry{10, &m}};
std::tuple t_tuple = std::make_tuple(&Harry::a, &Harry::b);
abra(h_vector, t_tuple);
}
It would be very nice if someone had some tips on how to solve this.
(I know this all looks like it makes no sense why anyone would need to do this. However, my priority is not to write good, usable code but to learn stuff and also I really want to get this architecture I had in mind to work.)

It would be very nice if someone had some tips on how to solve this.
First of all: I reproduce your error with g++ but my clang++ (7.0.1) compile your code without problem.
Who's right? g++ or clang++?
I'm not a language lawyer and I'm not sure but I suspect it's a g++ bug.
What is saying g++?
It's saying that in this loop
for(const auto& a : a_vector)
{
tuple_foreach_constexpr(b_tuple, [&a](const auto &x)
{
if constexpr(std::is_pointer<typename std::remove_reference<decltype(a.*x)>::type>::value)
{
std::cout << *(a.*x) << std::endl;
}
else
{
std::cout << a.*x << std::endl;
} // this does NOT work
//std::cout << a.*x << std::endl; // this does work
});
}
the a variable, that is an auto variable (const auto& a : a_vector) so it's type must be deduced by the compiler, that is captured inside the lambda function, is used (decltype(a.*x)) before the deduction of the type.
Anyway, the solution of the problem is simple: to make g++ happy, explicit the definition.
You know that a is an element of a_vector that is defined as a std::vector<A> const &, so you know that a is a A const &.
So, if you write the loop
for ( A const & a : a_vector )
{
// ....
}
there is no more needs to deduce the type of a and your code compile also with g++.

Related

flex - Simple parser gives error: fatal flex scanner internal error--end of buffer missed

I'm trying to implement a simple parser that calculates addition, subtraction, multiplication and division using fractional numbers. Fractional numbers in this form: nominatorfdenominator like this 2f3 4f6 9f4 etc. Parser should run on REPL mode. To compile and run:
lex lexer.l
yacc -d parser.y
cc lex.yy.c y.tab.c -lm -o main
./main
flex code:
%{
#include "y.tab.h"
extern YYSTYPE yylval;
#include <math.h>
void to_int(char* num, int* arr);
%}
IDENTIFIER_ERROR [0-9][a-zA-Z0-9_]*
COMMENT ";;".*
VALUESTR \"(.*?)\"
%%
[ \t\f\v\n] { ; }
exit { return KW_EXIT; }
"+" { return OP_PLUS; }
"-" { return OP_MINUS; }
"/" { return OP_DIV; }
"*" { return OP_MULT; }
"(" { return OP_OP; }
")" { return OP_CP; }
(0)|([1-9]+"f"[1-9]*) { to_int(yytext, yylval.INT_ARR); return VALUEF; }
[a-zA-Z_]([a-zA-Z0-9_]*) { strcpy(yylval.STR, yytext); return IDENTIFIER; }
{COMMENT} { printf("%s: COMMENT\n", yytext); }
{IDENTIFIER_ERROR} { printf("%s: SYNTAX ERROR\n", yytext); exit(1); }
. { printf("%s: SYNTAX ERROR\n", yytext); exit(1); }
%%
// fractional number taken as a string, converting it to: arr[0] = nominator, arr[0] = nominator, arr[1] = denominator,
void to_int(char* num, int* arr) {
char* nominator, *denominator;
strcpy(nominator, num); // nominator contains whole number for now
strtok_r(nominator, "f", &denominator);
//printf ("lex: NUMS parsed as: %s %s\n", nominator, denominator);
arr[0] = atoi(nominator);
arr[1] = atoi(denominator);
//printf("lex: nom: %d denom: %d\n", arr[0], arr[1]);
}
int yywrap(){
return 1;
}
yacc file:
%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int yylex(void);
void yyerror(char *str);
void fractional_divide(int* num1, int* num2, int* RESULTF);
void fractional_multiply(int* num1, int* num2, int* RESULTF);
void fractional_sub(int* num1, int* num2, int* RESULTF);
void fractional_sum(int* num1, int* num2, int* RESULTF);
%}
%token KW_EXIT
%token OP_PLUS OP_MINUS OP_DIV OP_MULT OP_OP OP_CP OP_COMMA
%union{
int INTEGER;
int INT_ARR[2];
char STR[20];
};
%start START
%type<INT_ARR> EXP
%token <INT_ARR> VALUEF
%%
START : EXPLIST ;
EXPLIST : EXP | EXPLIST EXP ;
EXP: OP_OP OP_PLUS EXP EXP OP_CP { fractional_sum($3, $4, $$); printf("> %d%c%d\n", $$[0], 'f', $$[1]); }
| OP_OP OP_MINUS EXP EXP OP_CP { fractional_sub($3, $4, $$); printf("> %d%c%d\n", $$[0], 'f', $$[1]); }
| OP_OP OP_DIV EXP EXP OP_CP { fractional_divide($3, $4, $$); printf("> %d%c%d\n", $$[0], 'f', $$[1]); }
| OP_OP OP_MULT EXP EXP OP_CP { fractional_multiply($3, $4, $$); printf("> %d%c%d\n", $$[0], 'f', $$[1]); }
| VALUEF { $$[0] = $1[0]; $$[1] = $1[1];}
| KW_EXIT { printf("exiting...\n"); return 0; }
;
%%
void equalize_denominators(int* num1, int* num2) {
num1[0] *= num2[1];
num1[1] *= num2[1];
num2[0] *= num1[1];
num2[1] *= num1[1];
}
void fractional_sum(int* num1, int* num2, int* RESULTF) {
if (num1[1] != num2[1])
equalize_denominators(num1, num2);
RESULTF[0] = num1[0] + num2[0];
RESULTF[1] = num2[1];
}
void fractional_sub(int* num1, int* num2, int* RESULTF) {
if (num1[1] != num2[1])
equalize_denominators(num1, num2);
RESULTF[0] = num1[0] - num2[0];
RESULTF[1] = num2[1];
}
void fractional_divide(int* num1, int* num2, int* RESULTF) {
RESULTF[0] = num1[0] * num2[1];
RESULTF[1] = num1[1] * num2[0];
}
void fractional_multiply(int* num1, int* num2, int* RESULTF) {
RESULTF[0] = num1[0] * num2[0];
RESULTF[1] = num1[1] * num2[1];
}
void yyerror(char *str) {
printf("yyerror: %s\n", str);
}
int main(int argc, char *argv[]){
if(argc == 1)
yyparse();
else {
printf("Input error. Exiting...\n");
exit(1);
}
return 0;
}
sample output, first line is ok, but when I hit the enter after second line I get this error:
(+ 2f3 1f3)
result: 3f3
(* 2f1 2f6)
result: 4f6
fatal flex scanner internal error--end of buffer missed
That error message can occur in some specific circumstances involving the use of yymore() in the last token in the input, but probably the most common cause is memory corruption, which is what you've managed to do here.
It's likely that the issue is in to_int, where you do a strcpy whose destination is an uninitialised pointer:
void to_int(char* num, int* arr) {
char* nominator, *denominator;
strcpy(nominator, num); // FIXME nominator is uninitialised
It's actually not clear to me why you feel the need to make a copy of the argument num, since you are calling it with yytext. You're free to modify the contents of yytext as long as you don't write outside of its memory area. (The variable yyleng tells you how long yytext is.) Since strtok does not modify it's argument outside of the contents area, it's safe to apply to yytext. But if you are going to copy num, you obviously have to copy it to an actual validly initialized pointer; otherwise chaos will ensue. (Which could include triggering random flex error messages.)
I didn't check your code thoroughly nor did I attempt to run it, so there may be other errors. In particular, I did notice a couple of problems with your token patterns:
(0)|([1-9]+"f"[1-9]*) does not allow 10f2 or 2f103, since you only allow integers written with digits 1 through 9. It also allows 2f, whose meaning is opaque to me, and your to_int function could blow up on it. (At best, it would end up with a denominator of 0, which is also an error.) I'd recommend using two patterns, one for integers and the other for fractions:
0|[1-9][0-9]* { yylval.INT_ARG[0] = atoi(yytext);
yylval.INT_ARG[1] = 1;
return VALUEF;
}
0|[1-9][0-9]*f[1-9][0-9]* {
to_int(yytext, yylval.INT_ARR);
return VALUEF;
}
But you might want to add more meaningful error messages for illegal numbers like 03f2 and 3f0.
Although you don't use it anywhere, your pattern for character strings is incorrect, since (f)lex does not implement non-greedy matching. A better pattern would be \"[^"]*\" or \"[^"\n]*\" (which prohibits newlines inside strings); even better would be to allow backslash escapes with something like \"(\\.|[^"\\\n])*\". There are lots of other variants but that basically covers the general principle. (Some of us prefer ["] to \" but that's just stylistic; the meaning is the same.)
Also, it is bad style to call exit from a yylex action. It's better to arrange for some kind of error return. Similarly, you should not use a return statement from a yyparse action, since it leaves the parser's internal state inconsistent, and does not allow the parser to free the resources it has allocated. Use YY_ACCEPT (or YY_ABORT if you want to signal a syntax error). These are described in the documentation or any good guide.

clang-format: macro in a function

Some c code
Before format:
#define MS_DEF(type) extern type
MS_DEF(int) my_func(int a, int b, int c, const char *x, const char *y, const char *z)
{
// do something
return 0;
}
After format (clang-format --style=LLVM test.c) :
#define MS_DEF(type) extern type
MS_DEF(int)
my_func(int a, int b, int c, const char *x, const char *y, const char *z) {
// do something
return 0;
}
I want to keep MS_DEF(int) and my_func in same line
MS_DEF(int) my_func(...)
How to do? thanks
The TypenameMacros style option is intended exactly for such cases.
Try adding the following to your .clang-format configuration file:
TypenameMacros: ['MS_DEF']
With just that option, the formatted result is as following
#define MS_DEF(type) extern type
MS_DEF(int) my_func(int a, int b, int c, const char *x, const char *y,
const char *z) {
// do something
return 0;
}

BinaryOperator doesn't work when comes to a=function(b,c)?

I want to identify the Expression like int a = function(b,c), so I wrote the code as followers:
void foo(int* a, int *b) {
int x;
int m;
int z;
int *p;
if (a[0] > 1) {
b[0] = 2;
z=10;
x = function( sizeof(char));
}
m = function( sizeof(char));
bar(x,m);
}
void bar(float x, float y);
int function(int size){
return size;
}
And than I used clang -Xclang -ast-dump -fsyntax-only cfunc_with_if.c to get the AST of the code:
From the result I found the AST Node type of int a = function(b,c) is BinaryOperator. In order to verify this, I use VisitStmt(Stmt *s) to print out all stmts' type.
bool VisitStmt(Stmt *s) {
if(isa<Stmt>(s)) {
Stmt *Statement = dyn_cast<Stmt>(s);
//Statement->dump();
std::string st(Statement->getStmtClassName());
st = st + "\n";
TheRewriter.InsertText(Statement->getLocStart(), st, true, true);
}
return true;
}
But the result is so weird. There is nothing printed out about the type of int a = function(b,c). and I'm so confused about the result. Is there some error in my code or something else?
There's no output at bar(x,m); either. Are there any errors when the tool compiles the code being analyzed? As written above, the code would fail to compile at x = function( sizeof(char)); since function has not been declared. Even when compilation has failed due to errors, the libtool tools can still run at least partially, with strange results.
Edit to add: what happens if you run the tool on this code?
void bar(float x, float y);
int function(int size);
void foo(int* a, int *b) {
int x;
int m;
int z;
int *p;
if (a[0] > 1) {
b[0] = 2;
z=10;
x = function( sizeof(char));
}
m = function( sizeof(char));
bar(x,m);
}
void bar(float x, float y);
int function(int size){
return size;
}

Possible bug in libc++ for mac os ,string destructor is not called when string obj goes out of scope

In libc++ i have found that basic_string destructor does not gets called , once string goes out of the scope the memory is freed by calling delete operator rather than calling its destructor and then calling the delete operator from destructor, why so?
Can some one explain this?
see the sample program
void * operator new ( size_t len ) throw ( std::bad_alloc )
{
void * mem = malloc( len );
if ( (mem == 0) && (len != 0) )
throw std::bad_alloc();
return mem;
}
void operator delete ( void * ptr ) throw()
{
if ( ptr != 0 )
free( ptr );
}
int main(int argc, const char * argv[])
{
std::string mystr("testing very very very big string for string class");
std::string mystr2(mystr1.begin(),mystr.end());
}
Put break point on new and delete and then check the call stack.
new operator gets called from basic_string class while the delete gets called from the end of main, while ideally basic_string destructor should have called first and then the delete operator should be called via deallocate call of allocator, this is valid for 2nd string creation.
I'm seeing the same thing in the debugger that you are; I don't know for sure, but I suspect that stuff is getting inlined. The destructor for basic_string is very small; a single test (for the small string optimization), and then a call to the allocator's deallocate function (through allocate_traits). std::allocators allocate function is also quite small, just a wrapper around operator delete.
You could test this by writing your own allocator. (Later: see below)
More stuff that I generated while investigating this question; read on if you're interested.
[Note: there's a bug in your code - in the second line you wrote: mystr1.begin(),mystr.end()) - where is mystr1 declared?]
Assuming that's a typo, I tried some slightly different code:
#include <string>
#include <new>
#include <iostream>
int news = 0;
int dels = 0;
void * operator new ( size_t len ) throw ( std::bad_alloc )
{
void * mem = malloc( len );
if ( (mem == 0) && (len != 0) )
throw std::bad_alloc();
++news;
return mem;
}
void operator delete ( void * ptr ) throw()
{
++dels;
if ( ptr != 0 )
free( ptr );
}
int main(int argc, const char * argv[])
{
{
std::string mystr("testing very very very big string for string class");
std::string mystr2(mystr.begin(),mystr.end());
std::cout << "News = " << news << "; Dels = " << dels << std::endl;
}
std::cout << "News = " << news << "; Dels = " << dels << std::endl;
}
If you run this code, it prints (at least for me):
News = 2; Dels = 0
News = 2; Dels = 2
which is exactly what it should.
If I toss the code into compiler explorer, then I see both the calls to basic_string::~basic_string(), exactly as I expect. (Well, I see three of them, but one of them is in an exception handling block, which ends with a call to _Unwind_resume).
Later - this code:
#include <string>
#include <new>
#include <iostream>
int news = 0;
int dels = 0;
template <class T>
class MyAllocator
{
public:
typedef T value_type;
MyAllocator() noexcept {}
template <class U>
MyAllocator(MyAllocator<U>) noexcept {}
T* allocate(std::size_t n)
{
++news;
return static_cast<T*>(::operator new(n*sizeof(T)));
}
void deallocate(T* p, std::size_t)
{
++dels;
return ::operator delete(static_cast<void*>(p));
}
friend bool operator==(MyAllocator, MyAllocator) {return true;}
friend bool operator!=(MyAllocator, MyAllocator) {return false;}
};
int main(int argc, const char * argv[])
{
{
typedef std::basic_string<char, std::char_traits<char>, MyAllocator<char>> S;
S mystr("testing very very very big string for string class");
S mystr2(mystr.begin(),mystr.end());
std::cout << "Allocator News = " << news << "; Allocator Dels = " << dels << std::endl;
}
std::cout << "Allocator News = " << news << "; Allocator Dels = " << dels << std::endl;
}
prints:
Allocator News = 2; Allocator Dels = 0
Allocator News = 2; Allocator Dels = 2
which confirms that the allocator is getting called.

histogram kernel memory issue

I am trying to implement an algorithm to process images with more than 256 bins.
The main issue to process histogram in such case comes from the impossibility to allocate more than 32 Kb as local tab in the GPU.
All the algorithms I found for 8 bits per pixel images use a fixed size tab locally.
The histogram is the first process in that tab then a barrier is up and at last an addition is made with the output vector.
I am working with IR image which has more than 32K bins of dynamic.
So I cannot allocate a fixed size tab inside the GPU.
My algorithm use an atomic_add in order to create directly the output histogram.
I am interfacing with OpenCV so, in order to manage the possible case of saturation my bins use floating points. Depending on the ability of the GPU to manage single or double precision.
OpenCV doesn't manage unsigned int, long, and unsigned long data type as matrix type.
I have an error... I do think this error is a kind of segmentation fault.
After several days I still have no idea what can be wrong.
Here is my code :
histogram.cl :
#pragma OPENCL EXTENSION cl_khr_fp64: enable
#pragma OPENCL EXTENSION cl_khr_int64_base_atomics: enable
static void Atomic_Add_f64(__global double *val, double delta)
{
union {
double f;
ulong i;
} old;
union {
double f;
ulong i;
} new;
do {
old.f = *val;
new.f = old.f + delta;
}
while (atom_cmpxchg ( (volatile __global ulong *)val, old.i, new.i) != old.i);
}
static void Atomic_Add_f32(__global float *val, double delta)
{
union
{
float f;
uint i;
} old;
union
{
float f;
uint i;
} new;
do
{
old.f = *val;
new.f = old.f + delta;
}
while (atom_cmpxchg ( (volatile __global ulong *)val, old.i, new.i) != old.i);
}
__kernel void khist(
__global const uchar* _src,
const int src_steps,
const int src_offset,
const int rows,
const int cols,
__global uchar* _dst,
const int dst_steps,
const int dst_offset)
{
const int gid = get_global_id(0);
// printf("This message has been printed from the OpenCL kernel %d \n",gid);
if(gid < rows)
{
__global const _Sty* src = (__global const _Sty*)_src;
__global _Dty* dst = (__global _Dty*) _dst;
const int src_step1 = src_steps/sizeof(_Sty);
const int dst_step1 = dst_steps/sizeof(_Dty);
src += mad24(gid,src_step1,src_offset);
dst += mad24(gid,dst_step1,dst_offset);
_Dty one = (_Dty)1;
for(int c=0;c<cols;c++)
{
const _Rty idx = (_Rty)(*(src+c+src_offset));
ATOMIC_FUN(dst+idx+dst_offset,one);
}
}
}
The function Atomic_Add_f64 directly come from here and there
main.cpp
#include <opencv2/core.hpp>
#include <opencv2/core/ocl.hpp>
#include <fstream>
#include <sstream>
#include <chrono>
int main()
{
cv::Mat_<unsigned short> a(480,640);
cv::RNG rng(std::time(nullptr));
std::for_each(a.begin(),a.end(),[&](unsigned short& v){ v = rng.uniform(0,100);});
bool ret = false;
cv::String file_content;
{
std::ifstream file_stream("../test/histogram.cl");
std::ostringstream file_buf;
file_buf<<file_stream.rdbuf();
file_content = file_buf.str();
}
int output_flag = cv::ocl::Device::getDefault().doubleFPConfig() == 0 ? CV_32F : CV_64F;
cv::String atomic_fun = output_flag == CV_32F ? "Atomic_Add_f32" : "Atomic_Add_f64";
cv::ocl::ProgramSource source(file_content);
// std::cout<<source.source()<<std::endl;
cv::ocl::Kernel k;
cv::UMat src;
cv::UMat dst = cv::UMat::zeros(1,65536,output_flag);
a.copyTo(src);
atomic_fun = cv::format("-D _Sty=%s -D _Rty=%s -D _Dty=%s -D ATOMIC_FUN=%s",
cv::ocl::typeToStr(src.depth()),
cv::ocl::typeToStr(src.depth()), // this to manage case like a matrix of usigned short stored as a matrix of float.
cv::ocl::typeToStr(output_flag),
atomic_fun.c_str());
ret = k.create("khist",source,atomic_fun);
std::cout<<"check create : "<<ret<<std::endl;
k.args(cv::ocl::KernelArg::ReadOnly(src),cv::ocl::KernelArg::WriteOnlyNoSize(dst));
std::size_t sz = a.rows;
ret = k.run(1,&sz,nullptr,false);
std::cout<<"check "<<ret<<std::endl;
cv::Mat b;
dst.copyTo(b);
std::copy_n(b.ptr<double>(0),101,std::ostream_iterator<double>(std::cout," "));
std::cout<<std::endl;
return EXIT_SUCCESS;
}
Hello I arrived to fix it.
I don't really know where the issue come from.
But if I suppose the output as a pointer rather than a matrix it work.
The changes I made are these :
histogram.cl :
__kernel void khist(
__global const uchar* _src,
const int src_steps,
const int src_offset,
const int rows,
const int cols,
__global _Dty* _dst)
{
const int gid = get_global_id(0);
if(gid < rows)
{
__global const _Sty* src = (__global const _Sty*)_src;
__global _Dty* dst = _dst;
const int src_step1 = src_steps/sizeof(_Sty);
src += mad24(gid,src_step1,src_offset);
ulong one = 1;
for(int c=0;c<cols;c++)
{
const _Rty idx = (_Rty)(*(src+c+src_offset));
ATOMIC_FUN(dst+idx,one);
}
}
}
main.cpp
k.args(cv::ocl::KernelArg::ReadOnly(src),cv::ocl::KernelArg::PtrWriteOnly(dst));
The rest of the code is the same in the two files.
For me it work fine.
If someone know why it work when the ouput is declared as a pointer rather than a vector (matrix of one row) I am interested.
Nevertheless my issue is fix :).

Resources