Serving the Quantitative Finance Community

 
User avatar
vmkulkarni
Topic Author
Posts: 1
Joined: July 14th, 2002, 3:00 am

XLW - passing vector to a function

October 10th, 2008, 10:49 am

Hi MJ and Others,I am trying to add a C++ function to my addin developed with XLW plus 3.0. The function takes vector as input. Is there a type to accept vector directly or we need to read an array and convert it to vector.Please suggest a way to solve this problemV
 
User avatar
samyonez
Posts: 0
Joined: October 7th, 2004, 10:01 am

XLW - passing vector to a function

October 10th, 2008, 11:34 am

Easiest way is to do the conversion. I think there is some typedef or template setting somewhere in XLW where you can alter the matrix & vector types that it uses to your favourite containers, but I found that rather than mucking about with XLW, its easier to write a bunch of conversion functions to convert the CellMatrix type into your favourite containers.It's not like the conversion is going to trouble you for performance or anything.
 
User avatar
vmkulkarni
Topic Author
Posts: 1
Joined: July 14th, 2002, 3:00 am

XLW - passing vector to a function

October 10th, 2008, 12:22 pm

Agree ... Conversion would do the job ... Let me try that route ... thanks for quick reply.rgdsV
 
User avatar
mj
Posts: 12
Joined: December 20th, 2001, 12:32 pm

XLW - passing vector to a function

October 10th, 2008, 7:23 pm

you just declare the function as MyArray, this is a typedef for vector. If you want to change the typedefs look in MyContainers.h
 
User avatar
vmkulkarni
Topic Author
Posts: 1
Joined: July 14th, 2002, 3:00 am

XLW - passing vector to a function

October 11th, 2008, 4:39 am

Thanks mark..
 
User avatar
vmkulkarni
Topic Author
Posts: 1
Joined: July 14th, 2002, 3:00 am

XLW - passing vector to a function

October 11th, 2008, 5:15 am

Perfect ... MyArray did the job.... thanks again
 
User avatar
vmkulkarni
Topic Author
Posts: 1
Joined: July 14th, 2002, 3:00 am

XLW - passing vector to a function

October 29th, 2008, 8:36 am

MJ and Others,To extend it further, I have added a class to handle Date mm/dd/yyyy datatype. Could you pls guide me the modifications required to incorporate custom data type in the XLW.RegardsVK
 
User avatar
vmkulkarni
Topic Author
Posts: 1
Joined: July 14th, 2002, 3:00 am

XLW - passing vector to a function

November 3rd, 2008, 3:49 pm

HiI am trying to incorporate matrix library into XLW. The Output from Matrix library is in the form of a matrix. Do i need to write a converter function to convert the O/P to MJMatrix in XLW?RegardsVK
 
User avatar
mj
Posts: 12
Joined: December 20th, 2001, 12:32 pm

XLW - passing vector to a function

November 4th, 2008, 10:10 am

You have to typedef MyMatrix to refer to your matrix class. See the file MyContainers.h .