矩阵乘法中的分段错误 [英] Segmentation fault in Matrix Multiplication

查看:81
本文介绍了矩阵乘法中的分段错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我在C中有一个矩阵乘法程序,它乘以两个

矩阵。


当它们的尺寸为3 * 3或800 * 800时,程序运行正常。但是在这个尺寸之上,我得到了一个分段错误。


我需要这个巨大的尺寸作为我的任务的一部分。


谁能告诉我出了什么问题?


谢谢。

Hi Guys,

I have a matrix multiplication program in C that multiplies two
matrices.

When their size is 3*3 or 800*800, the program runs fine. But above
that size, I get a "segmentation fault".

I need this huge size as part of my assignment.

Can anyone tell me what''s going wrong?

Thanks.

推荐答案

am******* @ gmail.com 写道:
am*******@gmail.com wrote:
大家好,
我在C中有一个矩阵乘法程序,它将两个
矩阵相乘。

当它们的大小为3 *时3或800 * 800,程序运行正常。但是在那个尺寸之上,我得到了一个分段错误。

我需要这个巨大的尺寸作为我的任务的一部分。

谁能告诉我什么'出错了?
Hi Guys,

I have a matrix multiplication program in C that multiplies two
matrices.

When their size is 3*3 or 800*800, the program runs fine. But above
that size, I get a "segmentation fault".

I need this huge size as part of my assignment.

Can anyone tell me what''s going wrong?




你的程序中有一个错误。


这可能是错误的 - 在第17行使用商店。


-

克里斯理解是一把三角剑 Dollin



There''s a bug in your program.

It''s probably the mis-use of store on line 17.

--
Chris "understanding is a three-edged sword" Dollin


Chris,


感谢您的回复。


但我是想知道你在哪里看到我的代码。我没有发布它。


谢谢

Chris,

Thanks for your reply.

But I was wondering where you saw my code. I didn''t post it.

Thanks


am ******* @ gmail.com 写道:
Chris,

感谢您的支持回复。

但我想知道你在哪里看到我的代码。我没有发布它。

谢谢
Chris,

Thanks for your reply.

But I was wondering where you saw my code. I didn''t post it.

Thanks




他跟进了暗示使用ESP猜测的建议
你做了什么。你不可能在内存耗尽的情况下做任何事情,而不是在malloc()中检查是否成功,或者你是否b / b
让我们看到它。



He was following up on your implied suggestion of use of ESP to guess
what you have done. You couldn''t have done anything along the lines of
running out of memory and not checking for success in malloc(), or you
would have let us see it.


这篇关于矩阵乘法中的分段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