does omnet support array

243 views
Skip to first unread message

yangqiaoqy

unread,
Jun 4, 2014, 10:16:24 PM6/4/14
to omnetpp
hi all,
Here is a naive question. can I use array in omnet, like "int myArray[];"

greetings,
QiaoYang


yangqiaoqy

unread,
Jun 4, 2014, 10:39:43 PM6/4/14
to omnetpp
sorry, what I actually want to implement is a matrix. Does anyone know how can I make that happen.


yangqiaoqy
--
You received this message because you are subscribed to the Google Groups "omnetpp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Kirsche

unread,
Jun 5, 2014, 4:11:47 AM6/5/14
to omn...@googlegroups.com
You can use everything that standard C++ provides, so of course, you can use a matrix or an array, a vector or whatever you need.

If you do not know how to use/implement a matrix, take a look at some online material on C++, same rules apply for using it within OMNeT.

Alfonso Ariza Quintana

unread,
Jun 5, 2014, 4:17:31 AM6/5/14
to omn...@googlegroups.com

yangqiaoqy

unread,
Jun 5, 2014, 8:04:52 AM6/5/14
to omnetpp
hi Michael,
so I can define in my .cc file this "int a[3][2]={...};", right?


yangqiaoqy

Michael Kirsche

unread,
Jun 5, 2014, 11:01:01 AM6/5/14
to omn...@googlegroups.com
Yep you could do it like that.

But like Alfonso (good point) wrote... depending on your actual needs, it might be better to use a fully fledged math library like Armadillo or Eigen!

Syed Hasnain

unread,
Jun 20, 2015, 1:34:17 PM6/20/15
to omn...@googlegroups.com
I want to use Eigen math library. But how can I incorporate or install this library in my Omnet?
Thanks in advance.

Alfonso Ariza Quintana

unread,
Jun 21, 2015, 5:07:42 AM6/21/15
to omn...@googlegroups.com
In linux is easy, in windows I don't know how to include new libraries in the mingw envonment


Date: Sat, 20 Jun 2015 10:34:16 -0700
From: go2as...@gmail.com
To: omn...@googlegroups.com
Subject: Re: Re: [Omnetpp-l] does omnet support array
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.

To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.

ali asghar rajabi

unread,
Dec 7, 2018, 7:28:03 PM12/7/18
to omn...@googlegroups.com

 
hi i need to get array size from user so i try to define a array in .h like this      inta[]; 
 and in initialize func get size with par and do this

int a[size]; 
but it didnot work
?
 
  
Reply all
Reply to author
Forward
0 new messages