[GiNaC-list] GiNaC::marix::solve(..)

Lisa Maletzki l.maletzki at tu-bs.de
Thu Jun 4 10:12:02 CEST 2009


Zitat von Lisa Maletzki <l.maletzki at tu-bs.de>:

> Zitat von "Richard B. Kreckel" <kreckel at ginac.de>:
>
>> Hi!
>>
>> Lisa Maletzki wrote:
>>> Thanks again, I think that will do the trick but when compiling it  
>>>   I get a linker error which I cannot solve (I'm fairly new to  
>>> c++)  I  can't say if it is just missing a library of if I wrote   
>>> something  in the code wrong.
>>>
>>> This is the output:
>>>
>>> g++ -Xlinker `pkg-config --cflags --libs ginac` -o"sep"     
>>> ./src/bezierPoints.o ./src/testmain.o ./src/xml.o ./src/xmlParser.o
>>> ./src/bezierPoints.o: In function   
>>> `bezierPoints::solve(GiNaC::matrix, int)':
>>> /my_folder/Debug/../src/bezierPoints.cpp:63: undefined reference   
>>> to  `bezierPoints::generate_symbols(std::vector<GiNaC::symbol,    
>>> std::allocator<GiNaC::symbol> >&, std::basic_string<char,    
>>> std::char_traits<char>, std::allocator<char> > const&)'
>>>
>>> The method is declared in the header file and called with the   
>>> write  name in the source file, so typing error can be ruled out.   
>>> Any help?
>>
>> Apparently, you've declared the function generate_symbols inside
>> namespace bezierPoints (since that's where the linker is looking for
>> it). Did you also implement it inside namespace bezierPoints?
>>
>> Bye
>>  -richy.
>> -- 
>> Richard B. Kreckel
>> <http://www.ginac.de/~kreckel/>
>> _______________________________________________
>> GiNaC-list mailing list
>> GiNaC-list at ginac.de
>> https://www.cebix.net/mailman/listinfo/ginac-list
>
> Thanks a bunch for the help a clearly stupid mistake :)
>
> Kind regards,
>
> Lisa
>

That was a little overhasty I suppose because I came across another  
problem. The following snippet of code will give me a  
matrix::operator(): index out of range.

unsigned size = 18;
matrix vectorX(size, 1);
for (unsigned i = 0; i < size; i++) {
     vectorX(i, 1) = vars[i];
}

when making the matrix of size (size, size) it works but I have not  
the matrix I need. sub_matrix could correct that but unfortunately it  
will just end up in a matrix inside a matrix when doing something like  
this:

matrix tmp(size,1);
tmp = sub_matrix(vectorX,0,size,1,1);

Any idea how to reduce a matrix and get a matrix back or how to work  
the first one properly?

Kind regards,

Lisa



More information about the GiNaC-list mailing list