/*
 *  LinTool.h
 *  GaussSolve2
 *
 *  Created by Assistant on 8/28/06.
 *  Copyright 2006 __MyCompanyName__. All rights reserved.
 *
 */


#ifndef LinTool_H_DEF 
#define LinTool_H_DEF

//#define Ith(v,i)    NV_Ith_S(v,i-1)       /* Ith numbers components 1..NEQ */
//#define IJth(A,i,j) DENSE_ELEM(A,i-1,j-1) /* IJth numbers rows,cols 1..NEQ */

#include <iostream>
#include <iomanip>

class LT_matrix
{
	private:
	public:
	
		double** A;
		int Nrows, Ncols;

	
		LT_matrix(int Nrows, int Ncols);	
		~LT_matrix();
		
		void solve(LT_matrix* b, LT_matrix* x);
		
		double* operator[](int i);
		
		
		double ElemSum();
		
		void copy( LT_matrix* N);
		void add( LT_matrix* M, LT_matrix* N);
		void sub( LT_matrix* M, LT_matrix* N);
		void mult_elemwize( LT_matrix* M, LT_matrix* N);
		void div_elemwize( LT_matrix* M, LT_matrix* N);
		void mult( LT_matrix* M, LT_matrix* N);
		void mult(double t);
		
		LT_matrix* transp(void);

		void rand_fill(double min, double max);
		bool is_this(LT_matrix* M);
		
		//news:
		double max();
		double min();
};

std::ostream& operator<<(std::ostream &s, LT_matrix &M);


#endif