Serving the Quantitative Finance Community

Search found 33 matches

by CurtHagenlocher
June 3rd, 2011, 12:23 pm
Forum: Programming and Software Forum
Topic: Matrix Calculations in Managed Code (eg C#)
Replies: 27
Views: 25670

Matrix Calculations in Managed Code (eg C#)

<t>QuoteOriginally posted by: CuchulainnI suppose - like STL vectors - that this memory is all continguous?Yes. And in fact, if you're willing to use unsafe code, you can access it as a block by using Marshal.UnsafeAddrOfPinnedArrayElement to get the address of the first element and then performing ...
by CurtHagenlocher
June 2nd, 2011, 12:54 pm
Forum: Programming and Software Forum
Topic: Matrix Calculations in Managed Code (eg C#)
Replies: 27
Views: 25670

Matrix Calculations in Managed Code (eg C#)

<t>QuoteOriginally posted by: CuchulainnGovert,Maybe JIT does a lot for you regarding removing bounds checking??QuoteI even changed the lookups in C# to use unsafe pointers in an attempt to remove bounds checking, and it was still slower.It's my understanding that the JIT is pretty good at hoisting ...
by CurtHagenlocher
February 9th, 2011, 9:55 pm
Forum: Programming and Software Forum
Topic: Math.Sqrt in C# (slow) versus Leonardo of Pisa/Babylonian performance tests
Replies: 76
Views: 34003

Math.Sqrt in C# (slow) versus Leonardo of Pisa/Babylonian performance tests

QuoteOriginally posted by: CuchulainnIn Visual Studio, 10^9 trials (rough estimates)A. Debug modeMy: 3 secondsMS: 31 secondsB. Release modeMy: 1.65 secondsMS: 1.65 secondsI believe the JIT's inlining is turned off for debug mode.
by CurtHagenlocher
February 9th, 2011, 6:34 pm
Forum: Programming and Software Forum
Topic: Math.Sqrt in C# (slow) versus Leonardo of Pisa/Babylonian performance tests
Replies: 76
Views: 34003

Math.Sqrt in C# (slow) versus Leonardo of Pisa/Babylonian performance tests

Out of curiousity, how does your test compare between running 32-bit and 64-bit? At least with CLR4, the JIT seems to use sqrtsd instead of fsqrt .
by CurtHagenlocher
January 26th, 2011, 9:36 pm
Forum: Programming and Software Forum
Topic: Sho
Replies: 3
Views: 22407

Sho

<r>If you're using IronPython, you might be interested in Sho:<URL url="http://research.microsoft.com/sho%22Sho">http://research.microsoft.com/sho"Sho</URL> is an interactive environment for data analysis and scientific computing that lets you seamlessly connect scripts (in IronPython) with compiled...
by CurtHagenlocher
December 6th, 2010, 7:57 pm
Forum: Programming and Software Forum
Topic: compiling Windows programs to run 64 bits
Replies: 8
Views: 24560

compiling Windows programs to run 64 bits

All 64-bit versions of Windows -- XP, Vista and Win7 -- effectively ship with both the 32-bit and 64-bit versions of the user-mode Windows DLLs. I used 64-bit Windows XP for well over a year and never had any trouble running 32-bit software which ran successfully on 32-bit XP.
by CurtHagenlocher
November 18th, 2010, 2:33 pm
Forum: Programming and Software Forum
Topic: COM Linker problem
Replies: 8
Views: 24465

COM Linker problem

Out of curiousity, have you made any further progress on this?
by CurtHagenlocher
November 15th, 2010, 8:52 pm
Forum: Programming and Software Forum
Topic: COM Linker problem
Replies: 8
Views: 24465

COM Linker problem

This isn't the entirety of your source code, is it? I don't see where the DllGetClassObject is implemented. And what are you doing to stick this thing into the registry?Assuming you're using MSVC, it's insane not to use ATL to implement COM objects.
by CurtHagenlocher
November 14th, 2010, 10:08 pm
Forum: Programming and Software Forum
Topic: COM Linker problem
Replies: 8
Views: 24465

COM Linker problem

Can you provide a more-specific error message or information? Is this an undefined symbol from the linker? Or is it the post-build registration that's failing?
by CurtHagenlocher
October 28th, 2010, 12:57 pm
Forum: Programming and Software Forum
Topic: Does data frame in R allow duplicate rows after merge or rbind?
Replies: 2
Views: 26452

Does data frame in R allow duplicate rows after merge or rbind?

QuoteOriginally posted by: HorseRiderNow I tried to add another row with same data.aRow = c(2, "aa", TRUE)rbind(df, aRow)rbind doesn't update its argument; it returns a new data frame. You need to reassign the result back to df:df = rbind(df, aRow)
by CurtHagenlocher
October 27th, 2010, 3:39 pm
Forum: Programming and Software Forum
Topic: Using a .NET DLL with a script-able dynamic language
Replies: 7
Views: 25911

Using a .NET DLL with a script-able dynamic language

<t>QuoteOriginally posted by: HansiThat was the first thing I tried but it didn't work with that either. Also IronPython docs say that the CWD is always part of sys.path.Dino says "I don't think [this behavior] is intentional. We actually have a bug to remove . from the sys.path when we're not in in...
by CurtHagenlocher
October 27th, 2010, 12:39 pm
Forum: Programming and Software Forum
Topic: Using a .NET DLL with a script-able dynamic language
Replies: 7
Views: 25911

Using a .NET DLL with a script-able dynamic language

<t>Hmmm... worked for me.PS C:\> type test\x.csusing System;namespace ClassLibrary1{public class Class1{public static int AddOne(int n){return ++n;}}}PS C:\> & 'C:\Program Files (x86)\IronPython 2.6 for .NET 4.0\ipy.exe'IronPython 2.6.2 (2.6.10920.0) on .NET 4.0.30319.1Type "help", "copyright", ...
by CurtHagenlocher
October 26th, 2010, 11:49 am
Forum: Programming and Software Forum
Topic: Using a .NET DLL with a script-able dynamic language
Replies: 7
Views: 25911

Using a .NET DLL with a script-able dynamic language

The "current directory" isn't part of the search path for AddReference. You could sys.path.append the directory or you could use clr.AddReferenceToFileAndPath and give a full path name.
by CurtHagenlocher
October 25th, 2010, 4:03 pm
Forum: Programming and Software Forum
Topic: Comparison of programming languages
Replies: 85
Views: 77460

Comparison of programming languages

<t>QuoteOriginally posted by: renormI see. What is the learning curve if I want to offer my C++ libraries to C# users? Basis C# syntax and some subset of C++/CLI?The main issue is figuring out how to marshal data efficiently between native and managed code. This is easy for simple scalar types and r...
by CurtHagenlocher
October 25th, 2010, 3:42 pm
Forum: Programming and Software Forum
Topic: Comparison of programming languages
Replies: 85
Views: 77460

Comparison of programming languages

QuoteOriginally posted by: renormDoesn't it mean I can access all the fancy C++ stuff from C#? What are the limits? Will CLI work with my SSE library?Sure. I've used C++/CLI to wrap MKL for use from C#.