Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何实现复数矩阵的特征向量 #23

Open
ztx8511 opened this issue Jul 29, 2024 · 6 comments
Open

如何实现复数矩阵的特征向量 #23

ztx8511 opened this issue Jul 29, 2024 · 6 comments

Comments

@ztx8511
Copy link

ztx8511 commented Jul 29, 2024

如题,您的框架能否实现复数矩阵的特征向量?

@BeardedManZhao
Copy link
Owner

你好,很抱歉现在才看到您的消息,框架目前提供了复数矩阵!!!

@BeardedManZhao
Copy link
Owner

BeardedManZhao commented Aug 3, 2024

您可以使用 io.github.beardedManZhao.algorithmStar.operands.matrix.ComplexNumberMatrix 下面是一些示例

您使用 1.42 版本可以直接通过 AlgorithmStar.matrixFactory() 构建一个复数矩阵哦!!!

        MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
        ComplexNumberMatrix complexNumbers = matrixFactory.parseComplexNumberMatrix(
                new String[]{
                        "1 + 2i", "2 + 4i", "3 + 5i", "4 + 6i", "5 + 7i"
                },
                new String[]{
                        "1 + 2i", "2 + 4i", "3 + 5i", "4 + 6i", "5 + 7i"
                }
        );
        System.out.println(complexNumbers);

@ztx8511
Copy link
Author

ztx8511 commented Aug 6, 2024

作者您好,
框架支持复数矩阵的特征向量计算吗?

@BeardedManZhao
Copy link
Owner

BeardedManZhao commented Aug 9, 2024

yes,这是被支持的,矩阵对象都实现了一些运算和转换功能

package org.example;

import io.github.beardedManZhao.algorithmStar.core.AlgorithmStar;
import io.github.beardedManZhao.algorithmStar.core.MatrixFactory;
import io.github.beardedManZhao.algorithmStar.operands.matrix.ComplexNumberMatrix;

public class Main {
    public static void main(String[] args) throws CloneNotSupportedException {
        MatrixFactory matrixFactory = AlgorithmStar.matrixFactory();
        ComplexNumberMatrix complexNumbers = matrixFactory.parseComplexNumberMatrix(
                new String[]{
                        "1 + 2i", "2 + 4i", "3 + 5i", "4 + 6i", "5 + 7i"
                },
                new String[]{
                        "1 + 2i", "2 + 4i", "3 + 5i", "4 + 6i", "5 + 7i"
                }
        );
        ComplexNumberMatrix clone = (ComplexNumberMatrix) complexNumbers.clone();
        System.out.println(complexNumbers);

        // 加减运算(还有很多没展示)
        ComplexNumberMatrix add = complexNumbers.add(clone);
        System.out.println(add);

        ComplexNumberMatrix diff = complexNumbers.diff(clone);
        System.out.println(diff);

        // 转换运算(还有很多没展示 这里只是一个共轭处理 以及一个转置)
        ComplexNumberMatrix conjugate = complexNumbers.conjugate();
        System.out.println(conjugate);

        ComplexNumberMatrix transpose = complexNumbers.transpose();
        System.out.println(transpose);
    }
}

@ztx8511
Copy link
Author

ztx8511 commented Aug 13, 2024

复数矩阵的特征向量,使用该框架具体是怎么实现?

@BeardedManZhao
Copy link
Owner

您可以创建一个只有一行的复数矩阵,并结合上面的例子就可以了,矩阵如果只有一行或一列,其就可以在大多数情况被做为向量计算

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants