The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Matrix size limited?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Belsinga

Netherlands
28 Posts

Posted - 06/21/2010 :  04:14:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8 SR 6
Operating System: WinXP

Hi,

Is it possible to construct a matrix with #rows larger than 180? My script doesnt work when I try to call, and returns
" Vector operation dimension check error "

************************************
matrix MAT(201,4);

for(int jj=0; jj<4;jj++)
{
for(int ii=0; ii<201; ii++)
{
MAT[ii][jj] = ...;
}
}

Penn

China
644 Posts

Posted - 06/22/2010 :  03:43:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Sorry that I can not reproduce the error you mentioned with the following code. The code works fine.

void testMatrix()
{
	matrix MAT(201,4);

	for(int iCol=0; iCol<MAT.GetNumCols(); iCol++)
	{
		for(int iRow=0; iRow<MAT.GetNumRows(); iRow++)
		{
			MAT[iRow][iCol] = iRow*iCol;
			printf("MAT[%d][%d] = %f\n", iRow, iCol, MAT[iRow][iCol]);
		}
	}
}

It will be better to get your entire code to make sure what the problem is.

Penn
Go to Top of Page

Belsinga

Netherlands
28 Posts

Posted - 06/22/2010 :  04:04:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I see what the problem was: my dataset was erroneously only filled up to 180, when I expected 201...

Thanks anyway!
Go to Top of Page

Penn

China
644 Posts

Posted - 06/22/2010 :  04:20:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It will be better to use the GetNumRows and GetNumCols methods to get a matrix's dimension.

Penn
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000