Lounge<C++>

Today we're daydreaming about C++26 reflection
Oct 10, 2012 14:14
regardless, how would you calculate the k size?
Oct 10, 2012 14:13
@LuchianGrigore I got it at 64 when I checked
Oct 10, 2012 14:13
stuck on this shit for a day now
Oct 10, 2012 14:12
process k x k blocks at a time. (Hint:
k should relate to the cache line size, which for PCs usually is 64 bytes)
Oct 10, 2012 14:11
What*
Oct 10, 2012 14:11
its in C
Oct 10, 2012 14:10
NxN matrix needs to have k x k blocks, 64 bytes cache line size
Oct 10, 2012 14:10
is cache line related to block size? I am trying to implement matrix multiplication using that shit
Oct 10, 2012 02:07
@Xeo there is no room for C, where should I post it then? C++ is similar to C
Oct 10, 2012 02:06
this is in C btw
Oct 10, 2012 02:05
@LucDanton how about now?
Oct 10, 2012 02:05
for(i=0; i<(size/sizeof(int)); i++) {
A[i] = rand();
}
Oct 10, 2012 02:04
Is this correct allocation of memory for the following array?

int *A;
A = malloc (size);
Oct 9, 2012 11:10
so t is in clocks per seconds?
Oct 9, 2012 11:09
hi guys would you know whether clock_t is measured in seconds??

        clock_t start, stop;
	double t = 0.0;
//code
stop = clock();
	t = ((double) (stop - start)) / CLOCKS_PER_SEC;
	printf("Run time: %f\n", t);
Oct 9, 2012 09:32
@MartinJames a lot of people from UK in these chat rooms, I am from NZ
Oct 9, 2012 09:30
where you all from =D
Oct 9, 2012 09:18
@DeadMG I dont see how I made you angry...I was asking for help nicely
Oct 9, 2012 09:18
@kbok thank you heaps!
Oct 9, 2012 09:18
@kbok its working =)
Oct 9, 2012 09:17
apart from that is the implementation correct @kbok ???
Oct 9, 2012 09:15
@kbok I am not worried about the code being slow because if the implementation of the matrix multiplication is not correct then time measured wouldnt matter. So was wondering if you could spot any problems with my code
Oct 9, 2012 09:14
its not working, I mean its printing numbers out but they are way too large like over millions. (btw I have made the code more compact so its faster ) @kbok
Oct 9, 2012 09:11
@kbok will really appreciate it if you could help me out with this if you have time
Oct 9, 2012 09:10
@kbok I was trying to implement matrix multiplication using a transpose but the answer is not coming right, below is a link to my code

http://stackoverflow.com/questions/12795143/matrix-multiplication-using-transpose-in-c
Oct 9, 2012 09:08
guys I need help badly =( I been stuck on square matrix multiplication for about a hour now and cant figure it out in C
Oct 9, 2012 07:54
stackoverflow.com/questions/12795143/… yoooo guys is my implementation of matrix multi using transpose correct?
Oct 9, 2012 07:22
it was 10 lines of code farout
Oct 9, 2012 07:17
got it
Oct 9, 2012 07:17
my bad!
 

C#

General discussions about the c# language, Squirrels | gist.gi...
Oct 10, 2012 14:11
is cache line related to block size? I am trying to implement matrix multiplication using that shit
NxN matrix needs to have k x k blocks, 64 bytes cache line size
cmon u lazy cunts =D
its in C
Oct 9, 2012 09:07
I am begging pleeease, I been stuck on this for a hour now
Oct 9, 2012 09:06
guys I need someones help really badly regard matrix multiplication in C!
Oct 9, 2012 08:05
anyone?
Oct 9, 2012 07:57
stackoverflow.com/questions/12795143/… is my implentation of matrix multiplication using transpose correct?
Oct 9, 2012 07:28
can anyone help me correct my code so that it would do matrix multiplication using transpose one matrix???
Oct 9, 2012 07:27
gcc
Oct 9, 2012 07:26
@LewsTherin no =( it saying for for loop declarations are only allowed in c99 mode
Oct 9, 2012 07:25
@vishalpatel ok
Oct 9, 2012 07:25
    int main()
{

  int a[3][3] = {{1,0, 1}, {2, 2, 4},{1, 2, 3}};

		int b[3][3] ={ { 2, 3, 1}, { 6, 6, 2 }, { 9, 9, 0 } };
		int result[3][3];
		double tmp;

		for (int i=0; i<3; i++) //i = col
		  {
			for (int k=0; k<3; k++)
			{
			  tmp = a[i][k];
			  for (int j=0; j<3; j++) //j = row
			  {
				result[i][j] += tmp * b[k][j];
				printf("%d\t",result[i][j]);
			  }
			}
		  }


}
Oct 9, 2012 07:25
I am stuck on this problem for 2 hours now! its a simple matrix multiplication using transpose but for some reason its not working, I am doing this in C
Oct 9, 2012 07:24
fine then
Oct 9, 2012 07:23
@vishalpatel
Oct 9, 2012 07:22
thodi help kardo
Oct 9, 2012 07:22
patel bhai
Oct 9, 2012 07:16
and declared again
Oct 9, 2012 07:16
i declared i,j,k
Oct 9, 2012 07:16
woops
Oct 9, 2012 07:15
btw this is in C not in C# =)
Oct 9, 2012 07:14
wtf why is this not compiling!

            int a[3][3] = {{1,0, 1},  {2, 2, 4}, {1, 2, 3}};

		int b[3][3] ={ { 2, 3, 1},  { 6, 6, 2 },  { 9, 9, 0 } };
		int result[3][3];
		double tmp;


		int i;
		int j;
		int k;

		for (int i=0; i<3; i++) //i = col
		  {
			for (int k=0; k<3; k++)
			{
			  tmp = a[i][k];
			  for (int j=0; j<3; j++) //j = row
			  {
				result[i][j] += tmp * b[k][j];
				printf("%d\t",result[i][j]);
			  }
			}
		  }