combining matrices using Scythe library

Dear C++ users,

I'm a beginner with C++. I want to combine two matrices using the cbind function in the Scythe library. Below is my main function:

#include <iostream>
#include <vector>
#include "la.h"
#include "lapack.h"
#include "matrix.h"

using namespace scythe;
using namespace std;

int main()
{
double val1[9]={1,1,1,1,1,1,1,1,1};
double val2[9]={2,2,2,2,2,2,2,2,2};
const Matrix<double, Col, Concrete> T(3,3,val1);
const Matrix<double, Col, Concrete> S(3,3,val2);
cbind(T,S);
}

I got the error message for my use of "cbind" as:
error: cannot convert `scythe::matrix_style' to `scythe::matrix_order' in initialization
error: non-constant `<expression error>' cannot be used as template argument

In the header file la.h, the "cbind" part was written as below:

template <matrix_order RO, matrix_style RS, typename T,
matrix_order PO1, matrix_style PS1,
matrix_order PO2, matrix_style PS2>
Matrix<T,RO,RS>
cbind (const Matrix<T,PO1,PS1>& A, const Matrix<T,PO2,PS2>& B)
{
SCYTHE_CHECK_10(A.rows() != B.rows(), scythe_conformation_error,
"Matrices have different numbers of rows");

Matrix<T,RO,Concrete> ret(A.rows(), A.cols() + B.cols(), false);
std::copy(B.template begin_f<Col>(), B.template end_f<Col>(),
std::copy(A.template begin_f<Col>(),
A.template end_f<Col>(),
ret.template begin_f<Col>()));
SCYTHE_VIEW_RETURN(T, RO, RS, ret)
}


template <typename T, matrix_order PO1, matrix_style PS1,
matrix_order PO2, matrix_style PS2>
Matrix<T,PO1,Concrete>
cbind (const Matrix<T,PO1,PS1>& A, const Matrix<T,PO2,PS2>& B)
{
return cbind<PO1,Concrete>(A, B);
}

What did I do wrong using "cbind"? Thank you for your help!

Xiang
Topic archived. No new replies allowed.