Re: VC++ .Net Compilation of MTL fails
Janusz opechowski <[email protected]>
| Newsgroups | gmane.comp.lib.mtl.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi.
Your code compiles without problems.
(VC.NET 2002)
I just modified slightly your
program ( namespace calls and includes deleted ) into
the one below.
Included file is mine "universal file",
in attachement.
It might be you didn't resolved "includes" part fully.
Check it.
#include"DataTypes.h"
int main()
{
//begin
// [1,0,2]
// [0,3,0]
// [0,4,5]
const int m = 3, n = 3, nnz = 5;
double values[] = { 1, 2, 3, 4, 5 };
int indices[] = { 1, 3, 2, 2, 3 };
int row_ptr[] = { 1, 3, 4, 6 };
// Create from pre-existing arrays
typedef mtl::matrix<double,
rectangle<>,
compressed<int, external,
index_from_one>,
row_major>::type
MatA;
MatA A(m, n, nnz, values, row_ptr, indices);
//end
cout << "matrix A" << endl;
print_all_matrix(A);
//begin
// Create from scratch
typedef mtl::matrix<double,
rectangle<>,
compressed<>,
row_major >::type MatB;
MatB B(m, n);
B(0,0) = 1; B(0,2) = 2;
B(1,1) = 3;
B(2,1) = 4; B(2,2) = 5;
//end
cout << "matrix B" << endl;
print_all_matrix(B);
return 0;
}
--- Manash Sahoo <[email protected]> wrote:
>
>
> I keep getting an error when compiling the following
> example from within
> MS VC++ 7 .Net version. Any help is appreciated,
> thanks in advance!
>
>
>
> c:\Program Files\MTL\mtl-2.1.2-21\mtl\light1D.h(87):
> error C2039:
> '_Ptrit' : is not a member of 'std'
>
>
>
> Here's the sample program I am trying to run:
>
>
>
> using namespace std;
>
>
>
> #include "stdafx.h"
>
> #include <mtl/matrix.h>
>
> #include <mtl/utils.h>
>
>
>
> int main()
>
> {
>
> using namespace mtl;
>
> using namespace std;
>
> //begin
>
> // [1,0,2]
>
> // [0,3,0]
>
> // [0,4,5]
>
> const int m = 3, n = 3, nnz = 5;
>
> double values[] = { 1, 2, 3, 4, 5 };
>
> int indices[] = { 1, 3, 2, 2, 3 };
>
> int row_ptr[] = { 1, 3, 4, 6 };
>
>
>
> // Create from pre-existing arrays
>
> typedef matrix<double,
>
> rectangle<>,
>
> compressed<int, external,
>
> index_from_one>,
>
> row_major>::type MatA;
>
>
>
> MatA A(m, n, nnz, values, row_ptr, indices);
>
> //end
>
> cout << "matrix A" << endl;
>
> print_all_matrix(A);
>
> //begin
>
> // Create from scratch
>
> typedef matrix<double,
>
> rectangle<>,
>
> compressed<>,
>
> row_major >::type MatB;
>
> MatB B(m, n);
>
> B(0,0) = 1; B(0,2) = 2;
>
> B(1,1) = 3;
>
> B(2,1) = 4; B(2,2) = 5;
>
> //end
>
> cout << "matrix B" << endl;
>
> print_all_matrix(B);
>
>
>
> return 0;
>
> }
>
>
>
>
>
>
>
> Manash Sahoo
>
> HealthEvolutions
>
> 9000 Keystone Crossing Blvd, Suite 200
>
> Indianapolis, IN 46240
>
> 317-815-0801 ext 146
>
> [email protected]
>
>
>
> > _______________________________________________
> This list is archived at
> http://www.osl.iu.edu/MailArchives/mtl-devel/
>
__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/
DataTypes.h
(text/plain, 2.2 KB)
#ifndef _datatypes_h
#define _datatypes_h
//#include"help.h"
// mtl includes
#include "mtl/matrix.h"
#include "mtl/mtl.h"
#include "mtl/utils.h"
#include "mtl/linalg_vec.h"
#include "mtl/lu.h"
//#include "mtl/dense2D.h"
//#include "mtl/array2D.h"
/*
// itl includes
#include <itl/interface/mtl.h>
#include "itl/krylov/qmr.h"
#include "itl/krylov/tfqmr.h"
#include "itl/krylov/gmres.h"
#include "itl/krylov/cgs.h"
#include "itl/krylov/bicg.h"
#include "itl/krylov/bicgstab.h"
#include "itl/krylov/cg.h"
#include "itl/krylov/gcr.h"
#include "itl/preconditioner/cholesky.h"
#include "itl/preconditioner/diagonal.h"
#include "itl/preconditioner/ssor.h"
*/
// begin
using namespace mtl;
//using namespace itl;
using namespace std;
// generic include
//STD
#include<complex>
#include<vector>
#include <deque>
#include<iterator>
#include<algorithm>
#include <functional>
#include<map>
#if(0) // say no !
///
#include<iostream.h>
#include<iomanip.h>
#include<stdlib.h>
#include <stdarg.h>
// c includes
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#include<stdarg.h> // zmienna ilosc argumentow
#endif
/// usefull macros
#define nl printf("\n" )
#define nnl printf("\n \n" )
#define nnnl printf("\n \n \n" )
#define sqr(x)((x)*(x))
#define cub(x)((x)*(x)*(x))
#define ot(x) (cout << #x << endl)
#define ov(y) (cout << y << endl)
#define otv(x,y) (cout << #x <<y << endl)
#define otsl(x) (cout << #x )
#define ovsl(y) (cout << y )
#define otvsl(x,y) (cout << #x <<y )
// templatization
#define tt template <class t >
// c++ typedef
typedef void vo ;
typedef long double rl ;
//typedef float r ;
typedef double r ;
typedef float rs ;
typedef unsigned char ns;
//typedef unsigned short ns;
typedef char nssig;
typedef unsigned long int n ;
typedef long int nsig ;
// mtl typedef
typedef mtl::dense1D<r> Vec;
typedef Vec::size_type VecIndex;
typedef mtl::matrix<r,rectangle<>,dense<>,row_major>::type Mat;
typedef Mat::Row::iterator MatRowIt;
typedef Mat::size_type index;
typedef Vec::iterator VecIt;
typedef Vec::reverse_iterator rVecIt;
const r PI = 3.14159265358979;
const r twoPI = PI*2.0;
#endif
//#include "clock.h"