About template constraints


 
Thread Tools Search this Thread
Top Forums Programming About template constraints
# 1  
Old 11-21-2005
About template constraints

Hi, i have class template,

1)can i override the copy constructor

2)can we have virtual function in class template

if not plz tel why? I tried , compile error comes for me...

Thanks
Sarwan
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Solaris

Need help in configuring Password Constraints for Solaris 11.3

Hello Friends I was running Solaris 11.3 x86. Below is my configuration to set password Constraints. more /etc/default/passwd MAXWEEKS=4 MINWEEKS=1 WARNWEEKS=1 PASSLENGTH=8 NAMECHECK=YES HISTORY=4 MINDIFF=3 MINALPHA=2 (4 Replies)
Discussion started by: jebby123
4 Replies

2. UNIX for Dummies Questions & Answers

Grep with time constraints

Hello Friends - I am trying to grep certain messages that have a time slot like this: MyRate=33FC|SystemDEF=445DE|Calc=33W2|Time=15:50:24 I am trying to grep everything after Time=15:50:26 including SystemDEF=E2S and Calc=33W2 into a file called myrate.dat Not able to... (7 Replies)
Discussion started by: DallasT
7 Replies

3. Shell Programming and Scripting

Parsing a file based on positional constraints

I have a list file1 like dog cow fox cat fish duck crowI want to classify the elements of file1 based on constrains applied on file2. Additionally the number of elements (words) in the each line of file2 is not fixed. This is my file2 cow cat fox dog cow fox dog fish crow fox dog cat ... (5 Replies)
Discussion started by: sammy777
5 Replies

4. Solaris

Pkg update: No solution was found to satisfy constraints

I have an x86 Solaris box running 11.2 and have run into the following issue when attempting to run a package update. Has anyone else come across this issue and resolved it successfully, or am I waiting on Oracle to release other updated packages? uname -a SunOS <hostname> 5.11 11.2... (13 Replies)
Discussion started by: nova_cyclist
13 Replies

5. UNIX for Advanced & Expert Users

Teradata and Informatica Load constraints

HI Team , I have interesting issue observed when using teradata sql assistant(14.1) and Informatica tool (9.5) versions. I created SQL code in teradata where source count is 5000 records . I am using source and target database as teradata and trying to load using informatica tool . Its straight... (0 Replies)
Discussion started by: Perlbaby
0 Replies

6. UNIX and Linux Applications

Help in copying table structure to another table with constraints in Oracle

hi, i need to copy one table with data into another table, right now am using create table table1 as select * from table2 i want the constraints of table1 to be copied to table2 also , can anyone give me some solution to copy the constraints also, now am using oracle 10.2.0.3.0... (1 Reply)
Discussion started by: senkerth
1 Replies

7. Programming

C++ template error

I get some compiling errors about template instantiation :wall: , but I can't find where the syntax errors happens. Can some help me? template<typename Type> class SingleList; template<typename Type> class SingleListNode{ private: friend class SingleList<Type>; SingleListNode() :... (1 Reply)
Discussion started by: 915086731
1 Replies

8. UNIX for Advanced & Expert Users

GZIP memory constraints

