Solved

matrix class

Posted on 2003-11-30
11
540 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
 
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

705 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now