Register to reply 
If possible, I'd like a function f(i,j)=k defined as follows 
Share this thread: 
#19
Apr2014, 12:02 PM

P: 361

The original solution by Mark44 is a simple, direct solution. (The dimensions were off and a typo, but without a compiler it is hard to get it right the first time.) Regarding array indices and table lookups, nothing can beat the versatility of well implemented associative arrays (aka hash tables, dictionaries, etc.). C++ hash tables (unordered_map) are awkward to use, Perl is very good, Python looks good but I have no experience with it.



#20
Apr2014, 12:27 PM

Mentor
P: 21,409




#21
Apr2014, 01:27 PM

Engineering
Sci Advisor
HW Helper
Thanks
P: 7,293

C's model of arrays (like almost everything else in C) is tied much too closely to the "standard" computer hardware designs when it was invented. But at least the same people didn't make the same mistake twice when they invented Unix. 


#22
Apr2014, 02:09 PM

P: 361




Register to reply 
Related Discussions  
Function defined as series  Calculus  4  
The action is not a well defined function  Classical Physics  8  
When y is defined as a function of x  Calculus & Beyond Homework  3  
Existence of a function vs being welldefined?  Calculus  0  
[tex] f(x) = x^x [/tex]Given this function, defined, let's say for  General Math  9 