Currently I am using the ZLIB_VERSION "1.2.3" . The memory requirement for Zlib/GZIP compression is stated as /* The memory requirements for deflate are (in bytes): (1 << (windowBits+2)) + (1 << (memLevel+9)) that is: 128K for windowBits=15 + 128K for memLevel = 8 (default... (0 Replies)
Discussion started by: Parmod Garg
0 Replies
Login or Register to Ask a Question
tensor(2rheolef)						    rheolef-6.1 						  tensor(2rheolef)

NAME
tensor - a N*N tensor, N=1,2,3 SYNOPSYS
The tensor class defines a 3*3 tensor, as the value of a tensorial valued field. Basic algebra with scalars, vectors of R^3 (i.e. the point class) and tensor objects are supported. IMPLEMENTATION
template<class T> class tensor_basic { public: typedef size_t size_type; typedef T element_type; // allocators: tensor_basic (const T& init_val = 0); tensor_basic (T x[3][3]); tensor_basic (const tensor_basic<T>& a); // affectation: tensor_basic<T>& operator = (const tensor_basic<T>& a); tensor_basic<T>& operator = (const T& val); // modifiers: void fill (const T& init_val); void reset (); void set_row (const point_basic<T>& r, size_t i, size_t d = 3); void set_column (const point_basic<T>& c, size_t j, size_t d = 3); // accessors: T& operator()(size_type i, size_type j); T operator()(size_type i, size_type j) const; point_basic<T> row(size_type i) const; point_basic<T> col(size_type i) const; size_t nrow() const; // = 3, for template matrix compatibility size_t ncol() const; // inputs/outputs: std::ostream& put (std::ostream& s, size_type d = 3) const; std::istream& get (std::istream&); // algebra: bool operator== (const tensor_basic<T>&) const; bool operator!= (const tensor_basic<T>& b) const { return ! operator== (b); } template <class U> friend tensor_basic<U> operator- (const tensor_basic<U>&); template <class U> friend tensor_basic<U> operator+ (const tensor_basic<U>&, const tensor_basic<U>&); template <class U> friend tensor_basic<U> operator- (const tensor_basic<U>&, const tensor_basic<U>&); template <class U> friend tensor_basic<U> operator* (int k, const tensor_basic<U>& a); template <class U> friend tensor_basic<U> operator* (const U& k, const tensor_basic<U>& a); template <class U> friend tensor_basic<U> operator* (const tensor_basic<U>& a, int k); template <class U> friend tensor_basic<U> operator* (const tensor_basic<U>& a, const U& k); template <class U> friend tensor_basic<U> operator/ (const tensor_basic<U>& a, int k); template <class U> friend tensor_basic<U> operator/ (const tensor_basic<U>& a, const U& k); template <class U> friend point_basic<U> operator* (const tensor_basic<U>&, const point_basic<U>&); template <class U> friend point_basic<U> operator* (const point_basic<U>& yt, const tensor_basic<U>& a); point_basic<T> trans_mult (const point_basic<T>& x) const; template <class U> friend tensor_basic<U> trans (const tensor_basic<U>& a, size_t d = 3); template <class U> friend tensor_basic<U> operator* (const tensor_basic<U>& a, const tensor_basic<U>& b); template <class U> friend void prod (const tensor_basic<U>& a, const tensor_basic<U>& b, tensor_basic<U>& result, size_t di=3, size_t dj=3, size_t dk=3); template <class U> friend tensor_basic<U> inv (const tensor_basic<U>& a, size_t d = 3); template <class U> friend tensor_basic<U> diag (const point_basic<U>& d); template <class U> friend tensor_basic<U> identity (size_t d=3); template <class U> friend tensor_basic<U> dyadic (const point_basic<U>& u, const point_basic<U>& v, size_t d=3); // metric and geometric transformations: template <class U> friend U dotdot (const tensor_basic<U>&, const tensor_basic<U>&); template <class U> friend U norm2 (const tensor_basic<U>& a) { return dotdot(a,a); } template <class U> friend U dist2 (const tensor_basic<U>& a, const tensor_basic<U>& b) { return norm2(a-b); } template <class U> friend U norm (const tensor_basic<U>& a) { return ::sqrt(norm2(a)); } template <class U> friend U dist (const tensor_basic<U>& a, const tensor_basic<U>& b) { return norm(a-b); } T determinant (size_type d = 3) const; template <class U> friend U determinant (const tensor_basic<U>& A, size_t d = 3); template <class U> friend bool invert_3x3 (const tensor_basic<U>& A, tensor_basic<U>& result); // spectral: // eigenvalues & eigenvectors: // a = q*d*q^T // a may be symmetric // where q=(q1,q2,q3) are eigenvectors in rows (othonormal matrix) // and d=(d1,d2,d3) are eigenvalues, sorted in decreasing order d1 >= d2 >= d3 // return d point_basic<T> eig (tensor_basic<T>& q, size_t dim = 3) const; point_basic<T> eig (size_t dim = 3) const; // singular value decomposition: // a = u*s*v^T // a can be unsymmetric // where u=(u1,u2,u3) are left pseudo-eigenvectors in rows (othonormal matrix) // v=(v1,v2,v3) are right pseudo-eigenvectors in rows (othonormal matrix) // and s=(s1,s2,s3) are eigenvalues, sorted in decreasing order s1 >= s2 >= s3 // return s point_basic<T> svd (tensor_basic<T>& u, tensor_basic<T>& v, size_t dim = 3) const; // data: T _x[3][3]; }; typedef tensor_basic<Float> tensor; // inputs/outputs: template<class T> inline std::istream& operator>> (std::istream& in, tensor_basic<T>& a) { return a.get (in); } template<class T> inline std::ostream& operator<< (std::ostream& out, const tensor_basic<T>& a) { return a.put (out); } // t = a otimes b template<class T> tensor_basic<T> otimes (const point_basic<T>& a, const point_basic<T>& b, size_t na = 3); // t += a otimes b template<class T> void cumul_otimes (tensor_basic<T>& t, const point_basic<T>& a, const point_basic<T>& b, size_t na = 3); template<class T> void cumul_otimes (tensor_basic<T>& t, const point_basic<T>& a, const point_basic<T>& b, size_t na, size_t nb); rheolef-6.1 rheolef-6.1 tensor(2rheolef)