Click here to Skip to main content
15,896,915 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany20-Jul-10 8:01
Alan Balkany20-Jul-10 8:01 
AnswerRe: Distributing (different sized) objects Pin
Luc Pattyn16-Jul-10 5:54
sitebuilderLuc Pattyn16-Jul-10 5:54 
GeneralRe: Distributing (different sized) objects Pin
Alan Balkany16-Jul-10 6:06
Alan Balkany16-Jul-10 6:06 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 3:30
Wjousts20-Jul-10 3:30 
GeneralRe: Distributing (different sized) objects Pin
Luc Pattyn20-Jul-10 8:11
sitebuilderLuc Pattyn20-Jul-10 8:11 
GeneralRe: Distributing (different sized) objects Pin
Wjousts20-Jul-10 9:14
Wjousts20-Jul-10 9:14 
GeneralRe: Distributing (different sized) objects Pin
Luc Pattyn20-Jul-10 9:38
sitebuilderLuc Pattyn20-Jul-10 9:38 
QuestionGetting all combinations of N sets of objects iteratively Pin
gantww11-Jul-10 15:58
gantww11-Jul-10 15:58 
Greetings,
I'm making a little utility app to dump out test data for my forays into neural network programming (to make the training data sets). I'm trying to make it a little easier to create test data sets, so I'm building this application that allows me to create a list of input fields (along with the range of their values). From that, I want the app to spit out a file that contains all the possible combinations of values that are available (I'm assuming that the sets of values are small, and not interrelated). I've got an abstract base class called BaseDataBuilder that simply contains a description and an abstract function that returns an IEnumerable<object> that represents the set of available values for a particular input field. I'm currently only inheriting from this class in another class called BooleanDataBuilder that has the following function that defines the available values:
public override IEnumerable<object> AvailableValues()
{
yield return true;
yield return false;
}


In the future, I'd like to have the flexibility to use this with other data types, but for the moment, I'm only considering booleans.

Further up, I have an object that contains a list of BaseDataBuilder objects (currently called DataBuilder, but I'll be changing the type name soon as it isn't descriptive). This object has the following function definition.


public IEnumerable<object[]> GetDataValues()
{

}

What I want this to return is essentially a set of rows that is a combination of all the available values as defined by the list of BaseDataBuilder objects. However, I'm kind of stuck as to how to implement this. I know I could do it using recursion, but I was hoping there was some sort of LINQ-ish type of way to do this.

Anybody have any ideas?
AnswerRe: Getting all combinations of N sets of objects iteratively Pin
Alan Balkany15-Jul-10 3:55
Alan Balkany15-Jul-10 3:55 
QuestionMy sorting algorithm Pin
AksharRoop6-Jul-10 4:53
AksharRoop6-Jul-10 4:53 
AnswerRe: My sorting algorithm Pin
Luc Pattyn6-Jul-10 5:20
sitebuilderLuc Pattyn6-Jul-10 5:20 
GeneralRe: My sorting algorithm Pin
AksharRoop6-Jul-10 5:24
AksharRoop6-Jul-10 5:24 
GeneralRe: My sorting algorithm Pin
RugbyLeague6-Jul-10 22:41
RugbyLeague6-Jul-10 22:41 
GeneralRe: My sorting algorithm Pin
molesworth7-Jul-10 1:33
molesworth7-Jul-10 1:33 
GeneralRe: My sorting algorithm Pin
RugbyLeague7-Jul-10 2:37
RugbyLeague7-Jul-10 2:37 
QuestionCounting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 4:51
Tadeusz Westawic24-Jun-10 4:51 
AnswerRe: Counting set bits in bitmap [modified] Pin
harold aptroot24-Jun-10 5:14
harold aptroot24-Jun-10 5:14 
GeneralRe: Counting set bits in bitmap [modified] Pin
Tadeusz Westawic24-Jun-10 6:07
Tadeusz Westawic24-Jun-10 6:07 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 6:19
harold aptroot24-Jun-10 6:19 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 7:01
harold aptroot24-Jun-10 7:01 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 7:46
Tadeusz Westawic24-Jun-10 7:46 
GeneralRe: Counting set bits in bitmap Pin
Luc Pattyn24-Jun-10 8:06
sitebuilderLuc Pattyn24-Jun-10 8:06 
GeneralRe: Counting set bits in bitmap Pin
Tadeusz Westawic24-Jun-10 10:27
Tadeusz Westawic24-Jun-10 10:27 
GeneralRe: Counting set bits in bitmap [modified] Pin
Luc Pattyn24-Jun-10 11:00
sitebuilderLuc Pattyn24-Jun-10 11:00 
GeneralRe: Counting set bits in bitmap Pin
harold aptroot24-Jun-10 8:07
harold aptroot24-Jun-10 8:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.