Hello guys I have an issue, i've made the "regular" operations and operator overload with martices in C#, but my teacher told me that I should do those with generic types using IEnumerable and stuff, but without using functions from C# library to automatically sort things out, I guess I should create same functions using generics but I don't really understand what to do can someone help me ho to do these operations using generic types? I would really apreciate the help!
There's my code down below! If there are some issues Im open for corrections. And tips to improve. Im still coding this...
Amira BedhiafiPosted Mar 19, 2025, 10:28 PM
You need to create a generic matrix class in C# that supports basic matrix operations using generics (
T) and operator overloading. The key is to work within constraints that allow mathematical operations onT. SinceTcould be anything, we need to restrict it to types that support addition, multiplication, ...