Solved

matrix class

Posted on 2003-11-30
11
542 Views
Last Modified: 2010-04-01
looking for a matrix class address

0
Comment
Question by:hermesc
  • 7
  • 4
11 Comments
 
LVL 30

Expert Comment

by:Axter
ID: 9845328
What do you mean by class address?
0
 
LVL 30

Expert Comment

by:Axter
ID: 9845330
// Here's a 2 dynamic matrix class

template < class T>
class dynamic_2d_array
{
public:
      dynamic_2d_array(int row, int col):m_row(row),m_col(col), m_data((row!=0&&col!=0)?new T[row*col]:NULL){}
      ~dynamic_2d_array(){if(m_data) delete []m_data;}
      inline T* operator[](int i) {return (m_data + (m_col*i));}
      inline T const*const operator[](int i) const {return (m_data + (m_col*i));}
private:
      const int m_row;
      const int m_col;
      T* m_data;
};
0
 

Author Comment

by:hermesc
ID: 9845497
web address :=)

i need a matrix class
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 30

Expert Comment

by:Axter
ID: 9845518
Also check out the following links for matrix class:

Matrix class implemented using valarrays:
http://www.hep.ucl.ac.uk/atlas/atlfast/Doxygen/5.1.0/AtlfastUtils-00-00-10/Matrix_8h-source.html

blitz++:
http://www.oonumerics.org/blitz/ 

newmat:
http://www.robertnz.net/nm_intro.htm

Matrix Template Library (MTL):
http://www.osl.iu.edu/research/mtl/

boost libray multi-array class:
http://www.boost.org/libs/multi_array/doc/user.html
0
 
LVL 30

Expert Comment

by:Axter
ID: 9845534
>>web address :=)
>>i need a matrix class

Do you just need a class that can hold web address?

If so, you can use vector<string> object to hold a matrix of web address.

std::vector<std::string>  MyWebAddressMatrix;

//Add address via following method:
MyWebAddressMatrix.push_back("www.experts-exchange.com");

//Access item in array via following method.

cout << MyWebAddressMatrix[0] << endl;

0
 
LVL 30

Expert Comment

by:Axter
ID: 9845543
If that's not what you need, please provide much more details.

Spell out exactly what you need.
Tell us what is your requirement, and how you intend to use this matrix, so that we can have a better understanding of what you're looking for.
0
 

Author Comment

by:hermesc
ID: 9845917
I need a website a web adress ( world wide web ) which there is a class ( or it may be a FTP!!!!! )!!!! ( a class which its purpuse is matrix! )
( matrix : not the matrix which keanu plays the matrix which we use in maths )

I hope it is clear now
0
 

Author Comment

by:hermesc
ID: 9845930
I need a website a web adress ( world wide web ) which there is a class ( or it may be a FTP!!!!! )!!!! ( a class which its purpuse is matrix! )
( matrix : not the matrix which keanu plays the matrix which we use in maths )

I hope it is clear now

this class should be able to these operations

*,+,-, inverse , other basic matrix operations not the complex orthogonal or nonlinear ones ( or whatever you may think which is advanced )
0
 
LVL 30

Expert Comment

by:Axter
ID: 9845940
>>I hope it is clear now

I'm sorry, but you're still missing information.

When you say it's purpuse is matrix, what is the matrix suppose to do, and what is it suppose to store?

>>I need a website a web adress ( world wide web ) which there is a class

Which there is what class?
What is the class suppose to do?  What exactly is it's function.

Explain the what and how.
It might help if you give an example.
0
 
LVL 30

Accepted Solution

by:
Axter earned 100 total points
ID: 9845956
>>*,+,-, inverse , other basic matrix operations not the complex orthogonal or nonlinear ones ( or whatever you may think which is advanced )

OK, now we're getting somewhere.

The STL valarray class is suppose to serve this purpose, but I wouldn't recommend it.
If you want to use the valarray class, see the following link:
http://www.hep.ucl.ac.uk/atlas/atlfast/Doxygen/5.1.0/AtlfastUtils-00-00-10/Matrix_8h-source.html


Otherwise try looking at the previous links I posted for matrix class.
0
 

Author Comment

by:hermesc
ID: 9850638
thanks for your valuable helps

axter

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question