U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ Core » [DISCUSSION] Add 'complex' datatype, to Value too
Re: [DISCUSSION] Add 'complex' datatype, to Value too [message #33087 is a reply to message #33054] Wed, 06 July 2011 13:17 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
kohait00 wrote on Tue, 05 July 2011 07:28

got sth workin.. i think it would do it. thanks for the hints..

attached are Complex.h and Complex.cpp for Core.
the attached patch is to include them properly...

cdouble is derived from std::complex. i wanted cdouble to have as little code as possible and use native external means, except for where not otherwise possible like Value conversion.

if this could go to Core, the posted plugin/kissfft (see above) is also possible..

test

void Test(const cdouble& c) { RLOG(c); }

CONSOLE_APP_MAIN
{
	cdouble y(1.,5.);
	cdouble x = 12;

	//cdouble handling
	double d = y.real();
	y+=3.;

	//cdouble to value conversion test
	Value v = RichToValue(y);
	v = y;
	int type = v.GetType();

	Vector<cdouble> vc;
	vc.Add(12);

	//Value to cdouble conversion test	
	x = v;

	//Null handling	
	Test(Null);
	x = Null;

	bool b;
	b = (v == x);
	b = (x == v);
	b = (v != x);
	b = (x != v);
}



Would you mind if instead of "cdouble" we use either complex or Complex?

I think integer complex numbers are unlikely and is we later decide to support 'float', we can still use something like complex32 or so...

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Bugs in Tuple, RemoveSorted and in Scribble Example
Next Topic: PLATFORM_X11 warnings
Goto Forum:
  


Current Time: Thu Sep 10 22:58:28 GMT+2 2026

Total time taken to generate the page: 0.01084 seconds