Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » [DISCUSSION] Add 'complex' datatype, to Value too
Re: [DISCUSSION] Add 'complex' datatype, to Value too [message #33054 is a reply to message #32993] Tue, 05 July 2011 13:28 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
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);
}
  • Attachment: comp.svn.patch
    (Size: 0.95KB, Downloaded 299 times)
  • Attachment: Complex.h
    (Size: 1.24KB, Downloaded 328 times)
  • Attachment: Complex.cpp
    (Size: 0.30KB, Downloaded 555 times)

[Updated on: Tue, 05 July 2011 13:34]

Report message to a moderator

 
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: Sun Aug 24 23:18:13 CEST 2025

Total time taken to generate the page: 0.04762 seconds