Results 1 to 4 of 4
  1. #1
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default Help with System.arrayCopy

    I need some help rewriting the System.arrayCopy portion of this code. Is there any other way to get the same result without using the arrayCopy function?

    for (int i = 0; i < mat[0].length; i++) {
    int minor[][] = new int[mat.length - 1][mat[0].length - 1];

    for (int j = 2; j < mat.length; j++) {
    System.arraycopy(mat[j], 0, minor[j - 1], 0, i);
    System.arraycopy(mat[j], i + 1, minor[j - 1], i, mat[0].length - i - 1);
    }

    answer = mat[0][i] * Math.pow(-1, i) * determinant(minor);

    }

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,788
    Rep Power
    7

    Default

    Not without further details.

  3. #3
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

    Default

    ok, I think the System.arrayCopy is creating the minor of my matrixData[][]. So I just wanted another way of getting the same result.

  4. #4
    sehudson's Avatar
    sehudson is offline Senior Member
    Join Date
    Mar 2010
    Posts
    356
    Rep Power
    5

Similar Threads

  1. copy arrays without using arraycopy Method !
    By M7MD in forum Introductions
    Replies: 0
    Last Post: 10-10-2010, 06:59 PM
  2. Replies: 3
    Last Post: 02-07-2010, 08:34 PM
  3. System.exit 0 or 1?
    By antgaudi in forum New To Java
    Replies: 3
    Last Post: 11-13-2008, 06:33 PM
  4. System.out.println
    By sunjavaboy in forum Advanced Java
    Replies: 3
    Last Post: 03-22-2008, 01:30 AM
  5. System.getProperties(key)
    By diRisig in forum New To Java
    Replies: 1
    Last Post: 02-06-2008, 12:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •