Datasim Financial Forums Forum Index


 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
compile error in vector.cpp (255)

 
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> Financial Instrument Pricing using C++ (Duffy)
View previous topic :: View next topic  
Author compile error in vector.cpp (255)
admin
Site Admin


Joined: 07 Dec 2006
Posts: 119
Location: Amsterdam, The Netherlands

PostPosted: Thu Jan 28, 2010 8:21 am    Post subject: Reply with quote

array and matrix classes


Array.cpp
 Description:

Download
 Filename:  Array.cpp
 Filesize:  2.69 KB
 Downloaded:  76 Time(s)


Array.hpp
 Description:

Download
 Filename:  Array.hpp
 Filesize:  1.47 KB
 Downloaded:  59 Time(s)


Matrix.hpp
 Description:

Download
 Filename:  Matrix.hpp
 Filesize:  1.9 KB
 Downloaded:  59 Time(s)


Matrix.cpp
 Description:

Download
 Filename:  Matrix.cpp
 Filesize:  3.85 KB
 Downloaded:  58 Time(s)

Back to top
View user's profile Send private message Visit poster's website
Cuchulainn



Joined: 18 Dec 2006
Posts: 461
Location: Amsterdam, the Netherlands

PostPosted: Sun Mar 22, 2009 7:52 pm    Post subject: Reply with quote

In NumericMatrix the member function Element() was coded incorrectly. I use (,) operator overloading.

Here is the new source. Hope it helps.



NumericMatrix.hpp
 Description:

Download
 Filename:  NumericMatrix.hpp
 Filesize:  1.89 KB
 Downloaded:  172 Time(s)


numericmatrix.cpp
 Description:

Download
 Filename:  numericmatrix.cpp
 Filesize:  6.25 KB
 Downloaded:  161 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
nuclph



Joined: 07 Nov 2008
Posts: 5

PostPosted: Sat Nov 08, 2008 3:56 pm    Post subject: compile error in vector.cpp (255) Reply with quote

Hello,

I have small question with respect to Vector.cpp file.
I am getting compile error such as:

vector.cpp(255) : error C2059: syntax error : ')'

this line looks like:


template <class V, class I, class S>
Vector<V, I, S>& Vector<V, I, S>:perator += (const Vector<V, I, S>& v)
{ // Add the elements


for (I i=MinIndex(); i<=MaxIndex(); i++)
(*this) = (*this) + v); // 255 line

return *this;
}

I am using Visual Studio 2008 to compile files.
Below, Vector.hpp and Vector.cpp versions which I have from Financial Instrument Pricing Using C++.
For some reasons, compiler does not understand this line.

Thank you in advance for the reply.

nuclph



Vector.hpp
 Description:

Download
 Filename:  Vector.hpp
 Filesize:  3.59 KB
 Downloaded:  173 Time(s)


Vector.cpp
 Description:

Download
 Filename:  Vector.cpp
 Filesize:  8.47 KB
 Downloaded:  174 Time(s)

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> Financial Instrument Pricing using C++ (Duffy) All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group