|
From: | Jeremy Yan |
Subject: | Re: Using mldivide function of Octave in C++? |
Date: | Wed, 4 Jun 2014 11:28:54 -0400 |
----------------------------
octave_value_list retval;
octave_value_list input;
Matrix A;
ColumnVector B;
// assign values
input.append (A);
input.append (B);
retval = Fmldivide (input);
----------------------------
If you want to get the result as a ColumnVector you can then do:
------
ColumnVector X = retval(0).column_vector_value ();
------
why is this answer not satisfying to you? is there anything
specific that you need clarified about it?
After Pantxo's reply I pointed out that you don't need to
call Fmldivide (which is a built-in function in liboctinterp)
but you can use methods in the liboctave class library directly
and do:
----------------------------
Matrix A;
ColumnVector B;
// assign values
ColumnVector X = A.solve (b);
----------------------------
which gives the same result with less overhead and fewer lines of code.
Why is this solution not satisfactory to you?
[Prev in Thread] | Current Thread | [Next in Thread] |