The post on applying GPU to finding Eulerian path mentioned a stumbling block: partitioning a very specific kind of graph. In general, partitioning is a hard problem, NP-hard actually. The graphs we are dealing with are very specific, though, and may be partitioned in $latex O(|E|)$ time (E - the set of graph edges). Our … Continue reading HashSet, Graph, Cognac
Category: C#
F# vs C#. Fold and Aggregate
Suppose you need to write a script that finds n files, all called based on some pattern, say "c:\temp\my_file_x.txt", where "x" is replaced by a range of numbers [1..30] for instance, reads the content of these files and glues them together. Suppose also that the files are very small, so you can keep them in … Continue reading F# vs C#. Fold and Aggregate
C#/F# Interop and TDD
Since this development was supposed to conform to the best methodology available, I naturally chose Test Driven Development (TDD), which, as the name suggests, presumes writing tests for each piece of the code written. Actually it suggests writing tests first, but who wants to be so dogmatic! I was writing tests at least at the … Continue reading C#/F# Interop and TDD
Push Operation. A Few Words on Computation Expressions/Monads
As we have seen in the previous post, it is easy to implement Push types and operations: Here is an example of an implementation of FLOAT./ operation: a division of two integers on top of the stack. Since in Push an operation is denoted by "OP_TYPE.OP_NAME", it is convenient from the implementation standpoint to group … Continue reading Push Operation. A Few Words on Computation Expressions/Monads
Implementing a Push Type
From a developer's point of view, a Push type is implemented through a class, derived from PushTypeBase, as mentioned in the previous post. Once the type is implemented in any .NET language the system will hook it into the currently available types, will add a parser and a stack for it. All that needs to … Continue reading Implementing a Push Type