From: <lab...@gm...> - 2009-05-12 21:25:46
|
Oh, I see. There is already a get(index) method in the Vector class that returns the type, so I can use it right now. I knew I was missing something :-) thanks for clarifying that up. On May 12, 2009 12:26pm, Gary Pampara <gpa...@gm...> wrote: > Indeed it does. > Well, with the 0.7.1 release of CIlib we will be removing the getType() > method and will be adding a simple get(index) method on the Vector class. > Vectors will be defined to work only on Numeric types (Nuemric is the > super class of Real, Bit and Int). We are still chatting about the API on > the developers list but the current notion of a Vector of types will most > probably become a TypeList type class (where TypeList is a general list > object that can take any Type instances). Bottom line is that the code > will be simplified and easier to use. > You're calls to check if the returned type is a Real or a Bit should > still work and your PositionUpdateStrategy class shouldn't require any > additional changes. > Would this solve your current problem? > Regards, > Gary > lab...@gm... wrote: > Hi, > Yes, getType() was protected all along. My question is why? I need to > access it. I subclass PositionUpdateStrategy so that I can have mixed > types in a solution vector. So, I need to check for the type of each > element in the solution vector to see if it's a bit or a number and call > the appropriate position udate functions. Does that make sense? > On May 12, 2009 7:30am, Gary Pampara gpa...@gm...> wrote: > > Hi, > > > > > > > > Hmm.... that's strange. Wasn't the method protected all along? It was > intended to be an internal accessor if I remember correctly. We are > changing the Vector at the moment. We want the Vector to be specialized > with Numeric types. This greatly reduces the API complexity and we allow > you to directly vector.get(i) the elements of the vector. > > > > > > > > For now, please keep with your current work around. Sorry for any > issues it has caused. 0.7.1 of CIlib will be released relatively soon and > this will hopefully be corrected in that release through altering the > Vector class. > > > > > > > > Kind regards, > > > > Gary > > > > > > > > lab...@gm... wrote: > > > > > Hi! > > > > > > > > > > I'm now trying to integrate 0.7 with my code. > > > > > > > > > > I have a solution vector composed of bits and reals, so I need a > > > > > positionupdate method that takes care of this mix of data types. > > > > > I have a PositionUpdateStrategyMixin class that takes care of that but > > > > > it relies on getType(index) to get the type of the element in the > > > > > solution vector. However, this method is protected in the Vector > > > > > container class. Why is it protected? I did recompile cilib to change > > > > > that but maybe you have another suggestion? > > > > > > > > > > TIA, > > > > > > > > > > myriam > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > > ------------------------------------------------------------------------------ > > > > > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! > Your > > > > > production scanning environment may not be a perfect world - but > thanks to > > > > > Kodak, there's a perfect scanner to get the job done! With the NEW > KODAK i700 > > > > > Series Scanner you'll get full speed at 300 dpi even with all image > > > > > processing features enabled. http://p.sf.net/sfu/kodak-com > > > > > > > > > > > > > > > > ------------------------------------------------------------------------ > > > > > > > > > > _______________________________________________ > > > > > Cilib-users mailing list > > > > > Cil...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/cilib-users > > > ------------------------------------------------------------------------ > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK > i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > ------------------------------------------------------------------------ > _______________________________________________ > Cilib-users mailing list > Cil...@li... > https://lists.sourceforge.net/lists/listinfo/cilib-users |