Code Monkey home page Code Monkey logo

Comments (6)

johndpope avatar johndpope commented on August 26, 2024

screen shot 2018-08-13 at 11 46 08 am

from surge.

johndpope avatar johndpope commented on August 26, 2024

seems to bypass error.

public func det(_ x: Matrix<Double>) -> Double? {
    var decomposed = x
    var pivots = [__CLPK_integer](repeating: 0, count: min(x.rows, x.columns))
    var info = __CLPK_integer()
    var m = __CLPK_integer(x.rows)
    var n = __CLPK_integer(x.columns)
    _ = withUnsafeMutableMemory(&pivots, &(decomposed.grid)) { ipiv, grid in
        withUnsafeMutablePointers(&m, &n, &info) { m, n, info in
            dgetrf_(m, n, grid.pointer, m, ipiv.pointer, info)
        }
    }

    if info != 0 {
        return nil
    }

    var det = 1 as Double
    for (i, p) in zip(pivots.indices, pivots) {
        if p != i + 1 {
            det = -det * decomposed[i, i]
        } else {
            let detNew =  det * decomposed[i, i]
            det = detNew
        }
    }
    return det
}

from surge.

johndpope avatar johndpope commented on August 26, 2024

github "johndpope/Surge" ~> 2.1.1

from surge.

mattt avatar mattt commented on August 26, 2024

@johndpope You're reporting a diagnostic generated by SwiftLint. This isn't a compiler error, and doesn't inherently prevent users from building their project.

This project defines a .swiftlint.yml file, but doesn't enforce the shorthand_operator rule. Looking at this particular case, I don't agree with the advice to prefer shorthand operators, and don't believe we should opt-in to this here.

I believe the general recommendation is to exclude 3rd-party dependencies from swiftlint coverage, because such violations aren't directly actionable. You can do this by adding the following to your .swiftlint.yml file:

excluded:
- Carthage
- Pods

from surge.

johndpope avatar johndpope commented on August 26, 2024

Makes sense. I’m fine with this. But request that a note is added in source to point somewhere explaining this. Otherwise others will trip up and have to search around for solution. Or add to read me as known issue. Or let’s raise an issue with swift lint to rectify and link here.

from surge.

johndpope avatar johndpope commented on August 26, 2024

Whoops on mobile and see you’re one step ahead. Thx

from surge.

Related Issues (20)

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.