https://github.com/JuliaLang/julia
Revision 642e6e93355f589304ebcdce91039c5ec9c5c1cb authored by Simeon Schaub on 14 June 2021, 19:40:14 UTC, committed by Simeon Schaub on 14 June 2021, 22:11:15 UTC
- `hash` did not respect the type of a factorization, so completely
  different factorizations with the same underlying data would result in
  same `hash` leading to inconsistencies with `isequal`. This likely
  doesn't occur very often in practice, but definitely seems worth
  fixing.
- `==` and `isequal` only returned true if two factorizations are of
  exactly the same type, which is inconsistent with their implementation
  for other objects and with the definition of `hash` for factorizations.
- Equality for `QRCompactWY` did not ignore the subdiagonal entries of
  `T` leading to nondeterministic behavior. Perhaps `T` should be
  directly stored as `UpperTriangular` in `QRCompactWY`, but that seems
  potentially breaking.

Relying on implementation details of `DataType` here is certainly less
than ideal, but I could not come up with a nicer solution.
1 parent 4a81b08
Raw File
Tip revision: 642e6e93355f589304ebcdce91039c5ec9c5c1cb authored by Simeon Schaub on 14 June 2021, 19:40:14 UTC
fix some issues with equality of factorizations
Tip revision: 642e6e9
new-stdlib.sh
#!/bin/sh
# This file is a part of Julia. License is MIT: https://julialang.org/license

set -eu # stop on failure

printf -- "Julia Stdlib Creator Helper Wizard\n"
printf -- "----------------------------------\n"

ROOT=$(dirname "$0")/../stdlib
read -p "Name: " NAME
read -p "Github User account (empty for local): " USER

if [ -z "$USER" ]; then

UUID=$(uuidgen | tr [A-Z] [a-z])

sed -e "/^STDLIBS =/,/^\$/s!^\$!\\
STDLIBS += $NAME\\
!" "$ROOT/Makefile" >"$ROOT/Makefile.tmp"
mv "$ROOT/Makefile.tmp" "$ROOT/Makefile"

mkdir "$ROOT/$NAME"
mkdir "$ROOT/$NAME/src"
mkdir "$ROOT/$NAME/test"

cat >"$ROOT/$NAME/Project.toml" <<EOF
name = "$NAME"
uuid = "$UUID"
EOF

cat >"$ROOT/$NAME/src/$NAME.jl" <<EOF
module $NAME
end
EOF

cat >"$ROOT/$NAME/test/runtests.jl" <<EOF
using $NAME
using Test
@test "your tests here"
EOF

git add "$ROOT/$NAME"
git add -p "$ROOT/Makefile"

else

read -p "Git SHA1 hash of commit: " SHA1

UNAME=$(echo "$NAME" | tr [a-z] [A-Z])

sed -e "/^STDLIBS_EXT =/,/^\$/s!^\$!\\
STDLIBS_EXT += $NAME\\
${UNAME}_GIT_URL := git://github.com/$USER/$NAME.jl.git\\
${UNAME}_TAR_URL = https://api.github.com/repos/$USER/$NAME.jl/tarball/\$1\\
!" "$ROOT/Makefile" >"$ROOT/Makefile.tmp"
mv "$ROOT/Makefile.tmp" "$ROOT/Makefile"

cat >"$ROOT/$NAME.version" <<EOF
${UNAME}_BRANCH = master
${UNAME}_SHA1 = $SHA1
EOF

git add "$ROOT/$NAME.version"
git add -p "$ROOT/Makefile"

fi

printf -- "\n-------------------------------------------------------------------------------\n"
printf -- "\n\
Manually add this now to test/precompile.jl (Base.cache_dependencies),
test/choosetests.jl (net_required_for), and base/sysimg.jl (stdlibs), sorted
by top-down dependency order.\n"
printf -- "\n-------------------------------------------------------------------------------\n"
printf -- "Wizard finished.\n"
back to top