Giter VIP home page Giter VIP logo

kplanisphere / complex-matrix-operations-in-java Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 450 KB

A Java project for performing operations on complex matrices, including basic arithmetic and matrix-specific operations, with utility methods and input handling for complex number matrices - Final Project for the Programmation 2 Course

Home Page: https://linktr.ee/planisphere.kgz

Java 100.00%
arithmetic-operations beginner-friendly java-programming linear-algebra matrix-operations object-oriented-programming object-oriented-programming-in-java oop oops-in-java programming-education

complex-matrix-operations-in-java's Introduction

Complex Matrix Operations in Java

Project Overview

This repository contains a Java project for performing operations on complex matrices. The project is structured into several classes, each responsible for different aspects of handling and manipulating complex numbers and matrices. The main functionalities include creating complex matrices, performing arithmetic operations, and handling complex number arithmetic.

Features

  • Complex Number Operations: Basic operations on complex numbers such as addition, subtraction, multiplication, and division.
  • Complex Matrix Operations: Creation and manipulation of matrices with complex numbers including matrix addition, subtraction, multiplication, and scalar operations.
  • Utility Methods: Helper methods to facilitate complex number and matrix operations.
  • Input Handling: Reading complex matrices from input files and processing them.

Project Structure

src/
├── TComplejo.java
├── TOperaComplejos.java
├── TMatrizCompleja.java
├── TOpMatricesComplejas.java
└── MatricesComplejas.java

TComplejo.java

This class defines the structure and basic operations for complex numbers. It includes methods for addition, subtraction, multiplication, and division of complex numbers.

Key Methods

public class TComplejo {
    private double real;
    private double imag;

    public TComplejo(double real, double imag) {
        this.real = real;
        this.imag = imag;
    }

    public TComplejo add(TComplejo c) {
        return new TComplejo(this.real + c.real, this.imag + c.imag);
    }

    public TComplejo subtract(TComplejo c) {
        return new TComplejo(this.real - c.real, this.imag - c.imag);
    }

    // Other operations...
}

TOperaComplejos.java

This class provides additional operations for complex numbers, possibly including utility functions that extend the basic arithmetic operations provided in TComplejo.java.

TMatrizCompleja.java

This class represents a matrix with complex numbers. It includes methods to perform matrix-specific operations such as addition, subtraction, and multiplication.

Key Methods

public class TMatrizCompleja {
    private TComplejo[][] data;

    public TMatrizCompleja(int rows, int cols) {
        data = new TComplejo[rows][cols];
    }

    public TMatrizCompleja add(TMatrizCompleja m) {
        // Implementation for matrix addition
    }

    public TMatrizCompleja multiply(TMatrizCompleja m) {
        // Implementation for matrix multiplication
    }

    // Other matrix operations...
}

TOpMatricesComplejas.java

This class likely provides additional operations for complex matrices, complementing the basic operations defined in TMatrizCompleja.java.

MatricesComplejas.java

This is the main class that coordinates the complex matrix operations, possibly including reading inputs, initializing matrices, and invoking operations.

Example Usage

public class MatricesComplejas {
    public static void main(String[] args) {
        // Initialize matrices and perform operations
        TMatrizCompleja matrix1 = new TMatrizCompleja(3, 3);
        TMatrizCompleja matrix2 = new TMatrizCompleja(3, 3);

        TMatrizCompleja result = matrix1.add(matrix2);
        // Output the result...
    }
}

How to Use

  1. Clone the repository
git clone https://github.com/yourusername/ComplexMatrixOperations.git
  1. Navigate to the project directory:
cd ComplexMatrixOperations
  1. Compile the Java files:
javac src/*.java
  1. Run the main class:
java src/MatricesComplejas

Input File Format (example)

The input file ENTRADAS MATRICES COMPLEJAS.txt contain the matrices to be processed. Each matrix is represented by its elements, where each complex number is specified in the format (real, imaginary).

3
3
3
2
3
5
2
1
-4
2
5
4
6
...

complex-matrix-operations-in-java's People

Contributors

kplanisphere avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.