From b47230fd25a5b345cc65cc04bd6979080515e57b Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Mon, 2 Nov 2020 17:31:23 -0500 Subject: [PATCH 1/6] bump(*): - Make go 1.14 explicit - Bump operator-framework/operator-sdk to v0.18.2 - Bump k8s.io/* to v0.18.10 - Replace for github.com/Sirupsen/logrus (renamed) - Replace for github.com/docker/distribution (fix version tag resolution) - Pin docker/docker to specific version - Update knative.dev/pkg to release-0.18 - Update tekton to d5df1c164a48 to get k8s 1.18 clientsets - go mod tidy && go mod vendor --- go.mod | 29 +- go.sum | 290 +- vendor/github.com/blang/semver/.travis.yml | 21 + vendor/github.com/blang/semver/LICENSE | 22 + vendor/github.com/blang/semver/README.md | 194 ++ vendor/github.com/blang/semver/json.go | 23 + vendor/github.com/blang/semver/package.json | 17 + vendor/github.com/blang/semver/range.go | 416 +++ vendor/github.com/blang/semver/semver.go | 418 +++ vendor/github.com/blang/semver/sort.go | 28 + vendor/github.com/blang/semver/sql.go | 30 + .../pkg/apis/monitoring/v1/bindata.go | 363 -- .../pkg/apis/monitoring/v1/crd_kinds.go | 91 - .../pkg/apis/monitoring/v1/thanos_types.go | 4 + .../pkg/apis/monitoring/v1/types.go | 44 +- .../monitoring/v1/zz_generated.deepcopy.go | 36 - .../typed/monitoring/v1/alertmanager.go | 72 +- .../typed/monitoring/v1/podmonitor.go | 64 +- .../typed/monitoring/v1/prometheus.go | 72 +- .../typed/monitoring/v1/prometheusrule.go | 64 +- .../typed/monitoring/v1/servicemonitor.go | 64 +- .../typed/monitoring/v1/thanosruler.go | 72 +- .../github.com/evanphx/json-patch/.travis.yml | 7 +- vendor/github.com/evanphx/json-patch/LICENSE | 2 +- .../github.com/evanphx/json-patch/README.md | 11 +- vendor/github.com/evanphx/json-patch/merge.go | 13 +- vendor/github.com/evanphx/json-patch/patch.go | 28 +- vendor/github.com/json-iterator/go/README.md | 36 +- vendor/github.com/json-iterator/go/any_str.go | 4 +- vendor/github.com/json-iterator/go/config.go | 4 +- .../json-iterator/go/iter_object.go | 4 +- .../json-iterator/go/reflect_extension.go | 2 +- .../json-iterator/go/reflect_map.go | 80 +- .../json-iterator/go/reflect_optional.go | 4 - .../go/reflect_struct_decoder.go | 22 +- vendor/github.com/json-iterator/go/stream.go | 5 +- .../gomega/gstruct/errors/nested_types.go | 72 + .../api/pkg/lib/version/version.go | 67 + .../api/pkg/operators/catalogsource_types.go | 142 + .../operators/clusterserviceversion_types.go | 516 +++ .../api/pkg/operators/doc.go | 5 + .../api/pkg/operators/installplan_types.go | 392 +++ .../api/pkg/operators/operatorgroup_types.go | 79 + .../api/pkg/operators/register.go | 50 + .../api/pkg/operators/subscription_types.go | 312 ++ .../pkg/operators/zz_generated.deepcopy.go | 1457 ++++++++ .../operator-registry/LICENSE | 201 ++ .../operator-registry/pkg/api/registry.pb.go | 1558 +++++++++ .../operator-registry/pkg/api/registry.proto | 115 + .../operator-registry/pkg/image/reference.go | 16 + .../operator-registry/pkg/image/registry.go | 32 + .../operator-registry/pkg/registry/bundle.go | 318 ++ .../pkg/registry/bundlegraphloader.go | 147 + .../pkg/registry/channelupdateoptions.go | 27 + .../pkg/registry/conversion.go | 83 + .../operator-registry/pkg/registry/csv.go | 342 ++ .../operator-registry/pkg/registry/decode.go | 43 + .../pkg/registry/directoryGraphLoader.go | 226 ++ .../operator-registry/pkg/registry/empty.go | 111 + .../operator-registry/pkg/registry/graph.go | 51 + .../pkg/registry/imageinput.go | 125 + .../pkg/registry/interface.go | 70 + .../pkg/registry/populator.go | 405 +++ .../pkg/registry/replacesgraphloader.go | 40 + .../operator-registry/pkg/registry/types.go | 271 ++ .../operator-sdk/internal/scaffold/go_mod.go | 6 +- .../operator-sdk/internal/scaffold/role.go | 119 +- .../operator-sdk/internal/util/k8sutil/api.go | 156 +- .../internal/util/k8sutil/k8sutil.go | 9 + .../internal/util/k8sutil/manifest.go | 15 +- .../internal/util/k8sutil/options.go | 43 - .../internal/util/k8sutil/scan.go | 5 +- .../internal/util/kubebuilder/constants.go | 19 + .../internal/util/kubebuilder/project.go | 52 + .../util/projutil/interactive_promt_util.go | 113 + .../internal/util/projutil/project_util.go | 83 +- .../operator-sdk/pkg/k8sutil/k8sutil.go | 47 + .../operator-sdk/pkg/kube-metrics/server.go | 9 +- .../operator-sdk/pkg/kube-metrics/store.go | 8 +- .../pkg/metrics/service-monitor.go | 3 +- .../pkg/test/e2eutil/wait_util.go | 2 +- .../operator-sdk/pkg/test/resource_creator.go | 53 +- .../operator-sdk/version/version.go | 2 +- .../client/clientset/versioned/clientset.go | 2 +- .../typed/pipeline/v1alpha1/clustertask.go | 64 +- .../typed/pipeline/v1alpha1/condition.go | 64 +- .../typed/pipeline/v1alpha1/pipeline.go | 64 +- .../typed/pipeline/v1alpha1/pipelinerun.go | 72 +- .../versioned/typed/pipeline/v1alpha1/run.go | 72 +- .../versioned/typed/pipeline/v1alpha1/task.go | 64 +- .../typed/pipeline/v1alpha1/taskrun.go | 72 +- .../typed/pipeline/v1beta1/clustertask.go | 64 +- .../typed/pipeline/v1beta1/pipeline.go | 64 +- .../typed/pipeline/v1beta1/pipelinerun.go | 72 +- .../versioned/typed/pipeline/v1beta1/task.go | 64 +- .../typed/pipeline/v1beta1/taskrun.go | 72 +- vendor/golang.org/x/net/http2/server.go | 11 +- vendor/golang.org/x/net/http2/transport.go | 4 +- .../x/net/internal/timeseries/timeseries.go | 525 +++ vendor/golang.org/x/net/trace/events.go | 532 +++ vendor/golang.org/x/net/trace/histogram.go | 365 ++ vendor/golang.org/x/net/trace/trace.go | 1130 +++++++ vendor/golang.org/x/sys/unix/mkerrors.sh | 1 + .../x/sys/unix/syscall_darwin.1_12.go | 4 +- .../golang.org/x/sys/unix/syscall_darwin.go | 5 + vendor/golang.org/x/sys/unix/zerrors_linux.go | 1 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 9 + .../x/sys/windows/syscall_windows.go | 1 + .../golang.org/x/sys/windows/types_windows.go | 12 - .../x/sys/windows/types_windows_386.go | 13 + .../x/sys/windows/types_windows_amd64.go | 12 + .../x/sys/windows/types_windows_arm.go | 13 + .../x/sys/windows/zsyscall_windows.go | 13 + vendor/gonum.org/v1/gonum/AUTHORS | 89 - vendor/gonum.org/v1/gonum/CONTRIBUTORS | 91 - vendor/gonum.org/v1/gonum/LICENSE | 23 - vendor/gonum.org/v1/gonum/blas/README.md | 47 - vendor/gonum.org/v1/gonum/blas/blas.go | 283 -- .../gonum.org/v1/gonum/blas/blas64/blas64.go | 469 --- vendor/gonum.org/v1/gonum/blas/blas64/conv.go | 277 -- .../v1/gonum/blas/blas64/conv_symmetric.go | 153 - vendor/gonum.org/v1/gonum/blas/blas64/doc.go | 6 - .../v1/gonum/blas/cblas128/cblas128.go | 508 --- .../gonum.org/v1/gonum/blas/cblas128/conv.go | 279 -- .../v1/gonum/blas/cblas128/conv_hermitian.go | 155 - .../v1/gonum/blas/cblas128/conv_symmetric.go | 155 - .../gonum.org/v1/gonum/blas/cblas128/doc.go | 6 - .../gonum.org/v1/gonum/blas/conversions.bash | 159 - vendor/gonum.org/v1/gonum/blas/doc.go | 108 - vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go | 314 -- vendor/gonum.org/v1/gonum/blas/gonum/doc.go | 88 - .../gonum.org/v1/gonum/blas/gonum/errors.go | 35 - vendor/gonum.org/v1/gonum/blas/gonum/gemv.go | 190 -- vendor/gonum.org/v1/gonum/blas/gonum/gonum.go | 58 - .../v1/gonum/blas/gonum/level1cmplx128.go | 445 --- .../v1/gonum/blas/gonum/level1cmplx64.go | 467 --- .../v1/gonum/blas/gonum/level1float32.go | 644 ---- .../gonum/blas/gonum/level1float32_dsdot.go | 53 - .../v1/gonum/blas/gonum/level1float32_sdot.go | 53 - .../gonum/blas/gonum/level1float32_sdsdot.go | 53 - .../v1/gonum/blas/gonum/level1float64.go | 620 ---- .../v1/gonum/blas/gonum/level1float64_ddot.go | 49 - .../v1/gonum/blas/gonum/level2cmplx128.go | 2906 ---------------- .../v1/gonum/blas/gonum/level2cmplx64.go | 2942 ----------------- .../v1/gonum/blas/gonum/level2float32.go | 2296 ------------- .../v1/gonum/blas/gonum/level2float64.go | 2264 ------------- .../v1/gonum/blas/gonum/level3cmplx128.go | 1715 ---------- .../v1/gonum/blas/gonum/level3cmplx64.go | 1735 ---------- .../v1/gonum/blas/gonum/level3float32.go | 876 ----- .../v1/gonum/blas/gonum/level3float64.go | 864 ----- vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go | 318 -- .../v1/gonum/blas/gonum/single_precision.bash | 218 -- vendor/gonum.org/v1/gonum/floats/README.md | 4 - vendor/gonum.org/v1/gonum/floats/doc.go | 11 - vendor/gonum.org/v1/gonum/floats/floats.go | 933 ------ vendor/gonum.org/v1/gonum/graph/.gitignore | 1 - vendor/gonum.org/v1/gonum/graph/README.md | 3 - vendor/gonum.org/v1/gonum/graph/doc.go | 9 - vendor/gonum.org/v1/gonum/graph/graph.go | 282 -- .../v1/gonum/graph/internal/linear/doc.go | 6 - .../v1/gonum/graph/internal/linear/linear.go | 73 - .../v1/gonum/graph/internal/ordered/doc.go | 6 - .../v1/gonum/graph/internal/ordered/sort.go | 93 - .../v1/gonum/graph/internal/set/doc.go | 6 - .../v1/gonum/graph/internal/set/same.go | 36 - .../graph/internal/set/same_appengine.go | 36 - .../v1/gonum/graph/internal/set/set.go | 228 -- .../v1/gonum/graph/internal/uid/uid.go | 54 - .../gonum.org/v1/gonum/graph/iterator/doc.go | 9 - .../v1/gonum/graph/iterator/edges.go | 131 - .../v1/gonum/graph/iterator/lines.go | 131 - .../v1/gonum/graph/iterator/nodes.go | 125 - vendor/gonum.org/v1/gonum/graph/multigraph.go | 198 -- .../gonum.org/v1/gonum/graph/nodes_edges.go | 300 -- .../graph/simple/dense_directed_matrix.go | 301 -- .../graph/simple/dense_undirected_matrix.go | 268 -- .../v1/gonum/graph/simple/directed.go | 235 -- vendor/gonum.org/v1/gonum/graph/simple/doc.go | 9 - .../gonum.org/v1/gonum/graph/simple/simple.go | 72 - .../v1/gonum/graph/simple/undirected.go | 216 -- .../gonum/graph/simple/weighted_directed.go | 279 -- .../gonum/graph/simple/weighted_undirected.go | 273 -- .../v1/gonum/graph/topo/bron_kerbosch.go | 250 -- .../v1/gonum/graph/topo/clique_graph.go | 111 - vendor/gonum.org/v1/gonum/graph/topo/doc.go | 6 - .../v1/gonum/graph/topo/johnson_cycles.go | 285 -- .../v1/gonum/graph/topo/non_tomita_choice.go | 9 - .../v1/gonum/graph/topo/paton_cycles.go | 83 - .../gonum.org/v1/gonum/graph/topo/tarjan.go | 199 -- .../v1/gonum/graph/topo/tomita_choice.go | 9 - vendor/gonum.org/v1/gonum/graph/topo/topo.go | 68 - .../gonum.org/v1/gonum/graph/traverse/doc.go | 6 - .../v1/gonum/graph/traverse/traverse.go | 231 -- vendor/gonum.org/v1/gonum/graph/undirect.go | 270 -- .../gonum/internal/asm/c128/axpyinc_amd64.s | 134 - .../gonum/internal/asm/c128/axpyincto_amd64.s | 141 - .../internal/asm/c128/axpyunitary_amd64.s | 122 - .../internal/asm/c128/axpyunitaryto_amd64.s | 123 - .../v1/gonum/internal/asm/c128/doc.go | 6 - .../gonum/internal/asm/c128/dotcinc_amd64.s | 153 - .../internal/asm/c128/dotcunitary_amd64.s | 143 - .../gonum/internal/asm/c128/dotuinc_amd64.s | 141 - .../internal/asm/c128/dotuunitary_amd64.s | 130 - .../gonum/internal/asm/c128/dscalinc_amd64.s | 69 - .../internal/asm/c128/dscalunitary_amd64.s | 66 - .../v1/gonum/internal/asm/c128/scal.go | 31 - .../internal/asm/c128/scalUnitary_amd64.s | 116 - .../gonum/internal/asm/c128/scalinc_amd64.s | 121 - .../v1/gonum/internal/asm/c128/stubs_amd64.go | 96 - .../v1/gonum/internal/asm/c128/stubs_noasm.go | 163 - .../v1/gonum/internal/asm/c64/axpyinc_amd64.s | 151 - .../gonum/internal/asm/c64/axpyincto_amd64.s | 156 - .../internal/asm/c64/axpyunitary_amd64.s | 160 - .../internal/asm/c64/axpyunitaryto_amd64.s | 157 - .../v1/gonum/internal/asm/c64/conj.go | 7 - .../v1/gonum/internal/asm/c64/doc.go | 6 - .../v1/gonum/internal/asm/c64/dotcinc_amd64.s | 160 - .../internal/asm/c64/dotcunitary_amd64.s | 208 -- .../v1/gonum/internal/asm/c64/dotuinc_amd64.s | 148 - .../internal/asm/c64/dotuunitary_amd64.s | 197 -- .../v1/gonum/internal/asm/c64/scal.go | 79 - .../v1/gonum/internal/asm/c64/stubs_amd64.go | 68 - .../v1/gonum/internal/asm/c64/stubs_noasm.go | 113 - .../v1/gonum/internal/asm/f32/axpyinc_amd64.s | 73 - .../gonum/internal/asm/f32/axpyincto_amd64.s | 78 - .../internal/asm/f32/axpyunitary_amd64.s | 97 - .../internal/asm/f32/axpyunitaryto_amd64.s | 98 - .../v1/gonum/internal/asm/f32/ddotinc_amd64.s | 91 - .../internal/asm/f32/ddotunitary_amd64.s | 110 - .../v1/gonum/internal/asm/f32/doc.go | 6 - .../v1/gonum/internal/asm/f32/dotinc_amd64.s | 85 - .../gonum/internal/asm/f32/dotunitary_amd64.s | 106 - .../v1/gonum/internal/asm/f32/ge_amd64.go | 15 - .../v1/gonum/internal/asm/f32/ge_amd64.s | 757 ----- .../v1/gonum/internal/asm/f32/ge_noasm.go | 36 - .../v1/gonum/internal/asm/f32/scal.go | 55 - .../v1/gonum/internal/asm/f32/stubs_amd64.go | 68 - .../v1/gonum/internal/asm/f32/stubs_noasm.go | 113 - .../v1/gonum/internal/asm/f64/abssum_amd64.s | 82 - .../gonum/internal/asm/f64/abssuminc_amd64.s | 90 - .../v1/gonum/internal/asm/f64/add_amd64.s | 66 - .../gonum/internal/asm/f64/addconst_amd64.s | 53 - .../v1/gonum/internal/asm/f64/axpy.go | 57 - .../v1/gonum/internal/asm/f64/axpyinc_amd64.s | 142 - .../gonum/internal/asm/f64/axpyincto_amd64.s | 148 - .../internal/asm/f64/axpyunitary_amd64.s | 134 - .../internal/asm/f64/axpyunitaryto_amd64.s | 140 - .../v1/gonum/internal/asm/f64/cumprod_amd64.s | 71 - .../v1/gonum/internal/asm/f64/cumsum_amd64.s | 64 - .../v1/gonum/internal/asm/f64/div_amd64.s | 67 - .../v1/gonum/internal/asm/f64/divto_amd64.s | 73 - .../v1/gonum/internal/asm/f64/doc.go | 6 - .../v1/gonum/internal/asm/f64/dot.go | 35 - .../v1/gonum/internal/asm/f64/dot_amd64.s | 145 - .../v1/gonum/internal/asm/f64/ge_amd64.go | 22 - .../v1/gonum/internal/asm/f64/ge_noasm.go | 118 - .../v1/gonum/internal/asm/f64/gemvN_amd64.s | 685 ---- .../v1/gonum/internal/asm/f64/gemvT_amd64.s | 745 ----- .../v1/gonum/internal/asm/f64/ger_amd64.s | 591 ---- .../v1/gonum/internal/asm/f64/l1norm_amd64.s | 58 - .../gonum/internal/asm/f64/linfnorm_amd64.s | 57 - .../v1/gonum/internal/asm/f64/scal.go | 57 - .../v1/gonum/internal/asm/f64/scalinc_amd64.s | 113 - .../gonum/internal/asm/f64/scalincto_amd64.s | 122 - .../internal/asm/f64/scalunitary_amd64.s | 112 - .../internal/asm/f64/scalunitaryto_amd64.s | 113 - .../v1/gonum/internal/asm/f64/stubs_amd64.go | 172 - .../v1/gonum/internal/asm/f64/stubs_noasm.go | 170 - .../v1/gonum/internal/asm/f64/sum_amd64.s | 100 - .../v1/gonum/internal/cmplx64/abs.go | 14 - .../v1/gonum/internal/cmplx64/conj.go | 12 - .../v1/gonum/internal/cmplx64/doc.go | 7 - .../v1/gonum/internal/cmplx64/isinf.go | 25 - .../v1/gonum/internal/cmplx64/isnan.go | 29 - .../v1/gonum/internal/cmplx64/sqrt.go | 108 - .../gonum.org/v1/gonum/internal/math32/doc.go | 7 - .../v1/gonum/internal/math32/math.go | 111 - .../v1/gonum/internal/math32/signbit.go | 16 - .../v1/gonum/internal/math32/sqrt.go | 25 - .../v1/gonum/internal/math32/sqrt_amd64.go | 20 - .../v1/gonum/internal/math32/sqrt_amd64.s | 20 - vendor/gonum.org/v1/gonum/lapack/.gitignore | 0 vendor/gonum.org/v1/gonum/lapack/README.md | 28 - vendor/gonum.org/v1/gonum/lapack/doc.go | 6 - .../gonum.org/v1/gonum/lapack/gonum/dbdsqr.go | 505 --- .../gonum.org/v1/gonum/lapack/gonum/dgebak.go | 89 - .../gonum.org/v1/gonum/lapack/gonum/dgebal.go | 239 -- .../gonum.org/v1/gonum/lapack/gonum/dgebd2.go | 86 - .../gonum.org/v1/gonum/lapack/gonum/dgebrd.go | 161 - .../gonum.org/v1/gonum/lapack/gonum/dgecon.go | 92 - .../gonum.org/v1/gonum/lapack/gonum/dgeev.go | 279 -- .../gonum.org/v1/gonum/lapack/gonum/dgehd2.go | 97 - .../gonum.org/v1/gonum/lapack/gonum/dgehrd.go | 194 -- .../gonum.org/v1/gonum/lapack/gonum/dgelq2.go | 65 - .../gonum.org/v1/gonum/lapack/gonum/dgelqf.go | 97 - .../gonum.org/v1/gonum/lapack/gonum/dgels.go | 219 -- .../gonum.org/v1/gonum/lapack/gonum/dgeql2.go | 61 - .../gonum.org/v1/gonum/lapack/gonum/dgeqp3.go | 186 -- .../gonum.org/v1/gonum/lapack/gonum/dgeqr2.go | 76 - .../gonum.org/v1/gonum/lapack/gonum/dgeqrf.go | 108 - .../gonum.org/v1/gonum/lapack/gonum/dgerq2.go | 68 - .../gonum.org/v1/gonum/lapack/gonum/dgerqf.go | 129 - .../gonum.org/v1/gonum/lapack/gonum/dgesvd.go | 1374 -------- .../gonum.org/v1/gonum/lapack/gonum/dgetf2.go | 84 - .../gonum.org/v1/gonum/lapack/gonum/dgetrf.go | 85 - .../gonum.org/v1/gonum/lapack/gonum/dgetri.go | 116 - .../gonum.org/v1/gonum/lapack/gonum/dgetrs.go | 72 - .../v1/gonum/lapack/gonum/dggsvd3.go | 242 -- .../v1/gonum/lapack/gonum/dggsvp3.go | 281 -- .../gonum.org/v1/gonum/lapack/gonum/dhseqr.go | 252 -- .../gonum.org/v1/gonum/lapack/gonum/dlabrd.go | 173 - .../gonum.org/v1/gonum/lapack/gonum/dlacn2.go | 134 - .../gonum.org/v1/gonum/lapack/gonum/dlacpy.go | 59 - .../gonum.org/v1/gonum/lapack/gonum/dlae2.go | 49 - .../gonum.org/v1/gonum/lapack/gonum/dlaev2.go | 82 - .../gonum.org/v1/gonum/lapack/gonum/dlaexc.go | 269 -- .../gonum.org/v1/gonum/lapack/gonum/dlags2.go | 182 - .../gonum.org/v1/gonum/lapack/gonum/dlahqr.go | 431 --- .../gonum.org/v1/gonum/lapack/gonum/dlahr2.go | 195 -- .../gonum.org/v1/gonum/lapack/gonum/dlaln2.go | 405 --- .../gonum.org/v1/gonum/lapack/gonum/dlange.go | 89 - .../gonum.org/v1/gonum/lapack/gonum/dlanst.go | 75 - .../gonum.org/v1/gonum/lapack/gonum/dlansy.go | 132 - .../gonum.org/v1/gonum/lapack/gonum/dlantr.go | 260 -- .../gonum.org/v1/gonum/lapack/gonum/dlanv2.go | 132 - .../gonum.org/v1/gonum/lapack/gonum/dlapll.go | 55 - .../gonum.org/v1/gonum/lapack/gonum/dlapmt.go | 89 - .../gonum.org/v1/gonum/lapack/gonum/dlapy2.go | 14 - .../gonum.org/v1/gonum/lapack/gonum/dlaqp2.go | 127 - .../gonum.org/v1/gonum/lapack/gonum/dlaqps.go | 244 -- .../v1/gonum/lapack/gonum/dlaqr04.go | 478 --- .../gonum.org/v1/gonum/lapack/gonum/dlaqr1.go | 59 - .../v1/gonum/lapack/gonum/dlaqr23.go | 415 --- .../gonum.org/v1/gonum/lapack/gonum/dlaqr5.go | 644 ---- .../gonum.org/v1/gonum/lapack/gonum/dlarf.go | 101 - .../gonum.org/v1/gonum/lapack/gonum/dlarfb.go | 449 --- .../gonum.org/v1/gonum/lapack/gonum/dlarfg.go | 71 - .../gonum.org/v1/gonum/lapack/gonum/dlarft.go | 166 - .../gonum.org/v1/gonum/lapack/gonum/dlarfx.go | 550 --- .../gonum.org/v1/gonum/lapack/gonum/dlartg.go | 80 - .../gonum.org/v1/gonum/lapack/gonum/dlas2.go | 43 - .../gonum.org/v1/gonum/lapack/gonum/dlascl.go | 111 - .../gonum.org/v1/gonum/lapack/gonum/dlaset.go | 57 - .../gonum.org/v1/gonum/lapack/gonum/dlasq1.go | 100 - .../gonum.org/v1/gonum/lapack/gonum/dlasq2.go | 369 --- .../gonum.org/v1/gonum/lapack/gonum/dlasq3.go | 172 - .../gonum.org/v1/gonum/lapack/gonum/dlasq4.go | 249 -- .../gonum.org/v1/gonum/lapack/gonum/dlasq5.go | 140 - .../gonum.org/v1/gonum/lapack/gonum/dlasq6.go | 118 - .../gonum.org/v1/gonum/lapack/gonum/dlasr.go | 279 -- .../gonum.org/v1/gonum/lapack/gonum/dlasrt.go | 36 - .../gonum.org/v1/gonum/lapack/gonum/dlassq.go | 41 - .../gonum.org/v1/gonum/lapack/gonum/dlasv2.go | 115 - .../gonum.org/v1/gonum/lapack/gonum/dlaswp.go | 52 - .../gonum.org/v1/gonum/lapack/gonum/dlasy2.go | 290 -- .../gonum.org/v1/gonum/lapack/gonum/dlatrd.go | 165 - .../gonum.org/v1/gonum/lapack/gonum/dlatrs.go | 359 -- .../gonum.org/v1/gonum/lapack/gonum/dlauu2.go | 64 - .../gonum.org/v1/gonum/lapack/gonum/dlauum.go | 81 - vendor/gonum.org/v1/gonum/lapack/gonum/doc.go | 28 - .../gonum.org/v1/gonum/lapack/gonum/dorg2l.go | 76 - .../gonum.org/v1/gonum/lapack/gonum/dorg2r.go | 75 - .../gonum.org/v1/gonum/lapack/gonum/dorgbr.go | 138 - .../gonum.org/v1/gonum/lapack/gonum/dorghr.go | 101 - .../gonum.org/v1/gonum/lapack/gonum/dorgl2.go | 71 - .../gonum.org/v1/gonum/lapack/gonum/dorglq.go | 123 - .../gonum.org/v1/gonum/lapack/gonum/dorgql.go | 136 - .../gonum.org/v1/gonum/lapack/gonum/dorgqr.go | 134 - .../gonum.org/v1/gonum/lapack/gonum/dorgtr.go | 104 - .../gonum.org/v1/gonum/lapack/gonum/dorm2r.go | 101 - .../gonum.org/v1/gonum/lapack/gonum/dormbr.go | 178 - .../gonum.org/v1/gonum/lapack/gonum/dormhr.go | 129 - .../gonum.org/v1/gonum/lapack/gonum/dorml2.go | 102 - .../gonum.org/v1/gonum/lapack/gonum/dormlq.go | 174 - .../gonum.org/v1/gonum/lapack/gonum/dormqr.go | 177 - .../gonum.org/v1/gonum/lapack/gonum/dormr2.go | 103 - .../gonum.org/v1/gonum/lapack/gonum/dpbtf2.go | 110 - .../gonum.org/v1/gonum/lapack/gonum/dpocon.go | 90 - .../gonum.org/v1/gonum/lapack/gonum/dpotf2.go | 82 - .../gonum.org/v1/gonum/lapack/gonum/dpotrf.go | 81 - .../gonum.org/v1/gonum/lapack/gonum/dpotri.go | 44 - .../gonum.org/v1/gonum/lapack/gonum/dpotrs.go | 62 - .../gonum.org/v1/gonum/lapack/gonum/drscl.go | 63 - .../gonum.org/v1/gonum/lapack/gonum/dsteqr.go | 376 --- .../gonum.org/v1/gonum/lapack/gonum/dsterf.go | 285 -- .../gonum.org/v1/gonum/lapack/gonum/dsyev.go | 130 - .../gonum.org/v1/gonum/lapack/gonum/dsytd2.go | 136 - .../gonum.org/v1/gonum/lapack/gonum/dsytrd.go | 172 - .../gonum.org/v1/gonum/lapack/gonum/dtgsja.go | 373 --- .../gonum.org/v1/gonum/lapack/gonum/dtrcon.go | 90 - .../v1/gonum/lapack/gonum/dtrevc3.go | 885 ----- .../gonum.org/v1/gonum/lapack/gonum/dtrexc.go | 230 -- .../gonum.org/v1/gonum/lapack/gonum/dtrti2.go | 69 - .../gonum.org/v1/gonum/lapack/gonum/dtrtri.go | 72 - .../gonum.org/v1/gonum/lapack/gonum/dtrtrs.go | 55 - .../gonum.org/v1/gonum/lapack/gonum/errors.go | 174 - .../gonum.org/v1/gonum/lapack/gonum/iladlc.go | 45 - .../gonum.org/v1/gonum/lapack/gonum/iladlr.go | 41 - .../gonum.org/v1/gonum/lapack/gonum/ilaenv.go | 387 --- .../gonum.org/v1/gonum/lapack/gonum/iparmq.go | 115 - .../gonum.org/v1/gonum/lapack/gonum/lapack.go | 51 - vendor/gonum.org/v1/gonum/lapack/lapack.go | 213 -- .../gonum.org/v1/gonum/lapack/lapack64/doc.go | 20 - .../v1/gonum/lapack/lapack64/lapack64.go | 581 ---- vendor/gonum.org/v1/gonum/mat/README.md | 3 - vendor/gonum.org/v1/gonum/mat/band.go | 263 -- vendor/gonum.org/v1/gonum/mat/cdense.go | 168 - vendor/gonum.org/v1/gonum/mat/cholesky.go | 673 ---- vendor/gonum.org/v1/gonum/mat/cmatrix.go | 210 -- vendor/gonum.org/v1/gonum/mat/consts.go | 15 - vendor/gonum.org/v1/gonum/mat/dense.go | 558 ---- .../v1/gonum/mat/dense_arithmetic.go | 886 ----- vendor/gonum.org/v1/gonum/mat/diagonal.go | 311 -- vendor/gonum.org/v1/gonum/mat/doc.go | 169 - vendor/gonum.org/v1/gonum/mat/eigen.go | 350 -- vendor/gonum.org/v1/gonum/mat/errors.go | 149 - vendor/gonum.org/v1/gonum/mat/format.go | 238 -- vendor/gonum.org/v1/gonum/mat/gsvd.go | 415 --- vendor/gonum.org/v1/gonum/mat/hogsvd.go | 233 -- .../v1/gonum/mat/index_bound_checks.go | 348 -- .../v1/gonum/mat/index_no_bound_checks.go | 359 -- vendor/gonum.org/v1/gonum/mat/inner.go | 121 - vendor/gonum.org/v1/gonum/mat/io.go | 492 --- vendor/gonum.org/v1/gonum/mat/lq.go | 262 -- vendor/gonum.org/v1/gonum/mat/lu.go | 422 --- vendor/gonum.org/v1/gonum/mat/matrix.go | 946 ------ vendor/gonum.org/v1/gonum/mat/offset.go | 20 - .../v1/gonum/mat/offset_appengine.go | 24 - vendor/gonum.org/v1/gonum/mat/pool.go | 236 -- vendor/gonum.org/v1/gonum/mat/product.go | 193 -- vendor/gonum.org/v1/gonum/mat/qr.go | 260 -- vendor/gonum.org/v1/gonum/mat/shadow.go | 226 -- vendor/gonum.org/v1/gonum/mat/solve.go | 140 - vendor/gonum.org/v1/gonum/mat/svd.go | 247 -- vendor/gonum.org/v1/gonum/mat/symband.go | 221 -- vendor/gonum.org/v1/gonum/mat/symmetric.go | 602 ---- vendor/gonum.org/v1/gonum/mat/triangular.go | 659 ---- vendor/gonum.org/v1/gonum/mat/triband.go | 353 -- vendor/gonum.org/v1/gonum/mat/vector.go | 741 ----- vendor/google.golang.org/genproto/LICENSE | 202 ++ .../googleapis/rpc/status/status.pb.go | 206 ++ vendor/google.golang.org/grpc/.travis.yml | 42 + vendor/google.golang.org/grpc/AUTHORS | 1 + .../google.golang.org/grpc/CODE-OF-CONDUCT.md | 3 + vendor/google.golang.org/grpc/CONTRIBUTING.md | 62 + vendor/google.golang.org/grpc/GOVERNANCE.md | 1 + vendor/google.golang.org/grpc/LICENSE | 202 ++ vendor/google.golang.org/grpc/MAINTAINERS.md | 27 + vendor/google.golang.org/grpc/Makefile | 63 + vendor/google.golang.org/grpc/README.md | 141 + .../grpc/attributes/attributes.go | 76 + vendor/google.golang.org/grpc/backoff.go | 58 + .../google.golang.org/grpc/backoff/backoff.go | 52 + .../grpc/balancer/balancer.go | 374 +++ .../grpc/balancer/base/balancer.go | 237 ++ .../grpc/balancer/base/base.go | 71 + .../grpc/balancer/grpclb/state/state.go | 51 + .../grpc/balancer/roundrobin/roundrobin.go | 83 + .../grpc/balancer_conn_wrappers.go | 246 ++ .../grpc_binarylog_v1/binarylog.pb.go | 812 +++++ vendor/google.golang.org/grpc/call.go | 74 + vendor/google.golang.org/grpc/clientconn.go | 1556 +++++++++ vendor/google.golang.org/grpc/codec.go | 50 + vendor/google.golang.org/grpc/codegen.sh | 17 + .../grpc/codes/code_string.go | 62 + vendor/google.golang.org/grpc/codes/codes.go | 244 ++ .../grpc/connectivity/connectivity.go | 73 + .../grpc/credentials/credentials.go | 289 ++ .../grpc/credentials/go12.go | 30 + .../grpc/credentials/internal/syscallconn.go | 61 + .../internal/syscallconn_appengine.go | 30 + .../google.golang.org/grpc/credentials/tls.go | 259 ++ vendor/google.golang.org/grpc/dialoptions.go | 605 ++++ vendor/google.golang.org/grpc/doc.go | 26 + .../grpc/encoding/encoding.go | 122 + .../grpc/encoding/proto/proto.go | 110 + vendor/google.golang.org/grpc/go.mod | 15 + vendor/google.golang.org/grpc/go.sum | 68 + .../grpc/grpclog/component.go | 117 + .../google.golang.org/grpc/grpclog/grpclog.go | 132 + .../google.golang.org/grpc/grpclog/logger.go | 87 + .../grpc/grpclog/loggerv2.go | 218 ++ vendor/google.golang.org/grpc/install_gae.sh | 6 + vendor/google.golang.org/grpc/interceptor.go | 77 + .../grpc/internal/backoff/backoff.go | 73 + .../grpc/internal/balancerload/load.go | 46 + .../grpc/internal/binarylog/binarylog.go | 170 + .../internal/binarylog/binarylog_testutil.go | 42 + .../grpc/internal/binarylog/env_config.go | 208 ++ .../grpc/internal/binarylog/method_logger.go | 422 +++ .../grpc/internal/binarylog/sink.go | 161 + .../grpc/internal/buffer/unbounded.go | 85 + .../grpc/internal/channelz/funcs.go | 739 +++++ .../grpc/internal/channelz/logging.go | 102 + .../grpc/internal/channelz/types.go | 701 ++++ .../grpc/internal/channelz/types_linux.go | 53 + .../grpc/internal/channelz/types_nonlinux.go | 42 + .../grpc/internal/channelz/util_linux.go | 39 + .../grpc/internal/channelz/util_nonlinux.go | 26 + .../grpc/internal/credentials/go110.go | 65 + .../grpc/internal/credentials/gobefore110.go | 31 + .../grpc/internal/envconfig/envconfig.go | 38 + .../grpc/internal/grpclog/grpclog.go | 123 + .../grpc/internal/grpclog/prefixLogger.go | 81 + .../grpc/internal/grpcrand/grpcrand.go | 56 + .../grpc/internal/grpcsync/event.go | 61 + .../grpc/internal/grpcutil/encode_duration.go | 63 + .../grpc/internal/grpcutil/metadata.go | 40 + .../grpc/internal/grpcutil/method.go | 84 + .../grpc/internal/grpcutil/target.go | 55 + .../grpc/internal/internal.go | 76 + .../internal/resolver/dns/dns_resolver.go | 446 +++ .../grpc/internal/resolver/dns/go113.go | 33 + .../resolver/passthrough/passthrough.go | 57 + .../internal/serviceconfig/serviceconfig.go | 90 + .../grpc/internal/status/status.go | 162 + .../grpc/internal/syscall/syscall_linux.go | 116 + .../grpc/internal/syscall/syscall_nonlinux.go | 76 + .../grpc/internal/transport/bdp_estimator.go | 141 + .../grpc/internal/transport/controlbuf.go | 942 ++++++ .../grpc/internal/transport/defaults.go | 49 + .../grpc/internal/transport/flowcontrol.go | 217 ++ .../grpc/internal/transport/handler_server.go | 463 +++ .../grpc/internal/transport/http2_client.go | 1485 +++++++++ .../grpc/internal/transport/http2_server.go | 1264 +++++++ .../grpc/internal/transport/http_util.go | 607 ++++ .../grpc/internal/transport/transport.go | 804 +++++ .../grpc/keepalive/keepalive.go | 85 + .../grpc/metadata/metadata.go | 209 ++ vendor/google.golang.org/grpc/peer/peer.go | 51 + .../google.golang.org/grpc/picker_wrapper.go | 177 + vendor/google.golang.org/grpc/pickfirst.go | 136 + vendor/google.golang.org/grpc/preloader.go | 64 + vendor/google.golang.org/grpc/proxy.go | 152 + vendor/google.golang.org/grpc/regenerate.sh | 79 + .../grpc/resolver/resolver.go | 256 ++ .../grpc/resolver_conn_wrapper.go | 222 ++ vendor/google.golang.org/grpc/rpc_util.go | 882 +++++ vendor/google.golang.org/grpc/server.go | 1741 ++++++++++ .../google.golang.org/grpc/service_config.go | 454 +++ .../grpc/serviceconfig/serviceconfig.go | 41 + .../google.golang.org/grpc/stats/handlers.go | 63 + vendor/google.golang.org/grpc/stats/stats.go | 312 ++ .../google.golang.org/grpc/status/status.go | 127 + vendor/google.golang.org/grpc/stream.go | 1551 +++++++++ vendor/google.golang.org/grpc/tap/tap.go | 51 + vendor/google.golang.org/grpc/trace.go | 123 + vendor/google.golang.org/grpc/version.go | 22 + vendor/google.golang.org/grpc/vet.sh | 190 ++ vendor/gopkg.in/fsnotify.v1/.editorconfig | 5 - vendor/gopkg.in/fsnotify.v1/.gitignore | 6 - vendor/gopkg.in/fsnotify.v1/.travis.yml | 30 - vendor/gopkg.in/fsnotify.v1/AUTHORS | 52 - vendor/gopkg.in/fsnotify.v1/CHANGELOG.md | 317 -- vendor/gopkg.in/fsnotify.v1/CONTRIBUTING.md | 77 - vendor/gopkg.in/fsnotify.v1/LICENSE | 28 - vendor/gopkg.in/fsnotify.v1/README.md | 79 - vendor/gopkg.in/fsnotify.v1/fen.go | 37 - vendor/gopkg.in/fsnotify.v1/fsnotify.go | 66 - vendor/gopkg.in/fsnotify.v1/inotify.go | 337 -- vendor/gopkg.in/fsnotify.v1/inotify_poller.go | 187 -- vendor/gopkg.in/fsnotify.v1/kqueue.go | 521 --- vendor/gopkg.in/fsnotify.v1/open_mode_bsd.go | 11 - .../gopkg.in/fsnotify.v1/open_mode_darwin.go | 12 - vendor/gopkg.in/fsnotify.v1/windows.go | 561 ---- .../pkg/api/resource/generated.pb.go | 2 +- .../apimachinery/pkg/api/resource/math.go | 8 +- .../apimachinery/pkg/api/resource/quantity.go | 5 + .../pkg/apis/meta/internalversion/register.go | 19 +- .../pkg/apis/meta/v1/conversion.go | 59 - .../apimachinery/pkg/apis/meta/v1/duration.go | 5 + .../pkg/apis/meta/v1/generated.pb.go | 60 +- .../apimachinery/pkg/apis/meta/v1/register.go | 17 +- .../apimachinery/pkg/apis/meta/v1/time.go | 10 + .../apimachinery/pkg/apis/meta/v1/types.go | 3 + .../pkg/apis/meta/v1/validation/validation.go | 2 +- .../pkg/apis/meta/v1beta1/generated.pb.go | 101 +- .../pkg/apis/meta/v1beta1/generated.proto | 1 - .../pkg/apis/meta/v1beta1/register.go | 18 +- .../apimachinery/pkg/conversion/converter.go | 155 +- .../apimachinery/pkg/runtime/conversion.go | 32 +- .../apimachinery/pkg/runtime/converter.go | 122 +- .../apimachinery/pkg/runtime/embedded.go | 15 +- .../apimachinery/pkg/runtime/generated.pb.go | 60 +- .../pkg/runtime/schema/generated.pb.go | 2 +- .../k8s.io/apimachinery/pkg/runtime/scheme.go | 45 +- .../apimachinery/pkg/util/clock/clock.go | 29 +- .../apimachinery/pkg/util/errors/errors.go | 32 +- .../pkg/util/intstr/generated.pb.go | 60 +- .../apimachinery/pkg/util/intstr/intstr.go | 3 +- .../k8s.io/apimachinery/pkg/util/net/http.go | 51 +- .../pkg/util/validation/validation.go | 38 + .../k8s.io/apimachinery/pkg/util/wait/wait.go | 150 +- vendor/k8s.io/apimachinery/pkg/watch/watch.go | 10 +- .../discovery/cached/memory/memcache.go | 23 +- .../client-go/discovery/discovery_client.go | 13 +- vendor/k8s.io/client-go/dynamic/interface.go | 20 +- vendor/k8s.io/client-go/dynamic/simple.go | 47 +- .../v1/mutatingwebhookconfiguration.go | 5 +- .../v1/validatingwebhookconfiguration.go | 5 +- .../v1beta1/mutatingwebhookconfiguration.go | 5 +- .../v1beta1/validatingwebhookconfiguration.go | 5 +- .../informers/apps/v1/controllerrevision.go | 5 +- .../client-go/informers/apps/v1/daemonset.go | 5 +- .../client-go/informers/apps/v1/deployment.go | 5 +- .../client-go/informers/apps/v1/replicaset.go | 5 +- .../informers/apps/v1/statefulset.go | 5 +- .../apps/v1beta1/controllerrevision.go | 5 +- .../informers/apps/v1beta1/deployment.go | 5 +- .../informers/apps/v1beta1/statefulset.go | 5 +- .../apps/v1beta2/controllerrevision.go | 5 +- .../informers/apps/v1beta2/daemonset.go | 5 +- .../informers/apps/v1beta2/deployment.go | 5 +- .../informers/apps/v1beta2/replicaset.go | 5 +- .../informers/apps/v1beta2/statefulset.go | 5 +- .../auditregistration/v1alpha1/auditsink.go | 5 +- .../autoscaling/v1/horizontalpodautoscaler.go | 5 +- .../v2beta1/horizontalpodautoscaler.go | 5 +- .../v2beta2/horizontalpodautoscaler.go | 5 +- .../client-go/informers/batch/v1/job.go | 5 +- .../informers/batch/v1beta1/cronjob.go | 5 +- .../informers/batch/v2alpha1/cronjob.go | 5 +- .../v1beta1/certificatesigningrequest.go | 5 +- .../informers/coordination/v1/lease.go | 5 +- .../informers/coordination/v1beta1/lease.go | 5 +- .../informers/core/v1/componentstatus.go | 5 +- .../client-go/informers/core/v1/configmap.go | 5 +- .../client-go/informers/core/v1/endpoints.go | 5 +- .../client-go/informers/core/v1/event.go | 5 +- .../client-go/informers/core/v1/limitrange.go | 5 +- .../client-go/informers/core/v1/namespace.go | 5 +- .../client-go/informers/core/v1/node.go | 5 +- .../informers/core/v1/persistentvolume.go | 5 +- .../core/v1/persistentvolumeclaim.go | 5 +- .../k8s.io/client-go/informers/core/v1/pod.go | 5 +- .../informers/core/v1/podtemplate.go | 5 +- .../core/v1/replicationcontroller.go | 5 +- .../informers/core/v1/resourcequota.go | 5 +- .../client-go/informers/core/v1/secret.go | 5 +- .../client-go/informers/core/v1/service.go | 5 +- .../informers/core/v1/serviceaccount.go | 5 +- .../discovery/v1alpha1/endpointslice.go | 5 +- .../discovery/v1beta1/endpointslice.go | 5 +- .../informers/events/v1beta1/event.go | 5 +- .../informers/extensions/v1beta1/daemonset.go | 5 +- .../extensions/v1beta1/deployment.go | 5 +- .../informers/extensions/v1beta1/ingress.go | 5 +- .../extensions/v1beta1/networkpolicy.go | 5 +- .../extensions/v1beta1/podsecuritypolicy.go | 5 +- .../extensions/v1beta1/replicaset.go | 5 +- .../flowcontrol/v1alpha1/flowschema.go | 5 +- .../v1alpha1/prioritylevelconfiguration.go | 5 +- vendor/k8s.io/client-go/informers/generic.go | 4 + .../informers/networking/v1/networkpolicy.go | 5 +- .../informers/networking/v1beta1/ingress.go | 5 +- .../networking/v1beta1/ingressclass.go | 89 + .../informers/networking/v1beta1/interface.go | 7 + .../informers/node/v1alpha1/runtimeclass.go | 5 +- .../informers/node/v1beta1/runtimeclass.go | 5 +- .../policy/v1beta1/poddisruptionbudget.go | 5 +- .../policy/v1beta1/podsecuritypolicy.go | 5 +- .../informers/rbac/v1/clusterrole.go | 5 +- .../informers/rbac/v1/clusterrolebinding.go | 5 +- .../client-go/informers/rbac/v1/role.go | 5 +- .../informers/rbac/v1/rolebinding.go | 5 +- .../informers/rbac/v1alpha1/clusterrole.go | 5 +- .../rbac/v1alpha1/clusterrolebinding.go | 5 +- .../client-go/informers/rbac/v1alpha1/role.go | 5 +- .../informers/rbac/v1alpha1/rolebinding.go | 5 +- .../informers/rbac/v1beta1/clusterrole.go | 5 +- .../rbac/v1beta1/clusterrolebinding.go | 5 +- .../client-go/informers/rbac/v1beta1/role.go | 5 +- .../informers/rbac/v1beta1/rolebinding.go | 5 +- .../informers/scheduling/v1/priorityclass.go | 5 +- .../scheduling/v1alpha1/priorityclass.go | 5 +- .../scheduling/v1beta1/priorityclass.go | 5 +- .../informers/settings/v1alpha1/podpreset.go | 5 +- .../informers/storage/v1/csidriver.go | 89 + .../client-go/informers/storage/v1/csinode.go | 5 +- .../informers/storage/v1/interface.go | 7 + .../informers/storage/v1/storageclass.go | 5 +- .../informers/storage/v1/volumeattachment.go | 5 +- .../storage/v1alpha1/volumeattachment.go | 5 +- .../informers/storage/v1beta1/csidriver.go | 5 +- .../informers/storage/v1beta1/csinode.go | 5 +- .../informers/storage/v1beta1/storageclass.go | 5 +- .../storage/v1beta1/volumeattachment.go | 5 +- .../k8s.io/client-go/kubernetes/clientset.go | 2 +- .../v1/mutatingwebhookconfiguration.go | 64 +- .../v1/validatingwebhookconfiguration.go | 64 +- .../v1beta1/mutatingwebhookconfiguration.go | 64 +- .../v1beta1/validatingwebhookconfiguration.go | 64 +- .../typed/apps/v1/controllerrevision.go | 64 +- .../kubernetes/typed/apps/v1/daemonset.go | 72 +- .../kubernetes/typed/apps/v1/deployment.go | 85 +- .../kubernetes/typed/apps/v1/replicaset.go | 85 +- .../kubernetes/typed/apps/v1/statefulset.go | 85 +- .../typed/apps/v1beta1/controllerrevision.go | 64 +- .../typed/apps/v1beta1/deployment.go | 72 +- .../typed/apps/v1beta1/statefulset.go | 72 +- .../typed/apps/v1beta2/controllerrevision.go | 64 +- .../typed/apps/v1beta2/daemonset.go | 72 +- .../typed/apps/v1beta2/deployment.go | 72 +- .../typed/apps/v1beta2/replicaset.go | 72 +- .../typed/apps/v1beta2/statefulset.go | 85 +- .../auditregistration/v1alpha1/auditsink.go | 64 +- .../authentication/v1/generated_expansion.go | 2 + .../typed/authentication/v1/tokenreview.go | 18 + .../v1/tokenreview_expansion.go | 43 - .../v1beta1/generated_expansion.go | 2 + .../authentication/v1beta1/tokenreview.go | 18 + .../v1beta1/tokenreview_expansion.go | 43 - .../authorization/v1/generated_expansion.go | 8 + .../v1/localsubjectaccessreview.go | 19 + .../v1/localsubjectaccessreview_expansion.go | 44 - .../v1/selfsubjectaccessreview.go | 18 + .../v1/selfsubjectaccessreview_expansion.go | 43 - .../v1/selfsubjectrulesreview.go | 18 + .../v1/selfsubjectrulesreview_expansion.go | 43 - .../authorization/v1/subjectaccessreview.go | 18 + .../v1/subjectaccessreview_expansion.go | 44 - .../v1beta1/generated_expansion.go | 8 + .../v1beta1/localsubjectaccessreview.go | 19 + .../localsubjectaccessreview_expansion.go | 44 - .../v1beta1/selfsubjectaccessreview.go | 18 + .../selfsubjectaccessreview_expansion.go | 43 - .../v1beta1/selfsubjectrulesreview.go | 18 + .../selfsubjectrulesreview_expansion.go | 43 - .../v1beta1/subjectaccessreview.go | 18 + .../v1beta1/subjectaccessreview_expansion.go | 44 - .../autoscaling/v1/horizontalpodautoscaler.go | 72 +- .../v2beta1/horizontalpodautoscaler.go | 72 +- .../v2beta2/horizontalpodautoscaler.go | 72 +- .../kubernetes/typed/batch/v1/job.go | 72 +- .../kubernetes/typed/batch/v1beta1/cronjob.go | 72 +- .../typed/batch/v2alpha1/cronjob.go | 72 +- .../v1beta1/certificatesigningrequest.go | 72 +- .../certificatesigningrequest_expansion.go | 11 +- .../kubernetes/typed/coordination/v1/lease.go | 64 +- .../typed/coordination/v1beta1/lease.go | 64 +- .../typed/core/v1/componentstatus.go | 64 +- .../kubernetes/typed/core/v1/configmap.go | 64 +- .../kubernetes/typed/core/v1/endpoints.go | 64 +- .../kubernetes/typed/core/v1/event.go | 64 +- .../typed/core/v1/event_expansion.go | 11 +- .../typed/core/v1/generated_expansion.go | 2 + .../kubernetes/typed/core/v1/limitrange.go | 64 +- .../kubernetes/typed/core/v1/namespace.go | 58 +- .../typed/core/v1/namespace_expansion.go | 14 +- .../kubernetes/typed/core/v1/node.go | 72 +- .../typed/core/v1/node_expansion.go | 10 +- .../typed/core/v1/persistentvolume.go | 72 +- .../typed/core/v1/persistentvolumeclaim.go | 72 +- .../client-go/kubernetes/typed/core/v1/pod.go | 85 +- .../kubernetes/typed/core/v1/pod_expansion.go | 17 +- .../kubernetes/typed/core/v1/podtemplate.go | 64 +- .../typed/core/v1/replicationcontroller.go | 85 +- .../kubernetes/typed/core/v1/resourcequota.go | 72 +- .../kubernetes/typed/core/v1/secret.go | 64 +- .../kubernetes/typed/core/v1/service.go | 58 +- .../typed/core/v1/serviceaccount.go | 82 +- .../typed/core/v1/serviceaccount_expansion.go | 41 - .../typed/discovery/v1alpha1/endpointslice.go | 64 +- .../typed/discovery/v1beta1/endpointslice.go | 64 +- .../kubernetes/typed/events/v1beta1/event.go | 64 +- .../typed/events/v1beta1/event_expansion.go | 7 +- .../typed/extensions/v1beta1/daemonset.go | 72 +- .../typed/extensions/v1beta1/deployment.go | 85 +- .../v1beta1/deployment_expansion.go | 14 +- .../typed/extensions/v1beta1/ingress.go | 72 +- .../typed/extensions/v1beta1/networkpolicy.go | 64 +- .../extensions/v1beta1/podsecuritypolicy.go | 64 +- .../typed/extensions/v1beta1/replicaset.go | 85 +- .../typed/flowcontrol/v1alpha1/flowschema.go | 72 +- .../v1alpha1/prioritylevelconfiguration.go | 72 +- .../typed/networking/v1/networkpolicy.go | 64 +- .../networking/v1beta1/generated_expansion.go | 2 + .../typed/networking/v1beta1/ingress.go | 72 +- .../typed/networking/v1beta1/ingressclass.go | 168 + .../networking/v1beta1/networking_client.go | 5 + .../typed/node/v1alpha1/runtimeclass.go | 64 +- .../typed/node/v1beta1/runtimeclass.go | 64 +- .../policy/v1beta1/eviction_expansion.go | 8 +- .../policy/v1beta1/poddisruptionbudget.go | 72 +- .../typed/policy/v1beta1/podsecuritypolicy.go | 64 +- .../kubernetes/typed/rbac/v1/clusterrole.go | 64 +- .../typed/rbac/v1/clusterrolebinding.go | 64 +- .../kubernetes/typed/rbac/v1/role.go | 64 +- .../kubernetes/typed/rbac/v1/rolebinding.go | 64 +- .../typed/rbac/v1alpha1/clusterrole.go | 64 +- .../typed/rbac/v1alpha1/clusterrolebinding.go | 64 +- .../kubernetes/typed/rbac/v1alpha1/role.go | 64 +- .../typed/rbac/v1alpha1/rolebinding.go | 64 +- .../typed/rbac/v1beta1/clusterrole.go | 64 +- .../typed/rbac/v1beta1/clusterrolebinding.go | 64 +- .../kubernetes/typed/rbac/v1beta1/role.go | 64 +- .../typed/rbac/v1beta1/rolebinding.go | 64 +- .../typed/scheduling/v1/priorityclass.go | 64 +- .../scheduling/v1alpha1/priorityclass.go | 64 +- .../typed/scheduling/v1beta1/priorityclass.go | 64 +- .../typed/settings/v1alpha1/podpreset.go | 64 +- .../kubernetes/typed/storage/v1/csidriver.go | 168 + .../kubernetes/typed/storage/v1/csinode.go | 64 +- .../typed/storage/v1/generated_expansion.go | 2 + .../typed/storage/v1/storage_client.go | 5 + .../typed/storage/v1/storageclass.go | 64 +- .../typed/storage/v1/volumeattachment.go | 72 +- .../storage/v1alpha1/volumeattachment.go | 72 +- .../typed/storage/v1beta1/csidriver.go | 64 +- .../typed/storage/v1beta1/csinode.go | 64 +- .../typed/storage/v1beta1/storageclass.go | 64 +- .../typed/storage/v1beta1/volumeattachment.go | 72 +- .../listers/apps/v1/deployment_expansion.go | 70 - .../listers/apps/v1/expansion_generated.go | 8 + .../apps/v1beta2/deployment_expansion.go | 70 - .../apps/v1beta2/expansion_generated.go | 8 + .../listers/core/v1/expansion_generated.go | 12 + .../listers/core/v1/node_expansion.go | 48 - .../listers/core/v1/service_expansion.go | 56 - .../v1beta1/deployment_expansion.go | 70 - .../extensions/v1beta1/expansion_generated.go | 8 + .../networking/v1beta1/expansion_generated.go | 4 + .../networking/v1beta1/ingressclass.go | 65 + .../client-go/listers/storage/v1/csidriver.go | 65 + .../listers/storage/v1/expansion_generated.go | 4 + .../plugin/pkg/client/auth/azure/README.md | 8 +- .../plugin/pkg/client/auth/azure/azure.go | 109 +- .../plugin/pkg/client/auth/exec/exec.go | 27 +- .../plugin/pkg/client/auth/exec/metrics.go | 60 + .../plugin/pkg/client/auth/oidc/oidc.go | 15 +- vendor/k8s.io/client-go/rest/request.go | 179 +- vendor/k8s.io/client-go/testing/actions.go | 12 +- .../client-go/tools/cache/controller.go | 63 +- .../client-go/tools/cache/delta_fifo.go | 156 +- .../client-go/tools/cache/expiration_cache.go | 4 +- vendor/k8s.io/client-go/tools/cache/fifo.go | 56 +- vendor/k8s.io/client-go/tools/cache/index.go | 15 +- .../k8s.io/client-go/tools/cache/listwatch.go | 10 +- .../tools/cache/mutation_detector.go | 30 +- .../k8s.io/client-go/tools/cache/reflector.go | 212 +- .../client-go/tools/cache/shared_informer.go | 196 +- vendor/k8s.io/client-go/tools/cache/store.go | 46 +- .../tools/cache/thread_safe_store.go | 45 +- .../client-go/tools/clientcmd/api/types.go | 3 + .../client-go/tools/clientcmd/api/v1/types.go | 3 + .../api/v1/zz_generated.conversion.go | 2 + .../tools/clientcmd/client_config.go | 9 + .../client-go/tools/clientcmd/overrides.go | 4 + .../client-go/tools/clientcmd/validation.go | 34 +- .../tools/leaderelection/leaderelection.go | 25 +- .../resourcelock/configmaplock.go | 18 +- .../resourcelock/endpointslock.go | 15 +- .../leaderelection/resourcelock/interface.go | 7 +- .../leaderelection/resourcelock/leaselock.go | 15 +- .../leaderelection/resourcelock/multilock.go | 23 +- .../k8s.io/client-go/tools/metrics/metrics.go | 52 +- vendor/k8s.io/client-go/tools/pager/pager.go | 21 +- vendor/k8s.io/client-go/tools/record/event.go | 7 - vendor/k8s.io/client-go/tools/record/fake.go | 6 +- vendor/k8s.io/client-go/transport/cache.go | 29 +- .../client-go/transport/cert_rotation.go | 176 + vendor/k8s.io/client-go/transport/config.go | 7 +- .../k8s.io/client-go/transport/transport.go | 60 +- .../util/workqueue/default_rate_limiters.go | 48 + .../client-go/util/workqueue/metrics.go | 11 +- .../cmd/client-gen/args/args.go | 6 + .../client-gen/generators/client_generator.go | 5 +- .../fake/generator_fake_for_type.go | 35 +- .../generators/generator_for_clientset.go | 2 +- .../generators/generator_for_type.go | 111 +- .../code-generator/cmd/client-gen/main.go | 2 +- .../cmd/go-to-protobuf/protobuf/cmd.go | 88 +- .../cmd/go-to-protobuf/protobuf/parser.go | 26 +- .../code-generator/cmd/import-boss/main.go | 5 - .../cmd/informer-gen/args/args.go | 8 +- .../cmd/informer-gen/generators/generic.go | 10 +- .../cmd/informer-gen/generators/informer.go | 4 +- .../cmd/informer-gen/generators/packages.go | 16 +- .../code-generator/cmd/informer-gen/main.go | 2 +- .../cmd/lister-gen/args/args.go | 14 +- .../cmd/lister-gen/generators/lister.go | 5 +- .../code-generator/cmd/lister-gen/main.go | 2 +- .../k8s.io/code-generator/generate-groups.sh | 11 +- vendor/k8s.io/code-generator/go.mod | 14 +- vendor/k8s.io/code-generator/go.sum | 49 +- .../pkg/util/plural_exceptions.go | 37 + vendor/knative.dev/pkg/apis/duck/README.md | 5 +- vendor/knative.dev/pkg/apis/duck/cached.go | 5 +- vendor/knative.dev/pkg/apis/duck/enqueue.go | 6 +- vendor/knative.dev/pkg/apis/duck/interface.go | 4 +- vendor/knative.dev/pkg/apis/duck/typed.go | 21 +- .../pkg/apis/duck/v1beta1/destination.go | 3 +- vendor/knative.dev/pkg/apis/field_error.go | 2 +- vendor/knative.dev/pkg/configmap/parse.go | 4 +- vendor/knative.dev/pkg/kmeta/names.go | 4 +- vendor/knative.dev/pkg/kmp/diff.go | 4 +- vendor/knative.dev/pkg/kmp/reporters.go | 69 +- vendor/modules.txt | 149 +- .../controller-runtime/pkg/cache/cache.go | 5 +- .../pkg/cache/informer_cache.go | 16 +- .../pkg/cache/internal/informers_map.go | 18 +- .../pkg/cache/multi_namespace_cache.go | 12 +- .../pkg/client/apiutil/apimachinery.go | 2 +- .../pkg/client/config/config.go | 5 +- .../controller-runtime/pkg/client/dryrun.go | 95 + .../pkg/client/interfaces.go | 2 +- .../controller-runtime/pkg/client/options.go | 47 +- .../controller-runtime/pkg/client/patch.go | 74 +- .../pkg/client/typed_client.go | 27 +- .../pkg/client/unstructured_client.go | 27 +- .../pkg/controller/controller.go | 25 +- .../controllerutil/controllerutil.go | 41 +- .../pkg/internal/controller/controller.go | 79 +- .../controller-runtime/pkg/log/zap/flags.go | 4 +- .../pkg/log/zap/kube_helpers.go | 4 +- .../controller-runtime/pkg/log/zap/zap.go | 18 +- .../pkg/manager/internal.go | 54 +- .../controller-runtime/pkg/manager/manager.go | 35 +- .../pkg/metrics/client_go_adapter.go | 5 +- .../pkg/reconcile/reconcile.go | 2 +- .../pkg/runtime/inject/inject.go | 4 +- .../controller-runtime/pkg/scheme/scheme.go | 10 +- .../pkg/source/internal/eventsource.go | 2 +- .../controller-runtime/pkg/source/source.go | 31 +- .../internal/certwatcher/certwatcher.go | 2 +- .../pkg/webhook/internal/metrics/metrics.go | 25 +- .../controller-runtime/pkg/webhook/server.go | 27 +- vendor/sigs.k8s.io/kubebuilder/LICENSE | 201 ++ .../kubebuilder/pkg/model/config/config.go | 218 ++ .../structured-merge-diff/v3/LICENSE | 201 ++ .../v3/value/allocator.go | 203 ++ .../structured-merge-diff/v3/value/doc.go | 21 + .../structured-merge-diff/v3/value/fields.go | 97 + .../v3/value/jsontagutil.go | 91 + .../structured-merge-diff/v3/value/list.go | 139 + .../v3/value/listreflect.go | 98 + .../v3/value/listunstructured.go | 74 + .../structured-merge-diff/v3/value/map.go | 270 ++ .../v3/value/mapreflect.go | 209 ++ .../v3/value/mapunstructured.go | 190 ++ .../v3/value/reflectcache.go | 463 +++ .../structured-merge-diff/v3/value/scalar.go | 50 + .../v3/value/structreflect.go | 208 ++ .../structured-merge-diff/v3/value/value.go | 347 ++ .../v3/value/valuereflect.go | 294 ++ .../v3/value/valueunstructured.go | 178 + 946 files changed, 48351 insertions(+), 79924 deletions(-) create mode 100644 vendor/github.com/blang/semver/.travis.yml create mode 100644 vendor/github.com/blang/semver/LICENSE create mode 100644 vendor/github.com/blang/semver/README.md create mode 100644 vendor/github.com/blang/semver/json.go create mode 100644 vendor/github.com/blang/semver/package.json create mode 100644 vendor/github.com/blang/semver/range.go create mode 100644 vendor/github.com/blang/semver/semver.go create mode 100644 vendor/github.com/blang/semver/sort.go create mode 100644 vendor/github.com/blang/semver/sql.go delete mode 100644 vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/bindata.go delete mode 100644 vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/crd_kinds.go create mode 100644 vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go create mode 100644 vendor/github.com/operator-framework/api/pkg/lib/version/version.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/catalogsource_types.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/clusterserviceversion_types.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/doc.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/installplan_types.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/operatorgroup_types.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/register.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/subscription_types.go create mode 100644 vendor/github.com/operator-framework/api/pkg/operators/zz_generated.deepcopy.go create mode 100644 vendor/github.com/operator-framework/operator-registry/LICENSE create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/image/reference.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/image/registry.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/bundle.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/bundlegraphloader.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/channelupdateoptions.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/conversion.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/csv.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/decode.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/directoryGraphLoader.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/graph.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/imageinput.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/populator.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/replacesgraphloader.go create mode 100644 vendor/github.com/operator-framework/operator-registry/pkg/registry/types.go delete mode 100644 vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/options.go create mode 100644 vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/constants.go create mode 100644 vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/project.go create mode 100644 vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/interactive_promt_util.go create mode 100644 vendor/golang.org/x/net/internal/timeseries/timeseries.go create mode 100644 vendor/golang.org/x/net/trace/events.go create mode 100644 vendor/golang.org/x/net/trace/histogram.go create mode 100644 vendor/golang.org/x/net/trace/trace.go delete mode 100644 vendor/gonum.org/v1/gonum/AUTHORS delete mode 100644 vendor/gonum.org/v1/gonum/CONTRIBUTORS delete mode 100644 vendor/gonum.org/v1/gonum/LICENSE delete mode 100644 vendor/gonum.org/v1/gonum/blas/README.md delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/blas64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/conv.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/blas64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/conv.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/cblas128/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/conversions.bash delete mode 100644 vendor/gonum.org/v1/gonum/blas/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/errors.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/gemv.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/gonum.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go delete mode 100644 vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash delete mode 100644 vendor/gonum.org/v1/gonum/floats/README.md delete mode 100644 vendor/gonum.org/v1/gonum/floats/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/floats/floats.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/.gitignore delete mode 100644 vendor/gonum.org/v1/gonum/graph/README.md delete mode 100644 vendor/gonum.org/v1/gonum/graph/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/graph.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/same.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/set/set.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/edges.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/lines.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/iterator/nodes.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/multigraph.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/nodes_edges.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/directed.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/simple.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/undirected.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/tarjan.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/topo/topo.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/traverse/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/traverse/traverse.go delete mode 100644 vendor/gonum.org/v1/gonum/graph/undirect.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/math.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/signbit.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go delete mode 100644 vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s delete mode 100644 vendor/gonum.org/v1/gonum/lapack/.gitignore delete mode 100644 vendor/gonum.org/v1/gonum/lapack/README.md delete mode 100644 vendor/gonum.org/v1/gonum/lapack/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/errors.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/lapack.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/README.md delete mode 100644 vendor/gonum.org/v1/gonum/mat/band.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/cdense.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/cholesky.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/cmatrix.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/consts.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/dense.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/diagonal.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/doc.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/eigen.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/errors.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/format.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/gsvd.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/hogsvd.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/index_bound_checks.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/inner.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/io.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/lq.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/lu.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/matrix.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/offset.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/offset_appengine.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/pool.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/product.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/qr.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/shadow.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/solve.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/svd.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/symband.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/symmetric.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/triangular.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/triband.go delete mode 100644 vendor/gonum.org/v1/gonum/mat/vector.go create mode 100644 vendor/google.golang.org/genproto/LICENSE create mode 100644 vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go create mode 100644 vendor/google.golang.org/grpc/.travis.yml create mode 100644 vendor/google.golang.org/grpc/AUTHORS create mode 100644 vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md create mode 100644 vendor/google.golang.org/grpc/CONTRIBUTING.md create mode 100644 vendor/google.golang.org/grpc/GOVERNANCE.md create mode 100644 vendor/google.golang.org/grpc/LICENSE create mode 100644 vendor/google.golang.org/grpc/MAINTAINERS.md create mode 100644 vendor/google.golang.org/grpc/Makefile create mode 100644 vendor/google.golang.org/grpc/README.md create mode 100644 vendor/google.golang.org/grpc/attributes/attributes.go create mode 100644 vendor/google.golang.org/grpc/backoff.go create mode 100644 vendor/google.golang.org/grpc/backoff/backoff.go create mode 100644 vendor/google.golang.org/grpc/balancer/balancer.go create mode 100644 vendor/google.golang.org/grpc/balancer/base/balancer.go create mode 100644 vendor/google.golang.org/grpc/balancer/base/base.go create mode 100644 vendor/google.golang.org/grpc/balancer/grpclb/state/state.go create mode 100644 vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go create mode 100644 vendor/google.golang.org/grpc/balancer_conn_wrappers.go create mode 100644 vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go create mode 100644 vendor/google.golang.org/grpc/call.go create mode 100644 vendor/google.golang.org/grpc/clientconn.go create mode 100644 vendor/google.golang.org/grpc/codec.go create mode 100644 vendor/google.golang.org/grpc/codegen.sh create mode 100644 vendor/google.golang.org/grpc/codes/code_string.go create mode 100644 vendor/google.golang.org/grpc/codes/codes.go create mode 100644 vendor/google.golang.org/grpc/connectivity/connectivity.go create mode 100644 vendor/google.golang.org/grpc/credentials/credentials.go create mode 100644 vendor/google.golang.org/grpc/credentials/go12.go create mode 100644 vendor/google.golang.org/grpc/credentials/internal/syscallconn.go create mode 100644 vendor/google.golang.org/grpc/credentials/internal/syscallconn_appengine.go create mode 100644 vendor/google.golang.org/grpc/credentials/tls.go create mode 100644 vendor/google.golang.org/grpc/dialoptions.go create mode 100644 vendor/google.golang.org/grpc/doc.go create mode 100644 vendor/google.golang.org/grpc/encoding/encoding.go create mode 100644 vendor/google.golang.org/grpc/encoding/proto/proto.go create mode 100644 vendor/google.golang.org/grpc/go.mod create mode 100644 vendor/google.golang.org/grpc/go.sum create mode 100644 vendor/google.golang.org/grpc/grpclog/component.go create mode 100644 vendor/google.golang.org/grpc/grpclog/grpclog.go create mode 100644 vendor/google.golang.org/grpc/grpclog/logger.go create mode 100644 vendor/google.golang.org/grpc/grpclog/loggerv2.go create mode 100644 vendor/google.golang.org/grpc/install_gae.sh create mode 100644 vendor/google.golang.org/grpc/interceptor.go create mode 100644 vendor/google.golang.org/grpc/internal/backoff/backoff.go create mode 100644 vendor/google.golang.org/grpc/internal/balancerload/load.go create mode 100644 vendor/google.golang.org/grpc/internal/binarylog/binarylog.go create mode 100644 vendor/google.golang.org/grpc/internal/binarylog/binarylog_testutil.go create mode 100644 vendor/google.golang.org/grpc/internal/binarylog/env_config.go create mode 100644 vendor/google.golang.org/grpc/internal/binarylog/method_logger.go create mode 100644 vendor/google.golang.org/grpc/internal/binarylog/sink.go create mode 100644 vendor/google.golang.org/grpc/internal/buffer/unbounded.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/funcs.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/logging.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/types.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/types_linux.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/types_nonlinux.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/util_linux.go create mode 100644 vendor/google.golang.org/grpc/internal/channelz/util_nonlinux.go create mode 100644 vendor/google.golang.org/grpc/internal/credentials/go110.go create mode 100644 vendor/google.golang.org/grpc/internal/credentials/gobefore110.go create mode 100644 vendor/google.golang.org/grpc/internal/envconfig/envconfig.go create mode 100644 vendor/google.golang.org/grpc/internal/grpclog/grpclog.go create mode 100644 vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcsync/event.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/metadata.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/method.go create mode 100644 vendor/google.golang.org/grpc/internal/grpcutil/target.go create mode 100644 vendor/google.golang.org/grpc/internal/internal.go create mode 100644 vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go create mode 100644 vendor/google.golang.org/grpc/internal/resolver/dns/go113.go create mode 100644 vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go create mode 100644 vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go create mode 100644 vendor/google.golang.org/grpc/internal/status/status.go create mode 100644 vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go create mode 100644 vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/controlbuf.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/defaults.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/flowcontrol.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/handler_server.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/http2_client.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/http2_server.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/http_util.go create mode 100644 vendor/google.golang.org/grpc/internal/transport/transport.go create mode 100644 vendor/google.golang.org/grpc/keepalive/keepalive.go create mode 100644 vendor/google.golang.org/grpc/metadata/metadata.go create mode 100644 vendor/google.golang.org/grpc/peer/peer.go create mode 100644 vendor/google.golang.org/grpc/picker_wrapper.go create mode 100644 vendor/google.golang.org/grpc/pickfirst.go create mode 100644 vendor/google.golang.org/grpc/preloader.go create mode 100644 vendor/google.golang.org/grpc/proxy.go create mode 100644 vendor/google.golang.org/grpc/regenerate.sh create mode 100644 vendor/google.golang.org/grpc/resolver/resolver.go create mode 100644 vendor/google.golang.org/grpc/resolver_conn_wrapper.go create mode 100644 vendor/google.golang.org/grpc/rpc_util.go create mode 100644 vendor/google.golang.org/grpc/server.go create mode 100644 vendor/google.golang.org/grpc/service_config.go create mode 100644 vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go create mode 100644 vendor/google.golang.org/grpc/stats/handlers.go create mode 100644 vendor/google.golang.org/grpc/stats/stats.go create mode 100644 vendor/google.golang.org/grpc/status/status.go create mode 100644 vendor/google.golang.org/grpc/stream.go create mode 100644 vendor/google.golang.org/grpc/tap/tap.go create mode 100644 vendor/google.golang.org/grpc/trace.go create mode 100644 vendor/google.golang.org/grpc/version.go create mode 100644 vendor/google.golang.org/grpc/vet.sh delete mode 100644 vendor/gopkg.in/fsnotify.v1/.editorconfig delete mode 100644 vendor/gopkg.in/fsnotify.v1/.gitignore delete mode 100644 vendor/gopkg.in/fsnotify.v1/.travis.yml delete mode 100644 vendor/gopkg.in/fsnotify.v1/AUTHORS delete mode 100644 vendor/gopkg.in/fsnotify.v1/CHANGELOG.md delete mode 100644 vendor/gopkg.in/fsnotify.v1/CONTRIBUTING.md delete mode 100644 vendor/gopkg.in/fsnotify.v1/LICENSE delete mode 100644 vendor/gopkg.in/fsnotify.v1/README.md delete mode 100644 vendor/gopkg.in/fsnotify.v1/fen.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/fsnotify.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/inotify.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/inotify_poller.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/kqueue.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/open_mode_bsd.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/open_mode_darwin.go delete mode 100644 vendor/gopkg.in/fsnotify.v1/windows.go create mode 100644 vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go create mode 100644 vendor/k8s.io/client-go/informers/storage/v1/csidriver.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go delete mode 100644 vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go create mode 100644 vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csidriver.go delete mode 100644 vendor/k8s.io/client-go/listers/apps/v1/deployment_expansion.go delete mode 100644 vendor/k8s.io/client-go/listers/apps/v1beta2/deployment_expansion.go delete mode 100644 vendor/k8s.io/client-go/listers/core/v1/node_expansion.go delete mode 100644 vendor/k8s.io/client-go/listers/core/v1/service_expansion.go delete mode 100644 vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment_expansion.go create mode 100644 vendor/k8s.io/client-go/listers/networking/v1beta1/ingressclass.go create mode 100644 vendor/k8s.io/client-go/listers/storage/v1/csidriver.go create mode 100644 vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/metrics.go create mode 100644 vendor/k8s.io/client-go/transport/cert_rotation.go create mode 100644 vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go create mode 100644 vendor/sigs.k8s.io/controller-runtime/pkg/client/dryrun.go create mode 100644 vendor/sigs.k8s.io/kubebuilder/LICENSE create mode 100644 vendor/sigs.k8s.io/kubebuilder/pkg/model/config/config.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/LICENSE create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/allocator.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/doc.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/fields.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/jsontagutil.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/list.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/listreflect.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/listunstructured.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/map.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapreflect.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapunstructured.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/reflectcache.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/scalar.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/structreflect.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/value.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/valuereflect.go create mode 100644 vendor/sigs.k8s.io/structured-merge-diff/v3/value/valueunstructured.go diff --git a/go.mod b/go.mod index 43219951f..8f254cecf 100644 --- a/go.mod +++ b/go.mod @@ -1,36 +1,43 @@ module github.com/shipwright-io/build -go 1.13 +go 1.14 require ( + github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 // indirect github.com/go-logr/logr v0.2.0 github.com/go-openapi/spec v0.19.6 github.com/onsi/ginkgo v1.12.1 github.com/onsi/gomega v1.10.1 - github.com/operator-framework/operator-sdk v0.17.0 + github.com/operator-framework/operator-sdk v0.18.2 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.6.0 github.com/prometheus/client_model v0.2.0 github.com/spf13/pflag v1.0.5 - github.com/tektoncd/pipeline v0.17.1 - k8s.io/api v0.18.7-rc.0 + github.com/tektoncd/pipeline v0.17.1-0.20201006183654-d5df1c164a48 + k8s.io/api v0.18.10 k8s.io/apimachinery v0.19.0 k8s.io/client-go v12.0.0+incompatible - k8s.io/code-generator v0.18.6 + k8s.io/code-generator v0.18.10 k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 - k8s.io/kubectl v0.17.4 + k8s.io/kubectl v0.18.10 k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 - knative.dev/pkg v0.0.0-20200831162708-14fb2347fb77 + knative.dev/pkg v0.0.0-20201026165741-2f75016c1368 sigs.k8s.io/controller-runtime v0.6.1 sigs.k8s.io/yaml v1.2.0 ) replace ( github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible // Required by OLM + // github.com/operator-framework/operator-registry requires Sirupsen/logrus@v1.7.0 + github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.7.0 + // Pin docker/* to versions used to spinning up local test registries by operator-sdk + github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d + github.com/docker/docker => github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce github.com/go-logr/logr => github.com/go-logr/logr v0.1.0 // v0.2.0 release doesn't have logr.InfoLogger - k8s.io/apimachinery => k8s.io/apimachinery v0.17.6 - k8s.io/client-go => k8s.io/client-go v0.17.4 // Required by prometheus-operator - k8s.io/code-generator => k8s.io/code-generator v0.17.4 + k8s.io/apimachinery => k8s.io/apimachinery v0.18.10 + k8s.io/client-go => k8s.io/client-go v0.18.10 // Required by prometheus-operator + k8s.io/code-generator => k8s.io/code-generator v0.18.10 k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 // resolve `case-insensitive import collision` for gnostic/openapiv2 package - sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.5.2 + sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.1 + ) diff --git a/go.sum b/go.sum index e0010c8d8..7f80bf733 100644 --- a/go.sum +++ b/go.sum @@ -1,6 +1,5 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= bazil.org/fuse v0.0.0-20180421153158-65cc252bf669/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= -bou.ke/monkey v1.0.1/go.mod h1:FgHuK96Rv2Nlf+0u1OOVDpCMdsWyOFmeeketDHE7LIg= cloud.google.com/go v0.25.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.30.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -22,7 +21,6 @@ cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6T cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= -cloud.google.com/go v0.55.0 h1:eoz/lYxKSL4CNAiaUJ0ZfD1J3bfMYbU5B3rwM1C1EIU= cloud.google.com/go v0.55.0/go.mod h1:ZHmoY+/lIMNkN2+fBmuTiqZ4inFhvQad8ft7MT8IV5Y= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= @@ -62,8 +60,8 @@ contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRq contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= contrib.go.opencensus.io/exporter/ocagent v0.6.0 h1:Z1n6UAyr0QwM284yUuh5Zd8JlvxUGAhFZcgMJkMPrGM= contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200615190824-f8c219d2d895 h1:bXMXgHq+WAIkI2dQivk1yMyKVVqMj8emLmhEqQghPWw= -contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200615190824-f8c219d2d895/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= +contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d h1:LblfooH1lKOpp1hIhukktmSAxFkqMPFk9KR6iZ0MJNI= +contrib.go.opencensus.io/exporter/ocagent v0.7.1-0.20200907061046-05415f1de66d/go.mod h1:IshRmMJBhDfFj5Y67nVhMYTTIze91RUeT73ipWKs/GY= contrib.go.opencensus.io/exporter/prometheus v0.1.0 h1:SByaIoWwNgMdPSgl5sMqM2KDE5H/ukPWBRo314xiDvg= contrib.go.opencensus.io/exporter/prometheus v0.1.0/go.mod h1:cGFniUXGZlKRjzOyuZJ6mgB+PgBcCIa79kEKR8YCW+A= contrib.go.opencensus.io/exporter/prometheus v0.2.1-0.20200609204449-6bcf6f8577f0 h1:2O3c1g5CzMc1+Uah4Waot9Obm0yw70VXJzWaP6Fz3nw= @@ -72,7 +70,6 @@ contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e contrib.go.opencensus.io/exporter/stackdriver v0.12.8 h1:iXI5hr7pUwMx0IwMphpKz5Q3If/G5JiWFVZ5MPPxP9E= contrib.go.opencensus.io/exporter/stackdriver v0.12.8/go.mod h1:XyyafDnFOsqoxHJgTFycKZMrRUrPThLh2iYTJF6uoO0= contrib.go.opencensus.io/exporter/stackdriver v0.12.9-0.20191108183826-59d068f8d8ff/go.mod h1:XyyafDnFOsqoxHJgTFycKZMrRUrPThLh2iYTJF6uoO0= -contrib.go.opencensus.io/exporter/stackdriver v0.13.1 h1:RX9W6FelAqTVnBi/bRXJLXr9n18v4QkQwZYIdnNS51I= contrib.go.opencensus.io/exporter/stackdriver v0.13.1/go.mod h1:z2tyTZtPmQ2HvWH4cOmVDgtY+1lomfKdbLnkJvZdc8c= contrib.go.opencensus.io/exporter/stackdriver v0.13.2 h1:5lKLBwUuq4S6pTbYaBtWmnay3eJfKNS3qL8M8HM5fM4= contrib.go.opencensus.io/exporter/stackdriver v0.13.2/go.mod h1:aXENhDJ1Y4lIg4EUaVTwzvYETVNZk10Pu26tevFKLUc= @@ -101,6 +98,7 @@ github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= github.com/Azure/azure-storage-blob-go v0.0.0-20190123011202-457680cc0804/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= github.com/Azure/azure-storage-blob-go v0.8.0/go.mod h1:lPI3aLPpuLTeUwh1sViKXFxwl2B6teiRqI0deQUvsw0= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v13.3.2+incompatible h1:VxzPyuhtnlBOzc4IWCZHqpyH2d+QMLQEuy3wREyY4oc= github.com/Azure/go-autorest v13.3.2+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= @@ -110,7 +108,6 @@ github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+B github.com/Azure/go-autorest/autorest v0.9.3-0.20191028180845-3492b2aff503/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= github.com/Azure/go-autorest/autorest v0.9.3 h1:OZEIaBbMdUE/Js+BQKlpO81XlISgipr6yDJ+PSwsgi4= github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0= -github.com/Azure/go-autorest/autorest v0.9.6 h1:5YWtOnckcudzIw8lPPBcWOnmIFWMtHci1ZWAZulMSx0= github.com/Azure/go-autorest/autorest v0.9.6/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= github.com/Azure/go-autorest/autorest v0.10.2 h1:NuSF3gXetiHyUbVdneJMEVyPUYAe5wh+aN08JYAf1tI= github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630= @@ -167,11 +164,16 @@ github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF0 github.com/Masterminds/semver/v3 v3.0.3/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.1.0/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/sprig/v3 v3.0.2/go.mod h1:oesJ8kPONMONaZgtiHNzUShJbksypC5kWczhZAf6+aU= +github.com/Masterminds/sprig/v3 v3.1.0/go.mod h1:ONGMf7UfYGAbMXCZmQLy8x3lCDIPrEZE/rU8pmrbihA= +github.com/Masterminds/squirrel v1.2.0/go.mod h1:yaPeOnPG5ZRwL9oKdTsO/prlkPbXWZlRVMQ/gGlzIuA= github.com/Masterminds/vcs v1.13.1/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= +github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5 h1:ygIc8M6trr62pF5DucadTWGdEB4mEyvzi0e2nbcmcyA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/hcsshim v0.8.7/go.mod h1:OHd7sQqRFrYd3RmSgbgji+ctCwkbq2wbEYNSzOYtcBQ= +github.com/Microsoft/hcsshim v0.8.9 h1:VrfodqvztU8YSOvygU+DN1BGaSGxmrNfqOv5oOuX2Bk= +github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg38RRsjT5y8= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= @@ -185,6 +187,7 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d h1:UrqY+r/OJnIp5u0s1SbQ8dVfLCZJsnvazdBP5hS4iRs= github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:HI8ITrYtUY+O+ZhtlqUnD8+KwNPOyugEhfP9fdUIaEQ= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.23.1/go.mod h1:XLH1GYJnLVE0XCr6KdJGVJRTwY30moWNJ4sERjXX6fs= @@ -245,7 +248,6 @@ github.com/aws/aws-sdk-go v1.29.32/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTg github.com/aws/aws-sdk-go v1.29.34/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg= github.com/aws/aws-sdk-go v1.30.4/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.30.5/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.30.16 h1:1eabOZiVGl+XB02/VG9NpR+3fngaNc74pgb5RmyzgLY= github.com/aws/aws-sdk-go v1.30.16/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.31.12 h1:SxRRGyhlCagI0DYkhOg+FgdXGXzRTE3vEX/gsgFaiKQ= @@ -260,12 +262,15 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-hostpool v0.0.0-20171023180738-a3a6125de932/go.mod h1:NOuUCSz6Q9T7+igc/hlvDOUdtWKryOrtFyIVABv/p7k= +github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blakesmith/ar v0.0.0-20190502131153-809d4375e1fb/go.mod h1:PkYb9DJNAwrSvRx5DYA+gUcOIgTGVMNkfSCbZM8cWpI= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b/go.mod h1:ac9efd0D1fsDb3EJvhqgXRbFx7bs2wqZ10HQPeU8U/Q= github.com/bombsimon/wsl/v2 v2.0.0/go.mod h1:mf25kr/SqFEPhhcxW1+7pxzGlW+hIl/hYTKY95VwV8U= @@ -273,10 +278,15 @@ github.com/bombsimon/wsl/v2 v2.2.0/go.mod h1:Azh8c3XGEJl9LyX0/sFC+CKMc7Ssgua0g+6 github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/bombsimon/wsl/v3 v3.1.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= -github.com/brancz/gojsontoyaml v0.0.0-20190425155809-e8bd32d46b3d/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0= +github.com/brancz/gojsontoyaml v0.0.0-20191212081931-bf2969bbd742/go.mod h1:IyUJYN1gvWjtLF5ZuygmxbnsAyP3aJS6cHzIuZY50B0= +github.com/brancz/kube-rbac-proxy v0.5.0/go.mod h1:cL2VjiIFGS90Cjh5ZZ8+It6tMcBt8rwvuw2J6Mamnl0= +github.com/bshuster-repo/logrus-logstash-hook v0.4.1 h1:pgAtgj+A31JBVtEHu2uHuEx0n+2ukqUJnS2vVe5pQNA= github.com/bshuster-repo/logrus-logstash-hook v0.4.1/go.mod h1:zsTqEiSzDgAa/8GZR7E1qaXrhYNDKBYy5/dWPTIflbk= +github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd h1:rFt+Y/IK1aEZkEHchZRSq9OQbsSzIT/OrI8YFFmRIng= github.com/bugsnag/bugsnag-go v0.0.0-20141110184014-b1d153021fcd/go.mod h1:2oa8nejYd4cQ/b0hMIopN0lCRxU0bueqREvZLWFrtK8= +github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b h1:otBG+dV+YK+Soembjv71DPz3uX/V/6MMlSyD9JBQ6kQ= github.com/bugsnag/osext v0.0.0-20130617224835-0dd3f918b21b/go.mod h1:obH5gd0BsqsP2LwDJ9aOkm/6J86V6lyAXCoQWGw3K50= +github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0 h1:nvj0OLI3YqYXer/kZD8Ri1aaunCxIEsOst1BVJswV0o= github.com/bugsnag/panicwrap v0.0.0-20151223152923-e2c28503fcd0/go.mod h1:D/8v3kj0zr8ZAKg1AQ6crr+5VwKN5eIywRkfhyM/+dE= github.com/bwmarrin/snowflake v0.0.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE= github.com/caarlos0/ctrlc v1.0.0/go.mod h1:CdXpj4rmq0q/1Eb44M9zi2nKB0QraNKuRGYGrrHhcQw= @@ -287,6 +297,8 @@ github.com/cenkalti/backoff v0.0.0-20181003080854-62661b46c409/go.mod h1:90ReRw6 github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0 h1:t/LhUZLVitR1Ow2YOnduCsavhwFUklBMoGVYUCqmCqk= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v0.0.0-20181017004759-096ff4a8a059/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= @@ -302,7 +314,6 @@ github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6D github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/clarketm/json v1.13.4/go.mod h1:ynr2LRfb0fQU34l07csRNBTcivjySLLiY1YzQqKVfdo= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudevents/sdk-go v0.0.0-20190509003705-56931988abe3 h1:DNM19kh6j6qGBx/FI7OmHKBL2vCW1eN28ESYK1+O5DY= github.com/cloudevents/sdk-go v0.0.0-20190509003705-56931988abe3/go.mod h1:j1nZWMLGg3om8SswStBoY6/SHvcLM19MuZqwDtMtmzs= github.com/cloudevents/sdk-go v1.0.0 h1:gS5I0s2qPmdc4GBPlUmzZU7RH30BaiOdcRJ1RkXnPrc= github.com/cloudevents/sdk-go v1.0.0/go.mod h1:3TkmM0cFqkhCHOq5JzzRU/RxRkwzoS8TZ+G448qVTog= @@ -314,18 +325,25 @@ github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMe github.com/cockroachdb/cockroach-go v0.0.0-20181001143604-e0a95dfd547c/go.mod h1:XGLbWH/ujMcbPbhZq52Nv6UrCghb1yGn//133kEsvDk= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f h1:tSNMc+rJDfmYntojat8lljbt1mgKNpTxUZJsSzJ9Y1s= github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/containerd v1.2.7/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= +github.com/containerd/containerd v1.3.3 h1:LoIzb5y9x5l8VKAlyrbusNPXqBY0+kviRloxFUMFwKc= github.com/containerd/containerd v1.3.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY= +github.com/containerd/continuity v0.0.0-20200413184840-d3ef23f19fbb h1:nXPkFq8X1a9ycY3GYQpFNxHh3j2JgY7zDZfq2EXMIzk= +github.com/containerd/continuity v0.0.0-20200413184840-d3ef23f19fbb/go.mod h1:Dq467ZllaHgAtVp4p1xUQWBrFXR9s/wyoTpG8zOJGkY= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= +github.com/containerd/ttrpc v1.0.1 h1:IfVOxKbjyBn9maoye2JN95pgGYOmPkQVqxtOu7rtNIc= +github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= +github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd h1:JNn81o/xG+8NEo3bC/vx9pbi/g2WI8mtP2/nXzu297Y= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coreos/bbolt v1.3.1-coreos.6/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= @@ -341,13 +359,12 @@ github.com/coreos/go-semver v0.0.0-20180108230905-e214231b295a/go.mod h1:nnelYz7 github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/prometheus-operator v0.38.0 h1:gF2xYIfO09XLFdyEecND46uihQ2KTaDwTozRZpXLtN4= -github.com/coreos/prometheus-operator v0.38.0/go.mod h1:xZC7/TgeC0/mBaJk+1H9dbHaiEvLYHgX6Mi1h40UPh8= +github.com/coreos/prometheus-operator v0.38.1-0.20200424145508-7e176fda06cc h1:nMbUjGuF7UzVluucix/vsy4973BNdEiT/aX6kFtskKM= +github.com/coreos/prometheus-operator v0.38.1-0.20200424145508-7e176fda06cc/go.mod h1:erio69w1R/aC14D5nfvAXSlE8FT8jt2Hnavc50Dp33A= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -370,6 +387,7 @@ github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1 github.com/deislabs/oras v0.8.1/go.mod h1:Mx0rMSbBNaNfY9hjpccEnxkOqJL6KGjtxNHPLC4G4As= github.com/denisenkom/go-mssqldb v0.0.0-20190111225525-2fea367d496d/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM= +github.com/denisenkom/go-mssqldb v0.0.0-20191001013358-cfbb681360f0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU= github.com/denverdino/aliyungo v0.0.0-20190125010748-a747050bb1ba/go.mod h1:dV8lFg6daOBZbT6/BDGIz6Y3WFGn8juu6G+CQ6LHtl0= github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= @@ -386,23 +404,24 @@ github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyG github.com/docker/cli v0.0.0-20190925022749-754388324470/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v0.0.0-20200130152716-5d0cf8839492/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v0.0.0-20200210162036-a4bedce16568 h1:AbI1uj9w4yt6TvfKHfRu7G55KuQe7NCvWPQRKDoXggE= github.com/docker/cli v0.0.0-20200210162036-a4bedce16568/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v0.0.0-20191216044856-a8371794149d h1:jC8tT/S0OGx2cswpeUTn4gOIea8P08lD3VFQT0cOZ50= github.com/docker/distribution v0.0.0-20191216044856-a8371794149d/go.mod h1:0+TTO4EOBfRPhZXAeF1Vu+W3hHZ8eLp8PgKVZlcvtFY= -github.com/docker/distribution v2.6.0-rc.1.0.20180327202408-83389a148052+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.0+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v0.7.3-0.20190103212154-2b7e084dc98b/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v0.7.3-0.20190817195342-4760db040282/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20180531152204-71cd53e4a197/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.4.2-0.20190924003213-a8608b5b67c7/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce h1:KXS1Jg+ddGcWA8e1N7cupxaHHZhit5rB9tfDU+mfjyY= github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v1.13.1/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= +github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c h1:+pKlWGMw7gf6bQ+oDZB4KHQFypsfjYlq/C4rfL7D3g8= +github.com/docker/go-events v0.0.0-20190806004212-e31b211e4f1c/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= +github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916 h1:yWHOI+vFjEsAakUTSrtqc/SAHrhSkmn48pqjidZX3QA= github.com/docker/go-metrics v0.0.0-20180209012529-399ea8c73916/go.mod h1:/u0gXw0Gay3ceNrsHubL3BtdOL2fHf93USgMTe0W5dI= github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/go-units v0.4.0 h1:3uh0PgVws3nIA0Q+MwDC8yjEPf9zjRfZZWXZYDct3Tw= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1 h1:ZClxb8laGDf5arXfYcAtECDFgAgHklGI8CxgjHnXKJ4= github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= @@ -420,7 +439,7 @@ github.com/elastic/go-sysinfo v1.0.1/go.mod h1:O/D5m1VpYLwGjCYzEt63g3Z1uO3jXfwyz github.com/elastic/go-sysinfo v1.1.1/go.mod h1:i1ZYdU10oLNfRzq4vq62BEwD2fH8KaWh6eh0ikPT9F0= github.com/elastic/go-windows v1.0.0/go.mod h1:TsU0Nrp7/y3+VwE82FoZF8gC/XFg/Elz6CcloAxnPgU= github.com/elastic/go-windows v1.0.1/go.mod h1:FoVvqWSun28vaDQPbj2Elfc0JahhPB7WQEGa3c814Ss= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -436,6 +455,8 @@ github.com/evanphx/json-patch v4.1.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible h1:ouOWdg56aJriqS0huScTkVXPC5IcNrDCXZ6OoTAWu7M= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= +github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/facette/natsort v0.0.0-20181210072756-2cd4dd1e2dcb/go.mod h1:bH6Xx7IW64qjjJq8M2u4dxNaBiDfKK+z/3eGDpXEQhc= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= @@ -453,6 +474,7 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsouza/fake-gcs-server v0.0.0-20180612165233-e85be23bdaa8/go.mod h1:1/HufuJ+eaDf4KTnYdS6HJMGvMRU8d4cYTuu/1QaBbI= github.com/fsouza/fake-gcs-server v1.7.0/go.mod h1:5XIRs4YvwNbNoz+1JF8j6KLAyDh7RHGAyAK3EP2EsNk= github.com/fsouza/fake-gcs-server v1.19.4/go.mod h1:I0/88nHCASqJJ5M7zVF0zKODkYTcuXFW5J5yajsNJnE= +github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7 h1:LofdAjjjqCSXMwLGgOgnE+rdPuvX9DxCqaHwKy7i/ko= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v0.0.0-20180820084758-c7ce16629ff4/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -462,7 +484,6 @@ github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32/go.mod h1:GIjDIg/heH github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= -github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I= github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= github.com/go-critic/go-critic v0.4.3/go.mod h1:j4O3D4RoIwRqlZw5jJpx0BNfXWWbpcJoKu5cYSe4YmQ= @@ -578,10 +599,10 @@ github.com/gobuffalo/envy v1.7.1 h1:OQl5ys5MBea7OGCdvPbBJWRgnhC/fGona6QKfvFeau8= github.com/gobuffalo/envy v1.7.1/go.mod h1:FurDp9+EDPE4aIUS3ZLyD+7/9fpx7YRt/ukY6jIHf0w= github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= -github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= +github.com/gobuffalo/flect v0.2.1/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= +github.com/gobuffalo/logger v1.0.1/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packr v1.30.1/go.mod h1:ljMyFO2EcrnzsHsN99cvbq055Y9OhRrIaviy289eRuk= -github.com/gobuffalo/packr/v2 v2.5.1/go.mod h1:8f9c96ITobJlPzI44jj+4tHnEKNt0xXWSVlXRN9X1Iw= +github.com/gobuffalo/packr/v2 v2.7.1/go.mod h1:qYEvAazPaVxy7Y7KR0W8qYEE+RymX74kETFqjFoFlOc= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gocql/gocql v0.0.0-20190301043612-f6df8288f9b4/go.mod h1:4Fw1eo5iaEhDUs8XyuhSVCVy52Jq3L+/3GJgYkwc+/0= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -597,6 +618,7 @@ github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5 github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-migrate/migrate/v4 v4.6.2 h1:LDDOHo/q1W5UDj6PbkxdCv7lv9yunyZHXvxuwDkGo3k= github.com/golang-migrate/migrate/v4 v4.6.2/go.mod h1:JYi6reN3+Z734VZ0akNuyOJNcrg45ZL7LDBMW3WGJL0= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/gddo v0.0.0-20190419222130-af0f2af80721/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= @@ -727,7 +749,6 @@ github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+ github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= @@ -747,11 +768,13 @@ github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoT github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/csrf v1.6.2/go.mod h1:7tSf8kmjNYr7IWDCYhd3U8Ck34iQ/Yw5CJu7bAkHEGI= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.1/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.1.3/go.mod h1:8KCfur6+4Mqcc6S0FEfKuN15Vl5MgXW92AE8ovaJD0w= @@ -780,10 +803,11 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.12.1 h1:zCy2xE9ablevUOrUZc3Dl72Dt+ya2FNAvC2yLYMHzi4= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/grpc-ecosystem/grpc-gateway v1.12.2 h1:D0EVSTwQoQOyfY35QNSuPJA4jpZRtkoGYWQMB7XNg5o= github.com/grpc-ecosystem/grpc-gateway v1.12.2/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= github.com/grpc-ecosystem/grpc-gateway v1.14.6 h1:8ERzHx8aj1Sc47mu9n/AksaKCSWrMchFtkdrS4BIj5o= github.com/grpc-ecosystem/grpc-gateway v1.14.6/go.mod h1:zdiPV4Yse/1gnckTHtghG4GkDEdKCRJduHpTxT3/jcw= +github.com/grpc-ecosystem/grpc-gateway v1.14.8 h1:hXClj+iFpmLM8i3lkO6i4Psli4P2qObQuQReiII26U8= +github.com/grpc-ecosystem/grpc-gateway v1.14.8/go.mod h1:NZE8t6vs6TnwLL/ITkaK8W3ecMLGAbh2jXTclvpiwYo= github.com/grpc-ecosystem/grpc-health-probe v0.2.1-0.20181220223928-2bf0a5b182db/go.mod h1:uBKkC2RbarFsvS5jMJHpVhTLvGlGQj9JJwkaePE3FWI= github.com/h2non/gock v1.0.9/go.mod h1:CZMcB0Lg5IWnr9bF79pPMg9WeV6WumxQiUJ1UvdO1iE= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= @@ -833,14 +857,13 @@ github.com/hashicorp/memberlist v0.1.4/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hashicorp/serf v0.8.5/go.mod h1:UpNcs7fFbpKIyZaUuSW6EPiH+eZC7OuyFD+wc1oal+k= -github.com/helm/helm-2to3 v0.5.1/go.mod h1:AXFpQX2cSQpss+47ROPEeu7Sm4+CRJ1jKWCEQdHP3/c= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/iancoleman/strcase v0.0.0-20190422225806-e506e3ef7365/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= @@ -894,14 +917,15 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jsonnet-bundler/jsonnet-bundler v0.2.0/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU= +github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/jsonnet-bundler/jsonnet-bundler v0.3.1/go.mod h1:/by7P/OoohkI3q4CgSFqcoFsVY+IaNbzOVDknEsKDeU= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kelseyhightower/envconfig v1.3.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg= github.com/kelseyhightower/envconfig v1.4.0 h1:Im6hONhd3pLkfDFsbRgu68RDNkGF1r3dvMUtDTo2cv8= @@ -928,6 +952,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.0.0/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -940,10 +965,13 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kshvakov/clickhouse v1.3.5/go.mod h1:DMzX7FxRymoNkVgizH0DWAL8Cur7wHLgx3MUnGwJqpE= github.com/kylelemons/godebug v0.0.0-20160406211939-eadb3ce320cb/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= +github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= github.com/leanovate/gopter v0.2.4/go.mod h1:gNcbPWNEWRe4lm+bycKqxUYoH5uoVje5SkOJ3uoLer8= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= +github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.0/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= @@ -964,12 +992,10 @@ github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/mailru/easyjson v0.7.1-0.20191009090205-6c0755d89d1e h1:jcoUdG1TzY/M/eM5BLFLP8DJeMximx5NQYSlLL9YeWc= github.com/mailru/easyjson v0.7.1-0.20191009090205-6c0755d89d1e/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= -github.com/maorfr/helm-plugin-utils v0.0.0-20200216074820-36d2fcf6ae86/go.mod h1:p3gwmRSFqbWw6plBpR0sKl3n3vpu8kX70gvCJKMvvCA= github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= github.com/markbates/inflect v1.0.4 h1:5fh1gzTFhfae06u3hzHYO9xe3l3v3nW5Pwt3naLTP5g= github.com/markbates/inflect v1.0.4/go.mod h1:1fR9+pO2KHEO9ZRtto13gDwwZaAKstQzferVeWqbgNs= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/martinlindhe/base36 v1.0.0/go.mod h1:+AtEs8xrBpCeYgSLoY/aJ6Wf37jtBuR0s35750M27+8= github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a h1:+J2gw7Bw77w/fbK7wnNJJDKmw1IbWft2Ul5BzrG1Qm8= github.com/mattbaird/jsonpatch v0.0.0-20171005235357-81af80346b1a/go.mod h1:M1qoD/MqPgTZIk0EWKB38wE28ACRfVcn+cU08jyArI0= @@ -998,6 +1024,8 @@ github.com/mattn/go-shellwords v1.0.10/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lL github.com/mattn/go-sqlite3 v0.0.0-20160514122348-38ee283dabf1/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v1.12.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw= github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-zglob v0.0.1/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= github.com/mattn/go-zglob v0.0.2/go.mod h1:9fxibJccNxU2cnpIKLRRFA7zX7qhkJIQWBb449FYHOo= @@ -1025,12 +1053,12 @@ github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eI github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v0.0.0-20170609045927-2bca23e0e452/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/ioprogress v0.0.0-20180201004757-6a23b12fa88e/go.mod h1:waEya8ee1Ro/lgxpVhkJI4BVASzkm3UZqkx/cFJiYHM= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f h1:2+myh5ml7lgEU/51gbeLHfKGNfgEQQIWrlbdaOsidbQ= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -1041,6 +1069,7 @@ github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= +github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mozilla/tls-observatory v0.0.0-20190404164649-a3c1b6cfecfd/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= github.com/mozilla/tls-observatory v0.0.0-20200317151703-4fa42e1c2dee/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= @@ -1106,15 +1135,18 @@ github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1y github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= +github.com/opencontainers/go-digest v1.0.0-rc1 h1:WzifXhOVOEOuFYOJAW6aQqW0TooG2iki3E3Ii+WN7gQ= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.0/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= +github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6 h1:yN8BPXVwMBAm3Cuvh1L5XE8XpvYRMdsVLd82ILprhUU= +github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/runc v0.0.0-20190115041553-12f6a991201f/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runc v0.1.1 h1:GlxAyO6x8rfZYN9Tt0Kti5a/cP41iuiO2yYT0IJGY8Y= github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= +github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700 h1:eNUVfm/RFLIi1G7flU5/ZRTHvd4kcVuzfRnL6OFlzCI= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= -github.com/openshift/api v0.0.0-20200205133042-34f0ec8dab87/go.mod h1:fT6U/JfG8uZzemTRwZA2kBDJP5nWz7v05UHnty/D+pk= -github.com/openshift/client-go v0.0.0-20190923180330-3b6373338c9b/go.mod h1:6rzn+JTr7+WYS2E1TExP4gByoABxMznR6y2SnUIkmxk= github.com/openshift/origin v0.0.0-20160503220234-8f127d736703/go.mod h1:0Rox5r9C8aQn6j1oAOQ0c1uC86mYbUFObzjBRvUKHII= github.com/openshift/prom-label-proxy v0.1.1-0.20191016113035-b8153a7f39f1/go.mod h1:p5MuxzsYP1JPsNGwtjtcgRHHlGziCJJfztff91nNixw= github.com/opentracing-contrib/go-stdlib v0.0.0-20190519235532-cf7a6c988dc9/go.mod h1:PLldrQSroqzH70Xl+1DQcGnefIbqsKR7UDaiux3zV+w= @@ -1127,20 +1159,22 @@ github.com/openzipkin/zipkin-go v0.2.0 h1:33/f6xXB6YlOQ9tgTsXVOkdLCJsHTcZJnMy4Dn github.com/openzipkin/zipkin-go v0.2.0/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/openzipkin/zipkin-go v0.2.2 h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb9NAWI= github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= -github.com/operator-framework/api v0.1.1/go.mod h1:yzNYR7qyJqRGOOp+bT6Z/iYSbSPNxeh3Si93Gx/3OBY= -github.com/operator-framework/operator-lifecycle-manager v0.0.0-20200321030439-57b580e57e88/go.mod h1:7Ut8p9jJ8C6RZyyhZfZypmlibCIJwK5Wcc+WZDgLkOA= -github.com/operator-framework/operator-registry v1.5.3/go.mod h1:agrQlkWOo1q8U1SAaLSS2WQ+Z9vswNT2M2HFib9iuLY= -github.com/operator-framework/operator-registry v1.6.1/go.mod h1:sx4wWMiZtYhlUiaKscg3QQUPPM/c1bkrAs4n4KipDb4= -github.com/operator-framework/operator-registry v1.6.2-0.20200330184612-11867930adb5/go.mod h1:SHff373z8asEkPo6aWpN0qId4Y/feQTjZxRF8PRhti8= -github.com/operator-framework/operator-sdk v0.17.0 h1:+TTrGjXa+lm7g7Cm0UtFcgOjnw1x9/lBorydpsIIhOY= -github.com/operator-framework/operator-sdk v0.17.0/go.mod h1:wmYi08aoUmtgfoUamURmssI4dkdFGNtSI1Egj+ZfBnk= -github.com/otiai10/copy v1.0.1/go.mod h1:8bMCJrAqOtN/d9oyh5HR7HhLQMvcGMpGdwRDYsfOCHc= +github.com/operator-framework/api v0.3.7-0.20200602203552-431198de9fc2/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q= +github.com/operator-framework/api v0.3.8 h1:tJykTCmwGKZBsPVTCfxbwz6nTF6dzmKydWJtC40erc8= +github.com/operator-framework/api v0.3.8/go.mod h1:Xbje9x0SHmh0nihE21kpesB38vk3cyxnE6JdDS8Jo1Q= +github.com/operator-framework/operator-registry v1.12.6-0.20200611222234-275301b779f8 h1:F3zzxoBJJANdKMxmSOi5z/HWiVT+gwOdhROkEwDWD2M= +github.com/operator-framework/operator-registry v1.12.6-0.20200611222234-275301b779f8/go.mod h1:loVINznYhgBIkmv83kU4yee88RS0BBk+hqOw9r4bhJk= +github.com/operator-framework/operator-sdk v0.18.2 h1:Ts5ckGcJ/Jf+2IXeagsEk87o83bEeA+Z7DwNkyWEBPs= +github.com/operator-framework/operator-sdk v0.18.2/go.mod h1:XPYwfr/2R81nK5wzX1Xtesh9pduffTuuBGB76iDClh0= github.com/otiai10/copy v1.0.2/go.mod h1:c7RpqBkwMom4bYTSkLSym4VSJz/XtncWRAj/J4PEIMY= +github.com/otiai10/copy v1.2.0 h1:HvG945u96iNadPoG2/Ja2+AUJeW5YuFQMixq9yirC+k= +github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= -github.com/otiai10/curr v0.0.0-20190513014714-f5a3d24e5776/go.mod h1:3HNVkVOU7vZeFXocWuvtcS0XSFLcf2XUSDHkq9t1jU4= -github.com/otiai10/mint v1.2.3/go.mod h1:YnfyPNhBvnY8bW4SGQHCs/aAFhkgySlMZbrF5U0bOVw= -github.com/otiai10/mint v1.2.4/go.mod h1:d+b7n/0R3tdyUYYylALXpWQ/kTN+QobSq/4SRGBkR3M= +github.com/otiai10/curr v1.0.0 h1:TJIWdbX0B+kpNagQrjgq8bCMrbhiuX73M2XwgtDMoOI= +github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= +github.com/otiai10/mint v1.3.1 h1:BCmzIS3n71sGfHB5NMNDB3lHYPz8fWSkCAErHed//qc= +github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= @@ -1152,6 +1186,7 @@ github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= +github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2 h1:JhzVVoYvbOACxoUmOs6V/G4D5nPVUW73rKvXxP4XUJc= github.com/phayes/freeport v0.0.0-20180830031419-95f893ade6f2/go.mod h1:iIss55rKnNBTvrwdmkUpLnDpZoAHvWaiq5+iMmen4AE= github.com/pierrec/lz4 v0.0.0-20190327172049-315a67e90e41/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= @@ -1214,6 +1249,7 @@ github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190425082905-87a4384529e0/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.0-20190522114515-bc1a522cf7b1/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.5/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= @@ -1233,7 +1269,6 @@ github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1: github.com/quasilyte/go-ruleguard v0.1.2-0.20200318202121-b00d7a75d3d8/go.mod h1:CGFX09Ci3pq9QZdj86B+VGIdNj4VyCo2iPOGS9esB/k= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20190706150252-9beb055b7962/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/robfig/cron v0.0.0-20170526150127-736158dc09e1/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.1.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= @@ -1241,12 +1276,13 @@ github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6L github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.5.0 h1:Usqs0/lDK/NqTkvrmKSwA/3XkZAs7ZAW/eLeQ2MVBTw= github.com/rogpeppe/go-internal v1.5.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.5.2 h1:qLvObTrvO/XRCqmkKxUlOBc48bI3efyDuAZe25QiF0w= github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= -github.com/rubenv/sql-migrate v0.0.0-20191025130928-9355dd04f4b3/go.mod h1:WS0rl9eEliYI8DPnr3TOwz4439pay+qNgzJoVya/DmY= +github.com/rubenv/sql-migrate v0.0.0-20200212082348-64f95ea68aa3/go.mod h1:rtQlpHw+eR6UrqaS3kX1VYeaCxzCVdimDS7g5Ln4pPc= github.com/rubiojr/go-vhd v0.0.0-20160810183302-0bfd3b39853c/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1321,6 +1357,7 @@ github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v0.0.6 h1:breEStsVwemnKh2/s6gMvSdMEkwW0sK8vGStnlVBMCs= github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v0.0.7/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -1356,8 +1393,8 @@ github.com/tektoncd/pipeline v0.8.0/go.mod h1:IZzJdiX9EqEMuUcgdnElozdYYRh0/ZRC+N github.com/tektoncd/pipeline v0.10.1/go.mod h1:D2X0exT46zYx95BU7ByM8+erpjoN7thmUBvlKThOszU= github.com/tektoncd/pipeline v0.11.0/go.mod h1:hlkH32S92+/UODROH0dmxzyuMxfRFp/Nc3e29MewLn8= github.com/tektoncd/pipeline v0.13.1-0.20200625065359-44f22a067b75/go.mod h1:R5AlT46x/F8n/pFJFjZ1U1q71GWtVXgG7RZkkoRL554= -github.com/tektoncd/pipeline v0.17.1 h1:wLbdo+dnOKSqr8mNN5rT6UQ80hlyx06/bOVul5oITZk= -github.com/tektoncd/pipeline v0.17.1/go.mod h1:RbS1SgDhFSGB0seQvk15HY36yu0ULD2uBxizwAmPj5I= +github.com/tektoncd/pipeline v0.17.1-0.20201006183654-d5df1c164a48 h1:bREVQct2dVm96b5nD2kJ6THuIoko7wv0jfp4xX9yxlo= +github.com/tektoncd/pipeline v0.17.1-0.20201006183654-d5df1c164a48/go.mod h1:KPpPkbruz7vAHu5Y8dzu73IkgmR9Ew1HNkI3IZHbJ8k= github.com/tektoncd/plumbing v0.0.0-20191216083742-847dcf196de9/go.mod h1:QZHgU07PRBTRF6N57w4+ApRu8OgfYLFNqCDlfEZaD9Y= github.com/tektoncd/plumbing v0.0.0-20200217163359-cd0db6e567d2/go.mod h1:QZHgU07PRBTRF6N57w4+ApRu8OgfYLFNqCDlfEZaD9Y= github.com/tektoncd/plumbing v0.0.0-20200430135134-e53521e1d887/go.mod h1:cZPJIeTIoP7UPTxQyTQLs7VE1TiXJSNj0te+If4Q+jI= @@ -1421,8 +1458,11 @@ github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1: github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43 h1:+lm10QQTNSBd8DVTNGHx7o/IKu9HYDvLMffDhbyLccI= github.com/yvasiyarov/go-metrics v0.0.0-20140926110328-57bccd1ccd43/go.mod h1:aX5oPXxHm3bOH+xeAttToC8pqch2ScQN/JoXYupl6xs= +github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50 h1:hlE8//ciYMztlGpl/VA+Zm1AcTPHYkHJPbHqE6WJUXE= github.com/yvasiyarov/gorelic v0.0.0-20141212073537-a9bba5b9ab50/go.mod h1:NUSPSUX/bi6SeDMUh6brw0nXpxHnc96TguQh0+r/ssA= +github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f h1:ERexzlUfuTvpE74urLSbIQW0Z/6hF9t8U4NsJLaioAY= github.com/yvasiyarov/newrelic_platform_go v0.0.0-20140908184405-b21fdbd4370f/go.mod h1:GlGEuHIJweS1mbCqG+7vt2nvWLzLLnRHbXz5JKd/Qbg= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= gitlab.com/nyarla/go-crypt v0.0.0-20160106005555-d9a5dc2b789b/go.mod h1:T3BPAOm2cqquPa0MKWeNkmOM5RQsRhkrwMWonFMN7fE= @@ -1433,6 +1473,8 @@ go.elastic.co/fastjson v1.0.0/go.mod h1:PmeUOMMtLHQr9ZS9J9owrAVg0FkaZDRZJEFTTGHt go.etcd.io/bbolt v1.3.1-etcd.7/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= +go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20181031231232-83304cfc808c/go.mod h1:weASp41xM3dk0YHg1s/W8ecdGP5G4teSTMBPpYAaUgA= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= @@ -1514,17 +1556,16 @@ golang.org/x/crypto v0.0.0-20200128174031-69ecbb4d6d5d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 h1:/Tl7pH94bvbAAHBdZJT947M/+gp0+CqQXDtMRC0fseo= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM= golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= @@ -1617,6 +1658,8 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73 h1:MXfv8rhZWmFeqX3GNZRsd6vOLoaCHjYEX3qkRo3YBUA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1686,6 +1729,7 @@ golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1698,6 +1742,7 @@ golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1714,9 +1759,11 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200802091954-4b90ce9b60b3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200828081204-131dc92a58d5 h1:7bMlihXlwJGQO5wkUzKoDE1wEy13q+lWFO6dMYQx92o= -golang.org/x/sys v0.0.0-20200828081204-131dc92a58d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f h1:Fqb3ao1hUmOR3GkUOg/Y+BadLwykBIzs5q8Ez2SbHyc= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1745,7 +1792,6 @@ golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190118193359-16909d206f00/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190125232054-d66bd3c5d5a6/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -1764,7 +1810,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190624180213-70d37148ca0c/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190706070813-72ffa07ba3db/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= @@ -1778,6 +1824,7 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20190918214516-5a1a30219888/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190927191325-030b2cf1153e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191004055002-72853e10c5a3/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010075000-0337d82405ff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191010171213-8abd42400456/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1798,7 +1845,6 @@ golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200102140908-9497f49d5709/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200115044656-831fdb1e1868/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200115165105-de0b1760071a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= @@ -1816,12 +1862,10 @@ golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjs golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200317043434-63da46f3035e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200327195553-82bb89366a1e h1:qCZ8SbsZMjT0OuDPCEBxgLZic4NMj8Gj4vNXiTVRAaA= -golang.org/x/tools v0.0.0-20200327195553-82bb89366a1e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= -golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65 h1:1KSbntBked74wYsKq0jzXYy7ZwcjAUtrl7EmPE97Iiw= golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200331202046-9d5940d49312/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200403190813-44a64ad78b9b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200426102838-f3a5411a4c3b/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= @@ -1838,12 +1882,13 @@ golang.org/x/tools v0.0.0-20200709181711-e327e1019dfe/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200725200936-102e7d357031/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200731060945-b5fad4ed8dd6/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200817023811-d00afeaade8f/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200827163409-021d7c6f1ec3/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200828013309-97019fc2e64b h1:TlHrnfzYWpw9fgHafO5AaiaqK81ZaJzPi+srvBuZUIQ= -golang.org/x/tools v0.0.0-20200828013309-97019fc2e64b/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200828161849-5deb26317202 h1:DrWbY9UUFi/sl/3HkNVoBjDbGfIPZZfgoGsGxOL1EU8= +golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= @@ -1856,12 +1901,7 @@ gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3m gomodules.xyz/jsonpatch/v3 v3.0.1/go.mod h1:CBhndykehEwTOlEfnsfJwvkFQbSN8YZFr9M+cIHAJto= gomodules.xyz/orderedmap v0.1.0/go.mod h1:g9/TPUCm1t2gwD3j3zfV8uylyYhVdCNSi+xCEIu7yTU= gonum.org/v1/gonum v0.0.0-20181121035319-3f7ecaa7e8ca/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20181029234149-ec6d1f5cefe6/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= google.golang.org/api v0.0.0-20160322025152-9bf6e6e569ff/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181021000519-a2651947f503/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= @@ -1892,6 +1932,8 @@ google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.31.0 h1:1w5Sz/puhxFo9lTtip2n47k7toB/U2nCqOKNHd3Yrbo= +google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1930,6 +1972,7 @@ google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200117163144-32f20d992d24/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1938,7 +1981,6 @@ google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200317114155-1f3552e48f24/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200326112834-f447254575fd h1:DVCc2PgW9UrvHGZGEv4Mt3uSeQtUrrs7r8pUw+bVwWI= google.golang.org/genproto v0.0.0-20200326112834-f447254575fd/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -1956,12 +1998,14 @@ google.golang.org/genproto v0.0.0-20200709005830-7a2ca40e9dc3/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200726014623-da3ae01ef02d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200731012542-8145dea6a485/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200815001618-f69a88009b70/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200827165113-ac2560b5e952/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200828030656-73b5761be4c5 h1:SXvXDcZm33V0P03upM01EgN1an0ggw+yntYrnvdWbCU= -google.golang.org/genproto v0.0.0-20200828030656-73b5761be4c5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d h1:92D1fum1bJLKSdr11OJ+54YeCMCGYIygTA7R/YZxH5M= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.13.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= @@ -2064,10 +2108,11 @@ gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20190905181640-827449938966/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -helm.sh/helm/v3 v3.1.0/go.mod h1:WYsFJuMASa/4XUqLyv54s0U/f3mlAaRErGmyy4z921g= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= helm.sh/helm/v3 v3.1.1/go.mod h1:WYsFJuMASa/4XUqLyv54s0U/f3mlAaRErGmyy4z921g= -helm.sh/helm/v3 v3.1.2/go.mod h1:WYsFJuMASa/4XUqLyv54s0U/f3mlAaRErGmyy4z921g= +helm.sh/helm/v3 v3.2.0/go.mod h1:ZaXz/vzktgwjyGGFbUWtIQkscfE7WYoRGP2szqAFHR0= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -2089,74 +2134,74 @@ k8s.io/api v0.0.0-20190813020757-36bff7324fb7/go.mod h1:3Iy+myeAORNCLgjd/Xu9ebwN k8s.io/api v0.0.0-20190918155943-95b840bb6a1f/go.mod h1:uWuOHnjmNrtQomJrvEBg0c0HRNyQ+8KTEERVsK0PW48= k8s.io/api v0.0.0-20190918195907-bd6ac527cfd2/go.mod h1:AOxZTnaXR/xiarlQL0JUfwQPxjmKDvVYoRp58cA7lUo= k8s.io/api v0.0.0-20191115095533-47f6de673b26/go.mod h1:iA/8arsvelvo4IDqIhX4IbjTEKBGgvsf2OraTuRtLFU= +k8s.io/api v0.0.0-20191122220107-b5267f2975e0/go.mod h1:vYpRfxYkMrmPPSesoHEkGNHxNKTk96REAwqm/inQbs0= k8s.io/api v0.16.4/go.mod h1:AtzMnsR45tccQss5q8RnF+W8L81DH6XwXwo/joEx9u0= -k8s.io/api v0.16.7/go.mod h1:oUAiGRgo4t+5yqcxjOu5LoHT3wJ8JSbgczkaFYS5L7I= k8s.io/api v0.17.0/go.mod h1:npsyOePkeP0CPwyGfXDHxvypiYMJxBWAMpQxCaJ4ZxI= -k8s.io/api v0.17.1/go.mod h1:zxiAc5y8Ngn4fmhWUtSxuUlkfz1ixT7j9wESokELzOg= k8s.io/api v0.17.2/go.mod h1:BS9fjjLc4CMuqfSO8vgbHPKMt5+SF0ET6u/RVDihTo4= k8s.io/api v0.17.3/go.mod h1:YZ0OTkuw7ipbe305fMpIdf3GLXZKRigjtZaV5gzC2J0= -k8s.io/api v0.17.4 h1:HbwOhDapkguO8lTAE8OX3hdF2qp8GtpC9CW/MQATXXo= k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= -k8s.io/api v0.17.6 h1:S6qZSkjdOU0N/TYBZKoR1o7YVSiWMGFU0XXDoqs2ioA= k8s.io/api v0.17.6/go.mod h1:1jKVwkj0UZ4huak/yRt3MFfU5wc32+B41SkNN5HhyFg= +k8s.io/api v0.18.0/go.mod h1:q2HRQkfDzHMBZL9l/y9rH63PkQl4vae0xRT+8prbrK8= +k8s.io/api v0.18.2/go.mod h1:SJCWI7OLzhZSvbY7U8zwNl9UA4o1fizoug34OV/2r78= k8s.io/api v0.18.4/go.mod h1:lOIQAKYgai1+vz9J7YcDZwC26Z0zQewYOGWdyIPUUQ4= -k8s.io/api v0.18.7-rc.0 h1:aFla3eKdrGxTxKup0ae3Rn5zWyJj2eSzCLKyjqx/wRs= k8s.io/api v0.18.7-rc.0/go.mod h1:v6x7KyKMJ7W/BbG7E9olOQshfszuXKKsxfnjaq+ylrk= +k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= +k8s.io/api v0.18.10 h1:M0/vqfuBAIIS7jsOOcosT0niiotZGqw6/zHTFpyi8iQ= +k8s.io/api v0.18.10/go.mod h1:xWtwPX1v47j5RTncmlMFGCx8b0avh+nP8OgZZ9hjo3M= k8s.io/apiextensions-apiserver v0.0.0-20190918161926-8f644eb6e783/go.mod h1:xvae1SZB3E17UpV59AWc271W/Ph25N+bjPyR63X6tPY= k8s.io/apiextensions-apiserver v0.0.0-20190918201827-3de75813f604/go.mod h1:7H8sjDlWQu89yWB3FhZfsLyRCRLuoXoCoY5qtwW1q6I= k8s.io/apiextensions-apiserver v0.16.4/go.mod h1:HYQwjujEkXmQNhap2C9YDdIVOSskGZ3et0Mvjcyjbto= -k8s.io/apiextensions-apiserver v0.16.7/go.mod h1:6xYRp4trGp6eT5WZ6tPi/TB2nfWQCzwUvBlpg8iswe0= -k8s.io/apiextensions-apiserver v0.17.0/go.mod h1:XiIFUakZywkUl54fVXa7QTEHcqQz9HG55nHd1DCoHj8= k8s.io/apiextensions-apiserver v0.17.2/go.mod h1:4KdMpjkEjjDI2pPfBA15OscyNldHWdBCfsWMDWAmSTs= -k8s.io/apiextensions-apiserver v0.17.3/go.mod h1:CJbCyMfkKftAd/X/V6OTHYhVn7zXnDdnkUjS1h0GTeY= -k8s.io/apiextensions-apiserver v0.17.4 h1:ZKFnw3cJrGZ/9s6y+DerTF4FL+dmK0a04A++7JkmMho= -k8s.io/apiextensions-apiserver v0.17.4/go.mod h1:rCbbbaFS/s3Qau3/1HbPlHblrWpFivoaLYccCffvQGI= -k8s.io/apiextensions-apiserver v0.17.6 h1:o5JWDya65ApIVez+RfR40PGrqjPUZHhlSmwAHCvL20E= k8s.io/apiextensions-apiserver v0.17.6/go.mod h1:Z3CHLP3Tha+Rbav7JR3S+ye427UaJkHBomK2c4XtZ3A= +k8s.io/apiextensions-apiserver v0.18.0/go.mod h1:18Cwn1Xws4xnWQNC00FLq1E350b9lUF+aOdIWDOZxgo= +k8s.io/apiextensions-apiserver v0.18.2/go.mod h1:q3faSnRGmYimiocj6cHQ1I3WpLqmDgJFlKL37fC4ZvY= k8s.io/apiextensions-apiserver v0.18.4 h1:Y3HGERmS8t9u12YNUFoOISqefaoGRuTc43AYCLzWmWE= k8s.io/apiextensions-apiserver v0.18.4/go.mod h1:NYeyeYq4SIpFlPxSAB6jHPIdvu3hL0pc36wuRChybio= -k8s.io/apimachinery v0.17.6 h1:P0MNfucrmKLPsOSRbhDuG0Tplrpg7hVY4fJHh5sUIUw= -k8s.io/apimachinery v0.17.6/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= +k8s.io/apimachinery v0.18.10 h1:Zupk3lPrUfhCF9puTpA8EvEfPsrhNZtrpOqdp66mKVs= +k8s.io/apimachinery v0.18.10/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apiserver v0.0.0-20190918160949-bfa5e2e684ad/go.mod h1:XPCXEwhjaFN29a8NldXA901ElnKeKLrLtREO9ZhFyhg= k8s.io/apiserver v0.0.0-20190918200908-1e17798da8c1/go.mod h1:4FuDU+iKPjdsdQSN3GsEKZLB/feQsj1y9dhhBDVV2Ns= +k8s.io/apiserver v0.0.0-20191122221311-9d521947b1e1/go.mod h1:RbsZY5zzBIWnz4KbctZsTVjwIuOpTp4Z8oCgFHN4kZQ= k8s.io/apiserver v0.16.4/go.mod h1:kbLJOak655g6W7C+muqu1F76u9wnEycfKMqbVaXIdAc= -k8s.io/apiserver v0.16.7/go.mod h1:/5zSatF30/L9zYfMTl55jzzOnx7r/gGv5a5wtRp8yAw= k8s.io/apiserver v0.17.0/go.mod h1:ABM+9x/prjINN6iiffRVNCBR2Wk7uY4z+EtEGZD48cg= k8s.io/apiserver v0.17.2/go.mod h1:lBmw/TtQdtxvrTk0e2cgtOxHizXI+d0mmGQURIHQZlo= -k8s.io/apiserver v0.17.3/go.mod h1:iJtsPpu1ZpEnHaNawpSV0nYTGBhhX2dUlnn7/QS7QiY= k8s.io/apiserver v0.17.4/go.mod h1:5ZDQ6Xr5MNBxyi3iUZXS84QOhZl+W7Oq2us/29c0j9I= k8s.io/apiserver v0.17.6/go.mod h1:sAYqm8hUDNA9aj/TzqwsJoExWrxprKv0tqs/z88qym0= +k8s.io/apiserver v0.18.0/go.mod h1:3S2O6FeBBd6XTo0njUrLxiqk8GNy6wWOftjhJcXYnjw= +k8s.io/apiserver v0.18.2/go.mod h1:Xbh066NqrZO8cbsoenCwyDJ1OSi8Ag8I2lezeHxzwzw= k8s.io/apiserver v0.18.4/go.mod h1:q+zoFct5ABNnYkGIaGQ3bcbUNdmPyOCoEBcg51LChY8= k8s.io/autoscaler v0.0.0-20190607113959-1b4f1855cb8e/go.mod h1:QEXezc9uKPT91dwqhSJq3GNI3B1HxFRQHiku9kmrsSA= k8s.io/cli-runtime v0.17.2/go.mod h1:aa8t9ziyQdbkuizkNLAw3qe3srSyWh9zlSB7zTqRNPI= k8s.io/cli-runtime v0.17.3/go.mod h1:X7idckYphH4SZflgNpOOViSxetiMj6xI0viMAjM81TA= -k8s.io/cli-runtime v0.17.4/go.mod h1:IVW4zrKKx/8gBgNNkhiUIc7nZbVVNhc1+HcQh+PiNHc= -k8s.io/client-go v0.17.4 h1:VVdVbpTY70jiNHS1eiFkUt7ZIJX3txd29nDxxXH4en8= -k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc= +k8s.io/cli-runtime v0.18.0/go.mod h1:1eXfmBsIJosjn9LjEBUd2WVPoPAY9XGTqTFcPMIBsUQ= +k8s.io/cli-runtime v0.18.2/go.mod h1:yfFR2sQQzDsV0VEKGZtrJwEy4hLZ2oj4ZIfodgxAHWQ= +k8s.io/cli-runtime v0.18.10/go.mod h1:8awhtXxYzOsxCrxgMTmR3DkIV8M/Gcu/v1aCIzQKIV4= +k8s.io/client-go v0.18.10 h1:fETWvjTtnE3/s+h0SYr2wvlKWFDF+NrhwAL/ddqVa2Q= +k8s.io/client-go v0.18.10/go.mod h1:XBkFAqPrzqfwmGkV5ac+mlgBpWcz5TkhLw2808q8C3c= k8s.io/cloud-provider v0.17.0/go.mod h1:Ze4c3w2C0bRsjkBUoHpFi+qWe3ob1wI2/7cUn+YQIDE= k8s.io/cloud-provider v0.17.4/go.mod h1:XEjKDzfD+b9MTLXQFlDGkk6Ho8SGMpaU8Uugx/KNK9U= -k8s.io/code-generator v0.17.4 h1:C3uu/IvQclEIO4ouUOXuoKWfc4765mYe0uebStg9CaY= -k8s.io/code-generator v0.17.4/go.mod h1:l8BLVwASXQZTo2xamW5mQNFCe1XPiAesVq7Y1t7PiQQ= +k8s.io/code-generator v0.18.10 h1:54UFw4V1/D2y3rfr52zNw4ECSD5Z9snwFXkXxkvmyvE= +k8s.io/code-generator v0.18.10/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= k8s.io/component-base v0.0.0-20190918160511-547f6c5d7090/go.mod h1:933PBGtQFJky3TEwYx4aEPZ4IxqhWh3R6DCmzqIn1hA= k8s.io/component-base v0.0.0-20190918200425-ed2f0867c778/go.mod h1:DFWQCXgXVLiWtzFaS17KxHdlUeUymP7FLxZSkmL9/jU= +k8s.io/component-base v0.0.0-20191122220729-2684fb322cb9/go.mod h1:NFuUusy/X4Tk21m21tcNUihnmp4OI7lXU7/xA+rYXkc= k8s.io/component-base v0.16.4/go.mod h1:GYQ+4hlkEwdlpAp59Ztc4gYuFhdoZqiAJD1unYDJ3FM= -k8s.io/component-base v0.16.7/go.mod h1:ikdyfezOFMu5O0qJjy/Y9eXwj+fV3pVwdmt0ulVcIR0= k8s.io/component-base v0.17.0/go.mod h1:rKuRAokNMY2nn2A6LP/MiwpoaMRHpfRnrPaUJJj1Yoc= k8s.io/component-base v0.17.2/go.mod h1:zMPW3g5aH7cHJpKYQ/ZsGMcgbsA/VyhEugF3QT1awLs= -k8s.io/component-base v0.17.3/go.mod h1:GeQf4BrgelWm64PXkIXiPh/XS0hnO42d9gx9BtbZRp8= k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE= k8s.io/component-base v0.17.6/go.mod h1:jgRLWl0B0rOzFNtxQ9E4BphPmDqoMafujdau6AdG2Xo= +k8s.io/component-base v0.18.0/go.mod h1:u3BCg0z1uskkzrnAKFzulmYaEpZF7XC9Pf/uFyb1v2c= +k8s.io/component-base v0.18.2/go.mod h1:kqLlMuhJNHQ9lz8Z7V5bxUUtjFZnrypArGl58gmDfUM= k8s.io/component-base v0.18.4/go.mod h1:7jr/Ef5PGmKwQhyAz/pjByxJbC58mhKAhiaDu0vXfPk= +k8s.io/component-base v0.18.10/go.mod h1:ZzFXjzUBHKOcF0mnWkxBI1wDu5t+CV3GxXKKvHZBLf0= k8s.io/csi-translation-lib v0.17.0/go.mod h1:HEF7MEz7pOLJCnxabi45IPkhSsE/KmxPQksuCrHKWls= k8s.io/csi-translation-lib v0.17.4/go.mod h1:CsxmjwxEI0tTNMzffIAcgR9lX4wOh6AKHdxQrT7L0oo= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190306031000-7a1b7fb0289f/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20191010091904-7fa3014cb28f/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20191108084044-e500ee069b5c/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200205140755-e0e292d8aa12 h1:pZzawYyz6VRNPVYpqGv61LWCimQv1BihyeqFrp50/G4= k8s.io/gengo v0.0.0-20200205140755-e0e292d8aa12/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/helm v2.16.3+incompatible/go.mod h1:LZzlS4LQBHfciFOurYBFkCMTaZ0D1l+p0teMg7TSULI= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= @@ -2166,30 +2211,31 @@ k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/kube-aggregator v0.17.3/go.mod h1:1dMwMFQbmH76RKF0614L7dNenMl3dwnUJuOOyZ3GMXA= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 h1:NeQXVJ2XFSkRoPzRo8AId01ZER+j8oV4SZADT4iBOXQ= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= k8s.io/kube-state-metrics v1.7.2 h1:6vdtgXrrRRMSgnyDmgua+qvgCYv954JNfxXAtDkeLVQ= k8s.io/kube-state-metrics v1.7.2/go.mod h1:U2Y6DRi07sS85rmVPmBFlmv+2peBcL8IWGjM+IjYA/E= k8s.io/kubectl v0.17.2/go.mod h1:y4rfLV0n6aPmvbRCqZQjvOp3ezxsFgpqL+zF5jH/lxk= -k8s.io/kubectl v0.17.3/go.mod h1:NUn4IBY7f7yCMwSop2HCXlw/MVYP4HJBiUmOR3n9w28= -k8s.io/kubectl v0.17.4 h1:Ts0CvqvIVceS4RTVXgWMH+YqtieLAzyS2T9eoz8uDQ0= -k8s.io/kubectl v0.17.4/go.mod h1:im5QWmh6fvtmJkkNm4HToLe8z9aM3jihYK5X/wOybcY= +k8s.io/kubectl v0.18.0/go.mod h1:LOkWx9Z5DXMEg5KtOjHhRiC1fqJPLyCr3KtQgEolCkU= +k8s.io/kubectl v0.18.2/go.mod h1:OdgFa3AlsPKRpFFYE7ICTwulXOcMGXHTc+UKhHKvrb4= +k8s.io/kubectl v0.18.10 h1:4tGyJukVR6t1flTwi17Hp6WH5W2Lsut/2IOI32jCOhI= +k8s.io/kubectl v0.18.10/go.mod h1:VVVSZir1jxZ2t8q6UGp6c+j5Uo3/bce9gL/Qcf67g08= k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/kubernetes v1.14.7/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/legacy-cloud-providers v0.17.0/go.mod h1:DdzaepJ3RtRy+e5YhNtrCYwlgyK87j/5+Yfp0L9Syp8= k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js= k8s.io/metrics v0.17.2/go.mod h1:3TkNHET4ROd+NfzNxkjoVfQ0Ob4iZnaHmSEA4vYpwLw= -k8s.io/metrics v0.17.3/go.mod h1:HEJGy1fhHOjHggW9rMDBJBD3YuGroH3Y1pnIRw9FFaI= -k8s.io/metrics v0.17.4/go.mod h1:6rylW2iD3M9VppnEAAtJASY1XS8Pt9tcYh+tHxBeV3I= +k8s.io/metrics v0.18.0/go.mod h1:8aYTW18koXqjLVKL7Ds05RPMX9ipJZI3mywYvBOxXd4= +k8s.io/metrics v0.18.2/go.mod h1:qga8E7QfYNR9Q89cSCAjinC9pTZ7yv1XSVGUB0vJypg= +k8s.io/metrics v0.18.10/go.mod h1:7FQ0/pv0J15/kp8s8WvaeU6tz6jzAKk+xh1eHGwiaW8= k8s.io/test-infra v0.0.0-20181019233642-2e10a0bbe9b3/go.mod h1:2NzXB13Ji0nqpyublHeiPC4FZwU0TknfvyaaNfl/BTA= k8s.io/test-infra v0.0.0-20191212060232-70b0b49fe247/go.mod h1:d8SKryJBXAwfCFVL4wieRez47J2NOOAb9d029sWLseQ= k8s.io/test-infra v0.0.0-20200407001919-bc7f71ef65b8/go.mod h1:/WpJWcaDvuykB322WXP4kJbX8IpalOzuPxA62GpwkJk= k8s.io/test-infra v0.0.0-20200514184223-ba32c8aae783/go.mod h1:bW6thaPZfL2hW7ecjx2WYwlP9KQLM47/xIJyttkVk5s= k8s.io/test-infra v0.0.0-20200617221206-ea73eaeab7ff/go.mod h1:L3+cRvwftUq8IW1TrHji5m3msnc4uck/7LsE/GR/aZk= k8s.io/test-infra v0.0.0-20200630233406-1dca6122872e/go.mod h1:L3+cRvwftUq8IW1TrHji5m3msnc4uck/7LsE/GR/aZk= -k8s.io/test-infra v0.0.0-20200828131253-b23899a92dfa/go.mod h1:exGUBhfuK+dvNp2knbElr498c8UY2UN00oKgfhs7Llo= +k8s.io/test-infra v0.0.0-20200803112140-d8aa4e063646/go.mod h1:rtUd2cOFwT0aBma1ld6W40F7PuVVw4ELLSFlz9ZEmv8= k8s.io/utils v0.0.0-20181019225348-5e321f9a457c/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= k8s.io/utils v0.0.0-20190221042446-c2654d5206da/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= k8s.io/utils v0.0.0-20190308190857-21c4ce38f2a7/go.mod h1:8k8uAuAQ0rXslZKaEWd0c3oVhZz7sSzSiPnVZayjIX0= @@ -2199,7 +2245,6 @@ k8s.io/utils v0.0.0-20190907131718-3d4f5b7dea0b/go.mod h1:sZAwmy6armz5eXlNoLmJcl k8s.io/utils v0.0.0-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6 h1:p0Ai3qVtkbCG/Af26dBmU0E1W58NID3hSSh7cMyylpM= k8s.io/utils v0.0.0-20191114200735-6ca3b61696b6/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200124190032-861946025e34 h1:HjlUD6M0K3P8nRXmr2B9o4F9dUy9TCj/aEpReeyi6+k= k8s.io/utils v0.0.0-20200124190032-861946025e34/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 h1:v8ud2Up6QK1lNOKFgiIVrZdMg7MpmSnvtrOieolJKoE= @@ -2210,26 +2255,22 @@ knative.dev/eventing-contrib v0.6.1-0.20190723221543-5ce18048c08b/go.mod h1:SnXZ knative.dev/eventing-contrib v0.11.2/go.mod h1:SnXZgSGgMSMLNFTwTnpaOH7hXDzTFtw0J8OmHflNx3g= knative.dev/pkg v0.0.0-20191101194912-56c2594e4f11/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= knative.dev/pkg v0.0.0-20191111150521-6d806b998379/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= +knative.dev/pkg v0.0.0-20200207155214-fef852970f43 h1:52b67wiu9B62n+ZsDAMjHt84sZfiR0CUBTvtF1UEGmo= knative.dev/pkg v0.0.0-20200207155214-fef852970f43/go.mod h1:pgODObA1dTyhNoFxPZTTjNWfx6F0aKsKzn+vaT9XO/Q= knative.dev/pkg v0.0.0-20200428194351-90fc61bae7f7/go.mod h1:o+e8OVEJKIuvXPsGVPIautjXgs05xbos7G+QMRjuUps= knative.dev/pkg v0.0.0-20200505191044-3da93ebb24c2/go.mod h1:Q6sL35DdGs8hIQZKdaCXJGgY8f90BmNBKSb8z6d/BTM= knative.dev/pkg v0.0.0-20200515002500-16d7b963416f/go.mod h1:tMOHGbxtRz8zYFGEGpV/bpoTEM1o89MwYFC4YJXl3GY= -knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9 h1:bN9gghp5Osuw1bgKrvMaA+oiAvPuYmzSbRo54/EFSxI= knative.dev/pkg v0.0.0-20200528142800-1c6815d7e4c9/go.mod h1:QgNZTxnwpB/oSpNcfnLVlw+WpEwwyKAvJlvR3hgeltA= knative.dev/pkg v0.0.0-20200711004937-22502028e31a/go.mod h1:AqAJV6rYi8IGikDjJ/9ZQd9qKdkXVlesVnVjwx62YB8= -knative.dev/pkg v0.0.0-20200831162708-14fb2347fb77 h1:GVzuZIcWF2FqflS8gEwSYWO3bF+0qvx47dzMlBxnJIo= -knative.dev/pkg v0.0.0-20200831162708-14fb2347fb77/go.mod h1:xLMZC5ct0Sx3QQDWHMa1WZggjR6lpJt/S7mXEED6ONo= +knative.dev/pkg v0.0.0-20200922164940-4bf40ad82aab/go.mod h1:MCyt5KqLaai6ENUitOgRAQsu7Gw7cAIIiXQ2IS+O0NI= +knative.dev/pkg v0.0.0-20201026165741-2f75016c1368 h1:KzDx2IerB4km4TG4PunacQvuSeWv4TJXTzjZ3ryKZ9o= +knative.dev/pkg v0.0.0-20201026165741-2f75016c1368/go.mod h1:MCyt5KqLaai6ENUitOgRAQsu7Gw7cAIIiXQ2IS+O0NI= knative.dev/test-infra v0.0.0-20200407185800-1b88cb3b45a5/go.mod h1:xcdUkMJrLlBswIZqL5zCuBFOC22WIPMQoVX1L35i0vQ= knative.dev/test-infra v0.0.0-20200505052144-5ea2f705bb55/go.mod h1:WqF1Azka+FxPZ20keR2zCNtiQA1MP9ZB4BH4HuI+SIU= knative.dev/test-infra v0.0.0-20200513011557-d03429a76034/go.mod h1:aMif0KXL4g19YCYwsy4Ocjjz5xgPlseYV+B95Oo4JGE= knative.dev/test-infra v0.0.0-20200519015156-82551620b0a9/go.mod h1:A5b2OAXTOeHT3hHhVQm3dmtbuWvIDP7qzgtqxA3/2pE= knative.dev/test-infra v0.0.0-20200707183444-aed09e56ddc7/go.mod h1:RjYAhXnZqeHw9+B0zsbqSPlae0lCvjekO/nw5ZMpLCs= -knative.dev/test-infra v0.0.0-20200828171708-f68cb78c80a9/go.mod h1:0uZ4scq51k4xUTJe8zK+wnODCEM+v7pKM6iTKk0Oqo8= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +knative.dev/test-infra v0.0.0-20200921012245-37f1a12adbd3/go.mod h1:Pmg2c7Z7q7BGFUV/GOpU5BlrD3ePJft4MPqx8AYBplc= mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= @@ -2238,27 +2279,30 @@ mvdan.cc/xurls/v2 v2.0.0/go.mod h1:2/webFPYOXN9jp/lzuj0zuAVlF+9g4KPFJANH1oJhRU= pack.ag/amqp v0.11.0/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/letsencrypt v0.0.3 h1:H7xDfhkaFFSYEJlKeq38RwX2jYcnTeHuDQyT+mMNMwM= rsc.io/letsencrypt v0.0.3/go.mod h1:buyQKZ6IXrRnB7TdkHP0RyEybLx18HHyOSoTyoOLqNY= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/boskos v0.0.0-20200526191642-45fc818e2d00/go.mod h1:L1ubP7d1CCMSQSjKiZv6dGbh7b4kfoG+dFPj8cfYDnI= sigs.k8s.io/boskos v0.0.0-20200617235605-f289ba6555ba/go.mod h1:ZO5RV+VxJS9mb6DvZ1yAjywoyq/wQ8b0vDoZxcIA5kE= -sigs.k8s.io/boskos v0.0.0-20200819010710-984516eae7e8/go.mod h1:ZO5RV+VxJS9mb6DvZ1yAjywoyq/wQ8b0vDoZxcIA5kE= -sigs.k8s.io/controller-runtime v0.5.2 h1:pyXbUfoTo+HA3jeIfr0vgi+1WtmNh0CwlcnQGLXwsSw= -sigs.k8s.io/controller-runtime v0.5.2/go.mod h1:JZUwSMVbxDupo0lTJSSFP5pimEyxGynROImSsqIOx1A= +sigs.k8s.io/boskos v0.0.0-20200729174948-794df80db9c9/go.mod h1:ZO5RV+VxJS9mb6DvZ1yAjywoyq/wQ8b0vDoZxcIA5kE= +sigs.k8s.io/controller-runtime v0.6.1 h1:LcK2+nk0kmaOnKGN+vBcWHqY5WDJNJNB/c5pW+sU8fc= +sigs.k8s.io/controller-runtime v0.6.1/go.mod h1:XRYBPdbf5XJu9kpS84VJiZ7h/u1hF3gEORz0efEja7A= sigs.k8s.io/controller-tools v0.2.4/go.mod h1:m/ztfQNocGYBgTTCmFdnK94uVvgxeZeE3LtJvd/jIzA= -sigs.k8s.io/controller-tools v0.2.8/go.mod h1:9VKHPszmf2DHz/QmHkcfZoewO6BL7pPs9uAiBVsaJSE= +sigs.k8s.io/controller-tools v0.3.0/go.mod h1:enhtKGfxZD1GFEoMgP8Fdbu+uKQ/cq1/WGJhdVChfvI= +sigs.k8s.io/kubebuilder v1.0.9-0.20200513134826-f07a0146a40b h1:/ldZApUjz/QfKav8hg3OMYAGDrSozVgMVoDlN0VXJgk= +sigs.k8s.io/kubebuilder v1.0.9-0.20200513134826-f07a0146a40b/go.mod h1:FGPx0hvP73+bapzWoy5ePuhAJYgJjrFbPxgvWyortM0= sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= sigs.k8s.io/structured-merge-diff v0.0.0-20190302045857-e85c7b244fd2/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06 h1:zD2IemQ4LmOcAumeiyDWXKUI2SO0NYDe3H6QGvPOVgU= sigs.k8s.io/structured-merge-diff v1.0.1-0.20191108220359-b1b620dd3f06/go.mod h1:/ULNhyfzRopfcjskuui0cTITekDduZ7ycKN3oUT9R18= +sigs.k8s.io/structured-merge-diff v1.0.1 h1:LOs1LZWMsz1xs77Phr/pkB4LFaavH7IVq/3+WTN9XTA= sigs.k8s.io/structured-merge-diff v1.0.1/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= -sigs.k8s.io/structured-merge-diff v1.0.2 h1:WiMoyniAVAYm03w+ImfF9IE2G23GLR/SwDnQyaNZvPk= -sigs.k8s.io/structured-merge-diff v1.0.2/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA= sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba h1:AAbnc5KQuTWKuh2QSnyghKIOTFzB0Jayv7/OFDn3Cy4= sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba/go.mod h1:V06abazjHneE37ZdSY/UUwPVgcJMKI/jU5XGUjgIKoc= sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/vendor/github.com/blang/semver/.travis.yml b/vendor/github.com/blang/semver/.travis.yml new file mode 100644 index 000000000..102fb9a69 --- /dev/null +++ b/vendor/github.com/blang/semver/.travis.yml @@ -0,0 +1,21 @@ +language: go +matrix: + include: + - go: 1.4.3 + - go: 1.5.4 + - go: 1.6.3 + - go: 1.7 + - go: tip + allow_failures: + - go: tip +install: +- go get golang.org/x/tools/cmd/cover +- go get github.com/mattn/goveralls +script: +- echo "Test and track coverage" ; $HOME/gopath/bin/goveralls -package "." -service=travis-ci + -repotoken $COVERALLS_TOKEN +- echo "Build examples" ; cd examples && go build +- echo "Check if gofmt'd" ; diff -u <(echo -n) <(gofmt -d -s .) +env: + global: + secure: HroGEAUQpVq9zX1b1VIkraLiywhGbzvNnTZq2TMxgK7JHP8xqNplAeF1izrR2i4QLL9nsY+9WtYss4QuPvEtZcVHUobw6XnL6radF7jS1LgfYZ9Y7oF+zogZ2I5QUMRLGA7rcxQ05s7mKq3XZQfeqaNts4bms/eZRefWuaFZbkw= diff --git a/vendor/github.com/blang/semver/LICENSE b/vendor/github.com/blang/semver/LICENSE new file mode 100644 index 000000000..5ba5c86fc --- /dev/null +++ b/vendor/github.com/blang/semver/LICENSE @@ -0,0 +1,22 @@ +The MIT License + +Copyright (c) 2014 Benedikt Lang + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/vendor/github.com/blang/semver/README.md b/vendor/github.com/blang/semver/README.md new file mode 100644 index 000000000..08b2e4a3d --- /dev/null +++ b/vendor/github.com/blang/semver/README.md @@ -0,0 +1,194 @@ +semver for golang [![Build Status](https://travis-ci.org/blang/semver.svg?branch=master)](https://travis-ci.org/blang/semver) [![GoDoc](https://godoc.org/github.com/blang/semver?status.png)](https://godoc.org/github.com/blang/semver) [![Coverage Status](https://img.shields.io/coveralls/blang/semver.svg)](https://coveralls.io/r/blang/semver?branch=master) +====== + +semver is a [Semantic Versioning](http://semver.org/) library written in golang. It fully covers spec version `2.0.0`. + +Usage +----- +```bash +$ go get github.com/blang/semver +``` +Note: Always vendor your dependencies or fix on a specific version tag. + +```go +import github.com/blang/semver +v1, err := semver.Make("1.0.0-beta") +v2, err := semver.Make("2.0.0-beta") +v1.Compare(v2) +``` + +Also check the [GoDocs](http://godoc.org/github.com/blang/semver). + +Why should I use this lib? +----- + +- Fully spec compatible +- No reflection +- No regex +- Fully tested (Coverage >99%) +- Readable parsing/validation errors +- Fast (See [Benchmarks](#benchmarks)) +- Only Stdlib +- Uses values instead of pointers +- Many features, see below + + +Features +----- + +- Parsing and validation at all levels +- Comparator-like comparisons +- Compare Helper Methods +- InPlace manipulation +- Ranges `>=1.0.0 <2.0.0 || >=3.0.0 !3.0.1-beta.1` +- Wildcards `>=1.x`, `<=2.5.x` +- Sortable (implements sort.Interface) +- database/sql compatible (sql.Scanner/Valuer) +- encoding/json compatible (json.Marshaler/Unmarshaler) + +Ranges +------ + +A `Range` is a set of conditions which specify which versions satisfy the range. + +A condition is composed of an operator and a version. The supported operators are: + +- `<1.0.0` Less than `1.0.0` +- `<=1.0.0` Less than or equal to `1.0.0` +- `>1.0.0` Greater than `1.0.0` +- `>=1.0.0` Greater than or equal to `1.0.0` +- `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0` +- `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`. + +Note that spaces between the operator and the version will be gracefully tolerated. + +A `Range` can link multiple `Ranges` separated by space: + +Ranges can be linked by logical AND: + + - `>1.0.0 <2.0.0` would match between both ranges, so `1.1.1` and `1.8.7` but not `1.0.0` or `2.0.0` + - `>1.0.0 <3.0.0 !2.0.3-beta.2` would match every version between `1.0.0` and `3.0.0` except `2.0.3-beta.2` + +Ranges can also be linked by logical OR: + + - `<2.0.0 || >=3.0.0` would match `1.x.x` and `3.x.x` but not `2.x.x` + +AND has a higher precedence than OR. It's not possible to use brackets. + +Ranges can be combined by both AND and OR + + - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1` + +Range usage: + +``` +v, err := semver.Parse("1.2.3") +range, err := semver.ParseRange(">1.0.0 <2.0.0 || >=3.0.0") +if range(v) { + //valid +} + +``` + +Example +----- + +Have a look at full examples in [examples/main.go](examples/main.go) + +```go +import github.com/blang/semver + +v, err := semver.Make("0.0.1-alpha.preview+123.github") +fmt.Printf("Major: %d\n", v.Major) +fmt.Printf("Minor: %d\n", v.Minor) +fmt.Printf("Patch: %d\n", v.Patch) +fmt.Printf("Pre: %s\n", v.Pre) +fmt.Printf("Build: %s\n", v.Build) + +// Prerelease versions array +if len(v.Pre) > 0 { + fmt.Println("Prerelease versions:") + for i, pre := range v.Pre { + fmt.Printf("%d: %q\n", i, pre) + } +} + +// Build meta data array +if len(v.Build) > 0 { + fmt.Println("Build meta data:") + for i, build := range v.Build { + fmt.Printf("%d: %q\n", i, build) + } +} + +v001, err := semver.Make("0.0.1") +// Compare using helpers: v.GT(v2), v.LT, v.GTE, v.LTE +v001.GT(v) == true +v.LT(v001) == true +v.GTE(v) == true +v.LTE(v) == true + +// Or use v.Compare(v2) for comparisons (-1, 0, 1): +v001.Compare(v) == 1 +v.Compare(v001) == -1 +v.Compare(v) == 0 + +// Manipulate Version in place: +v.Pre[0], err = semver.NewPRVersion("beta") +if err != nil { + fmt.Printf("Error parsing pre release version: %q", err) +} + +fmt.Println("\nValidate versions:") +v.Build[0] = "?" + +err = v.Validate() +if err != nil { + fmt.Printf("Validation failed: %s\n", err) +} +``` + + +Benchmarks +----- + + BenchmarkParseSimple-4 5000000 390 ns/op 48 B/op 1 allocs/op + BenchmarkParseComplex-4 1000000 1813 ns/op 256 B/op 7 allocs/op + BenchmarkParseAverage-4 1000000 1171 ns/op 163 B/op 4 allocs/op + BenchmarkStringSimple-4 20000000 119 ns/op 16 B/op 1 allocs/op + BenchmarkStringLarger-4 10000000 206 ns/op 32 B/op 2 allocs/op + BenchmarkStringComplex-4 5000000 324 ns/op 80 B/op 3 allocs/op + BenchmarkStringAverage-4 5000000 273 ns/op 53 B/op 2 allocs/op + BenchmarkValidateSimple-4 200000000 9.33 ns/op 0 B/op 0 allocs/op + BenchmarkValidateComplex-4 3000000 469 ns/op 0 B/op 0 allocs/op + BenchmarkValidateAverage-4 5000000 256 ns/op 0 B/op 0 allocs/op + BenchmarkCompareSimple-4 100000000 11.8 ns/op 0 B/op 0 allocs/op + BenchmarkCompareComplex-4 50000000 30.8 ns/op 0 B/op 0 allocs/op + BenchmarkCompareAverage-4 30000000 41.5 ns/op 0 B/op 0 allocs/op + BenchmarkSort-4 3000000 419 ns/op 256 B/op 2 allocs/op + BenchmarkRangeParseSimple-4 2000000 850 ns/op 192 B/op 5 allocs/op + BenchmarkRangeParseAverage-4 1000000 1677 ns/op 400 B/op 10 allocs/op + BenchmarkRangeParseComplex-4 300000 5214 ns/op 1440 B/op 30 allocs/op + BenchmarkRangeMatchSimple-4 50000000 25.6 ns/op 0 B/op 0 allocs/op + BenchmarkRangeMatchAverage-4 30000000 56.4 ns/op 0 B/op 0 allocs/op + BenchmarkRangeMatchComplex-4 10000000 153 ns/op 0 B/op 0 allocs/op + +See benchmark cases at [semver_test.go](semver_test.go) + + +Motivation +----- + +I simply couldn't find any lib supporting the full spec. Others were just wrong or used reflection and regex which i don't like. + + +Contribution +----- + +Feel free to make a pull request. For bigger changes create a issue first to discuss about it. + + +License +----- + +See [LICENSE](LICENSE) file. diff --git a/vendor/github.com/blang/semver/json.go b/vendor/github.com/blang/semver/json.go new file mode 100644 index 000000000..a74bf7c44 --- /dev/null +++ b/vendor/github.com/blang/semver/json.go @@ -0,0 +1,23 @@ +package semver + +import ( + "encoding/json" +) + +// MarshalJSON implements the encoding/json.Marshaler interface. +func (v Version) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +// UnmarshalJSON implements the encoding/json.Unmarshaler interface. +func (v *Version) UnmarshalJSON(data []byte) (err error) { + var versionString string + + if err = json.Unmarshal(data, &versionString); err != nil { + return + } + + *v, err = Parse(versionString) + + return +} diff --git a/vendor/github.com/blang/semver/package.json b/vendor/github.com/blang/semver/package.json new file mode 100644 index 000000000..1cf8ebdd9 --- /dev/null +++ b/vendor/github.com/blang/semver/package.json @@ -0,0 +1,17 @@ +{ + "author": "blang", + "bugs": { + "URL": "https://github.com/blang/semver/issues", + "url": "https://github.com/blang/semver/issues" + }, + "gx": { + "dvcsimport": "github.com/blang/semver" + }, + "gxVersion": "0.10.0", + "language": "go", + "license": "MIT", + "name": "semver", + "releaseCmd": "git commit -a -m \"gx publish $VERSION\"", + "version": "3.5.1" +} + diff --git a/vendor/github.com/blang/semver/range.go b/vendor/github.com/blang/semver/range.go new file mode 100644 index 000000000..fca406d47 --- /dev/null +++ b/vendor/github.com/blang/semver/range.go @@ -0,0 +1,416 @@ +package semver + +import ( + "fmt" + "strconv" + "strings" + "unicode" +) + +type wildcardType int + +const ( + noneWildcard wildcardType = iota + majorWildcard wildcardType = 1 + minorWildcard wildcardType = 2 + patchWildcard wildcardType = 3 +) + +func wildcardTypefromInt(i int) wildcardType { + switch i { + case 1: + return majorWildcard + case 2: + return minorWildcard + case 3: + return patchWildcard + default: + return noneWildcard + } +} + +type comparator func(Version, Version) bool + +var ( + compEQ comparator = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) == 0 + } + compNE = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) != 0 + } + compGT = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) == 1 + } + compGE = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) >= 0 + } + compLT = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) == -1 + } + compLE = func(v1 Version, v2 Version) bool { + return v1.Compare(v2) <= 0 + } +) + +type versionRange struct { + v Version + c comparator +} + +// rangeFunc creates a Range from the given versionRange. +func (vr *versionRange) rangeFunc() Range { + return Range(func(v Version) bool { + return vr.c(v, vr.v) + }) +} + +// Range represents a range of versions. +// A Range can be used to check if a Version satisfies it: +// +// range, err := semver.ParseRange(">1.0.0 <2.0.0") +// range(semver.MustParse("1.1.1") // returns true +type Range func(Version) bool + +// OR combines the existing Range with another Range using logical OR. +func (rf Range) OR(f Range) Range { + return Range(func(v Version) bool { + return rf(v) || f(v) + }) +} + +// AND combines the existing Range with another Range using logical AND. +func (rf Range) AND(f Range) Range { + return Range(func(v Version) bool { + return rf(v) && f(v) + }) +} + +// ParseRange parses a range and returns a Range. +// If the range could not be parsed an error is returned. +// +// Valid ranges are: +// - "<1.0.0" +// - "<=1.0.0" +// - ">1.0.0" +// - ">=1.0.0" +// - "1.0.0", "=1.0.0", "==1.0.0" +// - "!1.0.0", "!=1.0.0" +// +// A Range can consist of multiple ranges separated by space: +// Ranges can be linked by logical AND: +// - ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0" +// - ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2 +// +// Ranges can also be linked by logical OR: +// - "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x" +// +// AND has a higher precedence than OR. It's not possible to use brackets. +// +// Ranges can be combined by both AND and OR +// +// - `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1` +func ParseRange(s string) (Range, error) { + parts := splitAndTrim(s) + orParts, err := splitORParts(parts) + if err != nil { + return nil, err + } + expandedParts, err := expandWildcardVersion(orParts) + if err != nil { + return nil, err + } + var orFn Range + for _, p := range expandedParts { + var andFn Range + for _, ap := range p { + opStr, vStr, err := splitComparatorVersion(ap) + if err != nil { + return nil, err + } + vr, err := buildVersionRange(opStr, vStr) + if err != nil { + return nil, fmt.Errorf("Could not parse Range %q: %s", ap, err) + } + rf := vr.rangeFunc() + + // Set function + if andFn == nil { + andFn = rf + } else { // Combine with existing function + andFn = andFn.AND(rf) + } + } + if orFn == nil { + orFn = andFn + } else { + orFn = orFn.OR(andFn) + } + + } + return orFn, nil +} + +// splitORParts splits the already cleaned parts by '||'. +// Checks for invalid positions of the operator and returns an +// error if found. +func splitORParts(parts []string) ([][]string, error) { + var ORparts [][]string + last := 0 + for i, p := range parts { + if p == "||" { + if i == 0 { + return nil, fmt.Errorf("First element in range is '||'") + } + ORparts = append(ORparts, parts[last:i]) + last = i + 1 + } + } + if last == len(parts) { + return nil, fmt.Errorf("Last element in range is '||'") + } + ORparts = append(ORparts, parts[last:]) + return ORparts, nil +} + +// buildVersionRange takes a slice of 2: operator and version +// and builds a versionRange, otherwise an error. +func buildVersionRange(opStr, vStr string) (*versionRange, error) { + c := parseComparator(opStr) + if c == nil { + return nil, fmt.Errorf("Could not parse comparator %q in %q", opStr, strings.Join([]string{opStr, vStr}, "")) + } + v, err := Parse(vStr) + if err != nil { + return nil, fmt.Errorf("Could not parse version %q in %q: %s", vStr, strings.Join([]string{opStr, vStr}, ""), err) + } + + return &versionRange{ + v: v, + c: c, + }, nil + +} + +// inArray checks if a byte is contained in an array of bytes +func inArray(s byte, list []byte) bool { + for _, el := range list { + if el == s { + return true + } + } + return false +} + +// splitAndTrim splits a range string by spaces and cleans whitespaces +func splitAndTrim(s string) (result []string) { + last := 0 + var lastChar byte + excludeFromSplit := []byte{'>', '<', '='} + for i := 0; i < len(s); i++ { + if s[i] == ' ' && !inArray(lastChar, excludeFromSplit) { + if last < i-1 { + result = append(result, s[last:i]) + } + last = i + 1 + } else if s[i] != ' ' { + lastChar = s[i] + } + } + if last < len(s)-1 { + result = append(result, s[last:]) + } + + for i, v := range result { + result[i] = strings.Replace(v, " ", "", -1) + } + + // parts := strings.Split(s, " ") + // for _, x := range parts { + // if s := strings.TrimSpace(x); len(s) != 0 { + // result = append(result, s) + // } + // } + return +} + +// splitComparatorVersion splits the comparator from the version. +// Input must be free of leading or trailing spaces. +func splitComparatorVersion(s string) (string, string, error) { + i := strings.IndexFunc(s, unicode.IsDigit) + if i == -1 { + return "", "", fmt.Errorf("Could not get version from string: %q", s) + } + return strings.TrimSpace(s[0:i]), s[i:], nil +} + +// getWildcardType will return the type of wildcard that the +// passed version contains +func getWildcardType(vStr string) wildcardType { + parts := strings.Split(vStr, ".") + nparts := len(parts) + wildcard := parts[nparts-1] + + possibleWildcardType := wildcardTypefromInt(nparts) + if wildcard == "x" { + return possibleWildcardType + } + + return noneWildcard +} + +// createVersionFromWildcard will convert a wildcard version +// into a regular version, replacing 'x's with '0's, handling +// special cases like '1.x.x' and '1.x' +func createVersionFromWildcard(vStr string) string { + // handle 1.x.x + vStr2 := strings.Replace(vStr, ".x.x", ".x", 1) + vStr2 = strings.Replace(vStr2, ".x", ".0", 1) + parts := strings.Split(vStr2, ".") + + // handle 1.x + if len(parts) == 2 { + return vStr2 + ".0" + } + + return vStr2 +} + +// incrementMajorVersion will increment the major version +// of the passed version +func incrementMajorVersion(vStr string) (string, error) { + parts := strings.Split(vStr, ".") + i, err := strconv.Atoi(parts[0]) + if err != nil { + return "", err + } + parts[0] = strconv.Itoa(i + 1) + + return strings.Join(parts, "."), nil +} + +// incrementMajorVersion will increment the minor version +// of the passed version +func incrementMinorVersion(vStr string) (string, error) { + parts := strings.Split(vStr, ".") + i, err := strconv.Atoi(parts[1]) + if err != nil { + return "", err + } + parts[1] = strconv.Itoa(i + 1) + + return strings.Join(parts, "."), nil +} + +// expandWildcardVersion will expand wildcards inside versions +// following these rules: +// +// * when dealing with patch wildcards: +// >= 1.2.x will become >= 1.2.0 +// <= 1.2.x will become < 1.3.0 +// > 1.2.x will become >= 1.3.0 +// < 1.2.x will become < 1.2.0 +// != 1.2.x will become < 1.2.0 >= 1.3.0 +// +// * when dealing with minor wildcards: +// >= 1.x will become >= 1.0.0 +// <= 1.x will become < 2.0.0 +// > 1.x will become >= 2.0.0 +// < 1.0 will become < 1.0.0 +// != 1.x will become < 1.0.0 >= 2.0.0 +// +// * when dealing with wildcards without +// version operator: +// 1.2.x will become >= 1.2.0 < 1.3.0 +// 1.x will become >= 1.0.0 < 2.0.0 +func expandWildcardVersion(parts [][]string) ([][]string, error) { + var expandedParts [][]string + for _, p := range parts { + var newParts []string + for _, ap := range p { + if strings.Index(ap, "x") != -1 { + opStr, vStr, err := splitComparatorVersion(ap) + if err != nil { + return nil, err + } + + versionWildcardType := getWildcardType(vStr) + flatVersion := createVersionFromWildcard(vStr) + + var resultOperator string + var shouldIncrementVersion bool + switch opStr { + case ">": + resultOperator = ">=" + shouldIncrementVersion = true + case ">=": + resultOperator = ">=" + case "<": + resultOperator = "<" + case "<=": + resultOperator = "<" + shouldIncrementVersion = true + case "", "=", "==": + newParts = append(newParts, ">="+flatVersion) + resultOperator = "<" + shouldIncrementVersion = true + case "!=", "!": + newParts = append(newParts, "<"+flatVersion) + resultOperator = ">=" + shouldIncrementVersion = true + } + + var resultVersion string + if shouldIncrementVersion { + switch versionWildcardType { + case patchWildcard: + resultVersion, _ = incrementMinorVersion(flatVersion) + case minorWildcard: + resultVersion, _ = incrementMajorVersion(flatVersion) + } + } else { + resultVersion = flatVersion + } + + ap = resultOperator + resultVersion + } + newParts = append(newParts, ap) + } + expandedParts = append(expandedParts, newParts) + } + + return expandedParts, nil +} + +func parseComparator(s string) comparator { + switch s { + case "==": + fallthrough + case "": + fallthrough + case "=": + return compEQ + case ">": + return compGT + case ">=": + return compGE + case "<": + return compLT + case "<=": + return compLE + case "!": + fallthrough + case "!=": + return compNE + } + + return nil +} + +// MustParseRange is like ParseRange but panics if the range cannot be parsed. +func MustParseRange(s string) Range { + r, err := ParseRange(s) + if err != nil { + panic(`semver: ParseRange(` + s + `): ` + err.Error()) + } + return r +} diff --git a/vendor/github.com/blang/semver/semver.go b/vendor/github.com/blang/semver/semver.go new file mode 100644 index 000000000..8ee0842e6 --- /dev/null +++ b/vendor/github.com/blang/semver/semver.go @@ -0,0 +1,418 @@ +package semver + +import ( + "errors" + "fmt" + "strconv" + "strings" +) + +const ( + numbers string = "0123456789" + alphas = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-" + alphanum = alphas + numbers +) + +// SpecVersion is the latest fully supported spec version of semver +var SpecVersion = Version{ + Major: 2, + Minor: 0, + Patch: 0, +} + +// Version represents a semver compatible version +type Version struct { + Major uint64 + Minor uint64 + Patch uint64 + Pre []PRVersion + Build []string //No Precendence +} + +// Version to string +func (v Version) String() string { + b := make([]byte, 0, 5) + b = strconv.AppendUint(b, v.Major, 10) + b = append(b, '.') + b = strconv.AppendUint(b, v.Minor, 10) + b = append(b, '.') + b = strconv.AppendUint(b, v.Patch, 10) + + if len(v.Pre) > 0 { + b = append(b, '-') + b = append(b, v.Pre[0].String()...) + + for _, pre := range v.Pre[1:] { + b = append(b, '.') + b = append(b, pre.String()...) + } + } + + if len(v.Build) > 0 { + b = append(b, '+') + b = append(b, v.Build[0]...) + + for _, build := range v.Build[1:] { + b = append(b, '.') + b = append(b, build...) + } + } + + return string(b) +} + +// Equals checks if v is equal to o. +func (v Version) Equals(o Version) bool { + return (v.Compare(o) == 0) +} + +// EQ checks if v is equal to o. +func (v Version) EQ(o Version) bool { + return (v.Compare(o) == 0) +} + +// NE checks if v is not equal to o. +func (v Version) NE(o Version) bool { + return (v.Compare(o) != 0) +} + +// GT checks if v is greater than o. +func (v Version) GT(o Version) bool { + return (v.Compare(o) == 1) +} + +// GTE checks if v is greater than or equal to o. +func (v Version) GTE(o Version) bool { + return (v.Compare(o) >= 0) +} + +// GE checks if v is greater than or equal to o. +func (v Version) GE(o Version) bool { + return (v.Compare(o) >= 0) +} + +// LT checks if v is less than o. +func (v Version) LT(o Version) bool { + return (v.Compare(o) == -1) +} + +// LTE checks if v is less than or equal to o. +func (v Version) LTE(o Version) bool { + return (v.Compare(o) <= 0) +} + +// LE checks if v is less than or equal to o. +func (v Version) LE(o Version) bool { + return (v.Compare(o) <= 0) +} + +// Compare compares Versions v to o: +// -1 == v is less than o +// 0 == v is equal to o +// 1 == v is greater than o +func (v Version) Compare(o Version) int { + if v.Major != o.Major { + if v.Major > o.Major { + return 1 + } + return -1 + } + if v.Minor != o.Minor { + if v.Minor > o.Minor { + return 1 + } + return -1 + } + if v.Patch != o.Patch { + if v.Patch > o.Patch { + return 1 + } + return -1 + } + + // Quick comparison if a version has no prerelease versions + if len(v.Pre) == 0 && len(o.Pre) == 0 { + return 0 + } else if len(v.Pre) == 0 && len(o.Pre) > 0 { + return 1 + } else if len(v.Pre) > 0 && len(o.Pre) == 0 { + return -1 + } + + i := 0 + for ; i < len(v.Pre) && i < len(o.Pre); i++ { + if comp := v.Pre[i].Compare(o.Pre[i]); comp == 0 { + continue + } else if comp == 1 { + return 1 + } else { + return -1 + } + } + + // If all pr versions are the equal but one has further prversion, this one greater + if i == len(v.Pre) && i == len(o.Pre) { + return 0 + } else if i == len(v.Pre) && i < len(o.Pre) { + return -1 + } else { + return 1 + } + +} + +// Validate validates v and returns error in case +func (v Version) Validate() error { + // Major, Minor, Patch already validated using uint64 + + for _, pre := range v.Pre { + if !pre.IsNum { //Numeric prerelease versions already uint64 + if len(pre.VersionStr) == 0 { + return fmt.Errorf("Prerelease can not be empty %q", pre.VersionStr) + } + if !containsOnly(pre.VersionStr, alphanum) { + return fmt.Errorf("Invalid character(s) found in prerelease %q", pre.VersionStr) + } + } + } + + for _, build := range v.Build { + if len(build) == 0 { + return fmt.Errorf("Build meta data can not be empty %q", build) + } + if !containsOnly(build, alphanum) { + return fmt.Errorf("Invalid character(s) found in build meta data %q", build) + } + } + + return nil +} + +// New is an alias for Parse and returns a pointer, parses version string and returns a validated Version or error +func New(s string) (vp *Version, err error) { + v, err := Parse(s) + vp = &v + return +} + +// Make is an alias for Parse, parses version string and returns a validated Version or error +func Make(s string) (Version, error) { + return Parse(s) +} + +// ParseTolerant allows for certain version specifications that do not strictly adhere to semver +// specs to be parsed by this library. It does so by normalizing versions before passing them to +// Parse(). It currently trims spaces, removes a "v" prefix, and adds a 0 patch number to versions +// with only major and minor components specified +func ParseTolerant(s string) (Version, error) { + s = strings.TrimSpace(s) + s = strings.TrimPrefix(s, "v") + + // Split into major.minor.(patch+pr+meta) + parts := strings.SplitN(s, ".", 3) + if len(parts) < 3 { + if strings.ContainsAny(parts[len(parts)-1], "+-") { + return Version{}, errors.New("Short version cannot contain PreRelease/Build meta data") + } + for len(parts) < 3 { + parts = append(parts, "0") + } + s = strings.Join(parts, ".") + } + + return Parse(s) +} + +// Parse parses version string and returns a validated Version or error +func Parse(s string) (Version, error) { + if len(s) == 0 { + return Version{}, errors.New("Version string empty") + } + + // Split into major.minor.(patch+pr+meta) + parts := strings.SplitN(s, ".", 3) + if len(parts) != 3 { + return Version{}, errors.New("No Major.Minor.Patch elements found") + } + + // Major + if !containsOnly(parts[0], numbers) { + return Version{}, fmt.Errorf("Invalid character(s) found in major number %q", parts[0]) + } + if hasLeadingZeroes(parts[0]) { + return Version{}, fmt.Errorf("Major number must not contain leading zeroes %q", parts[0]) + } + major, err := strconv.ParseUint(parts[0], 10, 64) + if err != nil { + return Version{}, err + } + + // Minor + if !containsOnly(parts[1], numbers) { + return Version{}, fmt.Errorf("Invalid character(s) found in minor number %q", parts[1]) + } + if hasLeadingZeroes(parts[1]) { + return Version{}, fmt.Errorf("Minor number must not contain leading zeroes %q", parts[1]) + } + minor, err := strconv.ParseUint(parts[1], 10, 64) + if err != nil { + return Version{}, err + } + + v := Version{} + v.Major = major + v.Minor = minor + + var build, prerelease []string + patchStr := parts[2] + + if buildIndex := strings.IndexRune(patchStr, '+'); buildIndex != -1 { + build = strings.Split(patchStr[buildIndex+1:], ".") + patchStr = patchStr[:buildIndex] + } + + if preIndex := strings.IndexRune(patchStr, '-'); preIndex != -1 { + prerelease = strings.Split(patchStr[preIndex+1:], ".") + patchStr = patchStr[:preIndex] + } + + if !containsOnly(patchStr, numbers) { + return Version{}, fmt.Errorf("Invalid character(s) found in patch number %q", patchStr) + } + if hasLeadingZeroes(patchStr) { + return Version{}, fmt.Errorf("Patch number must not contain leading zeroes %q", patchStr) + } + patch, err := strconv.ParseUint(patchStr, 10, 64) + if err != nil { + return Version{}, err + } + + v.Patch = patch + + // Prerelease + for _, prstr := range prerelease { + parsedPR, err := NewPRVersion(prstr) + if err != nil { + return Version{}, err + } + v.Pre = append(v.Pre, parsedPR) + } + + // Build meta data + for _, str := range build { + if len(str) == 0 { + return Version{}, errors.New("Build meta data is empty") + } + if !containsOnly(str, alphanum) { + return Version{}, fmt.Errorf("Invalid character(s) found in build meta data %q", str) + } + v.Build = append(v.Build, str) + } + + return v, nil +} + +// MustParse is like Parse but panics if the version cannot be parsed. +func MustParse(s string) Version { + v, err := Parse(s) + if err != nil { + panic(`semver: Parse(` + s + `): ` + err.Error()) + } + return v +} + +// PRVersion represents a PreRelease Version +type PRVersion struct { + VersionStr string + VersionNum uint64 + IsNum bool +} + +// NewPRVersion creates a new valid prerelease version +func NewPRVersion(s string) (PRVersion, error) { + if len(s) == 0 { + return PRVersion{}, errors.New("Prerelease is empty") + } + v := PRVersion{} + if containsOnly(s, numbers) { + if hasLeadingZeroes(s) { + return PRVersion{}, fmt.Errorf("Numeric PreRelease version must not contain leading zeroes %q", s) + } + num, err := strconv.ParseUint(s, 10, 64) + + // Might never be hit, but just in case + if err != nil { + return PRVersion{}, err + } + v.VersionNum = num + v.IsNum = true + } else if containsOnly(s, alphanum) { + v.VersionStr = s + v.IsNum = false + } else { + return PRVersion{}, fmt.Errorf("Invalid character(s) found in prerelease %q", s) + } + return v, nil +} + +// IsNumeric checks if prerelease-version is numeric +func (v PRVersion) IsNumeric() bool { + return v.IsNum +} + +// Compare compares two PreRelease Versions v and o: +// -1 == v is less than o +// 0 == v is equal to o +// 1 == v is greater than o +func (v PRVersion) Compare(o PRVersion) int { + if v.IsNum && !o.IsNum { + return -1 + } else if !v.IsNum && o.IsNum { + return 1 + } else if v.IsNum && o.IsNum { + if v.VersionNum == o.VersionNum { + return 0 + } else if v.VersionNum > o.VersionNum { + return 1 + } else { + return -1 + } + } else { // both are Alphas + if v.VersionStr == o.VersionStr { + return 0 + } else if v.VersionStr > o.VersionStr { + return 1 + } else { + return -1 + } + } +} + +// PreRelease version to string +func (v PRVersion) String() string { + if v.IsNum { + return strconv.FormatUint(v.VersionNum, 10) + } + return v.VersionStr +} + +func containsOnly(s string, set string) bool { + return strings.IndexFunc(s, func(r rune) bool { + return !strings.ContainsRune(set, r) + }) == -1 +} + +func hasLeadingZeroes(s string) bool { + return len(s) > 1 && s[0] == '0' +} + +// NewBuildVersion creates a new valid build version +func NewBuildVersion(s string) (string, error) { + if len(s) == 0 { + return "", errors.New("Buildversion is empty") + } + if !containsOnly(s, alphanum) { + return "", fmt.Errorf("Invalid character(s) found in build meta data %q", s) + } + return s, nil +} diff --git a/vendor/github.com/blang/semver/sort.go b/vendor/github.com/blang/semver/sort.go new file mode 100644 index 000000000..e18f88082 --- /dev/null +++ b/vendor/github.com/blang/semver/sort.go @@ -0,0 +1,28 @@ +package semver + +import ( + "sort" +) + +// Versions represents multiple versions. +type Versions []Version + +// Len returns length of version collection +func (s Versions) Len() int { + return len(s) +} + +// Swap swaps two versions inside the collection by its indices +func (s Versions) Swap(i, j int) { + s[i], s[j] = s[j], s[i] +} + +// Less checks if version at index i is less than version at index j +func (s Versions) Less(i, j int) bool { + return s[i].LT(s[j]) +} + +// Sort sorts a slice of versions +func Sort(versions []Version) { + sort.Sort(Versions(versions)) +} diff --git a/vendor/github.com/blang/semver/sql.go b/vendor/github.com/blang/semver/sql.go new file mode 100644 index 000000000..eb4d80266 --- /dev/null +++ b/vendor/github.com/blang/semver/sql.go @@ -0,0 +1,30 @@ +package semver + +import ( + "database/sql/driver" + "fmt" +) + +// Scan implements the database/sql.Scanner interface. +func (v *Version) Scan(src interface{}) (err error) { + var str string + switch src := src.(type) { + case string: + str = src + case []byte: + str = string(src) + default: + return fmt.Errorf("Version.Scan: cannot convert %T to string.", src) + } + + if t, err := Parse(str); err == nil { + *v = t + } + + return +} + +// Value implements the database/sql/driver.Valuer interface. +func (v Version) Value() (driver.Value, error) { + return v.String(), nil +} diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/bindata.go b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/bindata.go deleted file mode 100644 index 913d690cb..000000000 --- a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/bindata.go +++ /dev/null @@ -1,363 +0,0 @@ -// Code generated for package v1 by go-bindata DO NOT EDIT. (@generated) -// sources: -// example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml -// example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml -// example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml -// example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml -// example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml -// example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml -package v1 - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("Read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -// Name return file name -func (fi bindataFileInfo) Name() string { - return fi.name -} - -// Size return file size -func (fi bindataFileInfo) Size() int64 { - return fi.size -} - -// Mode return file mode -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} - -// Mode return file modify time -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} - -// IsDir return file whether a directory -func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 -} - -// Sys return file is sys mode -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xfd\x7d\x73\xdc\xb8\x95\x28\x0e\xff\x9f\x4f\x81\xf2\xa4\x4a\x76\x3d\xdd\x2d\x3b\xc9\xcd\xdd\xeb\x9b\xda\x5b\x8a\xa5\x49\xf4\x64\x2c\xab\x2c\x8d\xe7\xe6\xf7\x52\xb3\x68\x12\xdd\x8d\x15\x09\x30\x00\xd8\x72\xcf\xdd\xfd\xee\xbf\xc2\x39\x00\x5f\xba\x49\x10\x6c\xb5\x6c\x6f\x86\xdc\xaa\xcd\xb8\x45\x1e\x00\x07\x07\x07\xe7\xfd\xfc\x66\x3e\x9f\xff\x86\x16\xfc\x13\x53\x9a\x4b\xf1\x96\xd0\x82\xb3\xcf\x86\x09\xfb\x2f\xbd\x78\xf8\x17\xbd\xe0\xf2\x7c\xfb\x66\xc9\x0c\x7d\xf3\x9b\x07\x2e\xd2\xb7\xe4\x5d\xa9\x8d\xcc\x3f\x32\x2d\x4b\x95\xb0\x4b\xb6\xe2\x82\x1b\x2e\xc5\x6f\x72\x66\x68\x4a\x0d\x7d\xfb\x1b\x42\xa8\x10\xd2\x50\xfb\xb3\xb6\xff\x24\x24\x91\xc2\x28\x99\x65\x4c\xcd\xd7\x4c\x2c\x1e\xca\x25\x5b\x96\x3c\x4b\x99\x82\x11\xfc\xf8\xdb\xd7\x8b\xdf\x2d\xfe\xf0\x1b\x42\x12\xc5\xe0\xf3\x7b\x9e\x33\x6d\x68\x5e\xbc\x25\xa2\xcc\xb2\xdf\x10\x22\x68\xce\xde\x12\x9a\x31\x65\x72\x2a\xe8\x9a\x29\xbd\xc8\xa5\xe0\x46\x2a\x2e\xd6\x8b\x44\x2a\x26\xf5\x22\x91\xf9\x6f\x74\xc1\x12\x98\x4c\x9a\xc2\x0c\x69\x76\xab\xb8\x30\x4c\xbd\x93\x59\x99\xe3\xcc\xe6\xe4\xff\x7f\xf7\xe1\xe6\x96\x9a\xcd\x5b\xb2\xb0\x1f\x2c\xdc\x5c\x60\xd6\x29\xd3\x89\xe2\x85\x81\xb9\xdd\x6f\x18\x71\x7f\x24\x72\x45\x2e\x1a\x33\x80\x97\x71\x62\x9f\x1a\x9f\x9b\x5d\xc1\xde\x12\x6d\xec\xc4\x3a\xc7\x52\xac\xc8\x78\x42\x75\xf7\x60\x29\xd3\x5c\xb1\x94\xf8\xb7\x88\x28\xf3\x25\x53\xfb\x83\xeb\xc6\xe8\x1f\x9b\x00\x71\x78\xbb\x62\x9c\x62\x6b\x7c\xbf\x5b\x8b\x03\x4c\x37\xc0\x5d\xac\x59\x03\x52\x4a\x8d\xfd\xe7\x5a\xc9\xb2\x78\x4b\xba\x71\x8e\x5f\xba\x4d\x47\x82\x39\x40\x54\xc6\xb5\xf9\xdb\xc1\x9f\x7e\xe0\xda\xc0\x9f\x8b\xac\x54\x34\xdb\xdb\x62\xf8\x8b\xe6\x62\x5d\x66\x54\xb5\xff\xf6\x1b\x42\x0a\xc5\x34\x53\x5b\xf6\xa3\x78\x10\xf2\x51\x7c\xcf\x59\x96\xea\xb7\x64\x45\x33\x6d\x67\xac\x13\x69\xe7\x7f\x63\x67\x56\xd0\x84\xa5\xf6\xb7\x72\xa9\x1c\x0d\xeb\xb7\xe4\xff\xfc\xe7\x6f\x08\xd9\xd2\x8c\xa7\x80\x0b\x9c\xbe\x2c\x98\xb8\xb8\xbd\xfe\xf4\xfb\xbb\x64\xc3\x72\x8a\x3f\xee\xed\x53\x73\x05\xee\x2f\x4b\xa6\x09\x15\xed\xbf\x24\x59\xa9\x0d\x53\x0b\x07\xa2\x50\xb2\x60\xca\x70\x8f\x28\xfb\x34\x8e\x61\xf5\xdb\xde\x60\x67\x76\x36\x8e\x02\x53\x7b\xf0\x98\x26\xa6\xa6\x4a\x96\x12\x0d\x33\xb5\x14\x62\x36\x5c\x5b\xca\xb1\x98\x11\x78\x14\x1b\x60\x89\x7d\x85\x0a\x22\x97\xff\xce\x12\xb3\x20\x77\x16\x7b\x4a\x13\xbd\x91\x65\x96\xda\xd3\xba\x65\xca\x10\xc5\x12\xb9\x16\xfc\x97\x0a\xb2\x26\x46\xc2\x90\x19\x35\xcc\xed\x97\x7f\xe0\x68\x09\x9a\x59\x3c\x96\x6c\x46\xa8\x48\x49\x4e\x77\x44\x31\x3b\x06\x29\x45\x03\x1a\xbc\xa2\x17\xe4\xbd\x54\x8c\x70\xb1\x92\x6f\xc9\xc6\x98\x42\xbf\x3d\x3f\x5f\x73\xe3\x19\x4f\x22\xf3\xbc\x14\xdc\xec\xce\x81\x7d\xf0\x65\x69\xa4\xd2\xe7\x29\xdb\xb2\xec\x5c\xf3\xf5\x9c\xaa\x64\xc3\x0d\x4b\x4c\xa9\xd8\x39\x2d\xf8\x1c\x26\x2e\x80\xef\x2c\xf2\xf4\xbb\x6a\x87\xcf\x1a\x33\xdd\x3b\x95\xf8\x00\xa9\xf6\xe2\xdd\x52\x2b\xe1\x9a\x50\xf7\x19\xce\xbf\x46\xaf\xfd\xc9\x62\xe5\xe3\xd5\xdd\x3d\xf1\x83\xc2\x16\xb4\x71\x0e\xd8\xae\x3f\xd3\x35\xe2\x2d\xa2\xb8\x58\x31\x85\x1b\xb7\x52\x32\x07\x88\x4c\xa4\x85\xe4\xc2\xc0\x3f\x92\x8c\x33\xd1\x46\xba\x2e\x97\x39\x37\x76\xa7\xff\x51\x32\x6d\xec\xfe\x2c\xc8\x3b\x60\xbf\x64\xc9\x48\x59\xd8\x43\x9b\x2e\xc8\xb5\x20\xef\x68\xce\xb2\x77\x54\xb3\x67\x47\xbb\xc5\xb0\x9e\x5b\x94\x0e\x23\xbe\x79\x6b\xb4\x5f\x44\x6c\x55\x3f\x7b\x6e\xde\xbd\x43\x77\x05\x4b\xf8\x8a\x27\x40\xe8\x48\xff\x35\x03\x5d\xb2\x0d\xdd\x72\xa9\xfc\xef\x07\x1c\xc9\x3f\xfe\x98\xf6\x20\x68\x53\x2e\x2d\x93\x3b\xb7\xb7\x97\x12\xcc\x30\xdd\xc0\xd5\x32\x93\xcb\xf3\x9c\xda\xef\x8f\xc5\x9b\x5d\xe2\x9c\x8a\x74\xae\x0d\x35\x65\x0b\x77\x5d\x1c\x03\xb8\x46\x7d\xb7\x31\xa6\xf6\xfe\xb8\xcf\xab\xda\xef\x12\x9a\x65\xf2\x51\x13\x2e\x2c\x9e\x2d\x09\x53\xa2\x99\x01\xce\x50\xbd\xd9\x71\xd3\x34\x1f\x23\x49\xc1\x98\x22\x8f\xdc\x6c\xec\x3f\x56\x52\xe5\x84\x92\x0d\x5f\x6f\xb2\x1d\xa1\x5b\xca\x33\xba\xcc\xd8\x3e\xff\xab\x58\x86\x61\xf9\xc1\x9c\x7b\x08\xa5\xf9\x27\xaa\x14\xdd\xb5\xf1\xb0\x02\x39\x64\x17\x44\xc0\xf5\x0a\xa8\x88\xaf\x38\x4b\x67\x40\x09\x85\x4c\xcf\x34\xf0\xb6\xb4\xcc\x2c\x0a\x12\x29\xb4\x51\x94\xdb\xc3\xb9\x07\xaa\x6f\x0b\xec\x23\x64\xca\x2e\x7a\xa6\x70\x30\x8d\xcb\xea\x9a\xb0\x9f\x55\x53\x6f\x4e\x43\x95\x19\xd3\x16\x9b\x7e\x96\xfb\x93\x19\x9a\x10\xfe\x9d\xad\x98\x52\x2c\xbd\x2c\x2d\x26\xef\x2a\xf0\xd7\x6b\x21\xab\x9f\xaf\x3e\xb3\xa4\x34\x7b\xd7\x4e\xef\xdc\xad\x5c\xe2\xe6\x09\xdb\x9e\x65\x6e\x18\xbb\xfb\xfe\x0f\x76\xc2\x70\x53\xd8\xf5\x1d\x12\x8d\x7f\xcc\x86\x1a\xa2\xa9\xe1\x7a\xb5\x83\x75\x56\x98\x60\x9f\x2d\x87\x04\x21\xb4\xde\x31\xb2\xdc\x39\xe6\x68\xaf\xf7\x59\x2f\xd8\x65\x69\x08\x37\xc0\x51\x93\x8d\x94\x9a\x11\x8a\x88\x86\xf1\xb6\x5c\xc2\xdd\x45\xa4\x60\x44\x2a\x92\xdb\x93\x8e\x7c\xa1\x17\x62\x63\x3a\x0b\xc0\x40\x0d\x8e\x6b\x92\x4b\x6d\x6a\x5c\xdb\x5f\xec\x5a\x2c\x78\x7b\x2a\x02\xab\x67\x64\x6d\x65\x2f\xa6\x0d\xd1\x65\x6e\x27\xf1\xc8\xf8\x7a\x63\xf4\x8c\xf0\x05\x5b\xc0\xf6\x33\x9a\x6c\x1a\xc3\xe5\x8c\x99\x7e\x84\xd2\x2c\xf3\x2c\xae\x49\x4b\xec\x1f\x25\x57\x2c\xb7\x17\x0e\x79\x59\xdd\x4e\xee\xc6\x98\xf9\xbf\x1f\x50\x49\xff\x30\x1d\xdb\x34\x23\xcc\x24\x8b\x57\x33\x92\xc8\xbc\x28\x8d\xc5\xb9\x5d\xd3\x72\x67\xcf\xb8\xa2\xee\x86\x54\xb2\x5c\x87\x31\xc2\x32\x37\x51\x2f\xc2\xc0\x66\x83\x2c\x61\x99\x92\x58\x93\x17\x88\xa4\x17\x5e\x12\xd1\x65\xde\x0b\x91\x23\x32\x00\x7f\x39\x35\xc9\xc6\x09\x4c\x89\x54\x8a\xe9\x42\x0a\x80\x08\x7f\xb9\xaa\xd7\xf2\x3f\x83\xc4\x60\x81\xbd\xd4\xaf\x1c\xcb\xdb\x30\x60\x76\x7e\x0f\xa9\x62\xf0\x5b\x9b\x26\xba\x0e\x2f\xe9\x67\x7f\xfe\x69\x33\x6f\x41\x58\x5e\x98\x5d\x83\xd2\x1a\x7b\x6c\x98\xca\xab\x15\x52\xd0\x93\xfa\x1e\xbc\x56\x35\xce\x9f\xe7\x56\x5f\xe0\xc6\x51\x1e\x79\x4d\x5e\x02\xe9\x71\x73\xa6\xe1\xd8\xcc\x65\xf1\x6a\x41\x2e\xbc\xf2\xd5\xf7\x0c\x4f\x4a\xc8\x6a\x64\x37\x84\x9d\xa8\x96\x01\xa0\xd5\xf8\xbd\xef\x0c\x71\xc0\xe6\xe4\x98\x48\x58\xe8\xad\x7d\x7c\x23\xd5\x68\x96\xb1\xc4\x58\x3e\xcc\x54\x3e\x23\x54\x6b\x99\x70\x2b\x52\x55\xfb\x1f\x04\x49\xf6\x48\x0d\xd1\xdc\xbf\xa0\xf8\x45\xd9\x67\x9f\x70\x87\xde\x3f\x58\xa2\xd5\xc4\xec\x49\x6b\x2f\xb5\xc9\x30\x06\x21\x12\x7b\xc6\xed\xf7\x67\x9a\x64\x74\xc9\xb2\x83\x7b\xf3\xf0\x19\xa0\xfb\xde\xe9\xf6\x4e\xd3\xc9\xe6\xee\x2f\x11\x80\xdd\xe5\x63\xe5\x34\xca\x85\x76\xfa\xc8\x8c\x50\xf2\xc0\x76\xa8\xba\x58\xed\xa8\xb0\xac\x0b\x2e\x61\x6a\xa2\xa0\x2a\x86\x97\x8b\xe5\x01\x0f\x6c\x07\x80\x9c\xae\x13\xf1\x7d\xfc\xce\xe3\xf3\xc0\x3a\x85\x8d\xae\xe7\xe0\x12\x87\xbd\x82\x39\x02\x26\x80\x93\x8e\xc1\x1f\x01\x95\xb5\xc8\x38\x03\x9d\x23\xf2\x9b\x80\x64\xd7\xfd\xf8\x2d\x38\x6a\x9d\x1f\x2b\x45\x0b\x37\xf6\x4c\xe3\x06\xd9\xb3\xb2\xe1\x45\xf4\x3a\x8d\xac\x45\x63\xaf\xb9\x7e\xa2\x19\x4f\xab\xe9\x69\xe0\xfc\xd7\xa2\x5f\x2a\xd9\x7f\x6e\xa4\xb9\x16\x33\x72\xf5\x99\x6b\x7b\xe1\x5f\x4a\xa6\x6f\xa4\x81\x7f\x2e\xc8\x5f\x0c\xd2\xe0\x0f\x03\xac\xa2\x31\xc5\xb1\x88\xc5\x75\x1c\x85\xd6\x0b\x81\x02\xb8\x45\x47\x53\x1f\xd6\x0b\x2b\x61\x0f\xb3\xc4\xfa\xa9\x0e\x18\xd7\x56\x43\x95\xca\xa3\x05\xac\x1a\x00\xb3\x43\xd6\x0f\x3d\x79\xa9\x41\xf1\x15\x52\xcc\xe1\xbe\xf4\x73\x6a\x8d\x85\x58\x8f\x9f\xa6\x6a\xed\xcf\xe1\xf4\xfc\xb0\xd1\x10\xfb\xa7\xf6\x17\x63\x87\xfb\xa1\x35\x48\xfc\x81\xac\x27\xb3\xa1\x5b\x10\xc2\xb8\x58\x67\x95\x58\x35\x23\x8f\x1b\x9e\x6c\x40\x6e\x8f\x06\xba\x64\x68\xda\x29\x14\xb3\xf7\x1e\x05\xeb\x96\xb3\x2a\x5a\x71\x98\x7b\x24\xf0\xf8\x89\x2a\x56\x64\x34\x61\x29\x49\x41\xe8\x44\xc3\x0a\x35\x6c\xcd\x13\x92\x33\xb5\x66\xa4\xb0\x77\x5b\x2c\xf5\x47\x5f\x28\xf8\x8c\x3e\x2c\xfd\x7a\x67\xf7\xe3\x45\xea\x98\x29\xcd\x2d\x67\x8a\x7a\xcf\x93\x49\xc4\xcb\x9d\x16\x94\xf0\xcb\x31\x6b\x03\x81\xc3\x59\x57\xbf\xb2\xac\x01\x7a\xc1\x24\x6b\x4c\xb2\x46\xef\x33\xc9\x1a\xfe\x99\x64\x8d\x49\xd6\x98\x64\x8d\x49\xd6\xf8\x2f\x24\x6b\x44\x02\x45\x7b\xca\x08\xb3\xce\x4f\x68\xe7\xda\xb7\xe3\x80\x60\xe3\xbd\x78\x2d\x93\xcd\xc0\x8a\xac\x98\x70\xe7\xee\xb2\x7b\x30\x11\x71\x01\x40\x14\x15\x6b\x46\xde\xcc\xdf\xbc\x7e\x1d\xa6\xac\x95\x54\x39\x35\xe0\xa7\xff\xfd\xef\x22\x70\x52\xfb\xf3\xbb\x9f\x61\x7a\x98\x37\x2c\x62\x81\x97\x10\xb7\xfd\xd6\xda\xe1\x1d\x1a\xda\xec\x3e\xcb\xf3\x13\xfc\x13\x8e\xcb\x55\x26\xea\x96\xf1\xfb\xc0\x95\xd0\xbb\x38\x67\x75\x56\x96\xb9\x1b\x92\x33\x43\xa8\x69\x99\x36\x79\xce\x2a\x0f\x12\xba\x41\xd0\xe3\xda\x0b\xd1\xfb\x46\x52\x22\x85\xb3\x5c\x5b\xda\x59\x44\xce\xb8\xdf\xdb\xd1\x74\x8a\x90\x84\x51\xcd\xac\x0c\xb1\x64\xd5\xac\x65\x6e\x67\xc9\x85\xf1\x0c\xd0\x4e\x99\x79\xac\xf6\x02\x7e\xc9\x16\xeb\x05\x49\x4b\x00\x47\x85\x73\x25\xbf\xc2\x55\xeb\x9d\x36\x2c\x07\x1f\x8b\x54\xf0\x3f\x76\xf9\x46\xed\x88\xe9\xb7\xe8\xb2\x2d\x13\xa6\xa4\x59\xb6\x23\x6c\xcb\x13\x53\xe1\x0f\xbc\xdd\xdc\xa0\x3f\xac\xef\xb4\xc4\x08\xac\xfb\xa7\x31\xc8\xa7\xf7\xc4\x37\x24\xc5\x45\xaf\xa6\x62\x2c\x3c\x70\xff\x84\x0f\xa9\x7d\x0d\x28\xe7\xc3\xc7\x7e\xcb\x3f\x89\xbb\x48\xf6\x75\x92\x32\xcb\x2c\xbe\xd1\x11\x70\x38\x3d\x6f\x6c\x1f\xe4\x59\xde\x14\x8f\xde\xac\x16\xc5\xa1\xff\x08\x3d\x19\x17\x37\x97\x16\x23\x43\x4b\x26\xe4\x5e\x16\x32\x93\xeb\x5d\x13\xf7\x70\xfa\xc1\xc1\xe0\x20\x53\xa2\xcb\xa5\x93\x6c\x87\x05\xb7\x9b\xbd\xad\x9c\x6c\xe6\x93\x1e\xdb\xf5\x4c\x7a\xec\xc1\x33\xe9\xb1\x91\x53\x9c\xf4\x58\x78\x26\x3d\x76\xd2\x63\x07\x9f\x49\x8f\xed\x78\x79\xb2\x99\x4f\xb2\x46\xe0\x99\x64\x8d\x83\x67\x92\x35\x26\x59\x63\x92\x35\x26\x59\x23\xf8\x4c\xb2\x46\xc7\xcb\x27\xb3\x99\x0f\x83\x1b\x42\xcf\xfc\xd0\xd0\x16\xb4\x00\xf7\x4e\x29\xf8\xe7\x42\xa6\x47\x84\xd4\x17\x32\x0d\x44\xd4\xa3\x51\x33\x91\xf3\x4c\x26\x98\xcd\xd6\x31\x29\x7b\x62\x2c\x18\x67\xc9\xd7\x34\x47\x5b\xed\x8c\xfc\x22\x05\xc3\x48\x67\x7b\xcc\xc0\xb2\x2a\xcd\x86\x29\xfb\xfa\x4b\xfd\xaa\x33\x52\x75\x8a\xd2\xef\x7c\xa6\x28\xfd\x29\x4a\xdf\x3d\xcd\x28\xfd\x0d\xd5\x48\x97\x78\x11\xf6\x07\xed\x37\xb8\x83\x65\x40\xff\x33\x38\xdf\xaf\x14\xb3\x6f\x89\xd0\x11\x0b\x64\x55\xd5\x1b\x8f\xeb\x4a\x9d\x3b\x92\xa5\xb7\xed\xd5\x04\xb8\x37\xea\x70\x30\x69\x9a\xa6\x2c\x25\x05\x53\x73\x24\x3d\x49\x56\x5c\xa4\x1d\x6b\xf1\xeb\xef\x05\x1b\x19\x47\xdf\x9e\xe4\x08\xd7\x45\xd3\xbb\xd2\x62\xd0\xfb\x51\xf5\x03\x77\x61\xb5\x7f\xcf\x19\x55\x0f\x9a\x97\xbf\xdc\xc6\xab\xec\xa0\xb7\xfd\xa3\x64\x6a\x47\xe4\x96\xa9\x5a\x33\xa9\x92\x51\x63\x94\x10\xb8\x7b\xb8\x26\x09\xd5\xc8\xa8\x87\x45\xad\x71\xda\xe9\x78\x3f\xc8\xc1\x62\xf7\x41\xa0\x96\xef\x6d\x16\x80\x88\x48\xe9\xad\xd3\xb4\xd1\xe1\x9c\xa2\x2a\x56\x84\x47\xd7\x55\xd4\xcb\xa3\x84\xd3\xce\xdd\xee\x31\x79\xc4\xab\x05\x0d\x37\xde\x80\xd9\x23\x1e\xe6\x9e\x79\xe4\x89\xa6\x0f\x72\x84\xf9\x83\x8c\x33\x81\x90\x7d\xf4\xda\x59\xba\x7b\xfa\xd0\x1a\x32\x02\x68\x83\xbe\xc6\x5b\x44\xc8\x71\xfa\xc8\x78\xcb\x08\xd9\x5f\x7e\xb5\x7d\xea\xc0\x4c\x32\x6a\xf1\x4d\x93\x4a\xbf\xa9\x64\x14\xc8\x03\xb3\x4a\xdb\x5c\x02\xb4\xd5\xb2\x98\x3c\x37\xb2\xc7\x59\x4b\xc8\x3e\xaa\x9d\xad\x80\x83\xea\xbc\x67\x3b\x19\x85\x98\xb6\x9d\xa5\xd7\x7e\x32\x0a\x66\x9f\x31\xa3\x6d\x43\x19\x0d\xf2\xd0\xde\x72\x60\x47\x39\xcd\x34\xdd\x14\x6b\x43\xc4\x28\xb0\x58\xc5\xe2\x94\xc6\x08\x32\xde\x20\x41\x8e\xa5\xcb\xb1\x86\x09\x32\xd2\x38\x41\x46\x18\x28\xc8\x58\x23\x05\x19\x6b\xa8\x20\xa3\xd7\x0b\x22\xc4\x0f\x10\x02\x11\xb7\xdc\x66\x2d\x9f\xb1\xb7\xd1\xe8\x1d\x3c\x94\x76\x70\xaa\x28\xe8\xe4\xb4\xb0\x5c\xe2\xff\xd8\xab\x19\x08\xff\x3f\x63\xef\x51\xca\x95\xb6\xa2\xb0\x33\xfe\x35\x20\x78\x9b\x43\x63\xb0\x48\xa0\x76\x36\x5c\x13\x4b\x3b\x5b\x9a\x59\x01\x04\xc3\xb6\x9c\xaa\x66\x67\xba\x2f\xaf\xc5\x9e\xef\xc7\x8d\x55\xcf\xed\xe5\x8b\x6a\x1e\xd7\xe4\xc5\x03\xdb\xbd\x98\x1d\xf0\x91\x17\xd7\xe2\x45\x2c\x54\xea\x54\x95\x16\xcf\xa8\x24\x1f\x29\xb2\x1d\x79\x01\x7f\x7b\x11\x7b\xb0\xbb\xc4\xc5\x31\x82\xe0\x11\x46\xb9\xa8\x97\x85\xaf\x3b\x34\xd6\x01\x58\x7f\x58\xd9\x57\xbc\x62\x5c\xff\x29\xc6\xda\xe8\x25\xa8\xbb\x43\x39\x88\xbc\xac\xd2\xc6\xd7\x16\xf3\xe6\x55\xbf\x2a\xdd\x58\x52\x2b\x12\x0d\x44\xfe\x9c\x51\xa1\xc9\x0b\x6f\x3d\x3b\xd3\xf5\x1c\x5f\x9c\xce\xe3\x38\xea\x0c\xc7\xf3\x22\xe3\x02\xd8\xfe\x16\x23\xae\xee\xe9\xf8\xce\x5a\xe8\x4a\x27\x2d\x59\x6d\x5e\x4c\xc9\x4b\xaf\xe9\xf6\xeb\xde\xf5\x23\x15\x44\x51\xb6\x3e\x17\x86\xcf\x2b\x18\xb5\xfe\x6b\x35\xc2\x58\xf6\xea\xc3\x9a\xdb\x14\xe0\x8d\x9b\x95\xdd\xae\xa6\xa8\x98\x13\xfc\xb8\x61\xaa\xb5\x52\xae\x5d\x49\x2a\xf0\x40\xa8\x52\x08\x3b\xae\x14\xce\xac\x17\x05\xd2\xb2\x19\xac\xac\xe4\xcc\x24\x28\xf6\xc3\xaa\x41\xf6\xaf\x77\x29\x32\xd4\x91\x78\x03\x26\x94\xbb\x72\x31\x93\x52\xb8\x43\x64\x7f\xf1\x96\x38\xc0\x0b\x4b\x63\x31\xcb\xab\x35\x2e\xc8\x15\x1c\x82\xe6\xe4\xb8\x86\x9d\x84\x02\x3b\x31\xdc\x27\x9a\xaa\xe3\x64\x83\x79\x73\x32\xa7\x70\x19\x8c\x0e\xb3\x7f\x3c\x71\x98\xfd\x9e\xe9\xe9\xbf\x48\x94\x7d\xa4\x51\x6f\x0a\xb5\x9f\x42\xed\x1b\xa1\xf6\xf0\x11\x72\xbe\xe1\x98\xfb\x7e\x9a\x81\x58\xfc\xd8\x98\x7b\xf2\xd3\x86\xc1\x89\x0a\x18\xd8\xec\x16\xe5\x65\x66\x78\x51\x3b\xac\x35\x4e\x2d\x43\xf5\x11\x03\x95\xf4\x9e\x75\x36\x94\x11\x40\x93\xcd\xfe\x31\x81\x71\xc0\xa1\xad\x81\x23\x3b\x37\x0b\xcd\x32\x17\x5b\x6f\xf5\xca\xfe\x3d\x62\xce\x57\xc5\x4f\x63\xc2\xbf\x74\x65\x16\x2b\xa3\x09\x38\x27\x5e\xda\xcb\x32\xb3\xe4\x60\xaf\x2c\xcf\xd5\x42\x3e\xd7\x83\xfb\x17\xad\x32\x5b\xe6\x1d\x24\x6b\xbe\x65\xa2\xbe\x84\x5f\xea\x57\xaf\x86\xc2\x9a\x4c\xa4\xe8\x71\x28\x58\x04\x80\x76\x89\x1c\xb3\xc8\xeb\x3e\x00\xb6\x12\x04\x22\xae\xf9\x3f\x35\x6e\xaf\x7f\x0d\xc0\xac\x9d\x43\xbd\x17\x3c\xa0\xa7\xba\xe2\xab\x0d\x0c\x00\xe5\xc3\xab\x89\xb3\x83\x8e\x70\x23\x1c\xe1\x42\x20\xbc\x9f\x9d\xe0\x33\xc6\x7d\xf0\xc5\xd2\x27\x22\x5c\x06\x63\xc2\xdc\x86\xdd\x05\xb1\xfa\xdf\xb1\x21\x8f\x41\x07\xc0\x14\xf3\x18\x7c\xe2\x8d\xfd\xff\x7c\xa1\x8f\x01\xe3\xfe\x37\x1a\x03\x79\xb4\x51\xff\x4b\x86\x3e\x86\x0c\xf9\x23\xbd\x5d\x64\xc8\x88\xff\xc4\x00\xc0\xa1\x20\xc8\x68\x98\x3d\xc6\xfb\x6e\x83\x7c\x34\xd4\x2e\xc3\x7d\xa7\x31\x3e\x1a\xe2\x14\x41\x38\xf8\xde\xd7\x8e\x20\x1c\x69\x90\x3f\xd6\x18\x3f\x6a\x77\xc6\x1a\xe1\x9d\x79\x3d\x62\x1a\x91\x06\xf8\x43\xd3\x7a\xcc\x12\x07\x8d\xef\xfb\x66\xf5\x38\xa3\x53\xc8\xf0\xde\x69\x52\x8f\x00\xdb\x6d\x74\x7f\x92\x38\x15\x4d\x9d\x91\x2f\xc6\x9a\xd0\xc7\x9b\xcf\x23\x62\x09\x46\x98\xce\xbd\x61\x7c\x00\xe2\x29\xcc\xe6\x51\x1c\x31\xfa\xa4\xc5\x71\x88\x68\x33\xf9\x73\x98\xc8\x47\x9a\xc7\x63\xd4\x72\xd2\xa9\x9a\x87\x4c\xe3\xa8\x09\x0f\x80\x8c\x37\x8b\x37\xb5\xe1\xa1\xe5\xc7\x9a\xc4\x9b\xfa\xf0\x90\x67\x2a\xca\x1c\x7e\x68\xec\x8e\xf7\xa6\x8c\x32\x85\x47\x51\x6b\x8c\xe5\x35\xc6\xfc\xfd\x64\xa3\xea\x60\xf0\xba\x30\xfc\xd8\x00\xf6\x26\x5d\xf7\x44\xb1\x77\xce\x99\x6e\x25\x4f\x49\x51\x1a\x17\xca\x3b\x3a\x92\xbd\x13\xea\xaf\x2a\xba\xbd\x85\xfa\x60\x88\x7b\xd8\xa4\x3d\x3b\x22\xc4\xbd\x17\xa2\x3b\x96\x47\x84\xb8\xf7\x83\x74\xa1\xef\x47\x85\xb8\xf7\x42\x85\xd0\xf7\xe3\x42\xdc\x07\x4f\xfc\x3e\x09\xf5\xef\x95\x8f\x73\xef\x05\x39\x1c\xff\x1e\x88\x73\xef\xb7\x90\x07\xe3\xdf\x03\x71\xee\xfd\xe8\x8c\x8e\x7f\x3f\x88\x73\x0f\x90\xfc\x14\xff\xbe\xf7\x4c\xf1\xef\x8d\x67\x8a\x7f\x8f\x5c\xec\x14\xff\x3e\xc5\xbf\x0f\x3d\x53\xfc\xfb\x14\xff\x3e\xc5\xbf\x4f\xf1\xef\x53\xfc\xfb\x14\xff\xde\xf1\x4c\xf1\xef\x53\xfc\xfb\x14\xff\xde\x78\xa6\xf8\xf7\x81\xa5\x4c\xf1\xef\x53\xfc\xfb\x14\xff\x3e\xc5\xbf\x4f\xf1\xef\x1d\xaf\x7c\x95\xf8\xf7\x96\x11\xba\x37\x08\x3e\x60\x8e\xad\xeb\xa7\x8c\x0c\x82\xef\x85\xb9\x64\xc3\x41\xf0\xbd\xd3\xee\x85\xda\x53\xe3\x27\x2a\x12\xbe\xdf\xf4\xda\x8c\x90\x1f\x15\x09\x1f\x30\x9a\x77\x54\xa5\x7f\x62\xf5\x79\xd2\x88\x90\x3f\x36\x12\xbe\x9f\x04\xe4\x14\x09\x3f\x45\xc2\x4f\x91\xf0\x53\x24\xfc\x14\x09\x8f\xcf\x14\x09\x3f\x45\xc2\x4f\x91\xf0\x53\x24\xfc\x14\x09\x7f\xf0\x4c\x91\xf0\x9d\xd3\x9d\x22\xe1\xa7\x48\xf8\x29\x12\xbe\x7e\xa6\x48\xf8\xf6\x33\x45\xc2\x4f\x91\xf0\x81\x67\x8a\x84\x7f\x9e\x48\xf8\xde\x3f\x2d\xa9\x66\xd7\x39\x5d\xb3\xfd\xd9\xb7\x0e\xcc\x9f\xad\xd6\xce\xed\x6b\x55\x94\x73\xa9\x59\x6a\x59\x4e\xca\x8a\x4c\xee\x60\x5b\x66\x40\x05\xb2\x34\xc4\xd0\x83\xc0\xf8\x5e\x54\x26\x52\xac\xf8\xfa\x3d\x2d\x0e\x78\x47\x6b\x0a\xef\xaa\xd7\xda\x2a\x7a\xf3\xf7\x66\x78\xbd\x3f\x21\x07\x78\xa2\xa8\xd3\x5d\x64\x4c\x99\x9c\x0a\xba\x66\xca\x21\xc6\xb7\x7d\xd0\x1b\x9a\x65\x60\x45\x95\xa5\x80\x33\xe3\x4d\xb7\xcd\x8f\x0e\x00\xdf\xca\xd4\xe9\xfc\x8d\x39\x81\x8d\xb2\x09\xe6\x9c\x99\xe4\x9c\x36\xe0\x9c\x23\x02\x72\x5a\xe8\xf3\x3f\x55\xff\x3d\xb7\x0b\xf8\xd7\x7d\x24\xf6\xb0\xd8\x00\x99\xf6\x51\x0c\x0e\x74\xc7\x12\xc5\x0e\x1c\x2a\x1d\x78\xc7\x17\xbd\x3e\x6c\xe7\x06\xe7\x99\xfc\xad\x5c\x32\x25\x98\xd5\xe6\xfd\x2b\xa2\xf3\x02\x6b\x6f\x4a\xc4\x26\x54\x32\x00\xce\xb4\x54\xb4\xb3\x76\xcb\x0a\x0c\x0f\x5c\xb7\x41\xd9\xbb\x8f\x8a\x84\x2d\xc8\x25\x5b\xd1\x32\x33\x70\x3b\x9e\x35\xd1\x3e\xff\x53\xeb\x5f\x80\xee\xb3\x03\xf0\x90\xe3\x50\xad\x3d\x6a\x23\xc7\x10\xbe\x5d\x21\x53\x83\x84\xef\x5e\x43\x9e\x65\xe9\xdc\x22\x0a\x74\x9d\x4a\xde\x6d\x40\x43\x05\xe9\x60\x29\x76\xfe\x8c\xba\x80\x0c\x0b\xc8\xc7\xc8\x5b\xc5\xb4\x34\x1b\x26\x0c\x4f\x00\xc9\xa4\x50\xf2\xf3\xce\x49\x8c\x41\x92\x2f\xe4\x01\x03\xed\x21\xd1\x3d\x2b\x95\x93\x73\x41\x74\x71\x83\x56\x0b\x40\x16\xb3\x93\x25\x79\x74\xd3\x55\xa5\x00\xd6\xd2\x69\x62\xa4\x5d\xb3\x18\x32\x13\x51\xb5\xee\x11\x55\x5a\x13\x3d\xbb\x50\xeb\x12\x65\x4d\xc7\x01\x98\x30\x6a\x07\x1e\x15\x3c\xea\xa9\x4c\x1e\x2c\xc1\x59\xde\x78\xd6\x1b\x11\xf9\xee\xfd\x65\xc5\x33\xb9\xcb\x61\x70\xf7\x50\xa1\xe4\x96\xa7\x2c\x5d\x90\x4f\x54\x71\xba\xcc\xac\x8c\xeb\xba\x42\x6b\xf2\xdb\x97\x9f\x2e\x3e\xfe\x7c\x73\xf1\xfe\xaa\x4f\x18\xb1\x0c\x86\x7d\x2e\xa8\x48\x59\x4a\x4a\x5d\x7b\x35\x1d\x36\xcf\xce\x34\x61\x62\xcb\x95\x14\x76\x21\xa0\xd8\x53\xb2\x75\x63\xf5\x00\x4d\xa8\xc0\xe2\x4e\x60\xe0\xcd\xb6\x2c\x45\x09\xbf\x9a\x99\xe7\xb5\x5c\x14\xa5\xf1\xe6\x0c\xf0\x87\xf5\x16\x84\x2a\x45\xb2\xa1\x62\xed\x3a\xd9\x36\x57\x46\xf4\x4e\x18\xfa\xd9\x8e\x0a\x5a\xbe\x4e\x68\xe1\x5d\xb5\x94\xa4\xb2\xec\x9f\xe8\x6f\x7f\x3b\x23\x9c\xbd\x25\xbf\x6d\x80\x5b\x90\x2b\x07\xa1\x81\x48\xf4\xd5\xb1\x2d\x53\x30\x84\x43\x58\x9f\xe5\x49\xb1\x35\x55\x69\xc6\x34\xf8\x90\x1e\x37\x0c\xba\x8b\xa0\x26\xe3\x36\x89\x55\x46\x0e\x21\xcd\x82\xbc\xf3\x18\xeb\x5b\x3d\x38\xce\xd2\x05\x79\x2f\xc1\x9b\xb4\x92\x6f\xc9\xc6\x98\x42\xbf\x3d\x3f\x7f\xa8\x98\xe8\x82\xcb\xf3\x54\x26\xfa\xdc\x50\xfd\xa0\xcf\xf1\xa0\xcf\x53\x6a\xe8\xbc\x71\x54\xce\x51\x80\x9b\x27\x32\xcf\xa9\x48\xe7\xd4\x11\xe9\xbc\xda\xf4\xf3\xef\x9c\x78\x34\xa7\xd5\x5b\x5c\xcc\xe9\x5c\x6f\x58\x96\x1d\xb2\x39\x32\x24\xbe\x0f\x0a\x42\x61\xc9\xc4\xcd\x21\xe6\xc4\x5d\x55\x07\x0c\xa1\x2d\xc8\x8d\x34\xce\x35\xe9\x88\x82\x5b\x61\x15\x56\x12\x6a\x8a\xbc\x77\x32\xc9\xd5\xcd\xfd\xc7\xbf\xdf\x7e\xb8\xbe\xb9\x1f\x3c\x8a\x3d\x10\x07\x0e\x68\xcc\x51\xec\x81\xdc\x7f\x40\x87\x8f\x62\x9f\x4f\xb1\xff\x80\x0e\x1f\xc5\x7e\xb6\xd0\x7b\x40\xa3\x8f\x62\x0f\xec\x9e\x03\x1a\x7f\x14\x7b\xe0\x1e\x1c\xd0\x5f\xf9\x51\x64\x62\x1b\x71\x0c\x7f\x70\xd2\x75\x83\x30\x2b\x7c\xc3\x5d\xa8\x2b\x51\xaf\xa6\xef\xbe\x73\x73\x88\xfa\xf1\xab\x6e\xcd\xee\x4a\x6c\x3f\xd1\xb6\xa7\x42\x74\x4e\x95\xb8\x17\x7a\x75\x2e\x60\x25\xef\x86\x16\x10\xd5\xf3\x9e\xe6\x07\x3a\x54\xef\x02\x6e\x9c\x00\x8d\x12\xc5\xe1\xbc\x17\xe4\xbd\xb3\xc8\x87\xad\xd9\xef\x7e\xbe\xbe\xbc\xba\xb9\xbf\xfe\xfe\xfa\xea\x63\x48\x93\x8d\xd2\x63\x41\xe7\x8f\x5e\xc2\xd9\x18\x6e\x18\x5c\x44\xcd\x29\x0b\xc5\xb6\x5c\x96\xb5\x85\xa2\x9b\xfc\x7a\x54\x8c\xe6\x53\x0b\x93\xe8\xa5\xdc\x11\xcd\xd4\x96\x27\xdd\xe8\xc6\x4c\x89\x30\xaa\xe3\x19\x72\x8b\xf5\x06\x61\x8e\x65\xcb\x8e\x01\x07\x61\x3e\x0b\x73\xc6\xe7\x78\x16\x1d\x9e\x71\x5b\x92\x6a\x6a\x6c\x2f\x5e\x2c\xba\x39\x24\x3e\xf1\x64\xfd\xbd\x92\xc1\x44\xd1\x16\x69\xdf\x61\x42\x34\xaa\x96\xdd\x14\x73\xe6\xbc\xe1\x61\xf3\x51\x83\xf1\x39\x71\x03\xa3\x4c\x9c\xbc\x81\xee\xac\x00\x84\x58\x57\x77\x65\x42\xf9\x1b\xdb\x7d\x64\xab\x21\x1b\x6c\x7b\xb1\x60\x58\x73\xbe\x5e\x54\xea\x2b\xf3\xc5\x90\x59\x7d\x8c\x2b\x3e\xd2\x0d\x7f\x90\xb8\x8c\x36\x45\x67\xff\x8b\x71\xa2\x8c\xf2\xe5\x0c\x71\xed\xce\x69\x9d\x35\xd9\xb7\x3b\x3b\x26\x56\x9c\x48\xa4\x48\x58\x61\xf4\xb9\xdc\x5a\x8e\xc4\x1e\xcf\x1f\xa5\x7a\xb0\xf2\x81\x3d\xb1\x73\x34\x82\xe8\x73\x30\x95\x9c\x7f\x07\xff\x13\xe5\x2f\xbc\xff\x70\xf9\xe1\x2d\xb9\x48\x53\xd7\x0a\xb1\xd4\x6c\x55\x66\xbe\xd7\x34\xa1\x05\xff\xc4\x94\xe6\x52\xcc\xc8\x03\x17\x81\x8e\x80\xcd\xa7\xe4\xe9\xff\x0a\x1d\x40\xff\x8c\xc2\xb9\x2c\xd0\x64\x31\x1a\xef\x77\x60\xff\xde\xb5\x38\x4c\x45\xab\x96\x7f\xf0\xc8\x66\xb5\x96\xa6\xbc\xcb\xdb\x5d\x35\xd1\x8b\x5c\x4a\x99\x31\x3a\x14\xeb\x14\xeb\x8d\x8d\xf1\xc4\x46\xbb\xae\x60\xaf\xc7\x9e\xff\xb3\x9a\x01\x60\x18\xa9\xa3\xeb\x42\xa6\x6f\x89\x2e\x8b\x42\x2a\xa3\x49\xce\x0c\xb5\xb2\xef\xc2\x12\xe4\x30\xed\xb4\x5e\x07\x8b\xdf\xac\xfe\x0d\x1c\x06\xba\xf1\x03\x70\x49\x0c\x30\x19\x06\xad\x0b\x96\x2c\x84\x4c\x99\x3d\x84\x33\xfc\xa7\xbb\xdb\x2f\x92\x44\x96\xc2\xb8\x3f\x18\x6a\x4a\xbd\xd8\x48\x6d\xae\x6f\x23\xc0\xe2\xeb\x85\x4c\xaf\x6f\x67\xad\x7f\xe9\xe0\x15\x44\x46\xb2\xc1\xfa\x1c\x8e\x26\x7f\xf7\x5d\xb3\xa2\x47\x4e\xe1\x3f\xa1\xad\xfd\x2d\x0d\x14\x9b\x68\x3e\x5c\x93\x47\xc5\x8d\x61\x02\x24\x15\x08\x61\x95\xab\x99\x3d\x09\xf5\xc5\xbb\x7d\x13\x95\xef\x34\xea\xe0\xaf\xfc\x34\x47\x2f\xdd\x7e\xe4\xd7\x8d\x54\x5a\x5d\x09\x31\xd2\xa0\x7f\x6a\x07\xda\xc5\xed\x35\xd9\x22\x3e\x4f\xbc\xcc\xf8\x93\xbf\x8a\xdc\xb5\xe8\xf3\xef\x83\x31\xbf\x7f\x22\x1f\xa8\x4a\xc2\x38\x8c\x57\xc2\xf4\x5b\x70\xc8\x0f\xe2\xab\x0a\x0a\x25\x19\xcf\xb9\x0b\xd4\x72\xe5\x65\x34\x79\x89\x3f\x2e\x92\xa2\x9c\xb9\x17\x16\x39\xcb\xa5\xda\x0d\x9f\x52\xf7\x3a\x2b\x36\x2c\x67\x8a\x66\x73\x6d\xa4\xa2\x6b\x36\xab\xc0\x23\xd8\xea\x5f\x08\x78\xf8\x54\x36\x26\x78\x08\x1d\x75\x99\xa4\x54\xf6\x9e\xcf\x76\x9e\x2b\xb2\xf4\xa4\x9c\xa1\xc2\xf2\xcd\x51\x32\x49\xa5\xc4\xa2\x4c\x53\xd1\x21\x88\xb1\x5b\x99\x95\x79\x5c\x46\x55\x7d\x3f\x63\xbd\x21\xb1\xb5\x42\xaf\x3e\xb9\x14\x90\xf2\x2d\xd7\x71\xb1\x8a\x1d\x42\x00\x77\xe1\xa3\xb2\x34\x45\x69\x5c\x5a\xcd\x50\x67\xe2\xe6\xc3\x3e\x17\x52\x83\xea\x53\x05\x30\xb7\xf8\xdf\x9b\xe1\x64\xc1\x91\x0b\xf6\x23\x8d\xdf\x5a\x5f\xb6\xe6\x6d\x7d\x32\x2b\xf6\x77\xe2\x7d\x89\xe7\x5e\x7e\x2a\xa7\x62\x5e\xe8\x65\x3b\x8d\x02\xa3\x9b\xae\x48\x0c\x62\x89\xd2\x04\xba\x1d\xc6\xed\xe7\x4b\xe9\x3c\x55\xdc\x03\x2c\xa5\xbe\xee\x56\x4a\xe6\x0b\x02\xf6\xa1\x28\x42\x5f\x32\xb0\x26\x67\x3c\xf5\xb0\x1e\x58\x50\xe9\xf4\xcf\xa4\x47\xfd\x9a\xf4\x28\xe7\xbd\x47\x25\x2a\xba\x92\xc3\x3f\x9d\x12\x15\xf1\xda\xd0\xac\xe6\x70\x18\x82\xc6\xfb\x00\xfc\x41\xe3\x7d\xbf\x25\xab\xd3\x80\xef\x25\x31\x23\x49\x21\x8b\x32\xa3\xa6\xc7\x04\x1a\x76\x23\xd5\x36\x7e\xcf\xa0\x6a\x23\x6d\xed\x92\xc3\xbb\x29\x1f\x30\x5d\xb7\x8c\xd6\xe4\x22\xcb\x08\x17\xc8\xa0\x00\xac\xb7\x86\x2a\x86\x42\x16\xa1\x68\xde\xdf\xf6\xdb\xf1\x1f\x5d\x4e\x60\xc3\xec\xcb\xb5\x55\xe2\x94\x81\x10\x31\xc8\x19\xc4\xfb\xc1\x19\x1b\xb9\xa8\x32\x07\x7b\x60\x56\x62\x41\x15\xbf\x7a\x90\x46\x8c\xd1\x6f\xda\xf8\x85\xc3\xcc\x0d\x7d\xe8\x03\x59\x28\x96\xb0\x94\x41\x5c\xca\x27\x8c\x88\xf5\x38\x5c\xee\xec\x1a\xaf\xc4\xb6\xb2\xdb\x96\xe8\x63\xc2\xcb\xc0\x42\xee\xa3\x28\xfa\xc0\x5a\x90\x9f\xc3\xdb\x62\x89\xee\xce\x97\x89\xac\x9c\x2e\x70\x3f\x55\x9a\x82\x4f\xf6\xe8\x3d\x5d\x75\x54\xd4\x13\xdc\x2c\x95\xa9\x73\x40\x4c\x38\xb8\x53\x6b\x43\x51\xfb\x2e\x3d\x81\xf9\x35\xe6\xf2\xfb\xb6\x2f\xbe\xb1\x97\x5e\xd4\x85\x16\x7d\x99\xc5\x5e\x64\x23\x8c\x81\xe3\x2e\xa6\xd8\x4b\x29\xea\x12\x29\x14\x5b\xf1\xcf\xd1\xb4\x79\x21\x6a\x85\x8b\xa7\x4c\x18\xab\xdc\x40\x09\xdd\x42\xb1\x82\x89\xb4\x4a\x4b\x1e\xba\xe4\x1c\xab\xae\xad\xf7\xb5\x13\xf1\xb4\x8e\x42\x94\x23\xc7\x1e\xc0\xbb\x2e\x49\x76\x3a\x7d\xff\x3c\xa7\xcf\x6d\xf0\x57\x3b\x7a\x4f\x94\xad\x78\x57\x14\x74\xc7\xd2\xcf\x2e\x1b\x81\x45\x40\x7d\xa3\x69\xa7\x8e\xd5\x3c\x07\x28\x7d\x24\x72\x5f\x17\x77\xe0\xba\x66\x13\x55\x00\x27\x94\x0f\x56\x24\x63\x5b\x96\xb9\x9b\x91\x60\xa8\x66\xde\x2f\x2c\x41\xcc\x36\x58\x3a\xac\xb4\x6f\xc9\x58\xf1\xb4\x25\x3a\xc1\x94\x2c\x3b\xb1\xa4\x9d\x49\x9a\xc2\x1f\x95\xcc\x32\xa6\xfa\xa6\x9a\xf1\x07\x46\x2e\x21\x16\xdc\xe5\xe6\x88\x94\xdc\x19\x6a\x2c\x29\xdf\x31\xd3\x67\x45\x1f\x20\x53\x98\xcb\x6d\x99\x65\xb7\x32\xe3\x49\x8f\x36\xdd\xde\x1e\x88\x66\x27\x45\x99\x65\xa4\x80\x8f\x16\xe4\x83\x80\xf3\x7e\x91\x3d\xd2\x9d\x9e\x91\x1b\xb6\x65\x6a\x46\xae\x57\x37\xd2\xdc\xa2\x30\xd3\xc7\x13\x9b\xce\x68\xfc\x9c\xf0\x15\x79\x9b\x61\x95\x6e\x43\xd7\x20\x68\x7a\xb3\xf2\xcc\x62\xb4\x09\xb6\x07\x2a\x1c\xf3\x47\xae\x3b\xa5\xb5\x27\x13\xd3\x77\x00\xc9\xb2\x24\xfc\xf7\x51\x88\xcf\xf8\x8a\x25\xbb\x24\x8b\x39\x11\x17\x09\xf8\x6e\xea\xe4\xe8\x9a\x06\x7d\xb7\x4c\x97\x68\x03\xc2\x6a\x6f\xa1\x00\x2c\xd1\x81\x35\x4c\x6a\x72\xac\x66\x82\x2a\x80\x8e\x96\x70\x87\x2f\x90\x42\x6a\x73\x67\xb5\x84\xc8\xda\x1b\x67\xb7\xfe\x03\x02\xa5\x0c\xb2\x8c\xa5\x84\xe7\x39\x4b\xad\x56\x90\xed\x08\x5d\x19\xa8\x8e\x50\xcd\x3e\xc0\xd1\x2c\x04\x28\xf7\x9e\x56\xc9\xb6\x1b\x2a\xd2\x8c\x29\xb2\xa2\x3c\x73\x9a\x47\x4b\xa3\x31\x4c\xe5\x5c\x0c\xd4\xcb\x40\x5b\x36\x28\x3f\x56\x79\x4a\x12\xa9\x5c\xff\x4f\x50\xed\xdd\x9f\xea\xb3\x01\xfc\x7b\x90\x6b\x90\x3a\xe1\xa7\x9e\xd2\x32\x93\xc9\x83\x26\xa5\x30\x3c\xc3\x05\x48\xf9\x00\x45\xdd\x33\xa0\xd5\x06\x29\x07\xc0\x8e\x24\xf2\xea\x3f\xe7\x15\x65\xcc\xed\xb8\xfa\xfc\xbb\xfa\x4f\xf0\x43\xff\x15\x19\x27\x5b\xb0\xcf\x2c\x19\x91\x55\x66\xb9\x8c\x45\x3e\x24\x2d\x4a\x51\x89\x18\x2b\x69\x99\xb5\xdd\x02\x3c\x05\x03\x37\xe2\xb2\x91\xe8\xb5\x20\x57\x9f\x59\xd2\x48\x16\x84\x92\x41\x70\xdc\x20\x20\x9d\x3e\x0c\x44\xa0\xc4\x5b\x2b\x83\x21\xba\xbd\x6b\x7e\x87\x5f\xf9\xc4\x10\x07\x84\x64\x5c\xc0\x29\x76\x61\xbb\x11\x76\x21\x2e\x34\x4f\x59\x9b\xbe\xf0\x04\x38\xf9\x8a\xa4\x5c\x41\x36\xdc\x8e\xac\xe2\xf2\x91\x1b\xf3\x81\x84\x31\x29\x0d\x79\x79\x76\x7e\xf6\xea\xc0\xa8\x71\x66\x6f\xd9\x8c\x21\xaf\x8a\xb1\x8d\xde\x37\x60\xdb\x0b\x80\xe7\x45\xb6\x83\xd5\x9e\xa5\x33\xc2\x8d\x8f\xf0\x51\xa5\x70\x2b\x8b\x00\xea\x62\x9a\x67\x44\x4b\x62\x14\xad\x32\x3b\xe0\x57\x48\x69\x51\xa5\xe3\xb4\x2f\xcf\xfe\xe3\x2c\xc6\xf2\xc8\x4c\xf2\x8a\x3c\x4a\x71\x66\x00\x8d\x0b\x72\x2f\xad\x74\x59\x0f\xb5\x93\x25\x11\x0c\x33\xb9\xd8\xe7\x22\xe3\x09\x37\x11\x1e\x3e\x02\xcc\x8f\x40\xaa\x97\x74\xcd\x3b\x30\x1e\xfb\xea\x33\x37\xce\x7d\x6e\xe9\xff\x35\x50\x06\xb2\xb9\x18\x14\x68\x92\xf1\x2d\x3b\xdf\x30\x9a\x99\x0d\x56\x06\x11\x52\xcc\x7f\x61\x4a\x42\xd4\xb6\x70\x7f\x39\x61\xfd\x94\x67\x29\xe5\x18\x69\x6e\xb4\xac\xef\x2f\x87\x09\x58\xed\xa7\x75\xe0\xfe\x7a\x7f\x7f\xfb\x17\x66\xf6\x58\x82\x85\xe3\x1d\x98\xa0\x3a\x32\xb5\x92\x6a\x80\x94\xe3\x79\xc3\x46\xea\x81\x39\x1e\xce\x53\x6a\x83\x79\x62\x78\x99\x0b\xab\xf1\x19\xd9\xf2\xb2\x45\x1e\xe2\x42\xa6\xe4\xfa\x76\x41\xfe\x2e\x4b\x3b\xe7\x25\x5d\x66\xbb\x2a\x35\x48\x33\x43\x5e\xd8\xc1\x5e\xd8\x53\x6d\xf1\xf0\x57\x46\xd3\x7e\x39\xb5\xf9\xd8\x23\xc5\xe8\x29\xeb\x22\x92\xe6\x0c\xc6\xb2\xd2\x52\x1b\x99\x93\x0d\x7e\xbc\x17\x63\xed\xf6\x36\x86\x37\x59\x0a\xf1\x99\x62\x8a\x15\x70\xf4\x3c\xd4\xe7\x2a\x3b\x64\xc7\xc4\x55\xbb\xdf\x97\x50\xa1\x2c\x69\x2e\x29\xca\xa1\x80\xd5\xeb\x30\x5a\x52\xe0\x52\xec\x96\x47\xf9\x6e\xc6\x16\x06\x8a\xf5\x59\x91\x2e\x6b\x06\xae\xc9\x29\x67\x01\x83\xff\xfe\x73\x5c\xed\x99\xd3\x4c\x33\x26\xa9\xfb\xc8\x79\x8e\xab\x3e\x12\x89\xaf\x79\xf4\x8c\x9f\xa9\xf6\x48\x11\x15\xab\x74\x18\xa9\x64\x15\xf4\x24\x81\x78\x68\x3c\xbe\x40\xc8\x9a\xa9\x6d\x7f\x8e\xc1\xfe\xfc\xa2\x50\x5f\xc8\x90\xee\xe2\x1f\x2a\x76\x1f\x06\x7d\xea\x90\xa5\x1e\x55\x73\x74\xff\xfd\x63\xca\xa6\xa0\x09\x4e\x11\x51\xe6\x4b\xa6\xea\x98\x43\x65\x6a\xe4\x45\xec\xbb\x3c\xf0\x4e\xdd\x20\x40\x6f\x84\x6a\xd7\x67\x8d\xa1\x24\x49\xfe\xf8\xdf\xfe\xdb\xef\xff\xdb\x02\xa7\x58\xf9\xb2\x04\xb9\xbe\xb8\xb9\xf8\xf9\xee\xd3\x3b\x08\x9e\x1f\xde\xc5\xcf\xf3\x5a\x9f\x99\x73\x61\xe6\x52\xcd\x11\x53\x6f\x89\x51\x83\x54\x0d\xd1\x7d\x11\xe7\xbe\x6d\x95\x83\x8f\xec\x1a\xac\x90\xb7\x92\xca\xdf\xbc\x4e\xff\x43\x15\x2d\xee\x1a\x69\x5a\x3e\x2c\xf9\x7e\x85\xea\xc1\x96\x1c\x4e\x21\x65\x99\xa4\xb8\x93\xc9\xc3\x28\x39\xeb\xec\xfe\xdd\x2d\x7e\xd4\x10\xb5\xa8\xf0\xca\x17\x17\x5b\x99\x6d\x87\xc9\x9e\x92\xfb\x77\xb7\xb0\x90\x05\xfc\x17\xe8\xa5\xa0\x1a\xec\x2c\x64\x1f\x48\xe6\x4c\xc0\x56\x8d\x18\x52\xc2\x11\xaa\x62\x34\xe3\xda\xf0\x04\xa0\xd6\x26\x12\x0b\x3f\x6c\x19\x7e\x56\xa9\xef\xec\x83\x37\x26\x0f\x0b\x80\x71\x87\xb1\x21\x00\x0e\x07\x50\xfc\x2a\x38\xa7\xe3\x98\xaa\xaa\xc2\x30\x71\xce\xc6\xf3\x65\x79\x4b\xc4\x4b\x85\x62\x77\x46\x16\xd1\x16\x46\x7c\xbd\xc7\xbe\xb8\x64\x2b\xa9\x58\xbc\x81\xb1\x36\x18\x56\xc5\x9c\x05\xc4\x3e\x7b\x5d\x51\x36\x4d\x7f\xc1\x18\x0b\xfb\xe8\x32\xd9\x78\x1d\x5d\x30\xad\xcf\xc1\x94\x58\x16\x28\xa3\x83\xd9\xb2\x54\x6c\x66\xd7\xcc\x72\x58\xd1\x2c\x26\x4e\xd0\x2e\x86\x09\x7c\x1d\x5a\xa1\xde\x37\x6c\xa1\xce\x92\xe2\x91\xb1\x67\x82\x0c\x41\x55\x54\x6f\x18\xe4\x95\xb1\xcf\xbc\x2e\xc7\x4a\xb5\x14\x98\xdb\xe5\x90\x03\xfc\x5c\x93\x82\x6a\x2c\x69\x13\xba\x49\xea\x89\x21\xb8\x5b\x99\x9e\x9d\xe9\x16\xa8\xb5\xa2\x09\xb3\x1a\x38\x97\x29\x81\x84\x84\x54\x3e\x86\x5c\x5b\x4b\xb6\xe6\x42\xfb\xbd\xb5\x43\x78\x22\xb0\xdc\x1c\x4b\x36\xf9\xfc\xf7\x05\xf9\x58\x25\xdb\x0d\x5b\x6a\x65\x69\x12\x59\x33\x09\x37\xf3\x7d\xc3\x32\x84\xad\xd4\x65\xb9\x43\xcb\xf7\xe4\xe4\x63\x7e\xcc\x30\x0a\x9c\x85\x39\x00\xb5\x41\x80\x63\x2d\xcc\x21\x14\xa8\xc6\x57\xbd\xfb\x03\xf5\x23\x69\xb2\x69\xfb\x5d\x26\x63\xf5\x64\xac\x0e\x3d\x93\xb1\x7a\x32\x56\x4f\xc6\xea\xce\x67\x32\x56\x4f\xc6\xea\xc9\x58\x3d\xfc\xed\x64\xac\x9e\x8c\xd5\x93\xb1\xba\xe3\xf9\x16\x4d\x2e\x93\xb1\x3a\xfc\xf9\x64\xac\x9e\x8c\xd5\x01\xa8\x93\xb1\xba\xf3\xfd\x5f\x03\xe7\x9c\x8c\xd5\xa1\x8f\xbf\x31\x63\xf5\xc0\x0b\xde\xea\x7b\x6b\x65\xdc\x98\x48\xec\x5b\xb0\xb1\xf1\xc4\x99\x87\xe5\xaa\x15\xd5\x8b\xc0\x16\x75\xf5\xbd\x9e\x89\xd7\xf9\x80\x3e\xa6\xd5\x19\x81\x6b\xa3\x73\x67\x4c\x30\xd8\xf3\x7a\x60\xc6\x47\x57\xfb\x10\x78\x7d\x5e\x48\xfc\x7f\xb5\x25\xaf\x61\xc2\x43\xb9\xbf\xfb\xd0\x0f\x33\xb1\xb0\xed\xee\x28\xbb\x5d\xdb\x32\x17\x20\x9e\x27\xd8\xec\xe2\xb8\x73\x94\xad\xee\x08\x3b\x5d\x9c\xad\x2a\xd6\x46\xb7\x6f\x81\x1b\x00\x1b\x6d\x9f\x6b\x5a\xdf\x06\x60\xc6\xd9\xe6\xfa\x2c\x6f\x43\x22\x5a\x8f\x5d\x6e\xd0\xea\x36\x00\xb7\xdb\x26\x17\xb4\xb8\x0d\xcd\xb4\xd3\x1e\x17\xb4\xb6\x0d\x23\x36\xd2\x16\xf7\xe5\x5b\x98\x44\x70\x6e\xe7\x56\xbb\xdf\x28\xa6\x37\x32\x0b\x9c\xa4\xd6\x29\x7a\xcf\x05\xcf\xcb\xdc\x12\xa6\x86\xbe\xae\xdb\xca\x43\xa7\x2b\x8a\x47\x1e\x1a\xb4\x6e\x41\x73\x14\x20\x3d\xa8\x26\x43\x79\x66\x77\x03\x12\x1d\x36\x74\x0b\x1c\xa7\x4c\x12\xc6\xa0\x86\xf9\x65\x94\xc1\xec\xf7\x8b\x6a\x76\x55\x41\xc4\x37\xfd\x3b\x13\xd7\x34\x39\x46\xaa\x19\x34\x61\x3e\x87\xf9\x32\x8e\x4d\x0e\x0b\xb0\xa3\x4d\x96\x11\xc5\x70\x9e\xc5\x5c\x19\x65\xaa\x8c\x3c\x45\xd1\x26\xca\xf1\xe6\x49\xd8\xdf\x21\xe5\xe5\x18\xd3\x64\x14\x17\x19\x6d\x92\x8c\xb1\x41\x1f\x65\x8e\x1c\x63\x8a\x3c\xaa\xce\xcb\xb1\x26\xc8\x51\x7a\x47\xb4\xe9\xf1\x34\x66\xc7\x67\xa9\xa9\x14\x81\x97\x38\x33\xe3\xc8\x6e\x67\x43\xe6\xc5\x61\xd3\xe2\x29\xcd\x8a\x91\xa8\x1d\x56\x8a\x23\x14\xe2\x31\xca\xf0\x08\x45\x78\xb4\xf9\xd0\x21\x69\x60\x5b\x63\x15\xe0\x3d\xf5\x76\x00\xea\x71\xca\xef\x13\x14\xdf\x18\x73\xe1\xb3\x98\x0a\xc7\x99\x09\x4f\xd6\xfc\x2b\xa8\xbe\x47\x1c\x55\x2e\xb8\xe1\x34\xbb\x64\x19\xdd\xdd\xb1\x44\x8a\x34\xb6\x59\xfc\xd9\x4d\x45\x73\x1a\x3f\x74\x92\x5b\x3b\xca\x66\x43\x5d\xb5\x9c\xa0\xdf\xdb\x05\x28\x79\xcd\xdd\x5d\x2e\xae\x3b\xbe\x9d\xe1\x31\xd9\xcb\x27\xd0\xaf\xc9\x49\x45\x44\x0c\x0c\x1a\x87\xe6\xbf\xca\x47\x22\x57\x86\x09\xf2\x92\x0b\x8f\xe9\x57\x0d\xe1\xb0\x96\xb5\x43\x24\xe7\xc8\xd3\x7e\xf7\xe6\xb5\x07\xf3\xb5\x44\x65\x10\xea\xb5\x3e\x85\xd6\xe1\x40\x3d\x45\xed\x70\x20\x56\x65\xd6\x56\x3d\x50\x1d\x89\xd5\x3b\xde\xd4\x25\x51\xde\xc0\x5c\x2a\x5a\xb6\xda\xa4\x0b\x66\x3c\x44\x78\x10\xe2\x17\xd8\x8a\x08\x97\xc0\x51\xee\x00\x34\xf8\x0f\x5c\xb1\xa3\x5c\x01\x4d\x63\x7f\x00\xee\x18\x37\xc0\xb3\x68\x4f\x27\x34\xfd\x8f\x31\xfb\xff\xd3\x49\x36\x11\xe6\xfd\x5f\x91\x64\xf3\x25\x64\x01\xc3\x73\x26\x4b\x73\x22\x31\x00\x5b\x2d\x36\x38\x32\x0f\xd7\x2b\x92\xe5\x5e\x83\x8e\x37\x0e\x60\xe7\x2d\x75\xba\x88\xda\x6f\x4c\x4a\x18\xd8\xa7\x7e\x25\xb9\xb7\x09\x50\x2d\x8b\xd5\x35\xca\xa9\x26\x94\x5c\xde\xdc\xfd\xfc\xc3\xc5\x9f\xaf\x7e\x58\x90\x2b\x9a\xf4\x95\x0a\x6f\x54\x09\x11\xd8\x10\x11\x69\x7f\x43\xb7\x8c\x50\x52\x0a\xfe\x8f\xd2\xb5\xed\x7c\x59\x41\x7c\xe5\xbd\x26\x3d\x40\x87\xea\xab\x0c\xf0\x0c\x68\x1c\x30\xa2\x52\x25\x36\x1a\x40\x33\xb2\xb4\x62\xbe\x92\xf9\xbe\xdb\xef\xca\xfe\xa9\x9f\x45\x51\xe4\x3d\x1b\xa6\x18\x59\xf3\xad\x33\xd8\xb9\x12\x34\x8d\x5e\x99\x96\x24\x2d\x25\xd8\xdb\x90\x2e\xc1\x4c\xdd\xcb\xa1\x04\x33\x96\xfa\x2a\x8d\x43\x0a\xdd\xcc\xbf\xb0\x1a\x89\x9e\x91\x65\x09\xa6\xfa\x42\xf1\x9c\x2a\x9e\xed\x9a\x43\xd0\xac\x8f\xdf\xdc\x48\x7f\x43\xef\xf0\x3a\xae\xa7\x7f\xf9\xe1\xea\x8e\xdc\x7c\xb8\x87\x9e\x48\xf6\x66\x05\x2b\x3a\xfc\x1d\x10\xb3\x64\xfd\x68\x70\xb5\xad\x17\xe4\x42\xec\xf0\x13\x3c\xe7\x5c\x43\xd7\x5c\xe6\x3b\x3e\x5b\xe4\xf8\x52\x50\x2f\x5e\x2f\xe0\xff\xfa\xca\x5e\xd3\x34\x55\x96\x9b\x57\x4e\x88\xbd\xfc\x01\xcb\x65\x81\xdf\xf3\x65\xd6\xd8\x3b\x87\xbd\x2f\xd6\x19\xac\x72\x26\xde\xda\x65\x37\x1b\x84\x55\x1b\x09\x08\xc1\x7a\xa5\xd0\x84\xb4\x97\x0f\x0c\xf6\x35\x8b\xac\x57\x59\x4f\x28\xba\x5e\x5e\xcd\xaf\xfd\x65\xea\x0e\x85\x6c\x94\xb4\x26\xd7\xb7\x7e\x5b\xc2\x17\x1a\x94\x11\xab\xee\x42\x57\x0c\x1a\x00\xa3\x49\x62\x46\x5e\x93\x3f\x91\xcf\xe4\x4f\x70\xb5\xfe\x31\x04\x2c\x8e\x83\xc6\x89\xb5\x28\xb5\x5d\xdf\x46\x63\xe5\x27\x7b\x04\xec\x37\x76\xe5\x46\x92\x25\x17\x29\x76\x68\xfa\x6c\x98\xb2\x07\xdb\x61\xeb\xc9\x15\x0e\xed\x20\x27\xdd\x30\xb0\x4e\x90\xeb\x55\xa3\x56\x58\x58\x52\x1c\xb9\x65\x16\xb4\x95\x64\x6f\x90\xc8\xc3\xe6\xe9\x56\xc5\xb2\x7a\x24\xe8\xd6\xde\x3e\x41\xf6\x0a\xd7\xa6\xd1\x5b\x38\x2c\x1b\x4a\xd0\x10\xd0\x1d\xb8\xe1\x41\xaa\x3c\x2d\x21\x8d\x6a\xbe\xd7\xda\x85\x3d\x4c\xef\x09\x8a\x03\x42\x78\xea\x6f\xd6\x46\x3a\x54\x21\x53\xbc\xaa\x61\x52\x69\x83\xdd\xf8\x5b\x39\x08\xf4\xf0\xc6\x76\x21\x2a\x95\xea\x0c\xf4\x65\x4f\x82\xeb\xc6\x09\x15\x2c\xd5\x40\xc6\x82\x3d\x2d\x55\x0f\xbc\xe0\xc6\x44\x9d\x8f\x42\x49\x23\x13\x19\xac\x19\xd9\x36\x09\xbb\x0f\x60\x19\xa8\x56\x7a\x4d\xfc\xc7\xcb\xdb\x99\xd5\x08\xa1\x78\xde\xdd\xbb\x21\xab\x5c\xab\x3d\xdc\xfd\xbb\xdb\x60\x9b\x9a\x88\xc5\x0c\x97\xf3\x6e\xb1\xf0\x3e\xb1\xfc\x69\xb5\x27\x15\xa3\x29\x3f\x59\x6c\x8d\x6f\x75\x58\x41\x1d\x13\x64\x93\xcb\x2d\x4b\xf1\x02\xaf\x5b\x26\xa6\xd0\x90\x57\x07\x22\x6f\x86\x65\xc8\xaf\x60\x19\x9c\x22\x6f\xa6\xc8\x9b\x29\xf2\x66\x8a\xbc\x09\xbc\x33\x45\xde\x4c\x91\x37\x53\xe4\x4d\x27\x5a\xa6\xc8\x9b\x29\xf2\x66\x8a\xbc\x69\xbc\x34\x45\xde\xb8\x49\xfd\x97\xf1\x4f\x4d\x91\x37\xed\x67\x8a\xbc\x39\x18\x65\x8a\xbc\xf9\x36\x7c\x6a\x53\xe4\x8d\x7f\xa6\xc8\x9b\x29\xf2\x66\x8a\xbc\x99\x22\x6f\xf6\x9e\x29\xf2\x66\x8a\xbc\x99\x22\x6f\xc2\xfb\x54\x75\xf3\x8e\x71\xa1\xbc\x93\x79\x51\x1a\x46\x3e\x56\xed\xea\xab\x9e\xe9\xcb\x1d\xfa\x05\x1b\x87\xe3\xb9\xdc\x1c\xd8\xb6\xab\x54\x10\x2a\x72\x8e\xb5\x10\xe7\x09\x4e\x6d\x5e\xad\x67\x5e\xcd\xe4\xfc\x58\x57\x07\xf6\xce\xef\xa7\x87\x3a\x3e\xe6\x36\x8a\xf1\x47\x31\xae\x36\xc6\x7f\x80\x29\x34\x0c\x2d\xd8\x2c\xea\x33\x90\x2f\xcd\x65\x89\x25\x20\xdd\xea\x03\x63\x57\x78\x41\x33\xd1\xd7\x43\x3b\x89\xef\x19\xcc\xf4\x57\xc6\xfe\x47\x37\x89\x7d\xfc\x3b\xf6\x71\x1c\xfe\xfd\x91\x81\x08\x84\x6a\x04\xae\x89\xcc\xb9\xb1\x72\x8a\x15\xf6\x1a\xd1\x42\x21\xaf\x06\x37\x2d\x1b\xaa\xa3\x16\xf0\x39\x52\x83\x55\x50\x2b\x37\x47\xb3\xe7\x9a\xef\xa6\x16\x42\x17\x54\xbe\xad\xa4\x25\xd8\xf5\xb9\x6f\xbe\x0b\x8c\xf3\x9b\xa6\xa0\x81\x17\xac\xbc\xaf\xb8\xd9\xbd\x93\xc2\xb0\xcf\x3d\x12\x4c\x9b\x18\xee\xdc\x27\xae\xab\xa0\xae\x44\x29\xe7\xc4\x54\xa5\x80\xa8\x86\x88\xab\x24\x06\x59\xd8\x6d\xec\xdc\x4f\x14\xb0\xc2\x3e\x9b\xf3\x1e\x90\x71\x5b\x61\xa8\x7e\xa8\xf7\x81\xcd\xed\xe5\x54\xa3\xfb\x60\xac\x63\x19\x27\xb0\x98\x5b\xc5\xb7\x3c\x63\x6b\x76\xa5\x13\x9a\xc1\x9e\xc7\x8a\x00\x17\x3d\xdf\xfb\xae\x8a\xba\xea\xa2\xd9\xd7\x31\xdb\xcd\x13\x84\xba\x84\x0a\xb2\xa6\x5c\x90\xdc\xe2\xa8\xf0\x60\xa1\xfb\x9e\x80\x0e\x6f\x05\x55\x56\x21\x70\x1f\x84\x24\x2e\x08\x0c\x5b\x4a\x99\x39\x8f\x6c\xb6\xab\xe7\xe4\x5c\xfd\x42\xfe\x2c\xd8\xe3\xcf\x76\x1c\x4d\x56\x19\x5d\x87\x7a\x51\x13\x57\x11\x96\x99\x83\x92\x2d\xd5\x74\x48\x1f\x3a\x42\x8c\x41\x83\xf8\x47\x28\x76\x60\xec\x6c\xf7\xfd\x96\xbc\x79\x05\x54\x4b\x35\xa9\xa0\x87\x8c\x2a\xbf\x7b\x05\xd6\x97\x77\x17\xb7\x3f\xdf\xfd\xfd\xee\xe7\x8b\xcb\xf7\xd7\x37\x43\x47\x34\xdc\xa7\x34\xa1\x05\x5d\xf2\x8c\x87\x79\xf7\x81\x15\xbc\xf9\x19\x30\xaa\x34\x3d\x4f\x95\x2c\x70\x9d\xaa\x14\x10\xaf\x59\xc7\x60\x45\x18\x32\xbc\x0f\xaa\x0a\xef\xc4\xd6\xdc\xed\xa1\xd6\x8a\x0a\xe3\x85\x9d\xa1\xfa\xdc\x88\x66\x55\x0a\x2b\xa8\x3e\xd5\xe3\x46\xd3\x31\x41\x09\x17\x69\xca\xd2\xd6\xd4\x4f\xec\x03\x7a\xe7\x41\xef\xea\x88\x51\x72\xfb\xe1\xee\xfa\x7f\xc7\x8f\x4a\x1c\x8d\x44\xb9\x07\x4e\xe4\xc1\x26\xc4\x92\xc9\x08\x4c\x7e\x74\xd1\x3d\x13\x2e\x7b\xde\x19\xa8\xe4\xef\xb9\x4a\xe4\xe1\xfe\x58\x8a\x76\x64\x7e\x0d\x81\xe4\x32\x65\x0b\x72\x8b\x4c\x11\xba\xed\x06\x79\x7f\xf5\x5d\xcd\x06\xc0\xfc\x6b\x3f\x16\x86\xd3\x2c\xdb\x11\x2b\x89\x6d\x69\xc6\xd0\x85\xac\x64\xaf\xb6\x42\xea\x92\x5a\x18\x97\xda\xe4\x1a\x2b\x9a\xe9\xc0\x01\x8f\xe1\x83\x96\xd5\xbf\xb7\xc2\x64\x24\x9e\xaa\xf7\x49\xca\x84\x34\x4e\x2e\xb5\x23\x41\x40\xad\x92\x09\x41\xd9\x14\xdd\x10\x81\x55\xd5\xe1\x44\x15\xb3\x04\x16\xeb\xd9\x20\xd7\x7e\xad\xb7\xd5\x98\xa0\x89\x07\x60\x96\x9a\xe9\xbd\xdb\xc6\xb1\xc1\x5a\x5a\xb5\xe3\x2a\x46\x53\x88\x0d\x2b\xa8\xd9\x80\x5d\x33\x00\x34\xa7\xfa\x81\xa5\xf8\xea\x02\xef\x61\x27\x49\x6b\xd7\x01\xc0\x4d\xef\xde\x62\x61\xc5\xa8\x29\x15\x83\xfb\x37\x2c\xe4\x2e\x19\x61\x82\x2e\xb3\x50\xe4\x59\x54\x50\x24\x4d\x3f\x88\x6c\xf7\x51\x4a\xf3\x7d\x15\x52\x15\xb9\x9d\x3f\x55\x3d\xc1\x9b\x1a\x34\x5c\xb6\x60\xa4\x4c\xe7\x80\x26\x08\xe4\x8a\xab\x64\x7e\x59\x6f\xdf\x09\xc8\x53\x95\xe2\x42\xff\x45\xc9\x32\xb6\x29\x87\xa5\xa0\xbf\x5c\x5f\xc2\xa9\x2a\xf1\xdc\x30\x61\xd4\x0e\x82\x22\x0f\x32\x78\x86\x65\xb8\x05\xf9\xd1\xd2\xd4\x1e\x15\x59\x89\xab\x14\x9a\x99\x05\x79\x4f\x77\x84\x66\x5a\x3a\x61\x2a\x24\x19\x09\x72\x0b\x3e\x93\xa6\xfc\xbf\x20\x10\xe3\x8c\x71\x17\x4b\x69\x36\x64\xef\x85\x01\xe2\x3c\x84\x88\xe1\x7b\x68\x60\xaa\x13\x94\xb8\xd8\x07\x1c\x22\x4e\xfa\xc0\x34\x29\x14\x4b\x58\xca\x44\x12\xd8\xc3\x86\xad\xe8\x8f\x7f\x78\x92\xf9\x1e\x76\xfa\x46\x0a\x4b\xc6\x91\x7b\x7d\x2d\x52\x9e\x50\xe4\x41\xae\x9b\x75\x4d\xc2\x60\xd5\x74\x32\x26\x85\x18\xb8\x01\x2e\x5b\x6a\xa6\xb0\xbb\xb3\x2a\x19\x22\xf1\x6f\xe5\x92\x65\xcc\x60\xc4\x2d\xc4\xf5\x53\x83\xad\x04\xb0\xa1\x3c\x35\x9e\x30\xc2\x27\x9d\x09\x5d\x42\xbb\x10\xab\x1a\x1b\x92\x4a\x56\xc7\x2b\x52\x4d\x7e\xbc\xbe\x24\xaf\xc9\x4b\x3b\xbf\x57\xe0\x63\x59\x51\x1e\x12\xdb\x8d\x44\x2f\xcc\xbe\x5c\xbd\xf2\xc0\x61\x19\x40\x9f\x44\x2a\x3c\x86\x33\x22\x42\x3e\x1f\xe8\x16\xe3\x56\x68\xd5\x1d\x1f\x63\xec\x3c\x73\x60\xb4\x69\x13\x7a\x80\x9c\x43\xe3\x84\x09\xbd\x8f\x9c\x03\x10\x87\x09\x7d\x04\x39\x47\xb3\xa4\x1f\x35\x53\x23\x38\xd2\x8f\x27\xe5\x48\x4d\x11\xc0\x52\x6d\x7b\xf5\x48\x9a\x39\x33\x34\xa5\x86\x12\x1e\xda\x8e\x52\x34\x3a\x82\xfc\x1a\x36\xf8\x74\xfc\x4a\xb3\x1f\xb8\x28\x3f\xa3\x8b\x6c\x8c\x0a\x79\x77\x05\x1f\x92\xc4\x4f\x1e\x10\x4e\x8b\x22\xe3\x18\x20\xdc\xce\xa3\x0c\x60\x06\x0f\x79\x33\x3d\xa6\x4b\xf0\x81\xa3\x4c\xb3\x4c\x5a\x56\x69\x6f\x75\x2a\x52\x99\x07\xc0\xee\x4f\xd0\x0a\x4c\x8c\x26\x9b\xa6\x85\xbd\x83\x58\x46\x5d\x52\xff\xc5\xaf\xbd\x38\xd5\x39\x63\x5b\x16\x4c\xbb\xd9\xcf\xae\xb5\xef\x5b\xc1\xc9\xef\x00\x00\x20\x19\x5d\xb2\x0c\x2f\x0f\xa4\x92\x48\x67\x6b\x14\x0d\x45\xab\x66\x4a\x66\x63\x82\x91\x3e\xca\x0c\xfc\x5b\xb4\x5a\x8c\x05\xf0\x8d\xac\x05\x5e\x8b\x5f\x0b\xc8\xf5\xad\xb5\x80\xbe\xf3\x6d\xac\xa5\x0c\xde\x44\x07\x6b\xb1\x17\x57\x7b\x2d\x70\x83\x7c\x0b\x6b\x89\x50\xeb\x1f\xb9\x48\xe5\xa3\x1e\xcf\x74\x7f\xc2\x0f\x3d\x67\x48\x2c\xeb\x31\x5c\xac\x75\x93\xf1\xd2\xa0\xb1\xb4\xa9\xa7\x76\x71\x5e\x6f\x9c\xaf\xf2\xa9\x0f\x79\x54\x00\xba\x17\xb8\x4a\xed\xfc\x33\x47\x5c\xa4\x21\x8a\x8f\xe2\x8d\x27\xe7\x80\xeb\x5c\xd3\x77\xca\xc2\x32\x9c\x66\x77\xc5\xa8\xb6\x67\x7f\x79\x7f\x77\xd1\xfe\xd8\x12\xee\x23\xa4\xdc\xdb\xf5\xd8\xbf\x13\x9a\xe6\x5c\xeb\xb0\x49\x1a\xf0\xcb\x96\xd0\x8e\xee\xa5\xf7\x51\xac\xb9\xd9\x94\xcb\x45\x22\xf3\x86\xbb\x62\xae\xf9\x5a\x9f\x3b\x2a\x9b\xdb\xd9\xbf\x1a\x80\xcb\x45\xc6\x45\xc3\xe8\x00\x09\xec\x4e\xa8\x83\x09\x26\xd5\x0a\x00\xf5\x98\x69\x3a\x00\x14\xad\xbc\x1d\x08\xc0\xec\x52\xce\xb2\xd4\x19\x22\x30\x1c\xdb\x9e\xe7\xac\xd8\xd0\x39\x5c\x18\x03\xc0\x5d\xce\x18\xe8\xf5\x1b\x29\xa4\xf3\xa1\x63\xcc\xb1\x53\xa5\xd0\x2e\x01\x93\x70\x27\xc7\xce\x65\x00\x70\xd3\xf2\x71\x12\xd6\x76\x48\x3d\x37\x83\x81\xf5\x03\x14\x04\x08\x74\x19\x73\x8d\x68\x9c\x81\x95\x75\x6e\x24\x0a\xdf\xbf\x86\x7d\xa8\x34\x9e\x91\xe8\x07\xcd\xc7\x7d\x66\xb9\x8d\x67\xc2\x9d\x9a\xd0\xc0\xa2\x0e\x6a\xaf\x74\x6a\x43\xf6\x95\xb6\x46\x34\x78\x7c\x0f\xf5\xa5\x21\xad\x68\x00\x64\x97\xb0\xfb\x24\x59\xb7\x1b\xe8\x09\xe4\x5d\xd2\x25\xf3\xee\xd1\xf3\x92\x19\x47\xce\x40\xb0\x39\xdd\x91\xe5\xd0\x71\x49\xb9\x06\xb3\x26\x38\xa5\x9b\xc4\xfb\xb1\x49\x48\xa7\xa6\xd3\x27\x3b\xe6\x31\xb0\x35\x3a\xab\xfb\xae\xf1\x3e\xe1\x87\xa6\xa8\x5b\x99\x62\xc8\x78\x15\x94\xdb\xdb\xff\xd0\x85\xae\xf3\x5f\xfc\xdd\x5f\x4b\x16\x42\x62\xcc\x44\x33\x8e\xdc\x37\x98\xc5\xa6\xa9\x3d\x30\x9d\x45\xd7\x35\x5f\x6d\xcd\x02\xad\x5c\x1b\xae\x9b\xc9\xe1\xb3\x6a\xd2\x01\xa7\x71\xb3\xb5\xc3\x8c\xfc\x7b\xa9\x0d\xa1\x95\xfb\xb9\xd5\x73\xa2\x8a\x39\x06\x72\x4a\x7a\xad\x29\x3e\x17\xcb\x48\x3b\x99\x2d\x4f\x19\x49\xf9\x6a\xc5\xbc\x5b\x7c\xc9\x48\x41\x15\xcd\x99\x01\x37\x0a\xa2\x16\xba\xf0\x8a\x7e\x62\x90\x2b\x42\x7d\xaf\xdb\x2a\x02\x6e\x86\x3e\x5a\x6e\x48\xce\xd7\x1b\x94\x75\x08\x25\x99\x14\x6b\x88\xe8\xb3\x53\xc8\x24\xed\x3b\x89\xc0\x1c\xa4\x22\x8f\x54\xe5\x84\x92\x84\x26\x1b\xb0\x12\x52\x41\xd2\x52\x41\x82\xa7\x61\x34\xdd\xcd\xb5\xb1\x7a\xb6\x95\x8e\xc0\x94\x86\x18\xe8\xf5\x42\x1f\x74\xc2\x00\x7c\x71\x8c\x44\xb6\x77\x49\x75\x4c\x9c\xaf\xc0\x0b\x07\x4d\xf2\xeb\x81\xde\x3a\x60\x53\x4a\xff\xde\x33\xa5\xf4\x4f\x29\xfd\x53\x4a\xbf\x7f\x73\x4a\xe9\x3f\x78\xa6\x94\xfe\x29\xa5\x7f\x4a\xe9\x9f\x52\xfa\xe1\x99\x52\xfa\xc7\xcf\x6d\x4a\xe9\x9f\x52\xfa\xa7\x94\xfe\xc6\x33\xa5\xf4\x1f\x8c\x32\xa5\xf4\x7f\x1b\xc9\x7a\x53\x4a\xbf\x7f\xa6\x94\xfe\x29\xa5\x7f\x4a\xe9\x9f\x52\xfa\xf7\x9e\x29\xa5\x7f\x4a\xe9\x9f\x52\xfa\x87\x5c\x68\x29\xef\x49\xb5\x8c\xc9\x3a\x70\x06\xfc\x46\xac\xe2\xb2\x5c\xad\xac\x86\x2a\x7b\x2f\x6b\x3b\xe2\x81\x25\xba\xca\x7d\xab\x1c\x5d\xce\x9a\xac\x99\x99\x41\x5a\x03\x86\xe9\x8c\x03\xea\x02\x29\x21\xad\x51\x31\x0d\x69\x00\x82\x5c\x7d\xf8\x7e\xd1\x48\x7a\xe8\x35\x65\xf6\xa6\x42\x0c\xc5\x1c\xc3\x6c\x3e\x88\x24\xc6\x29\x59\x23\xb6\x2b\x12\xd4\xe1\x37\xc9\xa4\xc6\x98\x02\x00\xdd\xe7\x9a\xda\x50\x21\x98\x97\x3a\xb8\x01\x59\x79\xc9\x98\x20\xb2\x60\x02\xfd\x50\xbe\x2d\x03\xa1\xc6\xd0\x64\xb3\xb0\xe3\x8b\x20\x54\x9f\x1d\x5a\x8d\x6e\x59\x2f\xa3\x39\x22\x57\xb1\x9c\x72\x1c\x80\xd0\x44\x49\xad\x49\x5e\x66\x86\x17\xd5\x10\x7d\x3b\xc6\x20\x06\x08\x23\xb3\x2a\x84\x81\x63\x81\xa1\x29\x1e\x62\xfa\xdd\xc6\x6a\xbf\x04\x29\x06\x03\xaf\x41\x36\x9a\x41\x42\x7b\x5e\x98\x1d\xba\x5c\xd1\xf1\xc4\x95\x36\x24\xc9\x38\x5c\xff\x30\x3b\xcc\x09\x85\x51\x66\x01\xa7\xbe\x81\x5c\x51\x58\xab\x76\x8b\x15\x29\xdc\x1a\x85\xd1\xe8\x68\xac\x87\x71\x03\xa4\x5c\xbb\x3b\x5a\xf7\x79\x26\xa8\xef\x1d\x82\x9b\xed\xd7\x0a\xdb\x9d\xc2\x10\x7e\x4c\xf7\x53\x63\x90\x01\x2c\x40\xca\x93\x53\x94\xea\x43\x05\x29\xc6\x3e\xcf\x67\xd6\xea\x33\x52\x54\xc9\x72\x66\x43\xfb\x2b\x2d\xf8\x83\xe8\x66\x0b\x44\x20\xd8\xd6\xd2\x2c\x4b\x98\x15\xa1\xe9\xc1\x09\xc3\xe1\x8e\x3a\x4a\x86\xa9\x9c\x0b\x70\xcb\xbe\x67\x5a\xd3\x35\xbb\xed\x35\xf0\xf4\x89\x4d\x60\xe3\xa9\x51\x0d\x84\x90\x81\x0c\x55\xff\x52\xbb\xc4\xce\xfa\x18\x42\x63\x2a\x24\xc7\xb9\x54\x31\x80\x8f\x8a\x1b\xab\x53\x71\x8d\xb9\x74\x60\xd7\xdc\x0f\xb8\xec\x07\xdd\x74\xc2\xbd\xf7\xa0\x6b\x90\x96\xbf\x8b\x14\x1d\x57\x4b\x46\x96\x8a\xb3\x15\x59\x71\x41\x33\xe7\x81\xea\xa3\x2f\xc8\x11\xa1\x28\x50\x6b\x6d\x45\x53\x29\xbc\x63\xc5\xaf\x61\x41\x7e\x72\x8b\x30\xaa\x14\x09\x1d\xcc\x59\x16\x32\x65\x84\xaf\xc8\x1a\xbc\x5d\x0a\x1d\xea\x7f\x78\xfd\x3f\xfe\x48\x96\x3b\x7b\x23\x82\xa1\xd2\x48\x43\xb3\x0a\x4d\x19\x13\x6b\xbb\x07\xc0\x20\xfa\xce\x42\x96\x35\xd3\x2f\x3d\x66\xa1\xae\x0a\x2e\xfd\xcd\xef\x1e\x96\xed\x2b\xfd\x3c\x65\xdb\xf3\xc6\xbe\xcc\x33\xd9\x1b\x97\x72\xd8\x0c\xa7\xfb\xf2\x1d\x10\x2f\x3b\x08\x12\x8a\x2f\x44\x90\xa4\x4f\x7e\x22\x1b\xf9\x88\x39\x98\x1d\x14\x55\xbb\xc4\x0b\x59\x94\x59\x7f\xd7\x1e\x42\xbe\xb7\x54\x0c\x78\x2a\xdd\xed\xd0\x0a\x67\xec\x3c\x39\xa0\xe8\x3b\xc0\xfd\xbc\xae\x79\xc3\xa3\x8b\xd3\x4f\x4f\xba\x78\x28\xa7\xe4\x56\xb9\x4f\xa5\x62\x0b\xf2\x3d\xcd\xb2\x25\x4d\x1e\xee\xe5\x0f\x72\xad\x3f\x88\x2b\xa5\x7a\xc5\x80\xd6\xbc\x33\x6a\xf9\xf2\xa6\x14\x0f\xed\x56\x0b\x99\x5c\x5b\x39\xae\x28\x8d\x8f\x58\x69\xac\xaa\x07\xb0\x9f\x29\x9c\xf1\xea\x12\xa0\xae\x97\x4d\x0d\x9b\x7d\x06\xba\x82\x80\x27\x2a\x08\xb3\x73\xed\xc3\xb4\xa5\xe8\xe6\x5c\x74\x93\x2c\x7f\xf7\xfa\x0f\xff\x82\xa4\x6f\xb5\x8b\x7f\x79\x0d\xce\x7f\x3d\x43\xe6\x62\x39\x63\x3f\x87\xd6\x39\xcd\x32\xab\x48\x34\x89\xda\x6e\xeb\x22\xb6\x77\xd3\x10\xb5\x9a\x18\xc2\x8c\x16\xee\xee\xef\xff\x1e\x90\xec\xb8\xd1\x2c\x5b\xcd\x30\xf6\xae\xca\xb7\x3d\x83\x8b\xe2\xcc\xf1\x2e\x7b\xab\x1f\x5e\x0d\xc7\x89\x59\x5b\x99\x95\x39\xbb\x64\xd0\x74\x25\x62\x99\xad\xf7\x7d\xc4\x46\xe6\xfa\xa3\x2d\x33\x99\x3c\x90\xd4\xfd\x11\x26\xdb\xb3\x4c\xf0\x5a\xb9\x90\x9e\x86\x2e\x58\x45\x01\x41\x00\x9e\x8f\xe4\x79\x6a\xc7\xad\xe6\x9c\x5b\xfe\xb6\x9c\x16\x05\x34\x1a\x5b\x41\x82\xd0\x23\x2e\x20\xa0\x63\x01\x04\xd7\x49\x87\x9e\xa6\xfb\x16\x02\xed\xbf\x90\x3b\xd6\x53\x7f\xe2\x37\xa0\x80\xff\xc6\x78\x91\x11\xa9\x75\xa4\x0e\xdb\xab\xd6\x86\x37\x86\xc5\x0c\x9c\xcc\x27\xf7\xe1\x19\xd5\xf7\x08\xcc\x0a\x8d\x4e\x4f\xcd\x78\x65\x4a\x0a\xa6\x34\x34\x87\x33\x9f\x60\x47\xdf\x65\x94\x87\x32\xba\x08\xa9\x1b\x1e\x3d\x6d\x19\xc3\x1d\x78\xea\x3d\xe9\x7d\x25\xe0\xed\x7b\x62\x6f\x1e\x24\x70\x48\xc6\x8f\x39\xc3\xb7\x32\x75\x9f\xc0\x21\xc5\xc2\x05\x1d\xa2\x96\x8e\xc8\x7d\x3f\x79\x7b\xbc\x4f\xf5\x5a\xda\x67\xd5\xfe\x52\x1d\x56\x7c\xcb\x1d\xc5\xde\xbd\x3d\xd1\x11\x85\xa1\x47\x9d\x50\x38\x9b\x8d\x8e\x5b\xf5\x7d\xd0\x12\xa1\x71\x13\x82\x14\x5c\x8b\x32\x4e\x26\x5e\x10\xb4\x69\x5b\xac\x3b\xb0\xe4\xec\xed\xd9\x93\xcf\x29\x2e\x52\xc9\x82\xae\x07\x4a\x47\xed\xad\x75\xff\x43\x92\x32\x14\x30\x98\x06\x21\x0d\xfe\x0e\x6e\xa3\xe0\x42\x0b\x07\xc1\x77\x76\xf2\x3e\x3e\x67\xa6\xf5\xe8\x73\x22\x08\x06\x07\x3f\x06\xbd\xd8\x84\x50\x25\x4b\x91\x3a\xfd\xbc\x32\x84\xbc\xdf\x9b\xf0\x8d\x14\x20\xe4\x60\x0e\x52\x20\x6c\x15\x9f\x56\x8c\xb8\xe5\x30\x6f\x16\x6f\x5e\x7f\x59\x36\x79\xbf\xd7\x10\xcf\x62\xe4\xa6\x62\x93\x78\x36\x9e\x3c\x23\x5f\x60\x23\x7a\x56\xef\x9d\xd2\x56\xd7\xcf\xe0\xbe\xaa\x00\xfc\x64\x95\x31\x16\x55\x0a\x8f\x90\x97\x20\xd2\x58\x59\xb0\x91\x95\xf0\x6a\x54\x19\x98\xb8\xb4\x76\xab\xdf\x2d\x9f\x74\xb6\xf1\x10\x23\xd1\x76\xe9\xc2\x61\x6a\x72\x5f\x77\x1c\xf3\x56\x17\xb9\x17\xe4\x25\xbe\x79\xa6\x21\x16\xf5\xd5\x93\xb7\xd7\x2d\xfb\xea\x73\x11\xcc\xa3\x6c\x2d\xfd\xea\x73\x41\x41\x87\x2e\x86\x70\x30\x20\x74\xb4\x6f\x99\x7e\x1c\xfc\x99\x6d\xe8\x96\x41\x9c\x2c\xcf\xa8\xea\xcd\x24\x70\x70\x25\xb9\xc3\x55\x41\xb3\x5b\x26\xb6\x5c\x49\x01\x7e\xaa\x2d\x55\x1c\x72\x8a\xa0\x15\x21\x13\x56\x3e\xfd\xed\xcb\x4f\x17\x1f\xc1\x3f\x10\xce\x76\xc3\xdc\x03\xb7\xf2\x52\x43\x0c\xc2\xde\x0a\x1a\x43\xd5\x1b\x37\x34\xd7\x8e\x4d\xf5\xf3\xb7\xbb\x02\xbc\xce\xaf\xc7\xce\x21\x2f\x4d\x49\xfb\xb3\x29\xf0\x61\x9f\x93\xac\xd4\x7c\xfb\xd4\xf3\x3f\x2c\xf1\x54\xb7\xe2\x57\x10\x78\x5c\x48\xf7\x25\xef\xa1\xdd\xee\x86\xbb\x67\xfa\x30\x16\x1c\xcc\x7a\x42\x9a\xe1\xae\xa7\x9d\xc6\xe5\x33\x5d\xd5\xc6\x69\xa6\xb2\x3a\xc5\xd5\xa5\x5c\xf4\x6a\x41\x55\x5d\xc8\xf4\xd0\xec\x0e\xf9\x59\xa7\x51\x61\xfb\xf7\xb2\x67\x8f\x02\xbb\xd3\xb7\x2f\xbe\xbf\xed\x8f\xea\x20\xf5\xff\x20\x00\xaf\xea\x85\xfb\xe3\xc7\x1f\x60\xd5\x17\x19\x53\x06\xcb\x93\x2a\x88\x26\xa5\x70\x40\xab\xae\xcd\x5b\xca\x33\x7b\x7a\x0f\x26\x5a\x8a\xb4\xa9\x36\x0a\x96\x30\xad\xa9\xda\xd9\xe3\xb5\x66\x82\x29\xab\x72\x27\x52\xd9\xcd\xb6\xa3\xe9\x8e\x77\x0f\x80\xf2\xd5\xde\x84\xbc\x13\x45\x55\x6d\x27\x21\x1d\x00\x2e\xdb\xcb\x9b\x3b\x6c\x81\xda\x89\xa7\x8e\x0d\x81\x7d\x0d\xa2\xe8\x1a\x32\xf3\x78\x23\x1f\x0a\x9c\x10\x75\xb2\x1a\x91\x5b\xa6\xc8\x92\x6a\x06\xaf\xce\x88\xa1\xeb\x4e\xbb\xbb\xde\x58\x09\x38\x5f\x3a\x63\x8f\x5e\x90\xbb\xba\x95\x37\xf0\x6d\xab\x51\x49\xb0\x8f\x6a\x83\x56\xe8\x06\x06\xb1\x7e\xcf\x21\x75\x60\xf1\xaf\x9c\x99\x0d\x2b\x35\xf9\x00\x29\x3f\x52\x91\x07\x21\x1f\x35\x79\xb4\x1a\xa5\x87\x2b\x0f\x51\xd9\xdd\x15\xbc\x3e\x09\xe3\x10\x79\x5b\x66\xd9\x1d\x4b\x14\x3b\x54\x7c\xda\x05\x1a\x85\x4b\x54\xa7\x59\x65\xad\x68\x5c\x05\x10\x30\x0c\x50\xfc\x41\xd4\x56\x9c\xb2\x1b\xab\x0b\x9a\x74\xe0\xa0\x0e\x4d\x2b\xca\x2c\xb3\xf8\x2c\x6a\x94\x80\x5f\xa3\xb5\x6e\x3b\x57\x67\xf3\x57\x6c\xcd\xed\x72\x3a\x1c\xaf\x9a\x61\xb8\x79\xb7\x77\xb4\xd4\x4c\xcd\xd7\x25\x4f\xd9\x39\xc2\xfb\xae\x6e\xcc\x3e\x87\x5f\xec\x54\xdc\x3a\xe6\x52\xcc\xe9\xfc\x50\xf1\xed\x51\xc4\xda\x05\x39\x64\x42\xb3\x0f\x70\xfa\x3f\x7a\x1c\x79\xce\x64\xef\x3a\x59\xae\x37\xad\x06\xf5\x46\x92\xac\xb3\x06\xd8\x4e\x96\xc4\x19\xbe\x30\x12\xdb\x41\x4b\x1d\x73\xf1\x36\x8b\x43\x8c\x1f\xb2\xb9\xb0\xa6\xd6\x2f\x3f\xef\x79\xc6\x1b\x81\x0b\x6e\x3a\x66\x74\x10\x9b\x3d\x7f\x5b\xce\x1e\xcf\xdd\x75\x32\xb7\xa2\xd0\x1c\x97\xa4\xcf\x61\x0d\xe7\xdf\xc1\xff\xf4\xd9\x42\x21\x8c\xe6\x22\x4d\x9d\x22\x53\x6a\xb6\x2a\x33\x54\x2d\xf4\x82\xd0\x82\x7f\xc2\x13\x34\x23\x0f\x5c\xa4\x33\x52\xf2\xf4\x7f\x1d\x61\x6a\x3f\x82\x91\x73\xc1\x4d\x75\x63\x86\x0f\xd5\xd9\x75\xeb\x5d\x1f\x3c\x4f\xd3\xd4\x9e\x87\x36\xa0\x46\xdc\x4c\x07\xf1\xad\x20\xa0\x10\xb3\x06\xa5\x66\xbe\x6f\xb4\x4f\x91\x64\x8b\xf5\x82\xac\x98\x55\x75\xfc\x31\xb5\x27\x8f\x0b\xbb\xae\x2e\x2b\x76\x65\xcc\x68\x71\x9f\x56\x39\x6c\x3c\x8c\xd5\x55\xe4\x6a\x61\x2f\xc8\x85\xd8\xa1\x1d\xfb\x70\xef\x5c\xc2\x23\x24\x70\x43\x4e\x9a\x63\x71\x54\xb4\x17\x8b\x17\x57\xc6\x28\x96\xd7\xf0\x3e\x44\x22\x0f\x2b\x48\xb9\xe4\xd3\xa7\x86\x51\xda\xe1\xeb\xba\xd2\xfa\xb0\x66\xf5\x8f\xba\x63\x4b\xa0\xee\xb9\xd8\x01\x27\x4b\xa8\xf6\x5a\x35\xf8\x69\x11\xcf\x88\x74\xf8\xf4\x10\x1d\x4c\x18\xae\x58\xb6\x23\xb2\x34\xf5\x29\x4e\x24\xd6\xc4\x7c\xf4\x96\xc5\x9c\xf2\xb6\x43\xca\x45\x93\x75\xde\x58\xcb\x1d\x49\x25\xe4\x18\xc9\x19\x70\x0f\x74\x0f\x7b\x3b\x25\xdc\x1f\x1b\xba\xe5\xb2\x54\x98\x94\xad\x18\x7d\x20\xd4\xc0\x3a\x3a\x2b\xd2\xd9\xa3\x29\x4b\xb0\x97\xf0\x84\x1d\xf8\xab\x62\xf8\xe1\x45\xe5\xef\x2f\x8a\x8c\x27\x75\x65\x6c\xdc\x6d\x98\x9b\x9d\xab\xcf\xa3\xf1\x85\xc9\x3b\x2d\x53\xd0\x64\x7d\x2c\x77\xa3\x6a\x1d\xd5\x2f\xe2\x42\xad\xcb\x1c\x9c\x57\x8e\xfe\xeb\x42\x03\xae\xca\xa8\x4c\x1e\xfc\x7d\xd4\xef\x4a\x7d\xf7\xfe\xd2\x1b\x44\xd0\x67\x54\x87\x92\xb8\x6c\xe5\x74\x41\x3e\x1d\xa5\x52\x0d\x2a\x53\xfb\xda\xd4\xb5\x95\xb2\xbc\xfa\xd6\x27\x47\x57\x42\xb2\x62\x5a\x66\x5b\x5f\x9b\xa6\x9a\x99\xbf\xd5\xb9\x28\x4a\xe3\x98\xa5\x17\x2f\xfb\x3c\x14\x22\xd9\x50\xb1\x46\x93\x10\x6b\xae\x8c\xe8\x9d\x30\xf4\xb3\x67\x52\x4c\x27\xb4\xa8\x9c\x60\x24\x95\x65\xff\x44\x7f\xfb\xdb\x19\xe1\xec\x2d\xf9\x6d\x03\xdc\x82\x5c\x39\x08\x0d\x44\x36\x42\x02\x96\x35\xc2\xfa\x54\x13\xc5\xd6\x54\xa5\x19\x44\xdf\xad\xaa\x52\xed\x58\x28\xc1\x6d\x12\xfb\xcc\xb5\x01\xe7\x9a\x90\xa6\xa1\x56\xf4\xad\x7e\x5c\xab\x10\x2c\x73\x8f\xfc\x78\x9e\x52\x43\xe7\x8d\xa3\x72\x8e\x4d\x0c\xe6\x2e\x2b\x76\x4e\x1d\x91\x36\x0a\xe1\x7f\xe7\x4a\x88\xcf\x69\xf5\x16\xb7\xf2\x0b\x64\x91\x76\xdf\x7b\x41\x8b\xf2\xa0\x82\x1b\x56\x2f\x83\x29\xcc\xed\x13\x77\x55\xd7\x34\x04\x68\x0b\x72\x23\x4d\x5d\xaa\xa0\xf2\x15\xb9\x7c\xd8\xfb\xde\x88\x80\xbd\x93\x49\xae\x6e\xee\x3f\xfe\xfd\xf6\xc3\xf5\xcd\xfd\xe0\x51\xec\x81\x38\x70\x40\x63\x8e\x62\x0f\xe4\xfe\x03\x3a\x7c\x14\xfb\xfc\x9e\xfd\x07\x74\xf8\x28\xf6\xb3\x85\xde\x03\x1a\x7d\x14\x7b\x60\xf7\x1c\xd0\xf8\xa3\xd8\x03\xf7\xe0\x80\xfe\xca\x8f\x22\x13\xdb\x88\x63\xf8\x83\x53\xe9\xba\x4c\x7e\xfb\xe9\xa0\x83\x2e\xa1\x93\xbb\xb4\xae\xc4\xf6\x13\x55\x75\xb1\x79\x88\x25\xea\xb4\x4e\xba\x17\x7a\x4d\x77\xc0\x4a\xde\x9d\xc2\xa7\x35\xca\xdf\xd0\x54\x9a\xba\xe6\x5d\xa7\x59\x84\xda\x83\x10\xf2\xee\xe7\xeb\xcb\xab\x9b\xfb\xeb\xef\xaf\xaf\x3e\x3e\xd9\x80\x3d\x98\x00\xda\x66\xd4\x63\xb8\x61\x70\x11\x35\xa7\x2c\x14\xb3\x92\xa8\x26\xbe\x4b\x4f\x37\xf9\xf1\xe1\x80\xf8\xb6\x83\xcb\xca\xb2\xda\x6a\x98\x49\x37\xba\x31\xde\x33\x8c\xea\x78\x86\xdc\x62\xbd\x61\x5f\xe4\x48\xb6\xec\x18\x70\xd8\x5e\xfd\x1c\xcc\x19\x9f\xe3\x59\xf4\x80\x85\xbd\x25\x49\xb5\xdd\x34\xc1\x84\x90\x78\xb2\xfe\x5e\xc9\x40\x29\xfb\xfd\x6c\x49\x50\x5d\xab\x5c\xab\x2e\x8a\x39\xd3\xae\x83\x54\xf8\x78\xd6\x8c\xcf\x89\x1b\x55\x70\xbf\xfd\x1d\x82\xc0\x42\x10\x62\x13\xcb\x51\x0f\x7f\x4f\x8b\xbf\xb1\xdd\x47\x36\x90\xd7\xb2\xbf\x58\x96\xb1\xc4\x72\x50\xf2\xc0\x76\x68\x82\x7d\xe7\xc1\x0d\xa5\x83\x8e\x49\x7c\x7f\x60\x41\xc7\x67\xe7\xdc\xec\x29\xb0\xb3\x82\xfb\xc6\x4e\x73\x68\x42\x64\x6c\xd2\xfb\x51\xe9\xf8\xdf\x88\xcd\xab\xfd\x8c\xb5\x80\x45\x01\xed\xb7\x92\xb5\x9f\x51\x38\xf7\x76\xe3\xd1\x78\x77\xb6\xf6\x16\x87\xa9\x68\xd5\xf2\x0f\x3e\x98\x6c\x86\x8f\xa5\x29\x9f\xda\xe4\xae\x9a\xe8\x45\x0e\x79\xbf\xf1\x89\x2f\x59\xf0\xc0\xc2\xfe\xc7\x11\xb5\x08\x60\xaf\xc7\x9e\xff\xb3\x9a\x01\x60\x20\x46\x95\x84\x96\xbe\xf5\x96\x25\x5d\x95\x35\x5c\x58\x82\x1c\xa6\x9d\xd6\xeb\x60\x7e\x9e\xd5\xbf\x41\x8d\x60\xdd\xf8\x01\xb8\x24\x3a\x54\x86\x41\xeb\x82\x25\x0b\x21\x53\x66\x0f\xe1\x0c\xff\xe9\xee\xf6\x8b\x24\x91\xa5\x30\xee\x0f\x10\x22\xbc\xd8\x48\x6d\xae\x6f\x23\xc0\xe2\xeb\x85\x4c\xaf\x6f\x67\xad\x7f\xe9\x81\x9c\xc4\x71\x6c\xb0\x3e\x87\xa3\xc9\xff\x53\xed\x03\x42\xc3\xe0\x86\xe5\x14\xfe\xf3\x7b\xbb\x71\x01\xcf\x71\xfb\xe1\xba\x0e\xe3\x17\x10\xbb\x6c\xef\xed\x76\xe1\x9b\x17\xdb\x37\x2f\x4e\xce\x6c\x57\x7e\x9a\xa3\x97\x0e\x2e\x7b\x5f\xa8\x0d\xa8\xb4\xba\x12\x62\xa4\x41\xff\xd4\xfe\xbf\x8b\xdb\x6b\xef\x53\x3b\xf1\x32\xe3\x4f\xfe\x2a\x72\xd7\xa2\xcf\xbf\x6f\x40\xf9\xfd\x13\xf9\x80\x87\x73\x10\xf9\xfa\x16\xaa\xe6\x0d\xe2\xab\xee\x14\x8a\xfd\x67\x5d\xce\x90\xeb\x13\xfa\x12\x7f\x5c\x24\x45\x39\x73\x2f\x2c\x72\x96\x4b\xb5\x1b\x3e\xa5\xee\x75\x56\x6c\x58\xce\x14\xcd\xe6\xda\x48\x05\x1e\x5b\x0f\x1e\xc1\x56\xff\x42\xc0\xc3\xa7\xb2\x31\xc1\x43\xe8\xa8\xcb\x24\xa5\xb2\xf7\x7c\xb6\xab\xb3\xb7\x4f\xca\x19\x2a\x2c\x0f\x57\xc7\xc5\x67\xbf\xb3\xb1\xd7\x78\x40\xa6\xa9\xfb\x1a\x5b\x31\xd6\x05\xa7\xc6\x5d\xfa\x95\x5f\x17\x1a\x36\x88\xad\x15\x7a\x03\x39\xa1\xf5\x33\x8a\x19\xa4\x7c\xcb\xb5\x1c\x28\x39\xdf\xb1\xd0\xbb\x56\x2d\x31\x97\xfb\x80\x9e\xd3\xb8\x22\xcc\xf8\xb0\xcf\x05\xe4\xae\x55\xb4\xba\xc7\xff\xde\xbc\x38\xf5\x82\xfd\x48\xe3\xb7\xf6\xa3\x67\x29\xf5\xc9\xac\xd8\xdf\x89\xf7\x25\x9e\x7b\xf9\xa9\x9c\x8a\x79\xa1\x7f\xec\x34\x0a\x8c\xf3\xb5\xd5\xc1\xea\x03\x31\x83\xc4\x69\x02\xdd\xa1\x09\xed\xe7\x4b\xe9\x3c\xfe\x96\xc7\xa5\xd4\xd7\xdd\x4a\xc9\xdc\x85\x2c\x47\x11\xfa\x92\x81\x35\x39\xe3\xa9\x87\xf5\xc0\x06\x8a\x38\xe2\x33\xe9\x51\xbf\x26\x3d\x0a\x63\x7e\x9c\x12\x15\xa1\x94\xe0\xf3\x4f\xa7\x44\x45\xf6\x75\x0f\x07\x72\x3e\x5f\x98\x26\x13\xdb\x7e\x4b\x56\xa7\x01\xdf\x4b\x62\x8d\x0c\xcb\x6e\x13\x68\xd8\x8d\xd4\x4a\x29\x03\x06\x55\x1b\x69\x6b\x97\x1c\xde\x4d\xf9\x80\xe9\xba\x65\xb4\x26\x17\x50\x55\x17\x19\x14\x80\xf5\xd6\x50\xc5\x5c\x89\x1c\x4c\x15\x66\xdb\x7e\x3b\x7e\x67\x73\x68\x4c\xb9\xe7\x62\xed\xd2\x15\xf0\x7e\x70\xc6\x46\x2e\xaa\x8a\x00\x3d\x30\x2b\xb1\xa0\x2e\x8f\x4f\xb5\x96\x09\x54\xe9\xaa\x2b\xd2\x43\x92\xa8\x5b\x38\xcc\xdc\xd0\x87\x3e\x90\xcd\xea\xf8\x9f\x2c\xc4\x1a\x87\xcb\x1d\x64\xa8\x8b\x6d\x65\xb7\x2d\xd1\xc7\x84\x97\x41\xa0\x94\x3a\x94\x1f\x6f\x42\x7e\x0e\x6f\x8b\x25\x3a\x67\x15\x6d\x38\x5d\xe0\x7e\xaa\x34\x05\xea\x1a\x4e\xf7\x9e\xae\xca\x54\xd3\x47\x6b\x31\x57\x6b\x65\xea\x1c\x10\x13\x0e\xee\xd4\xda\x50\xd4\xbe\x4b\x4f\x60\x7e\x8d\xb9\xfc\xbe\xed\x8b\xef\x84\xe1\x73\xf5\x13\x7d\x99\xc5\x5e\x64\x23\x8c\x81\xe3\x2e\xa6\xd8\x4b\x29\xea\x12\x29\x14\x5b\xf1\xcf\xd1\xb4\xd9\x0c\xa4\xe5\xd0\x18\x66\xc5\xa1\x56\xad\x05\x54\x30\x81\xf1\x7a\x34\xd9\x0c\x5e\x72\x8e\x55\xd7\xd6\xfb\xda\x89\x78\x5a\x47\x21\xca\x91\x63\x0f\xe0\x5d\x97\x24\x3b\x9d\xbe\x7f\x9e\xd3\xe7\x36\xf8\xab\x1d\xbd\x27\xca\x56\x9d\x79\x04\x1d\x4b\x3f\xbb\x6c\x04\x16\x61\xaa\xc2\x58\xda\x69\x04\x96\x62\xe0\x79\xcf\x8a\xda\x2d\x74\x2a\x36\x81\x2d\xe6\xe4\x23\xd9\xf0\xb5\x45\x3e\xb6\xd5\xc1\x9b\x91\x60\x6c\x6e\xde\x2f\x2c\x19\x59\x65\xd8\x48\x05\x99\x0f\x8a\xa7\x07\x89\x32\x20\x22\xf9\xa0\x58\xf8\xa3\x92\x59\xd6\x5f\xba\x3c\xe3\x0f\x8c\x5c\xb2\x22\x93\xbb\xdc\x45\x64\xa4\xe4\xce\x50\x63\x49\xf9\x8e\x99\x3e\x2b\xfa\x00\x99\x56\x39\x09\xd1\xf5\x4c\xce\x30\xdb\xa3\x28\xb3\x8c\x14\xf0\xd1\x02\x7a\x7e\x40\xe6\xc4\x23\xdd\xe9\x19\xb9\x61\x5b\xa6\x66\xe4\x7a\x75\x23\xcd\x2d\x0a\x33\x7d\x3c\xb1\xe9\x8c\xc6\xcf\x09\x5f\x91\xb7\x56\x8c\xd6\x06\xd2\x44\xb8\x6e\xb6\xd9\x91\xaa\x05\xb6\x07\x6a\x95\xb2\xf9\x84\xb0\xa4\x7e\x62\xfa\x0e\x20\x55\x39\x0c\x3d\xa6\xbb\x01\xc4\x57\xd5\xe1\x22\x50\x7e\xe1\xfa\x61\x98\x3a\x42\xd9\xd3\x20\xc1\x64\x77\x9f\x8a\x08\xc2\x6a\x6f\x7e\xb9\x62\xba\x90\x42\xb3\x76\x86\x72\x5d\xe7\x12\x54\x00\x1d\x2d\xe1\x0e\x5f\x20\x85\xd4\x06\xfa\xdf\xc4\x96\x01\xbc\xf5\x1f\x40\x41\x2c\x9a\x65\x2c\x25\x3c\xcf\x59\x6a\xb5\x82\x6c\xe7\x8a\x9c\xd1\xa8\x5a\x11\x16\x02\xb6\xe6\x70\x95\xb0\x18\xd9\x50\x91\x66\x4c\x35\x1b\x29\xb5\x34\x1a\x5f\x67\x26\xc8\x55\xd1\x96\xed\x8a\x6c\x11\x9a\x24\x52\xa5\xae\xcc\xb3\x55\xed\x7d\xec\x7c\x75\x36\x80\x7f\x0f\x72\x0d\xd2\xd5\x3b\x0d\xaa\x7b\xe8\x46\xfd\x2f\x68\x8d\x58\x35\x8b\x3a\x61\xfd\xc2\x06\x91\xd7\xd5\x0a\x2b\xca\x98\x43\x75\xd5\xf3\x46\x21\x43\xf8\xe1\xa9\x35\x51\xc3\x5d\x85\xc8\xb1\x9d\x85\x06\x6e\xc4\x56\xdf\xa1\xa7\x74\x17\x8a\x5f\x28\x89\xed\x32\x74\xb0\xe6\xb8\x4e\x43\x11\x76\xa1\x46\xde\x52\x4c\xb7\xa1\x18\x4b\x53\xbb\x1f\x51\x7c\xc7\xa1\x08\xd8\x8d\x9e\x44\x91\x5d\x87\x22\x80\xf6\xf4\x25\xea\xed\x3c\x14\x01\x72\xa8\x37\x51\x4f\xf7\xa1\x08\xc8\xa1\xfe\x44\x3d\x1d\x88\x62\x50\x10\xe8\x51\x34\xa2\x0b\x11\x89\xed\x21\x42\xc6\xda\x5c\xe3\xda\x3d\x44\x9b\x1b\x07\xdb\xe9\x90\x67\x6a\xa9\x43\x46\xf1\x86\xe1\xe2\xd0\x87\xf3\x8c\x68\xaf\x13\x79\x88\x9f\xa5\xc5\x0e\x89\x6d\xb3\x43\xc6\x91\x48\x74\xbb\x1d\x72\x54\xcb\x9d\x88\x55\x41\x9b\x90\xa3\xda\xee\x90\x31\xc7\x66\x74\xfb\x9d\x28\x87\x02\xd6\x63\x1b\xdf\x82\x87\x8c\xf4\xcc\x91\x11\x3e\x2b\x72\xaa\x76\x3c\x64\x2c\xb7\x21\x63\xda\xf2\x0c\x4f\x33\xb6\x35\xcf\x11\xf3\x8c\x75\xd5\x90\xd8\x36\x3d\x24\xba\x55\x0f\x19\xe3\x65\x26\x23\x78\x78\x4c\xdb\x1e\x72\xe2\xd6\x3d\x64\x1c\xea\x87\x0b\xdd\x93\xb8\x62\xf7\x64\x64\xc1\x7b\x32\xae\xe8\x3d\x39\xa6\xa5\x4f\xc4\xbe\xcb\x03\xef\x54\xb0\xf8\x7d\x0c\x25\xb5\xca\xe3\x1f\x59\x00\x9f\x3c\xad\xbd\x0f\x89\x6c\xf1\x43\x9e\xab\xcd\x0f\x19\xdd\xea\x87\x8c\xa1\xdb\x38\x66\x31\x50\xea\x9f\x8c\x70\xea\x0e\xb7\xff\x20\xc7\xb6\x00\x19\xc0\x0a\x34\x08\x19\xdf\x06\x64\x10\x6a\xd5\x24\x64\x54\x2b\x10\xf2\xdc\x52\xdf\x09\xdb\x82\x90\x91\xad\x41\xc8\xaf\x85\x73\x46\xb4\x0c\xf9\x15\x73\xce\x2f\xcb\x5b\x22\x5e\x2a\x14\xbb\x33\xb2\x88\xb6\x30\xe2\xeb\x3d\xf6\x45\xd7\x41\x2c\xda\xc0\x58\x1b\x0c\x49\x5a\xc2\x49\xa4\x02\x62\x9f\xbd\xae\x28\x9b\xa6\xbf\x60\x8c\x05\x69\x54\x6e\xf7\x5d\x9f\xce\x5d\xc7\xa7\x46\xff\xf7\x52\xb1\x99\x5d\x33\xcb\x61\x45\xb3\x98\x38\x41\x57\x20\x1c\x5e\x67\x26\xc1\x10\x13\x6f\x0b\x75\x96\x14\x8f\x8c\xf8\x5a\xbc\x89\xa2\x7a\x83\xe5\xaf\xd9\x67\x6e\x5c\x09\x78\xc5\xa8\x96\x02\x73\xbb\x1a\x85\xce\xb9\x26\x05\xd5\x58\x1d\x25\x74\x93\xd4\x13\x43\x70\xae\x39\x7c\x13\xd4\x5a\xd1\x84\xb9\x2e\x68\x04\x12\x12\x52\xf9\x18\x72\x6d\x41\x17\x7a\xed\xf7\x16\x8b\x41\x21\x11\x58\x6e\xce\xc0\xc2\xe4\xf3\xdf\x17\xe4\x63\x95\x6c\x37\x6c\xa9\x95\xa5\x49\x64\xcd\x24\xdc\xcc\xf7\x0d\xcb\x10\xb6\x02\x5b\x3f\x54\x0d\xaf\x22\xa7\x66\xa9\xc2\x01\x14\x38\x0b\x73\x00\x6a\x83\x00\xc7\x5a\x98\x43\x28\x50\x8d\xaf\x7a\xf7\x07\x1a\x52\xd0\x64\xd3\xf6\xbb\x4c\xc6\xea\xc9\x58\x1d\x7a\x26\x63\xf5\x64\xac\x9e\x8c\xd5\x9d\xcf\x64\xac\x9e\x8c\xd5\x93\xb1\x7a\xf8\xdb\xc9\x58\x3d\x19\xab\x27\x63\x75\xc7\xf3\x2d\x9a\x5c\x26\x63\x75\xf8\xf3\xc9\x58\x3d\x19\xab\x03\x50\x27\x63\x75\xe7\xfb\xbf\x06\xce\x39\x19\xab\x43\x1f\x7f\x63\xc6\xea\x81\x17\xbc\xd5\xf7\xd6\xca\xb8\x31\x91\xd8\xb7\x60\x63\xe3\x89\x33\x0f\xb7\x9b\x28\x3a\x60\x8b\xba\xfa\x5e\xcf\xc4\xeb\x7c\x40\x1f\xd3\xea\x8c\xc0\xb5\xd1\xb9\x33\x26\x18\xec\x79\x3d\x30\x8f\xae\x0b\x7d\x4c\xe3\xec\x61\x26\x16\xb6\xdd\x1d\x65\xb7\x6b\x5b\xe6\x02\xc4\xf3\x04\x9b\x5d\x1c\x77\x8e\xb2\xd5\x1d\x61\xa7\x8b\xb3\x55\xc5\xda\xe8\xf6\x2d\x70\x03\x60\xa3\xed\x73\x4d\xeb\xdb\x00\xcc\x38\xdb\x5c\x9f\xe5\x6d\x48\x44\xeb\xb1\xcb\x0d\x5a\xdd\x06\xe0\x76\xdb\xe4\x82\x16\xb7\xa1\x99\x76\xda\xe3\x82\xd6\xb6\x61\xc4\x46\xda\xe2\xa2\x0c\x0a\xd1\xd7\x61\x8c\xee\x16\xc1\xb9\x9d\x5b\xed\x7e\xa3\x98\xde\xc8\x2c\x70\x92\xda\xdd\xc3\xb8\xe0\x79\x99\x5b\xc2\xd4\x50\x5b\x7f\x5b\x79\xe8\x74\x45\xf1\xc8\x43\x83\xd6\xad\x25\xd0\xb6\x25\x3d\xa8\x26\x43\x79\x66\x77\x03\x12\x1d\x36\x74\x0b\x1c\xa7\x4c\x12\xc6\xd2\xbd\x1e\x5b\x01\x90\xbf\x5f\x54\xb3\xab\x0a\x22\xbe\xe9\xdf\x19\xac\xee\x02\x12\xcb\xef\x7f\x37\x80\xc9\xb0\x54\x33\x68\xc2\x7c\x0e\xf3\x65\x1c\x9b\x1c\x16\x60\x47\x9b\x2c\x23\x8a\xe1\x3c\x8b\xb9\x32\xca\x54\x19\x79\x8a\xa2\x4d\x94\xe3\xcd\x93\xb0\xbf\x43\xca\xcb\x31\xa6\xc9\x28\x2e\x32\xda\x24\x19\x63\x83\x3e\xca\x1c\x39\xc6\x14\x79\x54\x9d\x97\x63\x4d\x90\xa3\xf4\x8e\x68\xd3\xe3\x69\xcc\x8e\xcf\x52\x53\x29\x02\x2f\x71\x66\xc6\x68\x13\x63\x9c\x79\x71\xd8\xb4\x78\x4a\xb3\x62\x24\x6a\x87\x95\xe2\x08\x85\x78\x8c\x32\x3c\x42\x11\x1e\x6d\x3e\x74\x48\x1a\xd8\xd6\x58\x05\x78\x4f\xbd\x1d\x80\x7a\x9c\xf2\xfb\x04\xc5\x37\xc6\x5c\xf8\x2c\xa6\xc2\x71\x66\xc2\xc8\xa6\xae\x43\x87\x7b\x40\x7d\x8f\x38\xaa\xd0\xcb\x89\x66\x97\x2c\xa3\xbb\x3b\x96\x48\x91\x06\xdb\x9f\xb7\x4a\x1d\x54\x34\xa7\xf1\x43\x27\xb9\xb5\xa3\x6c\x36\xd4\x55\xcb\x09\xfa\xbd\x5d\x80\x92\xd7\xdc\xdd\xe5\x02\xb5\x11\x71\x86\xc7\x64\x2f\x9f\x40\xbf\x26\x27\x15\x11\x31\x30\x68\x1c\x9a\xff\x2a\x1f\x89\x5c\x19\x26\xc8\x4b\x2e\x3c\xa6\x5f\x35\x84\xc3\x5a\xd6\x0e\x91\x9c\x23\x4f\xfb\xdd\x9b\xd7\x1e\xcc\xd7\x12\x95\x41\xa8\xd7\xfa\x14\x5a\x87\x03\xf5\x14\xb5\xc3\x81\x58\x95\x59\x5b\xf5\x40\x75\x24\x56\xef\x78\x53\x97\x44\x79\x03\x73\xa9\x68\xd9\x6a\x93\x2e\x98\xf1\x10\xe1\x41\x88\x5f\x60\x2b\x22\x5c\x02\x47\xb9\x03\xd0\xe0\x3f\x70\xc5\x8e\x72\x05\x34\x8d\xfd\x01\xb8\x63\xdc\x00\xcf\xa2\x3d\x9d\xd0\xf4\x3f\xc6\xec\xff\x4f\x27\xd9\x44\x98\xf7\x7f\x45\x92\xcd\x97\x90\x05\x0c\xcf\x99\x2c\xcd\x89\xc4\x80\xba\xbd\xba\xe3\xc8\x3c\x5c\xaf\x48\x96\x7b\x0d\x3a\xde\x38\x80\x9d\xb7\xd4\xe9\x22\x6a\xbf\x31\x29\x61\x60\x9f\x22\x5b\xa7\x36\xcb\x50\xd5\xb2\x58\x5d\xa3\x9c\x6a\x6c\x87\xfc\xf3\x0f\x17\x7f\xbe\xfa\x61\x41\xae\x68\x6f\x1b\xf8\x46\x95\x10\x81\x0d\x11\x91\xf6\x37\x74\xcb\x08\x25\xa5\xe0\xff\x28\xb1\x56\x11\x79\x59\x41\x7c\xe5\xbd\x26\x3d\x40\x9f\xd4\x22\x1b\xb9\x58\x4c\x8f\x45\x5f\xa9\x12\x1b\x0d\xa0\x19\x59\x6a\xd7\xfb\x7e\xcf\xed\x77\x65\xff\xd4\xcf\xa2\x28\xf2\x9e\x0d\x53\x8c\xac\xf9\xd6\x19\xec\x5c\x09\x1a\x9a\x56\x41\xaa\xcd\x56\xbb\x74\x09\x66\xea\x5e\x0e\x25\x98\xb1\xd4\x57\x69\x1c\x52\xe8\x66\xfe\x85\xd5\x48\xf4\x0c\xda\xe3\x73\x2b\x12\xf3\x9c\x2a\x9e\xed\x9a\x43\xd0\xac\x8f\xdf\xdc\x54\x6d\xd2\x77\x78\x1d\xd7\xd3\xbf\xfc\x70\x75\x47\x6e\x3e\xdc\x43\x4f\x24\x7b\xb3\x82\x15\x1d\xfe\x0e\x88\xe9\xee\xfa\x8c\x8f\xab\x6d\x8d\xad\x57\xe1\x13\x3c\xe7\x5c\x43\xab\x66\x26\xec\x60\x4e\x2b\xf7\xa5\xa0\x5e\xbc\x5e\xc0\xff\xf5\x95\xbd\xa6\x69\xaa\x2c\x37\xaf\x9c\x10\x7b\xf9\x03\x96\xcb\x02\xbf\xe7\xcb\xac\xb1\x77\x0e\x7b\x5f\xac\x33\x58\xe5\x4c\xbc\xb5\xcb\x6e\x36\x08\xab\x36\x12\x10\x82\xf5\x4a\xa1\x09\x69\x2f\x1f\x18\xec\x6b\x16\x59\xaf\xb2\x9e\x50\x74\xbd\xbc\x9a\x5f\xfb\xcb\xd4\x1d\x0a\xd9\x28\x69\x4d\xae\x6f\xfd\xb6\x84\x2f\x34\x28\x23\x56\xdd\x85\xae\x18\x34\x00\x46\x93\xc4\x8c\xbc\x26\x7f\x22\x9f\xc9\x9f\xe0\x6a\xfd\x63\x08\x58\x1c\x07\x8d\x13\x6b\x51\x6a\xbb\xbe\x8d\xc6\xca\x4f\xf6\x08\xd8\x6f\xec\xca\x8d\x24\x4b\x2e\x52\xec\xd0\xe4\x9b\x0e\x3b\x6c\x3d\xb9\xc2\xa1\x1d\xe4\xa4\x1b\x06\xd6\x09\x72\xdd\x68\x41\x1f\x76\xac\x99\x91\x5b\x66\x41\x5b\x49\xf6\x06\x89\x3c\x6c\x9e\x6e\x55\x2c\xab\x47\xca\xa9\x49\x36\xed\x13\x64\xaf\x70\x6d\x6a\x22\x0e\x0b\xc3\xa9\x04\x0d\x01\xdd\x81\x1b\x1e\xa4\xca\xd3\x12\xd2\xa8\xe6\x7b\xad\x5d\xd8\xc3\xf4\x9e\xa0\x38\x20\x84\xa7\xfe\x66\x6d\xa4\x43\x15\x32\xc5\xab\x1a\x26\x95\x36\xd8\x8d\xbf\x95\x83\x40\x0f\x6f\x6c\x17\xa2\x52\xa9\xce\x40\x5f\xf6\x24\xb8\x6e\x9c\x50\xc1\x52\x0d\x64\x2c\xd8\xd3\x52\xf5\xc0\x0b\x6e\x4c\xd4\xf9\x28\x94\x34\x32\x91\xc1\x9a\x91\x6d\x93\xb0\xfb\x00\x1b\xfc\x23\x65\x39\x9c\xff\x78\x79\x3b\xb3\x1a\x21\x14\xcf\xbb\x7b\x37\x64\x95\x6b\xb5\x87\xbb\x7f\x77\x1b\x6c\x53\x13\xb1\x98\xe1\x72\xde\x2d\x16\xde\x27\x96\x3f\xad\xf6\xa4\x62\x34\xe5\x27\x8b\xad\xf1\xad\x0e\x2b\xa8\x63\x82\x6c\x72\xb9\x65\x29\x5e\xe0\x75\xcb\xc4\x14\x1a\xf2\xea\x40\xe4\xcd\xb0\x0c\xf9\x15\x2c\x83\x53\xe4\xcd\x14\x79\x33\x45\xde\x4c\x91\x37\x81\x77\xa6\xc8\x9b\x29\xf2\x66\x8a\xbc\xe9\x44\xcb\x14\x79\x33\x45\xde\x4c\x91\x37\x8d\x97\xa6\xc8\x1b\x37\xa9\xff\x32\xfe\xa9\x29\xf2\xa6\xfd\x4c\x91\x37\x07\xa3\x4c\x91\x37\xdf\x86\x4f\x6d\x8a\xbc\xf1\xcf\x14\x79\x33\x45\xde\x4c\x91\x37\x53\xe4\xcd\xde\x33\x45\xde\x4c\x91\x37\x53\xe4\x4d\x78\x9f\xaa\x6e\xde\x31\x2e\x94\x77\x32\x2f\x4a\xc3\xc8\xc7\xaa\x5d\x7d\xd5\x33\x7d\xb9\x43\xbf\x60\xe3\x70\x3c\x97\x9b\x03\xdb\x76\x95\x0a\x42\x45\xce\xb1\x16\xe2\x3c\xc1\xa9\xcd\xab\xf5\xcc\xab\x99\x9c\x1f\xeb\xea\xc0\xde\xf9\xfd\xf4\x50\xc7\xc7\xdc\x46\x31\xfe\x28\xc6\xd5\xc6\xf8\x0f\x30\x85\x86\xa1\x05\x9b\x45\x7d\x06\xf2\xa5\xb9\x2c\xb1\x04\xa4\x5b\x7d\x60\xec\x0a\x2f\x68\x26\xfa\x7a\x68\x27\xf1\x3d\x83\x99\xfe\xca\xd8\xff\xe8\x26\xb1\x8f\x7f\xc7\x3e\x8e\xc3\xbf\x3f\x32\x10\x81\x50\x8d\xc0\x35\x91\x39\x37\x56\x4e\xb1\xc2\x5e\x23\x5a\x28\xe4\xd5\xe0\xa6\x65\x43\x75\xd4\x02\x3e\x47\x6a\xb0\x0a\x6a\xe5\xe6\x68\xf6\x5c\xf3\xdd\xd4\x42\xe8\x82\xca\xb7\x95\xb4\x04\xbb\x3e\xf7\xcd\x77\x81\x71\x7e\xd3\x14\x34\xf0\x82\x95\xf7\x15\x37\xbb\x77\x52\x18\xf6\xb9\x47\x82\x69\x13\xc3\x9d\xfb\xc4\x75\x15\xd4\x95\x28\xe5\x9c\x98\xaa\x14\x10\xd5\x10\x71\x95\xc4\x20\x0b\xbb\x8d\x9d\xfb\x89\x02\x56\xd8\x67\x73\xde\x03\x32\x6e\x2b\x0c\xd5\x0f\xf5\x3e\xb0\xb9\xbd\x9c\x6a\x74\x1f\x8c\x75\x2c\xe3\x04\x16\x73\xab\xf8\x96\x67\x6c\xcd\xae\x74\x42\x33\xd8\xf3\x58\x11\xe0\xa2\xe7\x7b\xdf\x55\x51\x57\x5d\x34\xfb\x3a\x66\xbb\x79\x82\x50\x97\x50\x41\xd6\x94\x0b\x92\x5b\x1c\x15\x1e\x2c\x74\xdf\x13\xd0\xe1\xad\xa0\xca\x2a\x04\xee\x83\x90\xc4\x05\x81\x61\x4b\x29\x33\xe7\x91\xcd\x76\xf5\x9c\x9c\xab\x5f\xc8\x9f\x05\x7b\xfc\xd9\x8e\xa3\xc9\x2a\xa3\xeb\x50\x2f\x6a\xe2\x2a\xc2\x32\x73\x50\xb2\xa5\x9a\x0e\xe9\x43\x47\x88\x31\x68\x10\xff\x08\xc5\x0e\x8c\x9d\xed\xbe\xdf\x92\x37\xaf\x80\x6a\xa9\x26\x15\xf4\x90\x51\xe5\x77\xaf\xc0\xfa\xf2\xee\xe2\xf6\xe7\xbb\xbf\xdf\xfd\x7c\x71\xf9\xfe\xfa\x66\xe8\x88\x86\xfb\x94\x26\xb4\xa0\x4b\x9e\xf1\x30\xef\x3e\xb0\x82\x37\x3f\x03\x46\x95\xa6\xe7\xa9\x92\x05\xae\x53\x95\x02\xe2\x35\xeb\x18\xac\x08\x43\x86\xf7\x41\x55\xe1\x9d\xd8\x9a\xbb\x3d\xd4\x5a\x51\x61\xbc\xb0\x33\x54\x9f\x1b\xd1\xac\x4a\x61\x05\xd5\xa7\x7a\xdc\x68\x3a\x26\x28\xe1\x22\x4d\x59\xda\x9a\xfa\x89\x7d\x40\xef\x3c\xe8\x5d\x1d\x31\x4a\x6e\x3f\xdc\x5d\xff\xef\xf8\x51\x89\xa3\x91\x28\xf7\xc0\x89\x3c\xd8\x84\x58\x32\x19\x81\xc9\x8f\x2e\xba\x67\xc2\x65\xcf\x3b\x03\x95\xfc\x3d\x57\x89\x3c\xdc\x1f\x4b\xd1\x8e\xcc\xaf\x21\x90\x5c\xa6\x6c\x41\x6e\x91\x29\x42\xb7\xdd\x20\xef\xaf\xbe\xab\xd9\x00\x98\x7f\xed\xc7\xc2\x70\x9a\x65\x3b\x62\x25\xb1\x2d\xcd\x18\xba\x90\x95\xec\xd5\x56\x48\x5d\x52\x0b\xe3\x52\x9b\x5c\x63\x45\x33\x1d\x38\xe0\x31\x7c\xd0\xb2\xfa\xf7\x56\x98\x8c\xc4\x53\xf5\x3e\x49\x99\x90\xc6\xc9\xa5\x76\x24\x08\xa8\x55\x32\x21\x28\x9b\xa2\x1b\x22\xb0\xaa\x3a\x9c\xa8\x62\x96\xc0\x62\x3d\x1b\xe4\xda\xaf\xf5\xb6\x1a\x13\x34\xf1\x00\xcc\x52\x33\xbd\x77\xdb\x38\x36\x58\x4b\xab\x76\x5c\xc5\x68\x0a\xb1\x61\x05\x35\x1b\xb0\x6b\x06\x80\xe6\x54\x3f\xb0\x14\x5f\x5d\xe0\x3d\xec\x24\x69\xed\x3a\x00\xb8\xe9\xdd\x5b\x2c\xac\x18\x35\xa5\x62\x70\xff\x86\x85\xdc\x25\x23\x4c\xd0\x65\x16\x8a\x3c\x8b\x0a\x8a\xa4\xe9\x07\x91\xed\x3e\x4a\x69\xbe\xaf\x42\xaa\x22\xb7\xf3\xa7\xaa\x27\x78\x53\x83\x86\xcb\x16\x8c\x94\xe9\x1c\xd0\x04\x81\x5c\x71\x95\xcc\x2f\xeb\xed\x3b\x01\x79\xaa\x52\x5c\xe8\xbf\x28\x59\xc6\x36\xe5\xb0\x14\xf4\x97\xeb\x4b\x38\x55\x25\x9e\x1b\x26\x8c\xda\x41\x50\xe4\x41\x06\xcf\xb0\x0c\xb7\x20\x3f\x5a\x9a\xda\xa3\x22\x2b\x71\x95\x42\x33\xb3\x20\xef\xe9\x8e\xd0\x4c\x4b\x27\x4c\x85\x24\x23\x41\x6e\xc1\x67\xd2\x94\xff\x17\x04\x62\x9c\x31\xee\x62\x29\xcd\x86\xec\xbd\x30\x40\x9c\x87\x10\x31\x7c\x0f\x0d\x4c\x75\x82\x12\x17\xfb\x80\x43\xc4\x49\x1f\x98\x26\x85\x62\x09\x4b\x99\x48\x02\x7b\xd8\xb0\x15\xfd\xf1\x0f\x4f\x32\xdf\xc3\x4e\xdf\x48\x61\xc9\x38\x72\xaf\xaf\x45\xca\x13\x8a\x3c\xc8\x75\xb3\xae\x49\x18\xac\x9a\x4e\xc6\xa4\x10\x03\x37\xc0\x65\x4b\xcd\x14\x76\x77\x56\x25\x43\x24\xfe\xad\x5c\xb2\x8c\x19\x8c\xb8\x85\xb8\x7e\x6a\xb0\x95\x00\x36\x94\xa7\xc6\x13\x46\xf8\xa4\x33\xa1\x4b\x68\x17\x62\x55\x63\x43\x52\xc9\xea\x78\x45\xaa\xc9\x8f\xd7\x97\xe4\x35\x79\x69\xe7\xf7\x0a\x7c\x2c\x2b\xca\x43\x62\xbb\x91\xe8\x85\xd9\x97\xab\x57\x1e\x38\x2c\x03\xe8\x93\x48\x85\xc7\x70\x46\x44\xc8\xe7\x03\xdd\x62\xdc\x0a\xad\xba\xe3\x63\x8c\x9d\x67\x0e\x8c\x36\x6d\x42\x0f\x90\x73\x68\x9c\x30\xa1\xf7\x91\x73\x00\xe2\x30\xa1\x8f\x20\xe7\x68\x96\xf4\xa3\x66\x6a\x04\x47\xfa\xf1\xa4\x1c\xa9\x29\x02\x58\xaa\x6d\xaf\x1e\x49\x33\x67\x86\xa6\xd4\x50\xc2\x43\xdb\x51\x8a\x46\x47\x90\x5f\xc3\x06\x9f\x8e\x5f\x69\xf6\x03\x17\xe5\x67\x74\x91\x8d\x51\x21\xef\xae\xe0\x43\x92\xf8\xc9\x03\xc2\x69\x51\x64\x1c\x03\x84\xdb\x79\x94\x01\xcc\xe0\x21\x6f\xa6\xc7\x74\x09\x3e\x70\x94\x69\x96\x49\xcb\x2a\xed\xad\x4e\x45\x2a\xf3\x00\xd8\xfd\x09\x5a\x81\x89\xd1\x64\xd3\xb4\xb0\x77\x10\xcb\xa8\x4b\xea\xbf\xf8\xb5\x17\xa7\x3a\x67\x6c\xcb\x82\x69\x37\xfb\xd9\xb5\xf6\x7d\x2b\x38\xf9\x1d\x00\x00\x24\xa3\x4b\x96\xe1\xe5\x81\x54\x12\xe9\x6c\x8d\xa2\xa1\x68\xd5\x4c\xc9\x6c\x4c\x30\xd2\x47\x99\x81\x7f\x8b\x56\x8b\xb1\x00\xbe\x91\xb5\xc0\x6b\xf1\x6b\x01\xb9\xbe\xb5\x16\xd0\x77\xbe\x8d\xb5\x94\xc1\x9b\xe8\x60\x2d\xf6\xe2\x6a\xaf\x05\x6e\x90\x6f\x61\x2d\x11\x6a\xfd\x23\x17\xa9\x7c\xd4\xe3\x99\xee\x4f\xf8\xa1\xe7\x0c\x89\x65\x3d\x86\x8b\xb5\x6e\x32\x5e\x1a\x34\x96\x36\xf5\xd4\x2e\xce\xeb\x8d\xf3\x55\x3e\xf5\x21\x8f\x0a\x40\xf7\x02\x57\xa9\x9d\x7f\xe6\x88\x8b\x34\x44\xf1\x51\xbc\xf1\xe4\x1c\x70\x9d\x6b\xfa\x4e\x59\x58\x86\xd3\xec\xae\x18\xd5\xf6\xec\x2f\xef\xef\x2e\xda\x1f\x5b\xc2\x7d\x84\x94\x7b\xbb\x1e\xfb\x77\x42\xd3\x9c\x6b\x1d\x36\x49\x03\x7e\xd9\x12\xda\xd1\xbd\xf4\x3e\x8a\x35\x37\x9b\x72\xb9\x48\x64\xde\x70\x57\xcc\x35\x5f\xeb\x73\x47\x65\x73\x3b\xfb\x57\x03\x70\xb9\xc8\xb8\x68\x18\x1d\x20\x81\xdd\x09\x75\x30\xc1\xa4\x5a\x01\xa0\x1e\x33\x4d\x07\x80\xa2\x95\xb7\x03\x01\x98\x5d\xca\x59\x96\x3a\x43\x04\x86\x63\xdb\xf3\x9c\x15\x1b\x3a\x87\x0b\x63\x00\xb8\xcb\x19\x03\xbd\x7e\x23\x85\x74\x3e\x74\x8c\x39\x76\xaa\x14\xda\x25\x60\x12\xee\xe4\xd8\xb9\x0c\x00\x6e\x5a\x3e\x4e\xc2\xda\x0e\xa9\xe7\x66\x30\xb0\x7e\x80\x82\x00\x81\x2e\x63\xae\x11\x8d\x33\xb0\xb2\xce\x8d\x44\xe1\xfb\xd7\xb0\x0f\x95\xc6\x33\x12\xfd\xa0\xf9\xb8\xcf\x2c\xb7\xf1\x4c\xb8\x53\x13\x1a\x58\xd4\x41\xed\x95\x4e\x6d\xc8\xbe\xd2\xd6\x88\x06\x8f\xef\xa1\xbe\x34\xa4\x15\x0d\x80\xec\x12\x76\x9f\x24\xeb\x76\x03\x3d\x81\xbc\x4b\xba\x64\xde\x3d\x7a\x5e\x32\xe3\xc8\x19\x08\x36\xa7\x3b\xb2\x1c\x3a\x2e\x29\xd7\x60\xd6\x04\xa7\x74\x93\x78\x3f\x36\x09\xe9\xd4\x74\xfa\x64\xc7\x3c\x06\xb6\x46\x67\x75\xdf\x35\xde\x27\xfc\xd0\x14\x75\x2b\x53\x0c\x19\xaf\x82\x72\x7b\xfb\x1f\xba\xd0\x75\xfe\x8b\xbf\xfb\x6b\xc9\x42\x48\x8c\x99\x68\xc6\x91\xfb\x06\xb3\xd8\x34\xb5\x07\xa6\xb3\xe8\xba\xe6\xab\xad\x59\xa0\x95\x6b\xc3\x75\x33\x39\x7c\x56\x4d\x3a\xe0\x34\x6e\xb6\x76\x98\x91\x7f\x2f\xb5\x21\xb4\x72\x3f\xb7\x7a\x4e\x54\x31\xc7\x40\x4e\x49\xaf\x35\xc5\xe7\x62\x19\x69\x27\xb3\xe5\x29\x23\x29\x5f\xad\x98\x77\x8b\x2f\x19\x29\xa8\xa2\x39\x33\xe0\x46\x41\xd4\x42\x17\x5e\xd1\x4f\x0c\x72\x45\xa8\xef\x75\x5b\x45\xc0\xcd\xd0\x47\xcb\x0d\xc9\xf9\x7a\x83\xb2\x0e\xa1\x24\x93\x62\x0d\x11\x7d\x76\x0a\x99\xa4\x7d\x27\x11\x98\x83\x54\xe4\x91\xaa\x9c\x50\x92\xd0\x64\x03\x56\x42\x2a\x48\x5a\x2a\x48\xf0\x34\x8c\xa6\xbb\xb9\x36\x56\xcf\xb6\xd2\x11\x98\xd2\x10\x03\xbd\x5e\xe8\x83\x4e\x18\x80\x2f\x8e\x91\xc8\xf6\x2e\xa9\x8e\x89\xf3\x15\x78\xe1\xa0\x49\x7e\x3d\xd0\x5b\x07\x6c\x4a\xe9\xdf\x7b\xa6\x94\xfe\x29\xa5\x7f\x4a\xe9\xf7\x6f\x4e\x29\xfd\x07\xcf\x94\xd2\x3f\xa5\xf4\x4f\x29\xfd\x53\x4a\x3f\x3c\x53\x4a\xff\xf8\xb9\x4d\x29\xfd\x53\x4a\xff\x94\xd2\xdf\x78\xa6\x94\xfe\x83\x51\xa6\x94\xfe\x6f\x23\x59\x6f\x4a\xe9\xf7\xcf\x94\xd2\x3f\xa5\xf4\x4f\x29\xfd\x53\x4a\xff\xde\x33\xa5\xf4\x4f\x29\xfd\x53\x4a\xff\x90\x0b\x2d\xe5\x3d\xa9\x96\x31\x59\x07\xce\x80\xdf\x88\x55\x5c\x96\xab\x95\xd5\x50\x65\xef\x65\x6d\x47\x3c\xb0\x44\x57\xb9\x6f\x95\xa3\xcb\x59\x93\x35\x33\x33\x48\x6b\xc0\x30\x9d\x71\x40\x5d\x20\x25\xa4\x35\x2a\xa6\x21\x0d\x40\x90\xab\x0f\xdf\x2f\x1a\x49\x0f\xbd\xa6\xcc\xde\x54\x88\xa1\x98\x63\x98\xcd\x07\x91\xc4\x38\x25\x6b\xc4\x76\x45\x82\x3a\xfc\x26\x99\xd4\x18\x53\x00\xa0\xfb\x5c\x53\x1b\x2a\x04\xf3\x52\x07\x37\x20\x2b\x2f\x19\x13\x44\x16\x4c\xa0\x1f\xca\xb7\x65\x20\xd4\x18\x9a\x6c\x16\x76\x7c\x11\x84\xea\xb3\x43\xab\xd1\x2d\xeb\x65\x34\x47\xe4\x2a\x96\x53\x8e\x03\x10\x9a\x28\xa9\x35\xc9\xcb\xcc\xf0\xa2\x1a\xa2\x6f\xc7\x18\xc4\x00\x61\x64\x56\x85\x30\x70\x2c\x30\x34\xc5\x43\x4c\xbf\xdb\x58\xed\x97\x20\xc5\x60\xe0\x35\xc8\x46\x33\x48\x68\xcf\x0b\xb3\x43\x97\x2b\x3a\x9e\xb8\xd2\x86\x24\x19\x87\xeb\x1f\x66\x87\x39\xa1\x30\xca\x2c\xe0\xd4\x37\x90\x2b\x0a\x6b\xd5\x6e\xb1\x22\x85\x5b\xa3\x30\x1a\x1d\x8d\xf5\x30\x6e\x80\x94\x6b\x77\x47\xeb\x3e\xcf\x04\xf5\xbd\x43\x70\xb3\xfd\x5a\x61\xbb\x53\x18\xc2\x8f\xe9\x7e\x6a\x0c\x32\x80\x05\x48\x79\x72\x8a\x52\x7d\xa8\x20\xc5\xd8\xe7\xf9\xcc\x5a\x7d\x46\x8a\x2a\x59\xce\x6c\x68\x7f\xa5\x05\x7f\x10\xdd\x6c\x81\x08\x04\xdb\x5a\x9a\x65\x09\xb3\x22\x34\x3d\x38\x61\x38\xdc\x51\x47\xc9\x30\x95\x73\x01\x6e\xd9\xf7\x4c\x6b\xba\x66\xb7\xbd\x06\x9e\x3e\xb1\x09\x6c\x3c\x35\xaa\x81\x10\x32\x90\xa1\xea\x5f\x6a\x97\xd8\x59\x1f\x43\x68\x4c\x85\xe4\x38\x97\x2a\x06\xf0\x51\x71\x63\x75\x2a\xae\x31\x97\x0e\xec\x9a\xfb\x01\x97\xfd\xa0\x9b\x4e\xb8\xf7\x1e\x74\x0d\xd2\xf2\x77\x91\xa2\xe3\x6a\xc9\xc8\x52\x71\xb6\x22\x2b\x2e\x68\xe6\x3c\x50\x7d\xf4\x05\x39\x22\x14\x05\x6a\xad\xad\x68\x2a\x85\x77\xac\xf8\x35\x2c\xc8\x4f\x6e\x11\x46\x95\x22\xa1\x83\x39\xcb\x42\xa6\x8c\xf0\x15\x59\x83\xb7\x4b\xa1\x43\xfd\x0f\xaf\xff\xc7\x1f\xc9\x72\x67\x6f\x44\x30\x54\x1a\x69\x68\x56\xa1\x29\x63\x62\x6d\xf7\x00\x18\x44\xdf\x59\xc8\xb2\x66\xfa\xa5\xc7\x2c\xd4\x55\xc1\xa5\xbf\xf9\xdd\xc3\xb2\x7d\xa5\x9f\xa7\x6c\x7b\xde\xd8\x97\x79\x26\x7b\xe3\x52\x0e\x9b\xe1\x74\x5f\xbe\x03\xe2\x65\x07\x41\x42\xf1\x85\x08\x92\xf4\xc9\x4f\x64\x23\x1f\x31\x07\xb3\x83\xa2\x6a\x97\x78\x21\x8b\x32\xeb\xef\xda\x43\xc8\xf7\x96\x8a\x01\x4f\xa5\xbb\x1d\x5a\xe1\x8c\x9d\x27\x07\x14\x7d\x07\xb8\x9f\xd7\x35\x6f\x78\x74\x71\xfa\xe9\x49\x17\x0f\xe5\x94\xdc\x2a\xf7\xa9\x54\x6c\x41\xbe\xa7\x59\xb6\xa4\xc9\xc3\xbd\xfc\x41\xae\xf5\x07\x71\xa5\x54\xaf\x18\xd0\x9a\x77\x46\x2d\x5f\xde\x94\xe2\xa1\xdd\x6a\x21\x93\x6b\x2b\xc7\x15\xa5\xf1\x11\x2b\x8d\x55\xf5\x00\xf6\x33\x85\x33\x5e\x5d\x02\xd4\xf5\xb2\xa9\x61\xb3\xcf\x40\x57\x10\xf0\x44\x05\x61\x76\xae\x7d\x98\xb6\x14\xdd\x9c\x8b\x6e\x92\xe5\xef\x5e\xff\xe1\x5f\x90\xf4\xad\x76\xf1\x2f\xaf\xc1\xf9\xaf\x67\xc8\x5c\x2c\x67\xec\xe7\xd0\x3a\xa7\x59\x66\x15\x89\x26\x51\xdb\x6d\x5d\xc4\xf6\x6e\x1a\xa2\x56\x13\x43\x98\xd1\xc2\xdd\xfd\xfd\xdf\x03\x92\x1d\x37\x9a\x65\xab\x19\xc6\xde\x55\xf9\xb6\x67\x70\x51\x9c\x39\xde\x65\x6f\xf5\xc3\xab\xe1\x38\x31\x6b\x2b\xb3\x32\x67\x97\x0c\x9a\xae\x44\x2c\xb3\xf5\xbe\x8f\xd8\xc8\x5c\x7f\xb4\x65\x26\x93\x07\x92\xba\x3f\xc2\x64\x7b\x96\x09\x5e\x2b\x17\xd2\xd3\xd0\x05\xab\x28\x20\x08\xc0\xf3\x91\x3c\x4f\xed\xb8\xd5\x9c\x73\xcb\xdf\x96\xd3\xa2\x80\x46\x63\x2b\x48\x10\x7a\xc4\x05\x04\x74\x2c\x80\xe0\x3a\xe9\xd0\xd3\x74\xdf\x42\xa0\xfd\x17\x72\xc7\x7a\xea\x4f\xfc\x06\x14\xf0\xdf\x18\x2f\x32\x22\xb5\x8e\xd4\x61\x7b\xd5\xda\xf0\xc6\xb0\x98\x81\x93\xf9\xe4\x3e\x3c\xa3\xfa\x1e\x81\x59\xa1\xd1\xe9\xa9\x19\xaf\x4c\x49\xc1\x94\x86\xe6\x70\xe6\x13\xec\xe8\xbb\x8c\xf2\x50\x46\x17\x21\x75\xc3\xa3\xa7\x2d\x63\xb8\x03\x4f\xbd\x27\xbd\xaf\x04\xbc\x7d\x4f\xec\xcd\x83\x04\x0e\xc9\xf8\x31\x67\xf8\x56\xa6\xee\x13\x38\xa4\x58\xb8\xa0\x43\xd4\xd2\x11\xb9\xef\x27\x6f\x8f\xf7\xa9\x5e\x4b\xfb\xac\xda\x5f\xaa\xc3\x8a\x6f\xb9\xa3\xd8\xbb\xb7\x27\x3a\xa2\x30\xf4\xa8\x13\x0a\x67\xb3\xd1\x71\xab\xbe\x0f\x5a\x22\x34\x6e\x42\x90\x82\x6b\x51\xc6\xc9\xc4\x0b\x82\x36\x6d\x8b\x75\x07\x96\x9c\xbd\x3d\x7b\xf2\x39\xc5\x45\x2a\x59\xd0\xf5\x40\xe9\xa8\xbd\xb5\xee\x7f\x48\x52\x86\x02\x06\xd3\x20\xa4\xc1\xdf\xc1\x6d\x14\x5c\x68\xe1\x20\xf8\xce\x4e\xde\xc7\xe7\xcc\xb4\x1e\x7d\x4e\x04\xc1\xe0\xe0\xc7\xa0\x17\x9b\x10\xaa\x64\x29\x52\xa7\x9f\x57\x86\x90\xf7\x7b\x13\xbe\x91\x02\x84\x1c\xcc\x41\x0a\x84\xad\xe2\xd3\x8a\x11\xb7\x1c\xe6\xcd\xe2\xcd\xeb\x2f\xcb\x26\xef\xf7\x1a\xe2\x59\x8c\xdc\x54\x6c\x12\xcf\xc6\x93\x67\xe4\x0b\x6c\x44\xcf\xea\xbd\x53\xda\xea\xfa\x19\xdc\x57\x15\x80\x9f\xac\x32\xc6\xa2\x4a\xe1\x11\xf2\x12\x44\x1a\x2b\x0b\x36\xb2\x12\x5e\x8d\x2a\x03\x13\x97\xd6\x6e\xf5\xbb\xe5\x93\xce\x36\x1e\x62\x24\xda\x2e\x5d\x38\x4c\x4d\xee\xeb\x8e\x63\xde\xea\x22\xf7\x82\xbc\xc4\x37\xcf\x34\xc4\xa2\xbe\x7a\xf2\xf6\xba\x65\x5f\x7d\x2e\x82\x79\x94\xad\xa5\x5f\x7d\x2e\x28\xe8\xd0\xc5\x10\x0e\x06\x84\x8e\xf6\x2d\xd3\x8f\x83\x3f\xb3\x0d\xdd\x32\x88\x93\xe5\x19\x55\xbd\x99\x04\x0e\xae\x24\x77\xb8\x2a\x68\x76\xcb\xc4\x96\x2b\x29\xc0\x4f\xb5\xa5\x8a\x43\x4e\x11\xb4\x22\x64\xc2\xca\xa7\xbf\x7d\xf9\xe9\xe2\x23\xf8\x07\xc2\xd9\x6e\x98\x7b\xe0\x56\x5e\x6a\x88\x41\xd8\x5b\x41\x63\xa8\x7a\xe3\x86\xe6\xda\xb1\xa9\x7e\xfe\x76\x57\x80\xd7\xf9\xf5\xd8\x39\xe4\xa5\x29\x69\x7f\x36\x05\x3e\xec\x73\x92\x95\x9a\x6f\x9f\x7a\xfe\x87\x25\x9e\xea\x56\xfc\x0a\x02\x8f\x0b\xe9\xbe\xe4\x3d\xb4\xdb\xdd\x70\xf7\x4c\x1f\xc6\x82\x83\x59\x4f\x48\x33\xdc\xf5\xb4\xd3\xb8\x7c\xa6\xab\xda\x38\xcd\x54\x56\xa7\xb8\xba\x94\x8b\x5e\x2d\xa8\xaa\x0b\x99\x1e\x9a\xdd\x21\x3f\xeb\x34\x2a\x6c\xff\x5e\xf6\xec\x51\x60\x77\xfa\xf6\x05\xbb\x36\xff\x20\x13\x7a\x90\xfa\x7f\xd0\x4a\xdb\xbd\x47\x72\x48\xc2\xb2\xcb\xbe\xc8\x98\x32\x58\x9f\x54\xb9\x98\x31\x07\x91\x48\x41\x32\x29\x8b\x25\x4d\x1e\x0e\x77\x46\xcb\xc3\xea\x32\xd0\x72\x97\xae\x29\x17\xba\xce\x48\xba\xbe\x5d\x90\x1b\x09\x55\x6c\x50\xc3\x84\xfb\xa9\x4b\x0d\x3f\x98\xce\x8f\xd7\x33\x80\x6b\xff\xb0\x96\x5a\xf3\x02\xe2\xfb\x4b\xc1\x13\xcc\x74\xe9\xc4\x50\xd7\xad\x93\xc9\xf5\xf7\xe8\x91\x0a\x62\x48\xae\x9d\xe3\x0a\x42\x16\x5a\x73\x41\xfd\xbf\x41\x36\x50\xff\xb4\x73\x02\x1d\xb4\x90\xc9\xf5\x0f\x5d\xb5\x19\x0e\x86\xc7\xc4\xb7\x13\x8f\x2e\x64\xca\xee\x58\x06\xc7\x6e\x7f\x06\x71\xa5\x85\x03\x44\xde\x5a\xc2\x25\x14\xcd\x75\x47\xf0\x46\xa6\xbe\x60\x99\x4c\x31\x7a\x49\x27\x1b\x96\x96\x19\x78\x42\xba\xa7\xdf\x41\xfa\x05\xb5\x07\x3b\x88\x3a\x97\xee\xe8\xfc\x2e\x60\x8c\xa5\x2e\xf7\xc2\xc5\x44\x96\x22\x65\x2a\xa3\xd0\x4a\x1d\xb1\x9a\xba\xb1\x0e\x6f\x0b\x3b\x53\x4b\x77\x6b\x28\x98\x83\xb8\xaf\xea\x12\xcd\x2c\xa3\x67\x05\x92\x48\xca\x32\x66\x7c\x1a\xcf\x41\xac\x72\x3f\x3d\x16\x32\x7d\xef\xf2\x3f\x83\xeb\xba\xad\xdf\xab\x77\x5f\x93\x1f\xe8\x92\x65\x68\xbd\xbc\xb0\x4c\x8a\xe2\x52\x11\xed\x5d\xe2\x7e\x43\xc4\x77\xba\x26\x6d\x92\x57\x21\xd3\x83\xc9\x87\xd4\x33\x5a\x0f\xda\x75\x0b\xc4\x97\xab\x1e\xb8\x0e\xf7\x4a\xe5\x36\x96\x8a\xf9\x6a\xa5\x4b\xb2\x81\x23\xf1\xc0\x76\xce\x25\x9e\xd3\x82\x68\x23\xfb\xda\x1e\xa3\xcd\xb4\x2a\x53\x8d\x7c\x0c\xf3\x4c\x81\x8a\x96\xbb\xba\x67\xb8\x91\x32\x73\x3e\x36\xa9\x58\xaf\x8b\x4d\x31\xa3\x38\xdb\x32\x42\xd5\x92\x1b\x45\xd5\xae\xca\xef\x05\x87\xc2\xae\xa2\xa9\x7f\x94\x4c\xed\x40\x1e\x82\x40\x28\x10\xbc\x3a\x41\x5a\x9a\x53\x0c\x38\x72\x8a\x89\x84\xb9\x4c\xf9\x0a\x08\xd8\x11\xee\x41\x08\x60\xb7\x6f\xbf\xd4\x4c\xcd\xd7\x25\x4f\xd9\x79\x63\xe3\xba\xdc\x07\x41\xd9\x00\x2a\x76\x7c\xc9\xfd\x7e\x4f\x0b\x88\xa3\x80\xb7\xed\xf6\x22\xc5\xc3\x1e\xeb\x56\x97\x6b\x97\xd0\xd9\x39\xa4\x54\x6b\x2a\xf8\x2f\x88\xef\x84\x1a\xb6\x96\xca\xfe\xf3\xa5\x4e\x64\xe1\x76\x01\x78\xe3\xab\x06\x5a\xe9\x0e\xf5\xbb\x4e\x88\xda\xb1\x52\xf0\x53\x28\x56\x64\xee\x3a\xf2\xe5\x91\x33\x48\x1c\x05\xb8\xae\xa3\xf6\x50\x78\x46\xd4\xde\x21\xfe\x47\x6e\x5b\x3f\x53\x95\xca\x74\x65\xd7\xef\xb1\x1f\xe5\x22\xb6\x00\xc3\x75\x97\xf1\x14\x17\xb8\x96\x5b\xa6\xa0\x00\xb1\x5b\x6a\x8f\x12\xdf\xcc\x94\x79\x64\xcb\xd8\x7b\xab\x50\x5c\x42\x62\x79\x46\xb5\x1e\x9e\xac\x7b\x9b\x24\xf6\x75\x42\xb5\xe6\x6b\x51\x33\x3c\x7b\x07\xc5\x0e\xec\x36\xf5\x80\x88\xdb\xa1\xd2\x96\x8a\x9c\x15\x98\x7d\x2e\x58\x62\xb9\xab\xb6\x3f\x3a\x3b\x70\x8b\xc5\x5a\xdd\xc0\x74\x19\xc3\xee\x9d\xec\x89\x84\x83\xb2\x2c\xdb\x32\x81\x1a\x07\x48\x6a\x18\xbc\xd0\x80\x5c\x95\x7d\x46\xa0\x07\x30\xd9\x3f\x4a\xe0\x5d\x87\x73\xdb\x1f\x3f\x14\xa7\xd3\x1f\x9d\xd3\xdb\x49\xa3\x4b\x18\x68\xb7\x03\x80\x0e\x00\x98\x63\x0a\x05\xfc\x2d\x4d\xb9\x98\x8e\xdb\x91\xb7\x50\x7f\xcf\x8a\x67\x62\x48\xe3\x3a\x54\xd4\x0b\xef\x1c\xf9\xab\xf6\xa6\x08\x32\xfa\x50\x3f\x8a\x67\xc2\xec\xd8\xee\x13\x03\xb8\x1d\xdd\x77\xa2\xd9\x5d\xa2\x7b\x35\x47\x74\x9c\x08\xf6\x95\xe8\x1c\xe5\x2b\xf6\x9a\x38\xe6\x0e\x51\xcc\x30\xd1\x65\xb1\x6e\x9b\x4c\xa1\x8c\xad\x9b\xde\x9e\xbe\xb9\xa1\x10\x84\x05\xa6\x74\x10\x72\x57\xb2\x76\x27\x1f\xcc\x92\x6b\x72\xf6\xe6\x77\xaf\x37\x67\x33\x2c\x0d\xd2\x36\xc3\x2a\xb6\x2e\x33\xaa\xec\xae\x28\x8c\xce\x22\xff\xf6\x7f\xbf\x9e\xff\x8f\xff\xf7\xff\xf7\x32\xd7\xff\xa1\xff\x23\xff\x8f\xcd\xab\x7f\x3b\x80\xf9\x32\xe7\x59\xc6\x7d\xac\xa6\xff\xdf\x9c\x8b\xd2\x80\x15\xbd\x54\xfa\xc0\xe2\xd7\x7f\x6f\xc8\xd2\xb0\x5b\xc5\x56\xfc\x73\x18\x25\x76\xba\xf6\x5d\x2b\xe2\xad\xf8\xe7\x36\x56\x14\x5b\x5b\x05\x5c\x69\x4c\xe4\xda\x50\x91\x82\x48\xb1\xea\xf2\xf0\x7b\xbf\x6d\xa9\xd9\xaa\xcc\x66\x50\x4d\x06\x0c\x65\x57\x4e\x84\xfd\xf1\xe3\x0f\x18\xed\x65\x79\xe9\xe7\x1d\x46\x56\x3d\x2a\x0e\x1e\x9d\xce\xbc\x4c\x98\x99\x76\xae\x59\x3c\x3c\xb3\xca\xfc\x4f\x13\x7b\x31\xb5\xa0\x73\x4d\xb4\xb1\xd7\x16\x5a\x9c\x97\xe5\xe1\xce\xc1\x05\x86\xc6\x05\xf8\x9f\xc6\x5d\x00\x8a\x19\xa1\x8d\x22\x1c\x4d\xcc\x2c\xc8\xf7\xd2\x6e\x29\xb5\x87\xe8\x00\xac\x3d\xc6\xa5\x46\x67\x14\xf9\x37\x7b\x46\x12\x93\xe1\x3a\xff\x2d\x7a\xd3\x34\x4b\x14\x3b\xe4\x76\xed\xbb\x1e\xdf\x41\x07\xb9\xf7\xb9\x57\x3f\xa2\x86\xa9\xad\x9c\x64\x85\x25\x5d\xd0\x84\x11\xaa\x3b\x83\x90\x5a\x3b\x8d\x67\xca\x9b\xac\xf0\x34\xd4\x46\xd8\xda\x31\xd8\xfc\xe8\x00\x22\x5c\x9b\x58\xe8\xd3\x4d\x08\x4c\x96\x4d\x18\xe7\xcc\x24\xe7\x4d\x71\xe4\xdc\x2d\xfa\xfc\x4f\xf8\x1f\x73\x3b\xef\x7f\xdd\x47\x59\x8f\xeb\x30\xc0\xd9\xfb\x6c\x54\x03\x3d\x68\xf6\x71\xdd\xaa\x55\xb4\x91\x59\xaa\x09\x04\x22\x83\x71\xc4\xc3\x22\xd4\x18\xc5\x97\x40\xab\x5d\x7a\x59\x22\xf3\xbc\x19\x6f\x59\x55\xe0\x73\xc1\x0e\x69\x4f\x37\x8c\x8e\x72\x4a\x23\x84\x92\x55\x7f\xf1\xf0\xd6\x2a\x5f\x5c\xe0\x9d\x41\x33\xc8\xf1\x70\x37\x44\x46\xd6\xf6\xeb\x56\x5d\x44\x57\x28\xb0\x11\x5d\xd6\x79\x77\x40\x5c\x44\x21\xd3\x05\xb9\x93\x79\xe5\x17\xb0\x1b\xe2\xfa\x60\xb5\x0a\x4c\x1b\x09\xf1\xb6\x6b\x94\x2d\xe5\xa3\x05\xbb\xe1\x45\xb7\x06\xe5\x6e\x3c\x0f\x12\xec\x21\xf6\x93\x2a\x8e\xa4\x90\xe9\x5b\xf2\xff\x08\xf2\x06\xe9\x50\x3e\x82\x74\xfa\x97\xeb\xcb\xfe\xd2\x3e\x4b\x1c\xf9\xfb\x3b\x40\x17\xf9\x1d\x7e\xa9\x99\x59\xf3\x94\x2c\xb1\x1c\x87\x55\xc6\x5f\x0a\xf6\x88\xce\x70\x92\xb8\xfa\x14\x3d\x6e\xe7\x86\x37\xc4\x1b\x84\xab\x49\xba\x61\x5e\x91\xdf\xe3\x38\x05\x53\xae\x8a\x9f\x1d\xab\xdf\x45\xfa\xe1\xe3\x99\x8b\xb1\x52\x8f\x73\xf5\x38\x9f\xcf\xe7\x76\x9d\xbe\xd8\x75\x47\xd1\x6e\xab\xe3\xa3\xa2\xde\x1b\x83\x58\x61\x1b\x98\x6a\x3d\x15\x64\xb9\x62\xe7\x56\xb1\x78\xd1\xf1\xf5\x50\x39\xe1\x70\x44\x7d\xb8\xb8\xfd\x13\xca\xda\x87\xfb\x09\x8d\x2b\x68\xdf\x51\x52\xac\xbf\x06\xf4\x91\xd5\x9f\x03\xa9\xdd\xa3\xca\x55\x3a\x95\x98\x9a\x70\xb8\xc3\x09\x76\x2d\x50\xa8\xfe\x59\x4a\xd4\x9f\xbe\x38\xfd\x91\x65\xe9\xab\xe2\xf3\xbd\x87\x7e\x44\x41\xfa\xfd\xb2\xf3\x3d\xf6\xc1\x98\x52\xf4\x7d\xf5\xa5\xfb\x98\xf3\x71\x24\x3a\x50\x57\xf0\xc8\x8a\xaa\x61\xf7\x7c\xb0\xde\xfc\x13\x2a\xcd\x87\x99\xc4\xc8\x1a\xf3\x07\x35\x13\x7b\x94\xec\xa8\x3d\xeb\xdb\x9f\x6e\x98\xf1\x7b\x16\x5b\x1d\xf1\xab\xb0\x95\xe1\x7a\xf2\xe3\x2b\xc9\xb7\xe5\x94\xee\x8d\x7e\x4a\x11\x79\x3f\x83\x4e\xc0\x23\xcb\xc7\xff\xb3\x5d\x32\x43\xf1\x74\xc1\xe2\xf0\xc7\x95\x85\x1f\xaa\x7c\x34\x18\x03\x38\x18\x0e\x11\x2a\x02\x7f\x5c\xf9\xf7\xe7\x9f\x73\xa8\xd8\xfb\x71\x65\xde\x9f\x7f\xce\xa1\xa2\xee\xc7\x95\x73\x7f\xee\x39\x07\x4d\x98\x4d\x95\x0a\xe4\xdd\x61\xfe\x76\x51\xe9\xf5\xa0\x82\xe9\xfd\x06\x19\x98\x7d\xe7\x1b\x6d\x62\x95\xc0\xce\x99\xb7\x59\xcf\x0c\x14\x33\x67\x35\x3d\x28\x62\x7f\x66\xcf\x39\xcf\xa9\xda\x59\x61\xbb\x9f\x03\xb5\x18\xa6\x90\x7e\x8a\x5e\x52\xa1\xa9\x4b\xaf\xb2\xda\x43\x10\xb1\x81\x68\xe0\xe1\x4e\x25\x43\xe9\xba\xa1\xc8\x21\xbd\xd3\x89\xe9\x76\x1f\xb6\xb5\x7f\x7c\x0f\xb4\xfe\x86\xad\xa5\xb2\xab\xa4\x1e\x52\xe5\x92\xea\x95\x0b\x41\x19\x86\xd0\x03\xd0\xe0\x4a\x51\x17\x53\xf0\x30\x5e\xee\x27\x42\xf8\xfb\xa7\x3b\x2e\x0d\x83\x8a\xbc\x54\x9a\xd1\x52\x24\x07\x51\x18\x03\x58\xee\x58\x2c\x41\x93\xb0\x3d\x53\x0f\x4c\x09\x96\xd5\x05\x68\xdd\x0d\xdb\x27\x56\x0e\x87\x50\x87\x83\x5b\x3b\x8a\x27\xad\xd0\x50\x68\xc1\xee\x5c\x35\xb7\xde\xcf\x23\x82\xd9\x06\x6a\x85\xb5\xe3\xcf\x41\x78\x3a\xed\x0c\xc2\xc1\x74\x81\x40\xb9\x50\xf5\xaf\x81\x10\xba\xd0\x31\x18\xee\x27\x71\x74\x27\x89\xa3\x04\x2f\xdf\x43\xe2\x30\xb3\xe6\x4c\x47\x89\xae\xcf\xd6\x46\xe2\x84\x0d\x24\x86\x8e\x49\x7c\xd3\x88\xe7\x68\x17\x71\xfa\x46\x11\xc7\xb5\x88\x20\xcb\x40\xed\xd4\x67\x68\x0e\xf1\x0c\xed\x08\x62\x0a\xbc\x0f\xb2\x8c\x71\x4d\x20\x8e\x6b\xff\x40\x82\xcb\x18\xdd\xf8\xa1\x89\xcb\x5e\xa8\xe3\x70\x7c\x1a\x5c\x46\x35\x72\x38\xbe\x85\x03\x91\xfd\x9d\xe1\x8e\x6a\xde\x50\x99\x1a\x7a\xc1\x8e\x68\xdb\x10\xe1\x49\xa8\x9f\xe3\x38\x67\x50\xc2\x3e\x86\x7b\x86\x93\x70\xc2\x4d\x1a\x22\xdb\x30\x3c\xe7\xe9\x3d\xc6\x8b\xed\x42\x97\x2e\x92\x44\x96\x62\x38\x26\xea\xee\xe0\xf5\xae\xf3\xdd\x7e\xab\x2b\x36\xad\xc4\x00\x01\x4f\xd4\xb7\x4a\xe6\xcc\x6c\x58\xa9\x3b\xe3\x60\xfa\xbd\x97\x9b\x70\x04\xe9\xdd\x5f\x2f\xec\x9c\x5a\x6e\xc7\xbd\x50\x77\x27\x64\xa6\xac\xc8\xe4\xae\x99\xff\x72\xe8\xf9\x93\x8d\x6b\x59\xae\xc8\xbf\x59\x2e\xc2\xa5\xf8\xb7\x05\xb9\xc3\x3c\x11\x90\x45\x88\xa1\x6b\xf0\x03\x23\x2a\xfe\x7a\xd1\x88\x94\x38\x80\x89\xc3\x6a\x8c\x94\xc8\x4b\x03\xcc\xe8\x20\x18\xff\x13\x0e\x04\xd4\x76\x4f\xd7\x58\x0a\x71\x2d\x3a\x63\x3c\xf9\x0a\xc6\x44\x07\x52\x3c\x22\x8d\x54\x74\x3d\xb0\xf7\xf8\x8e\xdf\x70\x90\xdb\x51\xb1\x93\x2b\xc8\xb8\x73\x40\x5a\x52\x51\xd7\xbd\x7a\x10\xea\xce\x85\x36\x54\x24\x6c\x54\x00\x14\xd4\x06\xe8\xc9\xc4\x68\xc7\xd7\x5c\xb9\x37\x31\x41\xed\xce\xc5\xbd\xca\xc6\x14\xf7\x88\xb0\xf3\xf8\xdd\x19\x6a\xd8\xaa\xcc\xee\x98\xd1\xfb\x6d\x43\x7c\x31\xe4\x22\xa3\x09\x6b\x3b\xb2\x20\x59\xf8\x9e\xe5\x45\x46\x4d\x4f\x72\xcc\xc8\x88\x17\x87\xe6\x73\x97\x4a\x7b\xfe\x1d\x60\x22\xe5\xaa\x2b\xb2\x65\x48\xfa\xcb\x59\xca\xcb\xde\xf6\xd5\x6d\x3c\xfe\x04\x3e\x15\xd7\x7b\xdc\x6f\x36\x02\xa8\x92\xa8\x68\xf2\x80\xb9\x0e\x75\xa6\x4b\x2f\xcb\xdb\x6b\x3f\xfe\xe2\x85\xcf\x5e\x61\x54\x78\x4b\x38\xf2\x16\x99\xb2\xb3\x46\xca\x0b\x8e\xd9\x0f\xf8\x7d\x5d\x8f\x0d\x2b\x48\xb8\x28\xda\x97\x0e\xc0\x2b\x22\x15\x79\xcf\x72\xc8\xc3\x79\x1a\xf6\x83\xc8\x27\x31\x52\x82\xe6\xbf\x30\x88\xae\x8a\xdb\x84\x7b\x28\xce\x52\xc7\x84\x65\x90\xd2\xe2\x77\xc3\x6b\x7c\xce\x6a\x1a\xb8\xcd\xfc\xa1\xf0\xfe\x56\xf4\x40\xf3\x5f\x5c\xd5\x16\x94\xb1\xb4\x44\x35\x2b\x01\xbe\x64\x61\xe6\x80\xb5\x80\x80\x00\x3b\x03\xc0\x7c\x6c\x60\xe9\x8b\x8f\xe0\xb7\x9e\x62\xaa\x09\x3c\xf6\x46\x81\x93\xda\x55\x9e\xb7\xca\xbe\x2d\x99\x79\x64\x0c\xef\x8e\x3b\x8f\xbf\xc6\x65\x6f\xb5\x90\xa0\xe8\x0d\x21\x2b\x65\x6e\x11\xe8\x66\xe5\x22\x32\xed\xd9\x6d\x17\xb3\xa9\x43\x0b\xee\x03\xe2\x46\x83\x8e\x05\xcf\xda\x84\xec\x5d\x91\x15\x62\x4b\xe1\xe2\xe0\x90\xfa\x02\xaa\x4c\x74\x6c\xfb\x89\xc8\x31\xa8\xdc\x77\x30\xb4\x08\xc3\xe2\xed\xa7\x77\x95\x20\xdf\xcb\x71\xdb\xdc\xf5\x08\x3e\x46\x0b\xee\x6e\xc9\xb8\x63\x74\x71\x7b\xed\x6f\x55\x6f\x80\x82\xcb\x1d\x7f\x63\x29\x16\x8f\xa6\x28\xd1\x04\x8e\x91\x62\x90\xa7\xe0\xe2\x1b\x91\xf5\x3b\xfc\x2d\x40\x0e\xb2\x24\xe4\x2b\xc1\x49\xb1\x65\xca\x10\xc5\x12\xb9\x16\xfc\x97\x40\x15\x64\x1c\xbd\x92\xd3\x2d\xaa\x35\xd4\x4a\xc0\xc4\x0c\x38\x05\xb3\x4a\xfa\x54\xcc\x8e\x47\x4a\x11\x01\x19\x13\x08\x3a\xd9\xde\x9a\x9b\xc5\xc3\xbf\x00\x79\xb9\x4c\x33\xb3\x3b\x87\xe8\x6c\xbe\x2c\x8d\x54\xfa\x3c\xb5\x42\xef\xb9\xe6\xeb\x39\x55\xc9\x86\x1b\x06\xd9\x27\xe7\xb4\xe0\x73\x58\x9c\xc0\x4c\xa0\x3c\xfd\xae\x8a\xbc\x3c\x9a\x2f\x3e\xf0\xfe\x66\x3e\xed\xbd\xfc\x1b\x47\x05\x90\x7a\x3e\x8f\x4c\xa2\xda\x1a\x9f\x39\xfb\xf1\xea\xee\xbe\x8a\x9d\x0d\xa8\x4e\x56\x97\x84\x1d\xac\x41\xe8\x7a\x33\x2d\xc2\xb9\x58\xf9\x92\x3b\x55\xd1\x00\x26\xd2\x70\x67\xbd\x46\x79\x39\x5d\x2e\x81\xdb\x54\x71\x80\x46\x76\xa5\x5c\x92\x6b\x41\xde\xd1\x9c\x65\xef\x68\x28\xe3\xfc\x99\xb7\x12\xa2\xa8\xe6\x76\x3b\x8e\xdf\xcc\xbc\x27\xdf\xab\x7b\x43\xef\x0c\x15\x29\x55\x3e\x47\xcd\x5e\xfd\x75\x42\xd1\x33\xaf\xd6\x0f\x14\x5e\x6a\x20\x83\x58\xc7\x5a\xd0\xce\xc0\x68\xd6\xe4\x3e\x29\xd3\x70\x79\x27\x1b\xaa\x68\x62\x98\x82\x02\xc7\x78\x29\xf5\x1f\x68\x8c\xfa\x72\xa4\xe4\x2b\x45\x16\x32\x25\xb4\x34\x1b\xa9\x8e\x96\x70\xea\xb2\x37\x73\x7f\xbb\xd4\x3f\xe1\x2f\x89\xbd\x0b\x7a\xa9\x22\xa6\xc6\x09\x16\xef\x7d\x2f\xd3\x70\xdd\xe5\x3d\xe6\x5d\x7f\xe4\x6f\xea\x36\x02\x5d\x49\xe0\xdc\xbe\x11\x80\xda\x0a\x9b\x73\x4c\x7a\x43\xb7\xe3\x83\xd0\x03\x28\xc3\xa9\xcc\x61\x2a\xf3\x37\xa1\xba\xcd\x11\xed\x5c\xc6\x34\xdc\x1e\xe8\xb6\x61\x69\x1c\x55\xa1\x71\xe5\x3f\xd0\x0a\x52\x55\x08\xb3\x08\x74\x7a\x95\xa0\x85\xde\x48\x73\x59\x01\x0e\x2e\xa5\xdd\x6d\x6f\x0d\xc1\x54\x20\x20\xf8\xc6\x7b\x90\xb1\x56\x2a\xc5\x84\xc9\x76\x7b\x63\x04\x21\x3b\xfd\x14\x4c\xab\xb5\xd3\x0b\xcc\x56\xc8\xfa\x5d\x49\x4d\x86\x2d\x10\xe1\xbe\x0f\x57\xab\x4a\xa8\xf0\x90\xf6\x26\xd2\x04\x0b\x79\x14\xa0\xfb\x62\xac\x66\x78\xf9\x44\xb0\x47\x4f\x7a\x76\xa9\x00\xc8\x6b\xce\x8a\x61\x06\x67\x65\x73\x70\xef\x0d\x34\x59\xf1\x71\xd8\x8d\x62\xbc\xad\x45\xd6\x31\x67\xdd\xab\x09\x42\x6f\xad\xb4\x19\x6a\xea\x2e\x2d\x1f\xa0\xea\xc5\x6b\x57\x59\x30\x08\xb3\x5e\xaf\xdb\x25\xac\x77\x09\x19\x60\x70\xfb\x01\xa0\xd2\x92\xc8\x8c\x3c\x32\xab\x5f\x8b\xa1\xfe\x44\x7e\x69\xb9\x3d\xc2\x8d\x49\xfb\x68\x60\x37\xbd\x25\xdb\xd0\x2d\x97\x2a\xa6\x25\x71\x13\x85\xf6\xfa\xc7\xe0\xe1\x50\xa5\x8b\xd8\x5e\x47\xb4\xe0\xbd\x11\xa9\xcd\xa7\x2d\x53\xdf\x5e\x63\xdc\xb0\xa3\x74\x8c\x9a\xf6\xf9\x89\x83\x02\x8e\x7f\x96\xcc\x0a\x46\x55\x61\x12\x74\x60\x35\x61\xb7\xcb\x53\x0c\x62\x89\xb4\x42\x7b\x40\x28\xdb\x2b\xae\x9e\xd8\x2d\xb9\xb8\xbd\xc6\x19\x43\x76\xc3\x20\x44\x2a\x76\xae\xea\x92\xd9\x70\x95\xce\x0b\x0a\x9e\x51\xbb\x97\xb3\xd6\x6c\xab\xb4\xa7\x01\x90\xd1\x25\xe8\x43\x02\xa8\x7f\x5a\xfb\xe2\xe5\x50\xa8\x75\xe9\xcc\x24\x55\x9e\xf5\x3e\xb6\x4f\x35\xcb\x98\x4e\x59\x87\x9e\xee\x3d\xa3\xed\x33\xcf\x32\xa6\x33\xd5\x1c\xf0\x1d\x7c\x61\xa0\x6d\x55\x54\x33\xaa\xde\xe4\xcd\xe6\xb3\x9f\x9e\x57\xa7\x70\x7a\x75\xa0\x65\x93\x08\xa7\xe3\x55\xd3\x7b\x76\x51\x63\x50\xe7\x22\x23\x38\x53\x7f\x7e\x69\xf3\x89\xcf\x88\x6c\xa1\x22\xbe\xa9\xd9\x31\x39\xa8\x83\xe3\x1f\xe4\x51\x7e\xdd\x7c\xd4\x43\xd4\x44\x74\x54\x0b\xe5\xa9\x36\x9f\x2f\xbc\x43\x51\xb9\xac\x83\xc3\x77\xe5\xba\x0e\xe6\xb5\x0e\x42\x0d\xe5\xbd\x76\xe6\xb8\x0e\x42\x3c\x79\x0e\x6c\xf3\xf9\x8a\xf9\xb0\xcd\x27\x92\x22\xa3\x5e\xd3\x3d\x75\x78\x9a\xcf\x7e\x5c\x22\xc4\x56\x42\xe1\x10\x22\xb7\x4c\x35\x2b\x88\xfa\xc6\x4d\x81\xba\xc6\xf8\x2c\xb9\x48\xb9\x08\xb6\xbd\x8f\xe5\x8b\x90\x72\x7b\x55\x65\xd9\x8e\xeb\xbf\xb9\xff\x71\x3b\xa5\x12\x97\xea\x71\x34\x48\x1f\xee\x3c\xe4\x68\x9e\xba\xdf\xb0\xd6\x2f\xe0\x24\xbc\xb8\xb9\x1c\x16\x88\xa2\xda\x88\xf6\xec\x8b\x9f\x6c\x73\x68\x67\x8a\x8b\x5d\x06\x69\x45\x77\x6b\x67\xa0\x9c\x41\x3c\xe0\x0e\x6d\x9c\x54\xb8\x06\xef\x2e\x14\x3c\x02\xa6\x62\x99\xcb\x03\x62\x50\x1b\xa7\xae\x9d\x32\x84\x8e\x71\x8d\x4a\x89\x85\x1e\xf3\xda\x1e\x02\xed\x9c\x7c\x15\x6b\xc0\xa4\xfd\xa1\xf2\x14\x8c\x40\x1e\x01\x2d\xc2\x07\x1d\x0f\x2f\x8e\x8c\xe3\xee\xf6\xf1\xb8\x3f\x62\x99\xd5\xb6\x35\x44\x27\xd8\xd8\x33\x8d\x5b\x64\x4f\x41\x5f\xea\x65\xc7\xc4\x25\x50\x16\x9c\x16\x6f\xc8\xfe\x44\x33\x9e\x56\x03\x21\xdd\x5f\x8b\xa1\x7e\xe2\xfe\xb9\x91\xe6\x5a\xcc\xc8\xd5\x67\xee\x4b\x73\x5c\x4a\xa6\x6f\xa4\x81\x5f\x9e\x05\x9d\x38\xf1\x23\x90\xe9\x6a\xff\x60\xf5\x27\xb0\xee\x34\x2a\x04\xc5\x12\x37\x3e\xce\x36\x50\x6d\x0f\xd7\x56\xdb\x96\xca\xe3\xa3\x0a\x74\xd0\x83\x4d\x5b\x9b\x8f\xd7\xf7\x84\x14\x73\xf0\x44\x2d\xba\x46\x42\x64\x47\x82\x94\xaa\xb5\x23\x87\x53\xab\x06\xc5\x01\x23\xc1\x82\x2d\x0b\xbf\x07\xdd\x11\x3c\xf7\x29\x49\x4b\x85\x0d\xeb\xb4\x51\xd4\xb0\x35\x4f\x48\xce\x54\x20\x22\xaa\xfd\x14\x96\xbf\xc7\x4d\x21\x92\xeb\xe2\x33\x92\xc2\x62\xfb\xed\xe2\x13\xdb\x37\x18\x74\x34\x36\x0c\x6f\x5e\x6d\x76\xa4\x98\x19\x21\xed\xc6\xaf\x08\xae\xd8\x1f\x7a\xab\x75\x35\x9f\x2f\x2b\x1a\x37\x26\x86\x37\x64\x8e\x15\xbe\xfe\x8f\xbd\xe6\x80\xa0\xff\x93\x14\x94\x0f\x35\xfd\xb6\xcf\x85\x2f\x1a\xd4\xfc\xd6\xd9\x58\x9a\xc3\xd8\x11\xb8\x26\x76\x7f\xb7\x34\x63\x11\x82\x37\x0a\xac\xcc\x75\x59\x94\xab\x03\x89\x65\x46\x1e\x37\x52\xe3\x9d\x0a\xa6\xe0\x41\x90\x5c\x93\x17\x0f\x6c\xf7\x62\x76\xc0\x07\x5e\x5c\x8b\x17\x75\x6d\x8d\x51\xec\xa6\x92\x16\xc0\xca\xfb\x02\xbe\x7d\xf1\x14\x21\xe8\xa4\x52\x2e\xaa\xe8\xbd\x85\xbb\x9a\xcf\x5e\xff\xbc\x66\x10\x5d\x03\x4a\x1d\xd7\xe1\x53\x36\x32\xca\x03\x01\x30\xe4\xf8\xa8\xa2\x0e\xbb\x02\x94\x14\x0b\xfb\x2e\xa2\x0e\x85\x6f\x17\x90\xc6\x63\xa4\xfe\xa4\x72\x94\x3d\x36\xa3\x90\x9c\x41\xa5\x61\xfe\x0b\xeb\x01\x4d\xec\xd5\x29\x17\xdf\x57\xed\x06\xa0\x63\x53\x8e\x89\x05\x8f\xae\x7a\x7b\xd8\xd9\x20\x92\xac\x4c\x31\xfa\x0b\xc0\x82\x22\x38\xae\xa3\xc8\x68\x14\x8e\x22\xaa\x4f\xd5\x27\x5e\xe0\x74\xda\x50\x6d\xe6\x1b\xca\x56\xb3\xcf\xed\x5e\x13\x0c\x08\xf5\x42\xcf\x3a\x74\x3d\x1b\xa0\xc7\x88\xd5\x0d\x7b\x56\xa1\x9d\x51\xb4\x0b\xd9\x94\x07\x16\x3b\xe7\x4f\x82\x63\xa1\x72\x54\x91\x11\x6a\xef\xd4\xf7\x3a\x80\x78\x8a\x73\x24\xf4\xd1\xd7\x9c\xff\x35\x79\x59\x5d\x15\xa4\x63\x9c\xac\x35\xd1\x30\x08\x0c\xda\xd0\xee\x50\x94\x7f\x32\x67\x6b\x42\x0b\x9a\xf0\xbe\x7e\x4e\xf8\x8c\x97\x46\x22\x27\xd8\xce\x14\x6e\x1f\x08\xb7\x95\xb5\x91\xcd\x5d\x3e\x58\x30\x78\x37\x24\xe2\x6c\x23\x5b\x3e\x0c\x5c\x98\x89\x14\xb8\xf6\x78\xea\x7c\xe7\x4e\xf2\x3b\xff\xa9\x9d\x79\xdf\x31\x0d\xae\x01\x12\xc3\xfc\x6a\x3b\x40\x40\xc0\x3f\xb2\x4b\xcd\x7f\x61\x20\xac\xf4\xe7\x33\x11\x47\xef\xf5\xbc\xbc\x8f\xd3\x95\x68\x3e\xfb\x08\x60\xee\xb0\xbb\x63\xb0\x7f\x4a\x04\x8d\xb6\x6b\x80\x76\xf5\x29\xaa\x27\x82\x67\x38\xd3\x24\x65\xf0\xbf\x43\xd2\xf1\x52\x96\x06\x78\x2e\xdc\x91\xc5\x36\xd4\x69\x7b\x8c\xd1\x24\xa3\xda\xdc\x2a\xb9\x64\xf7\x7c\xd8\x75\xb5\x9f\x9c\x4f\xb5\xc1\x86\x9b\x8f\xae\x97\x70\xd5\x1a\x0e\x57\x39\x2c\x3c\xfb\x4c\xdf\x94\x1a\x36\xef\xad\xd7\xd2\x7c\x46\x48\xfc\x76\x6d\xf7\x8a\x0a\x0d\x93\x79\xd2\x02\x5b\xcb\x22\xa6\x02\x1a\x61\x39\x26\x18\x95\x26\x05\xf3\x2d\x00\x41\xae\x07\xbb\xf4\x57\x46\x90\xeb\xf0\x37\x12\x2b\x7f\x2d\x73\x2a\xe6\x8a\xd1\x14\x02\x91\x7d\x9b\x40\x8e\xe5\x7e\xa0\xb1\x42\x14\x4d\x93\x8a\xae\xa1\x6b\x61\x8d\xd4\x61\xac\x8c\x58\xa3\x62\x54\x87\x1b\x19\x75\x2c\xf1\x47\xc1\xff\x81\xb5\x86\xb8\x6e\xb4\x24\xa1\xf6\xbf\x95\x99\x91\x9c\x26\x1b\x2e\x62\x0c\x11\xc0\xcd\x34\x84\xd0\x59\x64\x39\xfb\x10\xd8\x16\xd7\x7c\xeb\x6c\xa2\x38\xc7\x41\xc3\x39\x3e\x15\x19\x9e\xe9\x03\xc4\x59\xfe\xc9\x8d\x8b\xe0\xd0\xe4\x45\x8b\xbd\x75\x15\xf1\xda\x7f\xb0\x00\xb9\x8b\x94\x66\x71\xbc\x38\xca\x00\x0c\xdc\xfa\xa4\x1b\x1b\x16\x40\x8f\x02\x19\x2a\x97\x51\x3f\x23\xd8\xbc\x2b\xab\x11\x73\x10\xb0\x14\x54\x9d\xd0\x14\x06\xbc\xb0\x90\x4f\xb7\xf4\x38\xab\xd3\x9c\x0c\x88\xe7\xf8\x92\x19\x9a\xda\x28\xf5\x3e\x2c\xcb\x15\x1b\xaa\xe3\xb5\xaf\x5b\xfb\x76\x9f\x1a\x02\xa0\x7a\x31\xff\xbc\xea\xd4\x31\xc9\x82\x86\xae\xc3\x95\x5d\xe9\xfa\x8b\xa4\xdb\xf9\xc8\x7d\xab\x62\x63\x1a\x1c\xe1\x2b\x18\x7d\x64\xda\x9b\x91\x19\x53\xdd\xad\x1c\x0e\x3a\x6c\xb4\x4b\x07\x14\x32\x3d\xd3\xcd\xef\x23\xcb\x87\x1e\xa4\xfb\x16\x32\x45\x9e\x7f\x5f\xc1\x02\xbb\x01\x76\x38\xc7\x08\x40\xfc\x0b\x04\xaf\x75\xd1\xa5\xc5\xaf\xf1\x8d\x1c\x0c\xf6\x45\xdf\x30\x62\x14\x74\x72\xff\x53\x65\x23\x9c\xb1\xd5\x8a\x25\xe6\x5f\x1b\xcd\xa4\xe0\xfd\x6e\x1a\xaa\x2c\x75\x7f\xf2\xff\x75\x50\x22\x75\x48\xea\xc3\xf1\x22\x4a\x81\x5c\xc1\x8b\xfe\x3e\xf7\xf3\x87\x65\x21\x0c\xe8\x17\x09\xc6\x75\xcc\x1b\xea\xa1\x79\xbc\x46\xb0\x2a\x32\xcd\xb2\x16\x08\xed\xfb\xe5\xd7\x1b\xe9\xa2\x3e\x9c\xe9\xb1\x07\x26\x55\x8c\xdc\xc8\x3b\xd7\xbb\x65\x46\x6e\xc1\x6c\x52\xff\x02\x06\xcc\x1b\x79\xf5\x99\x25\x65\x5f\x86\xdf\xc0\x71\xed\x75\x21\xb6\xc3\xcb\x6a\x97\x21\xae\xab\xe5\x32\xac\x49\xd1\xbb\x03\xfb\xf8\x82\x74\x38\xec\xc1\xd6\x03\xdb\xe9\xca\x6d\xe3\xdc\x94\xe0\x5a\x99\x0d\xd9\xf5\xbd\x23\x06\xfd\x3b\xff\xd3\xb7\x24\xce\x97\x75\x9f\x6c\x97\xd8\x57\x8f\xe9\xad\xbe\xbd\xa1\x5f\xf6\x25\x98\xd2\x31\x88\x0d\x7b\x2e\x5b\xd8\xfd\x10\xe9\xa9\x6c\xf1\xa5\x3e\x16\xdd\xe5\x93\x6c\xb8\x18\xaf\xfe\x51\xd2\xac\x9d\x8d\xef\x7e\x0a\xba\xc6\x5a\xa6\x7c\xe8\x26\xc1\xb3\x34\xa1\x0a\xb3\xfd\x5c\x4e\x90\x6f\x4d\x85\x29\x00\x09\xc4\xcb\x22\xfb\x08\x20\x18\x76\xde\x15\xbd\x2e\xa8\x32\x3c\x81\x62\xe2\xae\x61\x48\x8f\x53\x6d\x28\x95\xac\x22\xc8\x3b\xac\x2b\x1e\xb1\x09\xf7\xfb\xdf\xec\xdf\x9c\x05\x53\x5c\xa6\x60\xa5\x70\x3a\x52\x2f\x95\x57\xc7\xe1\xa5\x4b\xc6\x73\xd4\x29\x57\x9e\xa7\x54\x87\xb6\x15\xb2\xd3\x9f\xed\x55\x15\x00\x70\x97\xce\xab\x06\x67\xae\x4e\xe5\x82\xfc\x79\xe7\xa3\x8a\x20\xc2\x08\x03\x69\x7b\x40\x42\x19\xdd\x76\xd6\x2b\x42\x6c\x1c\xf3\x95\x54\x6c\xcb\x14\x79\x99\x4a\x08\xc9\x65\x5b\x9e\xf4\x37\x62\xfc\xbf\x98\x92\x40\x64\x82\xad\xa9\xe1\xdb\xca\xb1\xe2\xed\x10\xc6\xc7\x69\x6b\xf2\x9a\xbc\x04\x60\x84\xe7\x39\x4b\x39\x35\x2c\xdb\xf5\x15\x56\x71\xa6\xf3\x50\x57\xde\xa7\xd7\xd0\x0a\x14\x4c\xea\x28\x96\xd4\x62\x86\x28\x27\xec\x71\xc2\xea\x3a\xec\x0d\x8c\xe8\x75\x4f\xb7\x4a\x5a\x56\xea\x98\x67\x84\x03\xcd\x44\xff\xdd\xd2\x1a\xad\x8a\xf2\xe3\x19\x39\xe2\x14\x1d\xd1\x10\x6f\xdb\x9d\x05\xd9\x46\x9f\x93\x9f\xd0\x17\x02\x5d\x54\x1a\x6b\xec\x6b\x4e\xd6\x31\xc7\x50\x03\xe8\xbe\xee\xca\x2e\xd8\x52\x93\x56\xa4\x1a\xf0\x9e\xca\x02\xda\x7a\xff\x00\x2b\x6e\xe6\xae\xa1\x7f\x23\x73\xb4\x51\x93\x60\xd1\x1e\xb2\x8e\x4b\xef\xac\xc9\x8d\x75\x3c\x99\x70\x85\xe4\x30\xde\xbc\x05\xc0\x79\x57\x69\xa7\x68\x3b\xeb\x8e\x4a\xb2\x5c\x7f\xcd\x04\x9c\x67\x4c\x6d\xb0\x5a\x69\x99\x61\xfd\x7c\xb4\x62\x43\x0e\x98\x6f\xbd\x74\x84\x08\x79\x44\xdb\xea\xce\x5c\xb2\x40\xdd\xbc\xb0\x8c\x37\xd0\xa4\xfa\xf8\xf6\xd4\xa1\xf6\x60\xe4\xd8\xc6\xd4\x03\x77\x56\x5c\x33\xea\x23\xdb\x50\x37\xfa\xd0\xf5\x5d\x30\x23\x1a\x50\x1f\x34\x99\x0e\xdd\x30\xc3\xad\xa7\xc7\xb4\x97\x1e\x40\x62\x7f\x46\xc2\x89\x9a\x49\x0f\x8c\x1f\x6e\x20\xfd\x94\xd6\xd1\xae\x3d\x74\x0f\xa6\x8f\x6d\x1a\x3d\xd4\x2e\x3a\xd8\x28\xfa\x59\x5a\x44\x9f\xb6\x39\xf4\xc0\x76\x0d\x36\x84\x3e\xb2\x15\xf4\x93\xd7\x7a\xd0\x04\x3a\xd0\xe8\xb9\x0f\x78\xb8\xfd\x73\x44\x8b\xe7\x1e\xc0\x9d\x8d\x9f\x23\x9b\x3b\xf7\x80\xec\x6a\xf9\x3c\xd4\xd6\xf9\xe8\xf6\xbf\xfd\x4d\x9c\x4f\xd7\x1a\xd8\x39\x85\x23\xe4\x92\x28\x91\xc4\xc7\x9d\xa3\xf4\x71\x28\x94\xc4\x48\x23\xfb\x82\x48\x53\xf0\xe8\x32\x80\x21\xb7\xaf\x22\xde\x41\xaf\xfb\x62\x42\x45\x5b\x13\xc6\x2a\x89\xde\x0e\xef\x6a\xa2\x34\xbb\x87\x76\x10\x08\xba\xe3\x5d\x4a\x7a\xb3\x38\xaf\x17\xa7\x0a\xd9\x61\xa0\x0f\xcb\x1b\xf4\x51\x5f\x65\x54\x1b\x9e\xfc\x39\x93\xc9\x83\x5d\x71\xcc\x6d\x73\x76\xf1\xd3\xdd\xc1\x77\xad\x15\x0a\x72\xf1\xd3\x1d\xb9\xe4\xfa\x61\x28\x85\xd2\x77\x40\x6b\xda\xe8\x28\x79\xc0\x06\x11\x67\x67\x1a\xaf\x6f\xe7\xb0\xf1\x37\xb7\xb0\x07\x5d\xea\xde\xbb\xdf\x99\x15\xa0\xd0\xcc\x13\x4b\x12\xd1\x47\xcd\x70\xa9\x4b\xbb\x54\x48\x25\xee\x8e\x85\x18\x76\xda\xae\xf4\x7d\xd0\x43\xd1\x46\x72\x23\x90\xca\x47\x68\x35\x78\x33\xe0\x6d\x27\x4b\xf2\x48\x83\xa1\x88\x46\x22\x7f\x58\x90\x7b\x5e\xbc\x25\x57\x8d\xbe\x19\x58\x8b\xba\x3d\x08\xd7\x75\x9a\x77\x00\xaa\x53\x60\x61\x6f\x50\xdd\x83\xd6\x9d\xa8\xcf\x92\x2b\x6c\xb2\xa5\xdf\x92\x17\xec\xb3\xf9\xc3\x8b\x19\x79\xf1\x79\xa5\xed\xff\x08\xb3\xd2\x2f\x42\xb6\xf8\xeb\xbc\x4a\x02\x82\xba\x20\x2e\x6f\x7b\xc9\x1c\xa8\xc3\x62\x89\xe1\x7e\xa8\xf8\x9c\x6a\xe3\x03\x43\xdc\x7f\xb8\xfc\xf0\x16\x84\xd4\x54\xa2\x3f\x1d\x12\xaf\x09\x53\x4a\xaa\x4a\xe5\x69\xa0\x1b\x2e\xd7\x44\xe6\x85\x92\x39\xd7\x03\x61\x31\x60\x5d\x86\x23\xd0\x1f\x87\x13\xe1\xc6\x00\x73\x54\xbf\x2c\x4e\x0e\x0b\x64\xd9\x53\xe4\x3f\x22\x6d\xe9\xa0\x45\x81\xe1\x44\x72\x47\x81\xd7\x2b\x9f\x5e\x36\xf3\x55\xef\x7c\x9d\x27\x4f\xa6\x96\xb2\x1c\x7c\xcb\x24\x43\xa4\x52\x53\xd9\xf7\xd2\xf3\x75\x72\x9e\xb2\xed\xb9\x4e\xe9\x9b\x19\x4c\x0d\x09\xc5\xb5\x96\xf2\xeb\x08\xc0\xa4\x9a\xbc\x78\xf3\xa2\xaa\x41\x98\xed\x66\xcd\x15\xd7\x98\x58\x49\x55\x0d\x15\x76\x10\xbe\x78\xfd\x82\xbc\x94\x0a\x66\x93\x50\x41\x32\x46\xb7\xcc\xd7\x12\xc0\xca\xd4\x60\x07\x79\xb5\xe8\xdf\xd9\x50\x6b\xd5\xfa\x19\xb2\x07\x91\x41\x71\x9e\x74\x56\x55\xb1\xf8\x7b\x61\xe5\xf8\x17\x20\x7b\x4b\x95\xf8\x5e\xc7\xc8\x42\x3e\x3a\x98\x01\x24\x54\x4b\xe5\xa2\x6d\x09\xb0\x42\x16\x80\xee\x25\x8e\x00\x54\xae\xc9\x0b\x50\x05\x5e\x7c\x41\x2e\x4f\x22\x94\x0c\x52\x09\x4c\xd7\x97\xb1\x98\xc6\x90\x05\x72\x7d\xe9\xf9\x7c\xc3\x61\x9f\x36\xef\xd1\xbe\x66\x01\xf8\xd8\x6b\xf7\xe5\x45\x4e\x7f\x91\x82\x5c\xfd\xf9\xce\x4d\xe3\xd5\x57\x41\xd0\x13\x8a\xa9\x7b\xec\x05\x04\xe5\x5e\x67\x2c\xfd\xa5\x54\xcc\x8a\x1e\x11\x92\xcc\x85\x7f\x77\x5f\x7a\xb1\xbf\x93\x4b\x6a\x28\x0a\x31\x2e\x1b\xba\x0f\xf3\xd5\x5d\x68\xcf\xc5\x12\x8a\x35\xb8\x62\xad\xfd\x92\x19\x89\x12\x19\x12\xe0\xfa\xeb\x70\x9c\x77\x9b\x92\xfe\x6a\x27\xf2\x0e\xbf\x83\x80\xd2\xb7\xe4\x46\x0a\x36\x83\x83\x4a\xec\x49\x75\xff\xf9\x93\x55\xc8\x03\x6c\x27\xe2\x42\xb1\x94\x19\x0e\xa0\x3e\xf0\xd1\x36\xc3\xf2\xa1\xa2\x08\x50\xb7\xbb\x5a\x96\x99\x5c\xfa\x90\xff\xa7\xce\xeb\xc7\x8f\xd7\x23\xa6\xf5\xe3\xc7\xeb\xe7\x9d\xd2\x28\xe1\x6f\x5f\xf6\xab\xa5\xb8\xaa\x1c\x67\x43\x96\x08\x49\x0e\xf6\xeb\xba\x70\xcf\x90\xdc\xb6\xf0\x12\x5b\xe8\x46\x6b\xc9\x72\xa3\x25\xb6\xa7\xe0\x30\x5c\x45\x64\xaf\x50\xad\x6f\x56\xee\x5c\x36\x77\x1b\x6a\x19\x0e\xc9\xcb\xcc\x80\x2f\x1f\x36\xd6\xee\x74\xe8\xfa\x2e\x98\xaa\xea\x81\x52\x57\x82\x99\x5c\x32\x74\xad\xa7\x6f\x7d\xee\x50\x05\xab\xf9\x41\x48\xce\xf0\xa0\xde\x83\xf9\x3b\x7d\x8b\x5c\x8b\xa0\x35\x3c\x6d\x50\xe1\x4b\xb4\xa4\x09\xff\xa7\x10\xd0\x2d\xe5\x19\x5d\xf2\x8c\x9b\x9d\xbd\x9d\x5f\x2d\x5a\x19\xf9\x1a\x10\xf0\xa4\xe3\x3e\x52\x7c\x38\xb0\xd9\x91\x97\x16\xc2\x39\x58\x02\x5f\x2d\x2a\xc9\x21\x5c\x62\xd4\x55\x36\x42\xc1\xa3\x29\x70\xf8\xf6\x15\xfb\x52\xc5\x10\x89\x85\x2e\xee\xa1\x8b\xc9\x33\xbc\xc0\x9f\x7f\xfc\x78\x7d\xf4\xb5\x65\xcf\x7d\xec\xb5\x65\xdf\xed\xbc\xb6\xe0\x0f\xae\x6c\x38\x09\xd5\x88\x70\xbe\x9f\xe7\xb9\xb9\xfe\xf9\x69\xc5\x37\x7c\x1e\x71\x01\x36\xeb\x04\xe1\xc7\x7b\x09\xfb\xb8\x83\x77\x83\x0c\xc4\x97\x83\x87\xdb\xd4\xee\xdd\xdf\x02\xc9\xa4\x11\x27\x1b\x98\xc3\x88\x85\x00\x37\x25\xc1\x22\xfc\x4f\x16\x02\x6b\xec\xf6\xbd\xe0\x27\x7d\xcc\x79\x4b\x58\xb1\x59\xc5\xc4\x51\xbc\x63\xc5\xe6\xfb\xbb\xb6\x01\xcf\xfe\x46\xbe\xbf\xab\xe4\xc2\x86\xa3\xa9\xbf\xa4\x02\x4c\x57\xa3\xb1\xef\x4c\x93\x8c\xaf\x58\x6f\x44\xf8\xf0\xf9\xca\xa5\xe0\x46\xaa\x40\x04\xed\x61\x31\x19\xc0\x36\x79\xef\xbe\xc4\x94\xba\x44\x66\x19\x4b\xbc\x8d\x16\x16\xe6\x41\x07\xe8\xaf\x43\x9d\x70\xad\xd5\xb5\xaf\x1e\xea\x4b\xaa\x23\xa2\xcf\x3f\x5e\x5d\x5c\xbe\xbf\x5a\xe4\xe9\x77\x1b\xf9\x38\x37\x72\x5e\x6a\x36\xe7\xa6\xff\x3e\x1a\xcc\xd8\x88\x0a\x8f\x1d\x8e\x42\x2d\x7a\xfd\x41\x87\x48\xc4\x6e\x4b\x34\x83\xee\x75\xa9\xeb\xcc\x5e\x75\x48\x57\x52\x9a\x19\x51\xd4\x55\x58\xeb\x65\x1b\xc4\xa9\x0c\xab\x32\xcb\x10\xe3\x46\x31\x36\x6b\xda\x43\x02\x95\x64\x4e\x7f\x4f\x37\x96\x15\xcb\x86\x43\xc6\x36\xa6\xd8\x68\x36\x1c\xae\xdd\x4d\x9e\x99\xd4\xe2\x79\x7d\xff\x05\x1d\xc2\xea\x5d\xf5\xad\x8f\xb3\x01\x8f\x9b\x91\x10\x13\x38\x10\xde\xbd\x92\x0a\xfa\xd8\xb4\xe9\x83\x99\x04\x96\x0b\x75\xcb\x17\xee\x2e\xf9\x02\xa7\x32\xe6\x2e\x81\xc9\x7c\x64\xab\x63\x11\xf5\x91\xad\x30\x0b\xb9\x9d\x52\x0b\x35\x78\x99\x30\x90\xa6\x12\x34\xe3\x39\x74\x74\x62\xce\x95\xd2\xf8\x02\xa8\x8a\xcb\xe2\x1a\xae\x39\xd8\x9f\xd6\xee\x30\x64\x46\x9b\x77\xe4\xd6\x8a\x87\xec\xf1\xfc\x51\xaa\x07\x2e\xd6\xf3\x47\x6e\x36\x73\xe7\xe5\x3a\x87\x16\x89\xe7\xdf\xc1\xff\x04\x67\xe6\xcd\xde\x17\x69\xea\xdc\x6b\xa5\x66\xab\x32\xc3\x00\x08\xbd\x68\x54\x92\x9f\x81\xf2\x36\x23\x25\x4f\xff\x57\xb8\x4a\xd6\x08\xb6\x1e\xcc\x41\x08\x35\x22\x0d\xf2\x75\xe5\x0f\xa9\xa2\xa9\xd4\xd8\xd7\xc9\xe2\x62\x16\x67\x93\xa4\x69\xce\xc5\x37\x71\x14\x87\x04\xac\xe0\x3d\x3f\x24\x3e\x71\x91\xf6\xe1\xb7\x8d\xdb\x77\xf0\x66\x5b\x7e\xc2\xaf\xeb\x52\xbc\xce\xf7\x47\xbd\xfe\xd1\xab\xe7\x4a\xe1\x7d\x83\x6d\xcf\x60\xd4\x81\xce\x77\xfa\x1f\xd9\x1c\xc7\x9e\x17\x69\x8d\xf1\xaf\xe3\xd0\xfb\x52\x46\x9d\x3d\x67\xdc\x57\x30\xed\x44\xc9\x8b\x23\x77\x87\x4c\xa2\xd0\x49\xb1\x18\x23\xfd\x1c\x75\xa7\x43\x23\x07\xed\xcb\x8d\xc1\xc5\xec\x3a\x42\x38\xad\x37\x2c\xfe\x54\x1d\x6c\x5d\x9f\x5e\x8c\xe4\x13\x2e\x8f\xe5\x43\xc1\xc4\x9d\xa1\xc9\x43\xc0\x8e\x3d\xdd\xc3\x5f\xf5\x1e\x1e\xeb\x09\xf3\x61\x31\x69\xb5\xdf\x1c\x7a\x58\x3a\x37\x6e\x1d\x35\x83\x44\xfe\x0d\x72\x9d\xe7\xf4\x6e\x61\x54\xd5\x7b\xda\x53\xe5\xbc\x6d\xb9\xf0\xef\xee\x5d\xbe\xd5\xcf\x60\x7b\x72\xd1\x7a\x85\x2c\xca\xac\x3f\xb3\x05\xf2\x8f\x70\xe2\x47\x5e\x96\x4e\x78\x1a\xe3\xca\xaa\x99\x48\x2e\x53\x46\x96\xdc\x54\xad\xcc\xa4\xa8\x8a\xe4\xc3\x9d\x19\xa0\x82\x65\x95\x43\xd2\xbc\x69\xdb\xcd\xaf\x5e\x83\xec\xf1\xfa\xbf\xff\xf7\xff\x1e\xc8\xa2\x6c\x60\x43\x92\xd7\x7f\xfc\xc3\x1f\x16\xe4\xd2\x75\x66\xe3\x4c\x37\x03\x28\x0b\x1f\xfc\x27\xa4\x21\x14\x32\x64\xc2\x6d\x71\x1d\x82\xdd\x9d\xe0\xc2\x88\xb1\x49\x38\x96\x7c\xb7\x9b\x96\xf1\xc4\x60\x47\x4c\x3c\xe4\xae\xe5\x72\x10\x28\xf5\xe3\x57\xf1\x27\x80\xcb\x19\xc9\xf8\x03\x23\x2b\x0d\x25\xdf\xeb\xc2\x61\x18\xfe\x16\x80\x98\x50\x01\x79\x0d\x30\x81\x7a\x57\x34\x33\x5f\x24\x80\x61\xc0\x28\xb4\x9f\x68\xda\xea\x52\x0d\xed\xf4\x1f\xd8\x6e\x8e\x5b\x5f\x50\x5e\xc5\xce\x5d\x52\xd3\xdf\x14\xc6\x27\x2b\xb5\x99\x7d\xc2\xd2\xc6\x01\xf3\x01\x88\x85\x92\xff\x8e\x9b\xcd\x45\x30\x24\xa6\xd9\x89\x42\x3b\xc1\xcf\x95\x83\x13\x8d\xf2\x52\xbe\xdc\xaa\x6b\xbe\x1c\x8e\x35\xa9\x53\xe9\x3a\x92\x6c\x33\x0e\x0d\x6d\x1e\xd8\x4e\x1f\xce\x36\x28\x6e\x38\xed\xbb\x8e\xb6\xb4\xd4\xad\x91\x66\x4a\x71\x00\x17\x5b\x58\x84\x6e\x74\x64\x45\x30\x49\xea\xb3\x22\x1b\xb1\x9c\x10\x70\xec\x5a\x26\xb8\x77\xdd\x3e\x05\x80\x56\x5b\xd1\x8a\xd8\xd1\xcc\x94\x6e\x73\x20\x10\xcb\xce\x97\x69\xed\x52\xc9\x72\xaa\x1e\x82\x6b\x97\x8e\xff\x2c\x20\x1a\x5c\x57\x69\x6f\x98\xc3\xb8\x65\x55\xd3\xb0\x66\xbe\x44\x78\x9e\x67\x8b\xc5\x19\xb2\x07\xa9\x88\x36\x54\xb9\x13\x6d\x7f\xef\xbf\xca\x06\x6d\xa1\xed\x48\x7c\x5a\x34\x1a\x78\x41\x66\xab\x84\x64\xc4\x3a\xca\x9b\x46\x94\x1b\x8a\xad\x42\x13\x51\xb4\xf7\xc0\xdd\xee\x26\xe5\x08\xf0\x64\x6d\x26\xf2\x81\x7a\x78\x07\x73\x19\xb8\x62\xb0\x2b\x19\xcf\xd8\x70\x09\xdc\x3c\xe2\x66\xb9\x5e\xed\xf5\x01\x19\x84\xda\xa0\xe5\xc6\xfd\xb9\xd7\x2b\xbf\x75\x59\x0c\x82\x0c\x5f\x26\x9d\x57\xc6\xf0\xe2\x07\xaf\x94\xc3\x8b\x63\x10\x68\xc4\xc5\x82\x4f\xdc\xf5\x82\x4f\xcc\x25\x83\x4f\xd8\x2f\x80\xcf\x01\x5d\x57\x9c\x01\x8f\xf8\xaa\xbe\x75\x21\x53\xbb\x88\x6a\xfc\x82\x87\x03\x1b\x81\xbb\x86\x40\x54\x10\xba\xd4\x32\x2b\x0d\x82\xae\xff\xe8\xd8\x4e\x14\x25\xc1\xa4\x7c\x41\x52\xe0\x38\x15\x98\x06\x2b\x02\x66\x1f\x57\x1e\x37\xcc\xb5\xdc\xc0\x27\xed\x6b\x12\xac\x99\x3b\x87\x15\x0e\xba\x8c\x06\x4a\x97\x0c\xbb\x8c\xc2\xba\xe2\xb7\xaa\x27\x9e\x58\x47\x8c\xd8\x57\x7f\x7f\xc6\x3a\x95\x5d\xb4\xe9\xe3\x86\x39\x17\x1a\x6b\x88\x58\x52\x11\xcb\x10\x40\xd0\xb0\xcc\x36\x24\xf1\xfb\x0a\xa7\xfd\x97\xfb\xb0\xd1\x63\x48\x11\xd3\x3c\x46\x05\xbb\xbb\x26\x2f\xdf\x55\xa9\x1a\xbe\xed\xf7\xb5\x30\x4c\xad\x68\xc2\x5e\x35\x55\xb3\x70\xdc\x90\xcf\x94\xd8\x50\x91\x66\x3e\x0f\x84\xb0\xcf\xae\x8d\xa9\x1d\x29\x55\x1c\x92\xdb\x2f\x9a\xfd\xe0\x7a\x32\xc9\x22\x14\x36\x80\x16\x1b\xbf\x81\x43\x77\x34\xb0\x6f\x4c\x0c\x96\x80\xf3\x0f\xcb\xb1\x95\xae\xb9\xb0\x04\x00\xf7\x07\xb0\xa6\x9d\x2c\x95\x33\xb0\xfb\x16\x5d\x89\x54\x56\x05\x1b\x6a\x68\x44\x35\x51\x6c\x6d\x65\x55\x85\x05\x66\x1b\xf9\xda\x4f\x8a\x49\x3b\x51\x5c\x5f\x23\xf6\xce\x99\x61\x43\x76\x5a\x6f\xa0\xfd\xff\xd8\xbb\xba\xdf\xc6\x6d\x6c\xff\xbe\x7f\x05\xd1\x7d\xc8\x0c\x10\x27\xed\xde\xa2\x28\x06\x8b\x02\x99\x24\xd3\x1b\xec\x34\xf5\x8e\xd3\xce\xc3\xc5\xc5\x82\x96\x18\x9b\x1b\x59\x54\x45\xc9\x19\xdf\xbf\xfe\x82\x3c\xfc\x92\x2c\xf1\xc3\x76\x92\xc9\xd6\x7a\x99\x89\x2d\x1d\x93\x14\x79\x78\x78\x3e\x7e\xbf\x7b\x65\x24\xb3\x35\xcd\xb5\xa1\x0f\x2c\xdd\x6b\x5d\xd5\x5f\x61\xce\x0d\xf9\x9d\x77\x80\x38\xcb\xa8\x3c\x50\x3b\x6f\x0c\x8c\x71\x69\x6e\x98\x5a\xdc\x4e\xee\x7e\x9c\xc3\x1a\xa8\xaf\x3d\x80\xf2\x11\x03\x5d\xb2\x9c\x4c\xdb\x79\x41\xf9\x72\x96\xe8\x8d\xbc\x1d\x78\x14\xb2\x1f\xb6\x62\x8c\xe0\xa1\xf4\x9d\x09\xfa\xbe\x4b\xc4\x89\xc4\x6f\x5b\x13\x17\x0a\x57\x5a\xb7\x98\x1b\xd6\xe1\xcb\xd9\x70\x56\x98\x6a\xad\x5a\x1f\x4c\x56\x84\x14\x44\x61\x56\x88\x17\xe1\xb4\xfd\x77\xcb\x70\x28\x3e\xfd\xad\xac\xdc\xcf\xbd\x87\xf6\xa2\xe0\xfd\xda\x64\xad\x9c\xc1\x52\x53\x85\x67\x6a\xf6\x50\x31\xb1\xc2\x63\x41\x7b\x44\x42\x76\x00\x7b\xc3\xc4\x81\x41\xb0\x59\xe2\x12\x31\x2f\xf0\x1e\x3c\x2e\xe1\x84\xb4\x28\xa7\xde\x53\x56\x7e\xcb\x09\x3d\x3e\x95\x8e\xee\xde\x17\x75\xf7\x26\x06\x5c\x66\xea\x2c\x04\x8b\x51\x57\x8e\x77\x6b\x47\xb5\xaa\x0f\x1f\x59\x03\x31\x9b\xbd\x42\x20\xf0\xeb\x17\x0d\x10\x21\x7b\x11\xa2\x13\xd1\x87\xa3\x86\x7e\xa0\xa8\xd4\xb6\x45\x9a\x0e\x84\x2b\x3d\x32\x51\x07\xcc\xcc\x59\x0b\x41\x27\xa1\x59\x59\x8e\xc6\x52\xf2\xec\x26\x2c\xf7\x5f\xf8\x70\xb4\x9c\x5a\x36\x96\x65\xad\x21\xe9\x92\xef\xcf\x86\x2b\x43\xe4\x2a\xc1\x39\x16\xcc\xd1\x95\xed\xdb\xc5\xa6\xcb\xd9\x63\xf9\x88\xeb\xfc\x62\x3a\x52\x3a\xd0\x35\x79\xec\xdd\xae\x15\xa7\x85\x48\x72\x4e\x00\x48\x55\xa9\xb4\x3e\xc3\xae\xe7\x85\x3f\xfa\xdb\xbb\x43\x74\xf4\xb7\xbf\x02\x7f\xbb\xb8\xb7\xcb\xc2\xd6\x59\x0b\x1a\x55\xc2\xe7\x50\x4a\x73\x74\x3a\x2b\x10\x34\x62\x3f\x27\xde\x31\xc8\xfc\x9b\x1f\x53\xb3\xdb\xbe\x35\xc7\xc0\x53\xcb\x37\xc8\xd1\x12\xeb\x30\x95\x72\xbc\xd6\xeb\x40\x5f\x9d\x04\xde\x99\x64\x34\x83\xa8\x81\x13\x98\xa8\x58\x04\xed\x90\xdc\x5e\x71\x59\x32\xd0\xcd\xfc\x14\x28\xd3\xf8\x29\x9c\xd9\x24\xd8\x99\x30\x40\x2a\x9c\x11\xb9\xa2\x8c\xe2\x0e\xba\xe1\x52\xa8\xde\xac\x85\x12\x43\xdb\x34\x08\xb8\xa5\x7a\xcd\xb3\x25\x59\x61\xf9\xdf\x0f\x62\x34\x06\x81\x30\x86\x2e\xca\x91\x30\x0b\x1a\x02\x85\xcd\xa4\x5e\x71\xc4\xee\x4f\x3b\x35\x33\xdf\xac\xbf\xf3\x96\xab\xeb\x2b\x89\x53\xea\x5e\x37\x33\xb9\xeb\xd3\x8e\x53\x51\xbc\xfa\x86\x29\x7e\xbb\x70\x84\xc4\x5e\x36\xd6\x22\x97\x25\x8c\xe7\x81\xbb\x19\x4b\x84\x35\xb1\xc3\x11\xe5\x47\x8c\xe0\xb7\x3a\x06\x01\x8e\x41\x00\xff\xbd\x4f\x18\x04\x70\xd4\xb4\x5c\xad\x94\x23\x35\x00\x6e\x60\x20\xe0\xac\x82\xab\x17\x3d\x98\x13\x6d\x81\x9d\x59\x90\x36\x31\xd7\x74\x5c\x20\x02\x7e\xde\x89\x51\xa2\x93\x93\xb3\xb3\x93\x13\x1d\x4d\x50\x13\xb7\x6d\xee\x27\x3f\x22\x52\x66\x2c\x87\x49\x15\x6e\xe6\x3d\xad\x79\x23\x37\x6e\x7b\x3e\x76\xfb\xba\xd2\x6d\xb5\x21\x86\x70\x5c\x41\xb6\x2d\x8e\x4d\x37\x0a\x1f\x1d\x6a\xe7\x3f\xec\xb4\xf1\xda\xed\xd6\xd4\xe0\xab\x8e\x1a\x0c\x9e\x77\x72\x5f\x0d\x76\xcb\x52\xc3\x00\x23\xb8\x5c\x1e\x9a\x7c\x1a\xbd\x81\x0f\xcf\xb2\xaa\x3d\x55\x37\x9c\xad\xc8\x8a\xd5\x9b\xb0\x8a\xd0\x42\xc4\xc3\x1d\xa9\x4a\x02\xc0\x63\x29\xac\xf4\x62\xf3\x44\xbb\xba\x19\x8f\x10\xa9\x96\xbe\x7a\x99\xc2\xc6\x4f\x2e\xbd\x33\x96\xa8\xed\xde\x00\x7c\xf0\x38\x2e\x52\xed\xdb\x92\x4f\x92\x72\x8d\xd6\xb8\xf6\x32\xb9\xeb\x2b\x69\x23\xcf\xe9\x9a\xf2\x38\x2a\xd7\x11\x9f\x87\x03\xbd\x09\xfa\x4b\xcd\xac\xa8\x4e\x2a\x0c\x24\x3b\xab\x7a\xb6\xcb\x77\x51\x8c\x11\x29\x1d\xd6\xbf\x94\xfe\x6a\xad\x56\x34\x6b\xc8\x98\x2e\x07\x7e\x2f\xf1\x96\x47\x00\x9a\xaa\xfb\xdb\x41\xc3\x23\x2e\x80\xf9\x1c\x01\xca\x80\x10\xe9\xe2\xbd\xa2\x51\xc9\xfb\xd7\xea\xde\x6e\x06\x61\x43\x56\x15\xab\x71\xbd\x41\xb9\x3a\x8f\x6f\xb4\x17\x03\xd7\xe3\xe0\xef\xb2\xf0\xd1\xa9\x7c\xdc\x1b\x95\x44\xf6\x24\xa7\xf5\xae\xf9\xfb\x2b\x92\xd3\x76\x15\xeb\x1d\xf9\xec\x92\x25\x6a\x50\x00\x10\x61\x20\x0f\x71\xf6\xe0\x43\xbd\x96\x42\xf5\x90\x01\xc5\xa6\x53\x9a\xf4\xcd\x37\x3d\xf8\x6a\x69\x81\xca\x78\x1a\xcb\xc9\x89\xdf\xe3\xa6\xc4\x40\x7b\x1c\xc7\x4b\xa9\x5c\xfa\x2a\x1b\xe8\x8d\xba\xf1\x2d\x62\x35\xfa\x45\xee\x0d\x89\x19\xb4\x87\x7b\x41\x28\xb2\x9e\x8c\xfe\x1f\xf9\x28\xb6\xc3\x68\xd4\x2a\xd6\xe0\x02\x61\x55\x9c\x7b\x8f\x0a\x96\xe1\xc2\xbc\xb1\xce\xae\x12\x78\x57\x66\xfa\xeb\x68\xa4\x78\x63\xa2\x3d\xb0\x3f\x4b\x67\x47\xc1\x21\xba\x45\x33\x89\x4e\x29\xa4\xc2\x9e\xeb\x91\xab\xdf\xd2\x9d\x04\xf6\xfa\x42\x57\xed\x0a\xb5\x92\x86\x49\x22\xfb\x8b\xa7\xf5\xcc\x32\x4d\x78\xf4\x20\xf8\x22\x08\x7a\xcb\x62\x54\x5a\x4a\x71\xdd\x03\x88\xf8\x66\xa6\xc7\xd1\x39\x00\x06\xaa\xe9\xb5\xf9\xce\x5b\x69\xdc\xa9\x96\x29\xe3\x85\xdd\xcb\x28\x8d\xd9\xf4\xb9\x81\x32\xf4\xcd\xa8\xde\x9c\x2f\x69\xd1\x9d\xf4\x1a\x99\xce\x0c\x70\x5b\xaa\x58\x7e\xc2\x3c\x1d\x9e\xa6\x2d\x27\xf5\x64\xd1\xd2\xfc\xa0\x13\x34\xa0\x6d\xef\xb3\x08\x3d\xfb\xe1\xb2\xab\x60\x3f\xd0\x79\x4d\xd0\xe5\x12\x97\x25\x29\x9c\x2d\xb3\x07\x96\x38\xe6\x50\x76\x21\x14\x03\x08\x8a\x07\x40\x7a\x78\x1d\x55\x50\x2f\x09\x6d\xf3\x4a\xe0\x01\x8b\x36\x1a\x18\xd0\x7a\x4c\x3e\x5c\xa2\x06\xd7\x0b\xd2\x88\xc7\x51\xd9\xae\xe6\xc4\xb3\x9a\x5e\x0e\xca\xee\xe5\x0b\xbb\xf6\xab\xc0\x82\x41\xfe\xfc\xf9\x36\x1a\xf1\x61\xe8\x1d\x3d\xb2\xba\xc8\x1f\x69\x0e\x29\x3a\x1c\xbd\x11\x02\xdf\xbe\x3c\x08\xc3\xe3\x23\x1d\x23\x35\x09\x74\x4c\x39\xc6\x64\xc7\x90\xec\x99\x2a\x17\xa2\x62\x47\x7a\x23\x05\x8f\xf1\x70\x88\xeb\x9a\x02\x0a\xbc\xb8\x4f\xd8\x44\x2e\xc7\x8e\x38\x8c\x99\x61\x97\xaa\x53\xcc\x71\xe5\xe4\xf3\xc8\x94\x38\xf1\xf3\x56\xb9\x68\x58\xb3\x44\x9c\xae\xda\xa2\xc1\x25\x61\x2d\x2f\x36\x9e\xa9\xf0\x3c\x03\x1e\xda\xb3\x0a\xf2\x05\xa6\x6e\xcc\xde\x65\x6e\xee\xee\x61\x12\x58\x99\x66\xfa\x05\x75\x36\xb1\xb1\x68\x13\x87\x5c\x26\x2e\xa9\x39\xcf\x4d\x5d\x30\xa0\x79\xcb\x6c\x37\x92\xa1\x39\x16\xfb\x56\x55\xb4\x0b\x3a\xe2\xb5\x7e\xb6\xdc\x36\x9b\xb7\x23\x2c\xf5\x08\x83\x32\x94\xc2\xf0\x27\x06\x92\xbb\x1b\xcc\x2a\x43\x39\xa9\x48\x99\x4b\xa8\x70\x3b\xd3\x7c\x6b\x4f\x76\x7e\xaf\x11\x56\x5e\xf0\x97\x4c\xf0\x70\x74\xdc\xf5\x97\xa6\xc6\x42\x2d\xad\x84\x02\xd2\x1e\x7a\x7a\x8f\x70\xe9\x53\x24\x87\x4f\xd5\x79\xf5\x5b\xe8\x93\x01\x93\x3c\x55\xd2\x20\xe8\xb8\xe0\x64\xd7\xa9\x7d\xa3\x29\x7c\xfa\xf7\xdd\x3a\x2b\x2f\x0a\x77\x7c\x2a\x9f\x9b\xb0\xe7\xdd\x11\xc5\x5d\x7c\x20\xcd\x08\xfa\x68\x7a\x72\x2c\xe3\xfe\x2a\xf3\xfa\x9e\x2e\xe7\xea\xbe\x60\xd9\x43\x14\x92\xc8\x07\xb8\xb3\x77\x52\x56\x1f\xf6\xa1\x44\xc4\x19\x78\xa4\xbb\xc3\x27\x63\xb5\x86\x9c\xed\x46\xa6\x14\x28\xf1\x62\xf2\xd7\x6c\x6c\x86\x73\x05\xb6\xa8\xb8\xed\xdb\x72\x14\xd3\x20\xc2\x32\xc1\x0d\xe6\x49\xa0\x82\x7d\x44\x5d\x4e\x1a\xc8\x07\x94\x00\x65\x2b\xd2\x60\x09\x27\x3a\xf9\x29\x14\x76\x54\x7d\xd6\x32\x84\x39\xa3\xfb\x6f\x29\x5d\x32\x56\x72\x9a\x13\x25\x3d\x17\xef\x22\xf3\xd0\x30\xc5\xc1\xf5\xc2\x2f\xfe\xf6\x5b\x34\x4a\x80\xb8\xb5\xd7\x67\xf5\x02\xa5\xc7\x48\x62\x69\xdb\x73\x80\xaf\xcf\xf7\xce\x24\x52\x92\x9e\xcc\x17\xb4\xc8\x88\x65\x27\x8e\x84\xa8\x3e\xf9\xf9\xf2\xba\xfb\x50\x77\x01\xfc\x7c\x79\xfd\x1f\x41\xb4\xb1\xc8\x88\x85\x3c\xcf\x29\x7f\x38\xb2\x6c\xfc\x09\x58\x36\xb6\xde\xfa\x6b\xf7\xa1\x1d\x29\x36\xbe\x62\x8a\x8d\x67\xd2\x51\xe8\xa0\x8e\xce\x2a\x4f\xb0\x05\x34\x8f\x84\xeb\xa4\x98\x5e\xb9\xe4\x11\x62\xc3\x38\x93\xf0\xa5\x7e\x7d\xd6\x01\xdd\xd1\x80\xf8\xf2\xd9\xe7\x1b\xc4\x27\xc0\xf7\xea\xe0\x48\x87\xce\x9f\x9e\x11\xda\x42\xed\xda\x26\x28\x7c\xf6\x81\xda\x07\xd8\x1c\x66\xd9\x4e\x46\x0d\x6d\x3e\x91\x6a\x64\x67\xe8\x99\x32\x70\x6b\xcf\x4f\x48\x1b\xf1\x01\xe3\x54\xe6\x11\x00\xdd\xb6\xe1\xcd\x1e\x7d\xed\xe0\x25\x3c\x43\x57\xd7\xd3\x4f\xd7\x97\x17\x77\xd7\x57\xef\x90\x96\x4f\x5d\xc3\xf4\x0c\xdd\x31\xeb\x56\x1c\x3d\x15\x58\x3e\x35\x99\x0f\x69\xdb\x75\xaa\xd4\x26\x2e\x6d\x2c\x56\x82\xa2\xe0\x12\xdd\x94\xb4\x31\x59\x4b\x3e\xc3\x2b\x2b\x58\xa9\xf2\x7d\x84\x4c\xe5\xd1\x5c\xd0\xe6\x14\xcc\x2c\x85\xba\xbe\x24\xdd\xdf\x18\x15\x49\xd0\x14\x72\x29\x2c\xd7\xec\xae\xf6\x92\xc9\x47\x88\x65\xcb\x80\x48\x82\xcd\xfc\x90\xbb\xc8\x36\x6f\xac\xc6\x37\xf1\x2c\x22\x8b\x7c\x22\x7d\x0e\x27\x67\x27\xda\x34\x2a\x0c\x6e\x8d\x4e\x7c\x35\x3f\x37\x48\x3a\x6c\x2f\x15\x06\xef\xce\xaa\x33\x84\x7e\xd5\xc4\xa3\xa7\xc2\xba\xe9\x81\xe3\x78\x0a\x6d\x74\x4b\x6d\xa4\x7b\x40\xbe\xde\xb7\x79\x3b\x77\x1b\xea\x4f\xf5\x91\x52\xd6\xa4\x0c\x6c\xc3\x51\x4a\x50\x37\x24\xf2\x1d\x7e\xb2\x2d\xff\xed\xd3\xc7\xfd\x7e\x1a\xd6\x55\xe4\x0f\x5f\xb2\xd5\x8a\x36\x68\x89\xf9\xd2\x94\xf5\xd9\x6c\x04\xb3\xaa\x77\x6f\x51\x48\xcf\xd9\xa1\xda\x49\xd7\x41\xc1\x78\x14\x6e\xfc\xc9\xcf\xfa\xe6\xde\x81\xcd\x7c\xbc\x85\x1e\xef\xd3\x20\x1d\xf4\xf8\x50\x12\xd5\x18\xd4\xac\x69\xff\xfe\xd8\xa7\xa4\xcc\x01\xd9\x31\x9a\x90\x45\x3f\x70\xeb\xe0\x5b\x69\x29\x60\xb0\xc8\x8e\xe6\xa4\xc1\xb4\xf0\x19\x7c\x76\x04\x1b\x56\xb1\x82\x2d\xd2\xf0\x9c\x07\x06\xe1\xaf\x90\x59\x3d\xc1\x13\x31\xba\xfb\xd9\xff\xf1\x68\xf2\x3a\x41\x5c\x0c\x84\xed\x93\xb1\x84\x65\x5e\x76\xca\xc1\xeb\x45\x3a\x7c\x50\x03\xac\x3f\x0a\x7e\x13\xd5\x12\x0c\xc3\x4e\x62\xeb\x87\x2b\x52\xaf\x28\x17\xaa\x64\xd0\x32\xf3\x88\x7d\xc6\x79\xb4\x8f\xb9\x66\x56\xdf\x98\x39\x37\x96\x66\x1a\x50\x70\x42\x0b\x45\x12\x64\x4b\xa2\x31\x39\x85\x3b\xea\xad\xaa\xc9\x84\x7c\xa1\x5c\xfa\x2a\x64\xed\x02\xab\xed\xee\x3d\x16\x71\x73\x18\x34\xb4\x0b\x4a\x3b\xac\xe0\x59\xc9\x9f\xdc\xc9\x58\xf2\xb0\xec\xc3\xa5\xdd\x81\xc0\xf0\x5b\x14\x1b\x00\x14\x95\xd5\xc8\xe0\x20\xc0\x0b\xd9\x68\x56\x2b\x77\x7b\x55\xd3\x35\x2d\xc8\x38\xcd\x52\xb3\xa4\xe5\xc2\x21\x0f\x96\x54\xc7\x44\x95\x61\x91\xad\x3e\x88\xf5\xcb\x1b\x27\x43\x6e\x44\xac\x5c\x05\xb7\xbf\xde\xa1\x92\x08\x61\x4b\xca\xf7\x3e\x3c\x88\x66\x78\x72\x8d\x27\x93\x89\xf4\xa7\xbc\xf9\xb7\xb0\x4b\xf3\xe2\x2d\xfa\x4c\xd4\xaf\x0b\xf3\x5c\xac\xf8\xac\x41\x8f\x4b\x26\x4f\xd4\x2d\x57\xfd\x0a\xbd\x47\x4d\xd0\x5f\xe6\xfa\xd9\x73\xf1\xbc\x30\x0b\x61\xb3\xeb\x48\x91\x55\xff\x1c\xd9\xc8\xe1\xce\x36\x6c\xb2\xd6\xd5\xae\x63\x63\xac\x39\x33\xd0\x40\x59\x04\x72\xb5\x65\xa5\x2b\xdf\xac\x0a\x5a\x3e\x9c\x22\xda\x68\x65\x26\xe6\x84\x4a\x61\x2c\x1f\xf4\x6c\xad\x09\x2e\x40\xa7\xa7\x29\x9f\x5d\xde\xf9\x5e\xfa\xbc\x49\x70\x9e\xde\x6d\x2a\xc8\x7a\x30\xaa\x40\x25\x82\xf4\x58\xd4\x93\x10\xad\x9f\xb9\xc7\xc1\x83\xf1\x8e\x9a\x94\xf2\x38\x84\xa8\x93\x9b\xd9\xe5\xec\xa6\x47\xe4\x05\x9f\x75\xdc\xfa\x5a\x1f\x8e\xf4\x74\x37\xb7\xbe\x1f\x16\x68\xcc\xad\x3f\xb6\x21\xca\x2e\xef\x6f\x59\x66\x4b\x5c\x5d\xb4\xcd\xf2\x8a\xf2\x8c\xad\x49\xf4\xa1\x46\xc3\x86\x29\xd7\x3a\xa2\x7a\x10\x41\x0a\xba\xfc\xef\x8b\x69\x2c\x87\x48\x4c\x3a\x81\x6e\xe7\x8c\xf0\x84\x13\xd0\x70\x2b\x95\x8c\x83\xb7\xf1\x18\x0c\x79\x45\xc1\x10\xb9\x7e\x5e\x7b\x00\x84\x96\xb4\xa1\xb8\x61\x81\x1a\xc0\xae\x57\xa0\xe5\x0d\x5b\xa9\xa5\x70\xa3\x05\xc8\xc0\xb6\xdc\x8c\x3b\x32\xfd\x3b\xb2\x83\x23\x4c\xe5\xe9\x2a\xe3\xd4\xa0\xed\xf5\xd2\x30\x4f\x51\x49\x1e\xe1\x57\xbd\xbb\x93\x7e\xfa\xef\x2a\x89\x56\xcc\x55\x5c\xfc\xf4\xee\xef\x4e\x18\xe5\x27\x53\x8e\xad\x8a\x74\x3d\x12\x2d\x74\x9d\xe4\x31\xd8\xcf\xe1\x81\x10\xfd\x23\x56\xf7\x28\xd7\x1d\x8c\xf3\x3f\x5b\x5c\xc0\x48\xdd\xee\xeb\x7f\xea\x8e\x72\x64\x63\xf4\xdb\xd6\xa3\x7b\x6b\x3c\x00\x2d\x27\x72\x17\x84\x3b\x9a\x1a\x97\x5c\x0c\x79\x2c\xf0\xd3\x89\x0a\x7a\x9d\xa0\x37\x4d\x56\x05\x51\x9f\x0e\x94\x12\x0f\x8d\x55\x23\xfc\xd1\xa4\xc2\x8f\xff\xfa\x01\x23\x44\x72\x3e\xc6\x3a\x62\x3a\x0d\x9d\xca\x47\xd1\x47\xca\x1b\xc8\xc0\x04\x59\x92\x28\x4b\x26\x46\xfb\x22\x79\x25\xba\x99\x4a\x58\xce\xea\x5f\x38\xcf\xeb\x77\xb0\x9f\x69\x30\x92\x5a\x9e\xde\x98\x21\xc3\x8b\x60\x4f\x7a\xd3\x6c\x2a\x9a\xc9\xa3\xda\xdd\xe5\x54\xca\xe0\xe8\xc7\x1f\x00\x3d\xe1\xbf\xfe\xf6\xc3\xb7\x9e\x97\xf9\x5c\x99\xea\x89\xfe\x8e\x67\x8c\x37\xed\x65\x28\xa4\xe6\x46\x4a\x43\x65\x66\x79\xd6\xd4\x5a\x85\x59\x25\x5e\x97\xd1\xd9\xb1\xe6\xcc\x31\xbf\xef\x45\x71\xfb\xe0\xd5\x81\x3e\xd8\x5d\x93\x80\x12\x99\xf6\x94\x08\xf2\x52\x61\xee\xa2\x44\x1c\x55\xe1\x33\x98\x52\x95\xc8\xde\xa7\x45\xfa\xc7\x70\x4f\x27\x62\x27\x19\xf9\xc6\x1d\xf9\x5d\x4e\x9a\xe3\x4b\xa2\xbb\x14\x40\x7f\x88\x33\xa1\x13\xb1\x93\x15\x00\x57\xb7\xb3\x7f\x7d\xbc\x78\x7f\xfd\x51\x71\x3a\xc8\x14\x02\x80\x57\xf3\x44\x20\x77\xc9\xfa\x8a\x5f\x49\xc3\xb3\x3e\xf0\x82\xca\xb8\xc8\xcc\x6d\x8f\xcf\xb7\x44\xb7\xa3\x64\xbe\x89\x35\xed\xfb\xfa\x70\xca\xfb\x91\x9e\x3f\x81\x13\x4c\x7b\x58\xc9\x97\x6e\x55\x87\x18\x0c\x4e\x6a\x89\xfc\xf8\x64\xae\x9b\xd1\x8e\xa2\x17\x88\x3b\x88\x1e\xc3\x28\xc0\xd1\xcf\xd3\xe3\xdd\x22\x0e\x2f\x3a\x8e\xa1\x9d\xbf\x8e\x2f\x85\x3a\x99\xc9\xbb\x75\xd4\x4a\xac\x12\x48\x35\xaa\x85\x1a\x17\x0a\x9c\x70\x1e\x06\x31\xe9\xcf\xb0\x17\x9b\x47\x3b\x7b\xff\x26\xaa\xfd\xbb\x28\x6c\x9b\xd5\x03\x2a\xf9\xb2\xc0\x74\x04\x85\xa2\xb7\x6a\x87\x1e\x84\xff\xce\xc0\x49\xd8\x09\xc5\x98\x3a\x95\x31\x25\xce\x10\x46\x83\x32\x4d\x3e\x03\x56\xc7\x5b\x89\x07\x18\xe1\xfa\x48\x79\x83\x76\x18\x26\xfa\x65\xda\x8f\xe0\x93\x4c\x34\x66\x67\x85\x28\x9f\x4e\x49\x9e\xbb\xd4\x0f\xf4\x6b\xfd\x46\x86\xc9\x6f\xaf\x6f\x0f\xa0\x26\x0c\xaf\x98\xae\x69\xec\x40\xdd\x1f\x5c\x47\xec\x39\xc2\xe8\x49\x34\xf1\xe7\xc4\x9a\xaf\xf0\xa9\x7f\xff\xf3\x4f\x48\x0d\x98\x99\xb4\xd3\x72\x5f\xb2\x86\x95\xc9\x89\xff\xd3\x81\xc7\xba\xeb\x1b\xee\xb8\x84\xd2\x94\x62\xdc\x3d\x60\x44\x40\x1e\xe7\x10\xdd\xee\x28\xb1\xee\x8e\x4b\xef\x3f\xb5\x48\xf5\x60\x90\x10\x31\xa9\x24\x79\x74\x39\xcc\xcd\x95\x32\xe6\x74\xc9\x0b\x57\x93\x03\xd9\xd9\xe1\xcc\x03\x4f\x7f\xbd\x39\xf8\xfb\x6f\xa7\xf9\x6e\xac\x97\xe2\x85\x3e\xb2\x3a\xbe\x28\x7d\xda\x79\xa0\x97\xa1\xa0\xbe\xeb\xd7\x8c\x8d\x99\xf8\x5f\xcb\x2a\x99\xc9\x70\xab\xd3\x95\xa1\x68\x8a\x5e\x3b\x9e\x57\x3c\xb4\xa8\xa2\x96\x8e\x47\xe6\xc0\xa2\x82\xa5\x13\x5e\x32\xbe\x1d\xef\x70\x8b\x29\x71\x93\x8a\x2d\x70\x0e\x01\x28\xa5\x16\x38\xef\x65\xc9\x27\x32\xed\xfe\xae\x6e\x57\x07\x7e\xf1\x7e\xac\xfa\xc0\x66\x09\x85\x52\xb1\x5e\x94\x0e\xd7\x30\x58\x46\xe8\x04\xc0\x27\xbf\x67\xb5\x84\xad\xa2\x50\xbe\x6c\x21\x39\x55\x89\xf2\xa9\x22\x9f\x58\xe1\x6a\x14\x6c\x52\xa8\x04\x17\xda\x7c\xc7\xe5\x9f\x8e\xd0\xff\x4b\x08\x96\xdf\x05\xdf\x8f\x52\x01\x1e\x58\xfe\x41\xa8\x7d\x8f\xd0\x31\x10\xfe\x00\xd4\xbe\x47\x62\x2a\x44\xb1\x03\x41\xec\x91\x1a\x0d\x4e\x6c\xc1\x87\x9f\x21\x88\xa3\xa6\x61\xe4\x44\xd0\x00\xfb\x3a\x59\x14\x96\x81\x97\x9d\x20\x0d\x5a\x7f\x6a\x24\xc2\x48\x2b\x6c\x01\xcb\x6f\x8b\x0b\x56\x2e\xc2\x68\xbe\xcc\x4d\x76\x20\xb9\xc9\x25\xd8\x54\x5e\x67\x79\x2c\xea\x6c\x80\x0e\x7b\xa4\x73\x2e\xe4\x82\x65\xe8\xb0\xbc\xd8\xb2\x5e\xda\x5b\x6e\x67\x5a\x19\x44\x23\x4f\x43\xd0\x0d\xbe\xa4\xc1\xfe\x44\x30\x1d\x47\x88\x44\x2e\x1b\x72\x98\xf3\x38\x4a\xe2\x30\x2f\xb2\x9b\x55\xd2\x63\x3f\x8e\x92\xea\x67\x48\x06\xe9\x03\x3c\xc8\x51\xb2\x9b\x10\x57\xf2\x00\x23\x72\x94\xe0\x18\xd6\x64\xc3\x8d\x1c\x25\x31\x89\x3f\x39\xba\xf3\x49\x4c\xca\x71\xd3\xca\x61\x5b\x0e\x72\x2a\x47\x49\x1c\xe1\x5d\x1e\x63\x57\x8e\x92\x19\xc3\x65\x8a\x52\x96\x68\x32\x2b\x73\x94\x4c\x14\xc5\xdd\x6c\xaf\x14\xed\x03\x57\x04\x9f\xb3\xbd\xf6\x64\x76\xb6\x57\x12\x10\x35\x5c\x31\x44\x0f\x23\x2d\xf5\x53\x3e\x44\xcb\x44\x0e\x39\x84\x9f\xfc\x21\x41\xe4\x08\x4d\xc4\x08\x0d\x44\x82\x60\x0f\x61\x84\x4b\x08\x91\x24\xf1\x30\xd4\x11\xf6\x8a\x26\x91\x48\x90\x99\x46\x9e\xd4\xbf\x52\x88\x25\xec\x15\x4f\x31\x61\xaf\x18\xb2\x09\x7b\xc5\x73\x4f\xa7\x4c\x67\xc3\x52\x1d\x60\xa1\x4e\x90\x39\xc8\x57\x6d\x69\xbb\x3a\x7c\xd4\x09\x62\xbd\xcc\xd5\x89\xd2\x92\x95\x4f\x2c\xc8\x3c\x5c\x21\xde\x6a\xf7\xce\x40\xd1\x81\xbd\xa2\xf9\x70\xdc\xdb\x7d\x99\x4d\xf6\x0a\x27\xd9\xc0\xf5\x35\xa7\xda\xc0\x95\x9a\x70\x13\x25\x34\x9c\x94\x03\x57\xd2\xac\x0a\x73\x65\xdb\x2b\x99\x35\x3b\xaa\x5b\x86\x59\x3b\x86\x3f\xbb\xdf\x4b\xbf\x67\xaa\x7b\x6f\xc4\x9c\x0d\x32\x31\x3a\xb7\x86\x4f\x76\x8e\x34\x79\xb6\x0b\xf6\xca\x1a\x30\x2f\x7f\xb6\xdb\x66\xd5\xdb\xa2\xbd\x8b\x7a\xbd\x91\x3b\xc1\xae\xe6\x6d\x88\x8b\x2f\x52\x17\xf7\xd0\x10\xfd\xac\x7c\xb1\xfb\x6a\x04\x77\x9f\x73\x77\xb2\xc1\x1c\xcb\xe7\x67\xaf\x78\x66\xbf\x24\x53\x14\x38\x00\x03\x1c\x7f\x09\x12\xf7\x61\x03\xb4\x57\xfa\x80\xa2\x64\x86\x40\x7b\xc5\x71\x05\x26\x89\x44\x96\x59\x30\xc8\x1a\x98\x28\x38\x81\x63\xd0\x79\x28\xfd\xa8\x84\x52\x79\x07\xed\x15\xcb\x40\x98\xd8\x73\x9d\x20\xb1\x2b\x17\xa1\xbd\x76\x1a\x8e\x34\x03\x0e\x25\x31\x15\xf6\x9b\x16\x6d\xa3\xa1\xe3\xa1\xf6\x78\xa8\x8d\xbc\xfe\x04\x87\xda\x10\x97\x62\xe2\x19\xb4\x03\x8a\x36\xc6\xaa\x98\x20\x73\x9b\x7f\x71\x94\x5f\x31\xe5\x58\x3b\xca\xc4\xd8\x65\x5a\x4c\x34\x0c\x82\x9c\x8c\x91\x9c\x8b\x8e\xd4\x74\xb5\x9b\xca\xc3\x68\xaf\x74\x46\xc6\x94\xa5\x24\xec\xa5\x78\x6e\xc6\x04\xc9\x5d\x16\xc7\x30\x4b\x63\x8a\x7d\xb4\x23\x9f\xa3\xbd\x76\xb3\xcb\x92\x39\x1e\xed\x15\xc7\xf6\x98\x68\x47\xb8\xdc\x90\xbb\xf3\x3e\xda\x6b\x47\xe3\x2a\x81\x0b\xd2\x79\x28\x92\x15\x32\x71\x48\xd4\x5a\xf0\xf3\x43\x26\xca\x8c\x63\x93\xb4\xd7\x8e\xc3\x98\xc2\x30\x69\xaf\xc3\x72\x4d\xee\xd9\x89\x5d\x2c\xcb\x48\x26\xca\x7e\xcb\x12\x0c\xcb\x54\x87\xe5\xcb\xbb\x21\xa3\x05\x43\xe2\xce\x01\xdc\x44\x8a\xef\x40\x45\xff\xbf\x1e\x0f\xd0\x33\x46\xf7\x55\x45\x67\x00\x63\xd1\x5e\x29\xa1\xfd\x78\xef\xc3\x31\xb4\xff\x34\xa1\xfd\x99\xe2\xea\x38\xc6\xf5\x07\x7b\x73\x8c\xeb\xdb\xeb\x18\xd7\x3f\xba\x40\x8e\x2e\x90\xed\xeb\x18\xd7\xef\x74\xeb\x18\xd7\x3f\xc6\xf5\x8f\x71\x7d\xdf\x75\xd0\xb8\xbe\x32\xcf\x21\xa8\x1f\x3d\xf9\xbe\x92\x98\xbe\x62\xc9\xba\xc8\x32\xd6\x96\xcd\x1d\x7b\x20\xc1\xd0\x5e\xd4\xa1\x6d\x4b\x6a\xb0\x83\x4f\x77\xc2\xc3\x6d\x4e\xc5\x49\x2a\xf9\x6d\x5f\xa8\x07\xf5\x21\x47\xec\x30\x65\x4e\x72\x23\x31\xd6\xe5\x2b\x1e\x6e\xc4\x28\x9c\xa1\x0b\x54\x93\x8c\x56\x94\x00\x0d\x3e\x86\xcf\x61\x3a\x68\x7a\x8f\x48\x43\x9f\x93\xe2\x5e\x11\x23\x94\x0e\xb1\x96\x73\x36\x51\xaa\x5f\x37\x37\x4a\xae\x52\x2a\xb2\x59\x60\x0e\x30\x8d\xd2\xaf\x19\xc7\x6a\xf2\x6f\x65\x71\xc4\xf5\x1e\x7a\x7e\xe7\xb4\xc4\x75\x7a\xc1\xd0\xc6\xf0\x82\x6d\x35\x12\x57\x54\x21\x16\x1c\x5a\x43\x90\x2f\x15\xad\xe5\xb4\x9e\x91\x8c\x95\x3e\x1e\x64\x7b\x75\x26\xcf\x75\x5f\x82\x9e\x45\xca\xbf\x1c\x79\x8c\xcd\xdb\xda\xf0\x1e\xaf\x71\x41\x73\xda\x6c\x4c\xe8\x5c\x51\xdc\x61\x58\x67\x6a\xa0\xa3\xc4\x5e\x70\xfb\x96\x11\xae\xaa\x9a\xe1\x6c\x49\xb8\xd3\x6f\xb0\x81\x55\x65\x65\x94\x4c\x5d\xf7\x02\xe4\x91\xd2\x00\x96\x72\x85\x9d\x54\x6c\x50\xcd\x1a\x9d\x36\xa2\x1a\x1e\x77\xfc\xec\x74\x0e\x8e\x3d\xd0\x28\xf8\x09\x30\x49\x9a\x7a\x23\xf3\x4f\xe2\x5c\xa8\x4e\x53\x60\x04\xe8\xbd\xfb\x07\x47\xac\xc8\x35\xb8\xd1\x8f\xdf\xc6\x1d\xfd\x48\x9d\xa9\x35\x2d\x8f\x37\x74\x25\x3d\x9c\x85\xb0\x11\xc5\xd6\xd0\xfd\x81\xb8\x49\x6e\x1b\xf1\xb7\xef\xd1\x92\xb5\x35\x3f\x73\x6b\x20\xbf\x93\x9f\xc1\xf9\x3c\x36\x4a\x26\x0c\xcb\x06\x15\x04\xf3\x06\x7d\xf7\x2d\x5a\xd1\xb2\x15\xa6\x41\xc4\xb3\x8e\x69\xfe\xc3\xf7\xd1\xcb\x2d\xd6\x28\x8f\x35\xc7\xb7\x13\x1f\xd4\xaa\xaa\x00\xf4\x5c\x59\xe5\x4a\xab\x84\xaa\x6e\x9d\xdf\x97\x84\x07\xbd\x38\xa4\xda\x8a\xdc\x37\x57\x36\xec\xc0\xba\x26\xd6\xba\x8d\xb2\x56\x23\xf7\xfd\xa8\xdb\x42\x46\x6c\xa8\x84\x54\x05\x38\x06\xbf\x0d\x34\xe0\x8f\x96\xcd\x37\x4d\x4c\x4d\xf9\x3f\xe1\xce\x6e\x31\xb9\xfe\x70\x18\x3c\x6a\xa4\xc3\x1d\x2e\x0f\x8b\x1d\x35\x78\x77\xd8\xfa\x58\x88\xd3\x74\x64\xdd\xa0\x3c\x79\xeb\xd3\xa0\x76\xd3\x66\x19\x01\xce\xe1\x2b\xcb\x16\x57\x32\x90\x1b\x78\x65\x87\xac\xb9\xf6\x22\x34\xe9\x71\xd6\xf5\x83\x3e\xe5\x7b\x78\x5e\x88\x18\x7b\xb8\x26\x0b\xca\x9b\x04\x0a\x1e\xb8\xbd\x3b\x9d\x38\x2d\x17\x40\x99\xb0\x6a\x8b\x86\x56\x85\xe9\xb9\xa7\xbf\x46\x94\xda\xeb\x5c\x97\x31\x76\x7c\x93\x18\x40\x0b\x00\x62\x2f\x10\x36\x78\x63\x7e\x9f\x94\x0d\x20\xf5\xd7\x62\x33\xad\x70\x8d\xcd\xc0\x4a\x52\x72\xfe\x56\xf9\xa5\x71\xe6\x4d\x7f\x53\xd8\x37\x62\xe7\xaa\x71\x61\x86\xcb\x0d\xe0\xee\x33\xd9\x1a\x52\xe2\xd2\x13\x05\xea\xba\x55\xe4\xcd\x88\x3d\xea\x4c\x52\xc5\xc4\xd4\x9b\x65\xc1\x92\xe7\xf7\x38\x7b\x20\x65\x2e\xe9\xf4\x60\x48\xf2\x4d\x89\x57\x0a\xc3\xd4\x90\x8e\x91\xbc\x27\x79\xb4\xb2\x5c\x5c\xe0\x65\x84\x92\x69\x0d\xc4\x10\x60\x02\x8f\x18\x9f\x96\x47\x83\x7c\xfd\xc6\x85\x2d\xe0\xd7\x11\x1c\x62\xaa\x35\x5d\x67\x44\x99\x4d\x9e\x2e\x89\x1f\xdf\xa7\xf1\x6b\x0f\xee\xc7\x56\xf3\x15\xe6\x07\x75\x66\xbe\x74\x5e\x9a\x30\x97\x44\xfc\xc3\x85\x50\x0b\xbe\xf3\x8f\x2e\xac\xef\x4d\x8a\xf9\x66\x5f\xc2\xae\x30\x47\x15\x2c\x8d\x91\xaf\x3d\x78\x0c\x81\xbd\xae\x9e\xc7\xe0\x24\x9c\x7c\x7a\x7f\xd5\xd5\x4a\x9f\x70\xce\x38\x7a\x5f\xb0\xec\x01\x5d\x11\x79\x0e\x70\xf7\xbb\x91\x91\xe8\x43\x28\xee\xc9\x5d\x55\xcf\xf3\xfd\xb9\x05\x8e\x78\xf8\xaf\x08\x0f\xbf\x9e\xfb\x06\xe0\x75\xa0\xe1\xaf\xf0\x22\x9e\x4e\x45\x9c\xd8\xe5\x52\x93\x8f\x69\x98\xd6\x1d\x97\xc8\x5f\x97\xec\x71\xd2\xb0\x49\xcb\xc9\x84\x7a\x12\x5f\x22\x7a\xf1\x40\x36\xe2\xdb\xd8\x7e\xfc\x03\x6e\xef\x1c\x97\x1a\x26\x03\x0f\xf2\x73\xb1\xe3\x7f\x7a\x7f\x25\xb6\x99\x18\x74\x37\xca\xd1\x39\x69\xb2\xf3\x8c\x54\xcb\x73\xd5\x94\xaf\x62\x58\x56\xac\xa4\x0d\xab\xa3\x19\xf0\x2e\x50\xc6\x8a\x42\xa1\x6a\xb0\x7b\x74\x49\xaa\xa5\x11\xf2\xf4\x3d\x7a\x2e\x84\xf4\x8a\xb1\x58\x04\x69\x67\xca\x8b\xa7\xd4\x8c\x77\x5e\x7c\x3d\x4f\x55\x30\xcf\x3d\x09\x5e\x19\x01\xf1\x13\x0c\xcf\x61\x81\xe5\x4f\x66\xfa\x01\x79\x0c\x75\x62\x4f\x5d\x1c\x79\x25\xd8\x33\x42\xae\x9a\x41\x37\xf7\x60\x8e\xe7\x24\x47\x6c\x4d\xea\x9a\xe6\x84\x23\xa3\x4d\xdc\x93\x2f\x2d\x0e\x44\x10\xb8\xd3\x98\x1e\x61\xf0\x5f\x14\x06\x3f\xe1\x98\xe4\x28\x2f\xf1\xd4\xb6\xf2\xc2\xf9\x8a\x96\x89\xb0\xae\xcf\xab\xbe\x82\x70\xf6\xc2\x0e\x19\xf9\x4e\x6f\x5c\xbb\x1c\x44\x78\x86\x0b\x72\xf3\x6b\xc4\x61\x64\x06\x77\x76\xcf\x23\xfa\x43\x07\xd9\x74\x27\x2c\xc7\x7f\x98\xc9\x8e\x4a\x96\x8f\xf9\xa6\xff\xbc\x68\xa7\xce\x5c\x06\x30\xc7\x7d\x36\xca\x05\x6e\xc8\x23\x8e\x66\x19\xd7\x5d\xe9\x62\x8a\x9b\x57\x7f\x31\xbd\x41\x3f\x83\xc4\xfd\x40\x56\x6b\xd6\x80\x45\x76\xc5\x56\x98\x46\x33\x29\x39\xe0\xd0\x6e\xb3\xa6\x46\x1c\x02\x79\x62\x17\x0a\x9c\x33\x00\x77\xac\x15\xe7\x2c\x75\x02\x3a\x22\x5d\x1e\xd8\xa8\xb0\x36\x85\xe3\x04\xd2\xa9\xbe\x96\xc4\x46\xbd\xc5\x80\x23\xcb\x06\xaa\x11\x27\x25\xa7\x32\x0a\xe4\x24\x27\x28\xfe\x50\x20\x9f\x85\x4c\x5d\x30\x3c\x7c\x2b\xef\x23\x5b\xd0\x52\xaf\x5b\xa6\x42\x9a\xf7\xd8\x67\x8b\x1c\x2d\x85\x17\xb5\x14\x38\x2f\xae\x4b\x3c\x2f\x7c\xe1\xb4\xae\xe2\x2f\xf0\x42\x4c\x3a\x22\x9f\x3a\xcf\x29\x17\xff\xa2\xd9\xec\xa3\x74\xa4\xb7\xa5\xb6\x6c\x03\xa9\xcd\x4a\xed\x99\x6a\x1e\x58\xb6\xfb\xad\x27\xd0\x3b\x09\x48\xa4\x37\x65\x2e\x9a\x4b\x78\x27\x3f\x49\xc9\x01\x90\x55\x93\x62\x2e\x33\x39\xfc\xf1\x9a\xbb\x25\xcd\x1e\xa6\x8e\xbf\x9c\xd5\xe2\xb3\xd2\xf9\xa8\xb3\x1d\xf5\xbf\xdb\x47\x61\xaa\x46\x4f\xe3\x8f\xad\x77\x8e\xc6\x9f\xa9\x2e\x8b\xc7\x11\xe6\x9c\x65\xd4\x06\x48\x02\x80\xa9\x76\xb3\xc8\xe5\x66\xb1\x5f\x37\xe4\x4e\xbf\xe3\xfe\xa5\x5f\x9c\x26\xc6\xe6\xce\xae\xe4\x3f\x84\xaa\x71\xd8\xab\xe9\x30\x51\x12\x98\x1a\xee\x3a\xdc\x0c\xda\xf6\x03\x8f\xbe\xf1\xdb\x2b\x0f\x60\x58\xa9\x6b\x6b\x4c\xd1\xe1\x6c\xbf\x44\xc3\xd1\xa0\x02\xcd\x4f\xe8\xfb\x57\x56\xd2\xc8\xb7\x66\xdf\x1b\xfb\x7e\xdc\x66\x0c\x59\xe4\x9e\x22\xaa\xa1\xf3\x79\x2f\x6c\x09\x9f\x29\x67\xbf\x4c\xdc\xaa\x58\xd5\x16\x78\x34\x6e\xb9\x45\x7c\xb1\x07\x05\x0c\xfc\xfa\xae\x21\x81\x74\x14\x66\x7f\x91\x41\x17\x90\xd9\xef\xc1\xd7\x50\xcd\x71\x80\xcc\x61\x88\x91\x86\xa1\x6f\x7f\xf8\xfe\xfb\x31\xf0\xe6\x51\x88\x66\xaf\x85\xea\x03\x6f\xf6\x41\x34\x7b\x85\x7a\xc1\x9b\xc7\x4a\x04\x7c\xc1\xba\x71\xf0\xe6\x71\x73\xe0\x70\xe8\xcd\x01\xdf\x6a\x6a\x3d\x9f\x5b\xab\xe7\xf3\x70\x85\xab\xf8\x86\xeb\xdb\x3c\x32\x3d\xb5\x7b\xfe\xba\x3c\x9f\xcc\x81\x8a\xbd\xc8\x6a\xbc\xc0\xd9\xc9\x26\x3a\x1c\xaa\x06\x2f\xa9\xf2\xce\xad\xaa\x0b\xb4\xd4\x5f\x6f\x37\x52\x4b\xe7\x91\x39\x5c\x65\x17\xae\xa0\xf3\x88\xec\xd4\xd6\x05\x2a\x2d\xd2\xd0\xc4\xc3\x35\x72\x51\xd5\x6f\xb1\x99\xd8\x11\x95\x6e\x7b\xd6\xb7\x45\x27\xdd\xc5\xd4\xb2\xa5\x6c\x2e\xb6\x2e\x2d\x20\x14\xf9\xeb\xd6\xc6\xaa\xd1\x82\x52\x87\xab\xd5\x7c\x35\x68\x41\x91\xfe\x6d\x64\xb7\xca\xb3\xe8\x7a\x33\x67\xcb\x08\x0a\x8d\xae\x32\x4b\xa9\x2d\x8b\x4f\x5e\x8d\x49\x5c\x8d\xaf\x1e\x73\x6a\xc2\x82\x1d\xf7\xd7\x8c\x0d\x57\x82\x45\xcd\xa4\xed\x4a\x31\x7f\xfd\x57\x50\x68\x4c\x7d\x58\xe4\xe2\x8d\xc9\x96\x0d\x55\x80\x05\x33\x69\x0f\x92\x1e\x1b\x53\x65\x94\x5e\x5b\x64\x76\x17\xaf\x96\xf7\x97\x14\xc5\x3b\xf3\x52\x78\xfa\x5c\x1f\x95\x3a\x7a\x68\x03\x17\x12\x8c\x2c\x68\xa1\xd7\x82\x68\x47\x82\xa4\x87\x3a\x7c\xa0\x98\xc9\x16\x3a\x98\xc1\xef\xb1\x18\x62\x5b\xe5\x8b\xf8\x75\xd6\x0b\x97\x98\x8f\x8f\x51\x92\x57\xce\x09\x77\x74\xee\x6f\x77\xd2\x3a\xf7\x79\x07\x42\x49\x3b\x25\xc0\x76\xba\x67\x35\x62\x73\x05\x1e\x1b\xb0\xd5\xed\x82\xb9\x98\xde\x88\xf3\xbc\xac\x18\xc3\x05\x3f\x43\x03\xf5\xfb\xca\x0c\x0a\x9d\x7f\xec\x09\x07\x37\x0d\x59\x55\x8d\x6f\x2a\x1c\x7d\xfb\x2f\xea\xdb\x4f\x76\x48\xfe\x6e\x1e\x30\xd4\xc8\xed\x0a\x97\x13\xb1\xda\xa4\x97\xdf\x71\xb6\x7a\x7a\xd0\xd7\xd4\x67\x48\x67\x33\xcb\x01\x95\xae\x1b\x59\xc8\xd0\xe1\x68\x47\x3e\x1f\x81\x65\xef\x3d\x8c\x87\x56\xca\x4a\x1e\x15\xd8\x8c\x7b\xeb\x33\x63\xfd\x9c\x5a\xaf\x0a\x92\x5d\x35\x23\xa4\x97\xa2\xb3\xd7\x77\x4e\xec\xcd\x92\x84\xb2\xf7\xa7\xb2\xfa\xc6\x3e\xdf\x3d\xc3\xc0\x21\x06\x17\x05\x7b\x84\xf6\xda\x7d\x30\x30\xdc\xb2\x67\x50\x22\x28\x6b\x51\xa8\x38\xe8\x2b\x6f\xb2\xdb\x05\xa9\x93\x1a\x71\x4a\xf2\x1a\xfe\xf2\x68\x50\xab\xd0\xe2\x8c\x34\xee\x64\x13\xc7\xe8\x12\x12\xd2\xc5\xff\x75\x66\x53\xa0\xe3\x3a\x70\x34\x27\x4b\xbc\xa6\xac\xad\x41\x6e\xc3\xd0\x37\xea\x2b\xb9\x69\x6d\x58\x6b\x9c\x85\x6d\x20\x61\xd6\x8c\x22\x1f\x78\x53\xb7\xf6\x4b\x79\x98\xcb\x99\xf6\xa3\x4c\xc8\x17\xea\x2d\x27\xdc\x1a\x33\xfd\x92\x34\x6a\xe7\x93\x19\x5e\x6b\x5e\x89\x5d\x31\x9a\x72\xf4\x77\xf7\xfe\xae\x01\xb6\x9e\xc9\xaf\x5e\x1b\xe1\xe8\xd1\x04\x1b\xba\x4c\xb8\xb0\xa0\xd9\x26\x9a\x6c\xd3\x86\x09\xc5\x63\xe8\x3d\xe6\x24\x47\xbf\xe0\x12\x2f\xe0\xec\xfb\x66\x36\x7d\xff\xcb\x5b\xf1\x0a\x03\xee\x8d\x9b\xab\xa1\x28\xa3\x96\x0f\xe2\x6f\xf7\xab\x4f\xe9\xf5\x31\x61\x1b\x3c\x58\x2f\xf7\xac\xb0\xd1\x1b\x96\x1f\xed\x7c\xbb\xc0\xb7\x4f\xa2\xdc\x5b\xb8\xeb\x55\xfe\x84\xe4\xc8\xb6\xc9\xe9\xea\x6a\x5c\xf6\x64\x18\x76\xcf\x23\x6d\xd8\xdb\x30\xf8\x00\x6f\x70\xd3\x76\xb4\x4d\xd7\xe0\xfc\x45\xac\xf1\x9a\x40\xb5\xfa\x5c\xe2\x27\xe4\xea\x21\xbd\xf1\x5f\x14\xa4\x6e\x56\x72\x8a\xd4\x28\x2b\x5a\xde\x90\x1a\x0e\x26\xb2\x64\xb3\x3b\x09\x6e\x99\x38\xe9\x67\x45\x9b\x4b\x9f\x3c\x29\x35\xc2\x81\x2c\x2b\xa8\xd9\xaa\x0b\xd5\x70\x0a\xc6\x92\xf9\x62\x5a\xb3\x15\x69\x96\xa4\xed\xee\xe0\xbf\x4a\x25\xc4\x6a\x69\xed\x03\xd6\xc5\xa0\x55\xbc\xa0\xcd\xb2\x9d\x9f\x65\x6c\xe5\x18\xc8\xe7\x2a\x77\xa3\xd9\x9c\xcf\x0b\x36\x3f\x5f\x61\xd1\x03\x61\x2e\x37\x35\x9d\xb7\x0d\xab\xf9\x79\x4e\xd6\xa4\x38\xe7\x74\x31\xc1\x75\xb6\xa4\x0d\xc9\x9a\xb6\x26\xe7\xb8\xa2\x93\x8c\x95\x6b\x31\xdd\x58\xc9\xcf\x56\xf9\x5f\x85\x8a\x9a\xe0\x32\x9f\xc0\x20\xb9\xd6\xee\x98\x76\xc7\x6b\x4c\x0b\x61\x63\x7e\x22\x42\x09\xe2\x2d\xe5\xdf\x75\x09\xb2\x06\x17\xa8\x6c\x57\x73\x52\xcb\xe8\xb9\x7e\x1a\x55\x2c\xe7\x70\x3c\x84\x9a\x4c\x53\xbb\xbf\xa2\xa5\x78\x1d\x1b\x85\x2d\xb1\x0d\x52\xdc\xe0\x7a\x41\x5c\xae\xd7\xc1\x77\xda\x7b\xcc\xe7\x22\x1d\x77\x89\x56\x58\x18\x67\xde\x1e\x7e\xb2\x3b\xaf\x76\x6f\x09\x13\x09\x03\x3d\xaa\x2e\xd1\x6e\xcb\x9c\xd4\x05\x96\x48\x0e\xd0\xd2\xed\xed\x58\x9d\x69\xa4\x0d\x34\x27\xe2\xce\x8a\xd4\xa2\xdd\xc2\x3c\x94\xe7\xdf\x5c\xec\xcc\xc4\xc8\x36\x21\x2c\x73\xdb\x60\xc7\x86\x8e\xbf\xf5\x2e\x2f\xaf\x64\xe5\xa4\x21\xf5\x8a\x96\x72\x33\x90\x6f\xd0\xfb\x32\xb6\xba\xa8\x5e\x0e\x7a\xd3\x2c\x09\xad\x15\x4f\x08\x5a\xe1\x26\x53\x5e\x57\x89\x9a\xcb\xea\xb7\x87\x79\x7d\x6d\xb9\xdf\x6c\x75\x9e\xdf\xa3\xb7\x07\xea\x4b\x95\x8b\x51\xdf\xa9\x1f\x87\x7b\x71\x72\xc7\x5a\xe2\x35\x38\x66\x72\xc2\xc5\x2e\xa0\x79\x34\xe4\x71\xe8\x10\xbd\x1d\xda\x5e\x26\xdb\x9a\xa7\xf3\x2d\x2c\xd5\xce\x47\xf5\xd0\x7d\x03\x73\xa2\xfb\x7d\x77\x9c\xfd\x5b\x52\xbf\xa1\x13\x39\x04\x7f\x19\xbc\x5f\x0d\xd2\x3b\xb4\xfe\xce\xfe\x25\xdf\xe3\x44\x41\x92\xcb\x2f\x00\xb8\x8a\xe4\xef\x50\x53\xb7\xb0\x91\x2a\xf3\x48\x7d\x62\x37\x41\x9c\x65\xa4\x6a\x48\x2e\xcf\x3b\xd0\x84\x07\x5a\xe6\xef\xd0\x37\x00\x9e\x5d\x15\x6d\x8d\x0b\xf5\xa7\x50\xa6\x54\xea\x8d\x77\xe8\x7f\xfe\xf7\x2f\x20\x95\xe4\xbf\xeb\x76\x88\x0f\xff\x3f\x00\x00\xff\xff\xf5\x63\xc4\xb9\xbe\x0f\x04\x00") - -func examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYamlBytes() ([]byte, error) { - return bindataRead( - _examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml", - ) -} - -func examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYaml() (*asset, error) { - bytes, err := examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml", size: 266174, mode: os.FileMode(420), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\x5f\x6f\xe3\xb8\x11\x7f\xf7\xa7\x18\xe4\x0a\xb8\x2d\x62\xa7\x7b\xbd\x16\xad\x5b\x14\xd8\xee\x6e\x71\xc1\xed\xe6\x82\x24\xbb\x2f\x45\x71\x47\x8b\x63\x8b\x67\x8a\xd4\x91\x94\x13\xb7\xe8\x77\x2f\x66\x48\xc9\x92\x2d\xc9\xbe\x6c\xf7\x2d\x7a\x49\x24\x8d\x86\x33\xbf\xf9\x2f\xd1\x93\xd9\x6c\x36\x11\xa5\xfa\x84\xce\x2b\x6b\x16\x20\x4a\x85\x4f\x01\x0d\x9d\xf9\xf9\xe6\x4f\x7e\xae\xec\xd5\xf6\xd5\x12\x83\x78\x35\xd9\x28\x23\x17\xf0\xa6\xf2\xc1\x16\x77\xe8\x6d\xe5\x32\x7c\x8b\x2b\x65\x54\x50\xd6\x4c\x0a\x0c\x42\x8a\x20\x16\x13\x00\x61\x8c\x0d\x82\x2e\x7b\x3a\x05\xc8\xac\x09\xce\x6a\x8d\x6e\xb6\x46\x33\xdf\x54\x4b\x5c\x56\x4a\x4b\x74\xbc\x42\xbd\xfe\xf6\x77\xf3\xaf\xe7\xdf\x4c\x00\x32\x87\xfc\xf8\x83\x2a\xd0\x07\x51\x94\x0b\x30\x95\xd6\x13\x00\x23\x0a\x5c\x40\x69\x65\x61\x8d\x0a\xd6\xf9\x79\xfa\x47\x99\xf5\x3c\xb3\x0e\xad\x9f\x67\xb6\x98\xf8\x12\x33\x5a\x7b\xed\x6c\x55\x2e\xa0\x9f\x28\xb2\x4b\x32\x46\xfd\x6e\xad\xfc\x10\x69\xf9\xa2\x56\x3e\x7c\x77\x70\xe3\xbd\xf2\x81\x6f\x96\xba\x72\x42\x77\xa4\xe1\xeb\x5e\x99\x75\xa5\x85\x6b\xdf\x99\x00\x94\x0e\x3d\xba\x2d\x7e\x34\x1b\x63\x1f\xcd\x3f\x14\x6a\xe9\x17\xb0\x12\xda\xe3\x04\xc0\x67\xb6\xc4\x05\xdc\x90\x44\xa5\xc8\x50\x4e\x00\xb6\x42\x2b\xc9\x48\x44\x19\x6d\x89\xe6\xf5\xed\xf5\xa7\xdf\xdf\x67\x39\x16\x22\x5e\x04\x90\xe8\x33\xa7\x4a\xa6\x6b\x09\x0a\x92\xcc\x83\xbe\xa5\x3d\xac\xac\x03\x01\x1e\x03\xd8\x15\x89\xe7\xe7\x89\x47\xe9\x6c\x89\x2e\xa8\x1a\x0e\x3a\x5a\xbe\xd1\x5c\x3b\x58\x6d\x4a\xe2\x44\x9a\x66\xb9\x90\x23\x24\x9b\xa2\x04\xcf\xa2\xd2\x72\x21\x57\x1e\x1c\x32\x0e\x26\xfa\x47\x8b\x2d\x10\x89\x30\x60\x97\x3f\x61\x16\xe6\x70\x4f\x58\x39\x0f\x3e\xb7\x95\x96\xe4\x42\x5b\x74\x01\x1c\x66\x76\x6d\xd4\xbf\x1b\xce\x1e\x82\xe5\x25\xb5\x08\x98\x2c\x53\x1f\xca\x04\x74\x46\x68\x02\xb2\xc2\x4b\x10\x46\x42\x21\x76\xe0\x90\xd6\x80\xca\xb4\xb8\x31\x89\x9f\xc3\x07\xeb\x10\x94\x59\xd9\x05\xe4\x21\x94\x7e\x71\x75\xb5\x56\xa1\x8e\x86\xcc\x16\x45\x65\x54\xd8\x5d\xb1\x4f\xab\x65\x45\x66\xbf\x92\xb8\x45\x7d\xe5\xd5\x7a\x26\x5c\x96\xab\x80\x59\xa8\x1c\x5e\x89\x52\xcd\x58\x70\xc3\xc1\x30\x2f\xe4\x57\x2e\x85\x8e\x9f\xb6\x24\x0d\x3b\x32\xbd\x0f\x64\xa2\xe6\x32\x3b\xe4\x20\xee\xe4\x95\xa0\x3c\x19\x93\x1f\x8b\xf2\xef\xe1\xa5\x4b\x84\xca\xdd\xbb\xfb\x07\xa8\x17\x65\x13\x74\x31\x67\xb4\xf7\x8f\xf9\x3d\xf0\x04\x94\x32\x2b\x74\xd1\x70\x2b\x67\x0b\xe6\x88\x46\x96\x56\x99\xc0\x27\x99\x56\x68\xba\xa0\xfb\x6a\x59\xa8\x40\x96\xfe\xb9\x42\x1f\xc8\x3e\x73\x78\xc3\x39\x01\x96\x08\x55\x29\x45\x40\x39\x87\x6b\x03\x6f\x44\x81\xfa\x8d\xf0\xf8\xc5\x61\x27\x84\xfd\x8c\x20\x3d\x0d\x7c\x3b\x95\x75\x09\x23\x5a\xcd\xe5\x3a\xc9\xf4\x5a\xe8\xbe\xc4\x4c\xad\x54\xc6\x7e\x4e\xbe\x2d\xd1\x2b\x87\x92\x02\x14\x3c\x6a\xcc\xf8\x06\x05\x64\x10\x6e\x8d\x01\xa4\xf2\x99\xdd\xa2\xdb\x75\xe0\x5c\xee\xe0\xd6\xd9\x02\x43\x8e\x55\x13\xad\x43\x11\x4b\xc7\x4f\x76\xf9\x5e\x2c\x51\x77\xaf\x1e\x48\xf7\xc0\x01\xb3\x44\x4d\xd1\x53\x79\xa4\x3f\x0e\x83\x53\xb8\x45\x36\xec\x4f\x76\xc9\xd9\x91\xed\x3e\x3f\x60\xd5\x0b\x1b\x1d\xa6\xce\x5e\xf7\xac\xa0\x75\xa3\x42\xd4\x44\xb4\x78\x44\x04\x1e\x73\x95\xe5\x7b\x36\x31\x99\xbc\x4b\x1e\xe7\x93\x01\xfc\x01\x53\x00\xe1\xb0\x81\x0f\x65\xaf\xcc\x43\x70\xf1\xe3\x66\x77\x7c\xf1\x40\xd8\xbf\x5b\xab\x51\x98\x74\x71\x49\xf1\xf5\x98\x93\x55\x1c\x08\xad\xdb\x22\x93\x30\x51\x1d\x4e\xe2\xc7\x87\x32\xb1\x22\x0a\x1f\x48\x75\xc1\x65\x86\x82\x34\x38\x95\xd5\x91\x7b\xa4\xc0\x1e\xf8\x65\x14\xe5\xe8\x7e\x21\x42\x96\xdf\xec\x4b\xda\x88\x36\x54\xc4\xc8\x29\x1b\xb1\xe3\x7f\x7d\x6b\xaa\x80\x45\x2f\xc3\x11\x3f\x68\xdf\x16\xce\x89\x5d\xaf\x03\x1d\x84\x13\x1d\xa5\x95\x1f\xc8\x0d\x33\xdf\x18\x7d\xd4\x85\x5e\x47\xec\xec\xaa\x49\x4b\x9e\xcc\x61\x1f\x51\x82\xf0\x50\x0a\x17\x9a\xd2\xb3\xaf\x8c\x87\x6a\x0e\xa8\x78\x54\x57\xbb\x92\x35\x05\x4f\x80\xcf\x9c\x28\x51\x2c\x75\x2b\x3d\x52\x39\xeb\x01\xe5\xbb\x6a\x89\xce\x60\x40\x9f\x32\x81\xdb\x92\xc5\xf7\x31\x4e\xf9\x87\x96\x39\xb6\xc5\x98\x0b\x03\xe4\xd6\x58\xc7\x91\x3f\x60\xad\x8e\x3a\xdf\xee\xa9\x21\xcb\xad\xf5\x29\xd6\xe2\xe2\x53\x1f\xb3\x83\x07\x4b\xbe\xaa\xb5\xe2\x9e\xb0\x97\x2d\xc0\xa3\x0a\x79\x9d\xc4\xe2\x63\x7d\x7e\x74\xca\x7b\x93\x06\x4d\xcf\x77\xb6\x16\xfb\x27\xea\x46\xd3\x37\xa1\xd9\x82\xd5\x21\xe5\xeb\x9e\xe4\x91\x84\xcb\x11\xc2\x9e\x53\xaa\x87\x14\xab\xd1\xb8\x12\xa8\x26\x3c\x4f\x31\xee\x43\xb6\xe2\x28\x25\xf7\x68\x74\x9d\x48\x41\xd4\xc9\x30\xb9\x43\xdd\x08\x2d\xb1\x16\xe8\x39\x21\x19\x99\xdd\x21\x9b\x49\x99\xf5\x39\x20\x7f\x68\x3f\xf3\xc6\x9a\x95\x5a\x73\xd3\x25\xca\x52\xef\x38\x77\x8b\xa2\xd4\xe8\x61\x89\xab\x58\xc5\xd7\xe8\xe9\xd1\x7e\xb0\x46\xf2\xc9\x61\x93\xd3\x59\x33\xc6\xb5\x07\xb9\x33\xa2\x50\x19\x38\x7c\x74\x8a\xb3\x25\x07\x38\x0e\x70\x84\x54\xe7\x3c\x86\x4b\x58\x22\xd1\x93\xe0\x0a\xe5\xa8\xe8\x70\xdd\xc4\xf7\x20\xe3\x1f\xff\x1a\xe1\xfc\xc1\x45\x39\x7f\xc8\x22\x38\x7f\xfb\x71\xe6\x53\x79\xb7\xab\xb6\x0b\xc6\xfb\x95\x13\xc3\xe8\xd0\xd1\xd3\x0b\x95\xfb\x16\x40\xd9\x2b\x69\x33\xdf\xba\x74\x15\x5b\xdf\xab\x0e\xfb\x83\xb3\xaf\xfa\x45\x9d\x0e\x08\x31\x9e\x6a\xe2\x21\xb2\x70\x30\x1a\x8c\x5a\xf3\x75\x44\x24\x58\x28\xd1\xad\xac\x2b\x60\x29\x3c\x4a\xca\x30\x0e\xd7\xf8\x14\xcb\x17\x8d\x68\x23\x1c\x01\xde\xe2\x4a\x54\x3a\x50\xef\x3b\x75\x58\x6a\x91\xe1\x90\x12\x70\x3a\x1e\xe2\x51\x58\x59\xe9\x6a\x44\xd5\xc3\x88\x88\xf4\x3c\x79\x88\x0d\x26\x07\x84\x5c\xf8\xbc\xfe\x3f\x35\xdc\x0c\xf6\xa8\x3e\x69\xee\x18\xa1\x21\xac\x44\x58\x50\x16\xf9\xe3\x37\x27\x55\xa5\x5c\xb3\x46\x37\x48\xc7\x58\x9f\xad\xe9\x1d\xf2\x28\x0b\xf8\x44\x09\x91\xc7\x3c\xb1\x16\xca\xf8\x3a\x3b\xf1\x44\xf0\x14\x9c\x18\xec\x76\x3a\x8a\x92\xd9\xd8\xce\x34\x01\xb4\x4d\xf9\xeb\xf9\x6f\x7f\xf3\xd9\x76\x4c\xfe\x50\xa0\x09\xbf\x40\xc3\xe6\x99\x24\x62\x57\x41\x91\xbc\x33\xf1\x1e\x55\x51\xf9\xda\xb7\x51\x82\x8a\x8e\xe0\x8e\x11\x8c\x00\xf8\x39\xa1\x8b\x4f\xa3\x1c\x33\x51\xd2\x48\x13\xdf\x63\xc4\xd6\x52\x6c\x85\xd2\xd4\x6a\x74\x01\xfc\xd5\xab\xcf\x86\xcf\x63\x29\x9c\xe8\xe9\xda\x07\xc1\xbb\xaf\x9f\x00\x06\x87\xaa\x53\x78\x44\xe4\xfe\x36\x13\x01\x0d\x8d\x7a\x29\x16\x46\xf5\x8c\x39\xba\x9e\xc1\x65\x4b\xaf\xbf\x4c\xc7\x62\xe3\x3c\xbd\x78\xfd\xb1\xd6\xa8\x47\xb5\x87\x83\x20\xf6\xf5\x88\x12\x85\x8c\xf3\x30\x3e\x29\x1f\xc6\x96\x6e\x74\xf3\x73\xe2\xa8\x1c\xb7\x28\xdc\x58\xf8\x2e\x48\x95\xaf\x47\xf6\x3a\x71\x9f\x88\xa7\xc6\x5a\xe9\xb5\x06\x07\x55\xe3\xbc\x5d\x46\x3d\x5e\x38\xca\x9b\xa7\x52\x76\x5e\xb6\xeb\x25\x6c\x10\xcb\xf8\xfe\x44\x3a\x5b\xa6\xd4\x3f\x9a\xb5\x46\xcb\x7c\x3c\xce\x32\xde\xd8\x18\xd1\xa2\xe1\xee\xb3\x77\xee\x6d\x1f\xdd\x19\xa8\x9e\x7f\xf7\x99\xcc\xa1\xaf\x74\xd8\xbf\x4e\x51\x1e\xa8\xc9\x08\x38\x0e\x97\x32\x9c\x26\x18\xab\x84\x0d\x37\x10\x9c\xec\x8c\x24\x23\xed\x18\xd3\x2e\xcd\x28\x7e\x10\xb3\xc3\x78\x06\xf8\xbc\xc8\x18\x9c\xc2\xba\x04\x43\xc8\x93\xfb\x0d\x99\x58\x48\xc9\xef\x85\x85\xbe\x3d\xd9\x49\x9c\xf0\x94\xb3\x15\x19\xf6\x90\x8e\xd9\xbf\x2f\xa3\x60\xf0\xed\xc3\xc3\x2d\x7c\xbc\x7b\x1f\x15\xc1\x80\xae\xbf\xd5\x3b\x01\x53\x29\x42\x7e\xce\xa8\x42\xab\x11\x2d\xb7\x9d\xdc\xc1\xb3\x4b\x0c\x4e\x7b\x67\xe8\x5e\x5a\x37\x50\xe8\x3a\x4b\xdf\x88\xa2\xe9\x51\x4a\x2b\xf9\xb1\x38\x12\x37\xc3\xaa\xc3\x15\xba\xf8\xaa\xee\x43\x15\x2a\xa1\xf5\x50\xac\xe1\x53\xa6\x2b\xaf\xb6\xd8\x1e\xfb\x6e\xad\x0b\xcf\xd3\xc0\xd9\xa7\xdd\x47\x77\xce\x64\x74\xcb\xa4\x77\xef\x01\xd7\xdc\x16\xc7\xae\xf8\x69\xc7\x2f\xd5\xdd\xe2\xeb\x57\x7f\xfe\x03\xbc\x55\x8e\x46\xbc\x84\xef\xe0\xa8\x67\xe3\xba\x10\x72\x67\xab\x75\xde\xc5\xe2\x59\x7a\xb8\x5f\x34\x51\x4d\xff\x6f\xc3\xd4\x17\x1a\x16\xba\x53\x42\x7f\x63\xf1\x32\xc7\xbd\xcc\x71\x2f\x73\x5c\x73\xbc\xcc\x71\x2f\x73\xdc\xf0\xf1\x32\xc7\xbd\xcc\x71\x43\x5a\xbd\xcc\x71\x2d\x9a\x97\x39\xae\x17\xb5\x2f\x39\xc7\xf1\x3e\x0a\x3c\x77\x84\x89\xd4\xf5\x67\x63\x02\x83\x9b\xed\xc1\x7a\x7f\x42\xfe\xd8\xa9\x3f\xa8\x02\x6d\x75\xce\x2c\x93\x28\x41\xac\x02\xba\x96\xc5\xd3\x44\x15\xfb\xf8\xe7\x7d\x1b\xd9\x8f\x32\x03\x33\xad\xd9\x7d\xbf\xea\xbf\x35\x3b\xa3\x68\xcf\x4e\x9b\xb2\xdb\x35\xbf\xc5\xd2\x21\x25\x16\xb9\x80\x8f\x1e\x61\x3a\xa5\xc1\x6d\x3a\x05\x4a\x0c\x28\xe4\xbc\xbf\x50\x3c\xcd\x36\xcd\x27\xc6\x99\x32\x61\x66\xdd\x2c\xae\xb9\x80\xe0\xaa\xe3\xfc\x3d\xe2\x3e\x43\x8e\x53\x5a\xf9\xb0\x8f\xd4\xf1\x4f\xb4\xb7\x5d\x5a\x08\x4e\x18\xcf\xd3\xe6\xfe\x13\x23\x59\xb0\xfb\x61\xf4\x48\x4a\x6b\xd2\x3e\x9f\x68\xa6\x33\x3f\xe1\x8e\x40\x3e\xa4\x5b\x1c\x25\xde\xab\x42\x1d\xf9\x41\xb7\x66\xee\xe9\x9a\x2f\xc1\x25\xba\x59\xf2\x44\xcd\x37\xac\x01\x53\x15\x4b\x74\xd4\x4f\x0e\x7d\xb7\xab\x87\x97\x90\x8b\x00\x8f\x4a\x6b\x58\x52\x6a\xc9\xb0\x0c\x28\x0f\x15\x1d\xeb\x22\x87\x9d\xd0\x3f\x73\x3f\xc6\xad\x95\xf5\xa6\x8b\x5f\xb2\xa1\x82\xab\xd8\xbb\xa6\x46\x9d\xde\x8f\x70\xf8\x40\xdc\xda\x54\x7f\xdb\xaf\x27\xbf\x24\x9e\xc3\x9f\x2b\xe5\xb8\xd5\x1b\x48\xbd\x0f\x5c\x03\xf6\x54\x9c\x6e\x5f\xdf\xbc\x3d\x86\x13\xc6\x4b\xdc\xe1\x66\x83\x41\x41\xd2\x5e\xac\x06\x41\x32\x25\xb5\x08\x54\xc5\x07\xd2\x76\x6c\x40\x2e\x41\xc0\x06\x77\xb1\x28\x0b\x03\x04\xaa\x68\x58\xd0\x98\x17\xd2\xa7\xf9\x0d\xee\x98\x68\x6c\xd2\x38\x3d\xef\x6d\xb0\x77\xaf\x4b\x8f\xba\xb4\x9e\xf2\x69\x6f\x1d\xe9\x4d\x17\x58\x2a\x4e\xb8\xb5\xaa\x71\x0a\x1f\x9e\xae\x01\x82\x1d\x2e\x70\x67\x94\xb7\x1a\x91\x33\xc5\x6e\x00\xdc\x6f\x6a\x8b\x10\x4f\x7d\x84\x93\xfc\x2b\x57\x25\xbf\x75\x19\x91\x3a\x6d\x92\xac\x7b\xd9\x4f\x42\x2b\xd9\x30\x8f\x1e\x75\x6d\x2e\xe1\xc6\x06\xfa\xf3\x8e\x3a\x48\x4f\xf6\x19\x61\xf9\xd6\xa2\xbf\xb1\x81\x69\x3f\x0b\x92\x28\xd4\x99\x80\xa4\x46\x97\x1c\xd4\xc4\x7c\xc7\xc9\xa8\xb5\x6d\xd0\xcf\xe1\x3a\x4e\x39\xb5\x7e\x63\x0d\xa1\x87\x6b\x03\xd6\xd5\x9a\xf3\x76\xcf\xb8\x44\x64\x5e\x54\x9e\x77\xfa\x19\x6b\x66\x58\x94\x61\x57\x73\x1f\x61\xda\x18\x4d\xf9\x1a\x4a\xeb\x3a\x78\x0d\x2c\x34\xc2\x73\x89\x90\x96\x7f\xc8\x55\xfd\x4c\xdc\x82\x1a\x87\x1c\x59\x31\x04\xbc\x85\x52\x04\x5c\xab\x0c\x0a\x74\xeb\x31\x39\x4b\xca\x53\xc3\xa6\x3b\xd9\x2c\x9f\xd5\x2a\x9f\x6a\x94\x53\xda\x91\x43\xbd\xc8\x06\xfb\x9f\x9b\x8d\x9b\xf7\x44\x1b\x39\x26\x15\xa7\xef\xe1\xc1\xec\xfc\xaf\x01\x27\xf0\x39\xae\x19\xa9\xa9\xe0\xec\x5b\x88\x92\x3c\xfb\x3f\x94\x4e\xd9\x51\xfe\x0b\xa5\x50\xce\xcf\xe1\x35\x6f\xca\xd6\xfd\x96\x6d\xd3\xab\xd8\x8b\xb4\x59\x13\x57\x6a\x2b\x7f\xae\xd4\x56\x68\x4a\xf5\x94\x38\x0c\xa0\xe6\xc4\xdf\xcb\xd2\xae\x8e\x2a\xda\x25\x3c\xe6\xd6\xc7\x2c\xbe\x52\xa8\x79\xf7\xee\xc5\x06\x77\x17\x97\x9d\xc8\x03\xd5\x9f\x4a\x2f\xae\xcd\x45\x2c\x12\x47\x71\x50\xd7\x19\xb0\x46\xef\xe0\x82\xef\x5d\xcc\x8f\x8a\x60\x7f\x53\x3b\x56\x18\x4f\x76\x86\x47\xb7\xfa\x5c\x73\xd6\xb7\xab\xaf\x73\xbf\xae\x25\x93\x51\xfe\x87\xbc\x67\xbc\x01\x77\xd2\x4b\xbf\xff\x4d\xc1\xab\xfd\x19\xfb\xdc\x2c\xfd\x86\x80\x6f\x00\xef\xbf\xa3\x06\xbb\xe9\x8c\x7d\xb0\x4e\xac\x31\x5d\xf1\x41\x84\xf8\x42\xb1\xee\xc7\x6e\x0e\x7f\x32\x70\x71\xc1\x27\xf5\xaf\x01\xf8\x34\xb3\x26\x7a\xbc\x5f\xc0\x3f\xff\x35\x89\x5c\x51\x7e\xaa\xe5\xa0\x8b\xff\x0b\x00\x00\xff\xff\x85\x97\x1c\x68\x7f\x31\x00\x00") - -func examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYamlBytes() ([]byte, error) { - return bindataRead( - _examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml", - ) -} - -func examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYaml() (*asset, error) { - bytes, err := examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml", size: 12671, mode: os.FileMode(420), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\x7f\x73\xdc\x38\x92\x20\xfa\x7f\x7f\x0a\x84\x7b\x22\x64\xdf\x53\x95\xda\x3d\x73\x13\x7b\xbe\x89\xdb\xd0\x58\xee\x1e\xdd\xd8\xb2\xce\x52\xbb\x6f\xe2\xc5\x8b\x6e\x14\x89\xaa\xc2\x8a\x04\x38\x00\x58\x52\xcd\xce\x7e\xf7\x17\xc8\x04\xf8\xa3\x48\x82\xa0\x54\x6e\x7b\xba\xc9\x8d\xd8\x69\xab\xc8\x04\x90\x48\x64\x26\xf2\xe7\x57\x8b\xc5\xe2\x2b\x5a\xf0\x8f\x4c\x69\x2e\xc5\x2b\x42\x0b\xce\x1e\x0c\x13\xf6\x5f\x7a\x79\xf7\x6f\x7a\xc9\xe5\xd9\xee\xe5\x8a\x19\xfa\xf2\xab\x3b\x2e\xd2\x57\xe4\x75\xa9\x8d\xcc\x3f\x30\x2d\x4b\x95\xb0\x0b\xb6\xe6\x82\x1b\x2e\xc5\x57\x39\x33\x34\xa5\x86\xbe\xfa\x8a\x10\x2a\x84\x34\xd4\xfe\x59\xdb\x7f\x12\x92\x48\x61\x94\xcc\x32\xa6\x16\x1b\x26\x96\x77\xe5\x8a\xad\x4a\x9e\xa5\x4c\xc1\x08\x7e\xfc\xdd\x37\xcb\x6f\x97\x7f\xf8\x8a\x90\x44\x31\xf8\xfc\x96\xe7\x4c\x1b\x9a\x17\xaf\x88\x28\xb3\xec\x2b\x42\x04\xcd\xd9\x2b\x52\x28\x99\x33\xb3\x65\xa5\x66\x7a\x99\x4b\xc1\x8d\x54\x5c\x6c\x96\x89\x54\x4c\xea\x65\x22\xf3\xaf\x74\xc1\x12\x98\x4b\x9a\xc2\x04\x69\x76\xad\xb8\x30\x4c\xbd\x96\x59\x99\xe3\xc4\x16\xe4\x7f\xdf\xbc\xbf\xba\xa6\x66\xfb\x8a\x2c\xed\x07\x4b\x37\x15\x98\x74\xca\x74\xa2\x78\x61\x60\x6a\xb7\x5b\x46\xdc\x8f\x44\xae\xc9\x75\x35\x01\x78\x15\x67\xf5\xb1\xf1\xb1\xd9\x17\xec\x15\xd1\xc6\x4e\xab\x77\x24\xc5\x8a\x8c\x27\x54\xf7\x0f\x95\x32\xcd\x15\x4b\x89\x7f\x8b\x88\x32\x5f\x31\xd5\x1e\x9a\x35\x07\xff\xd0\x84\x87\xa3\xdb\xe5\x6e\x98\x3a\x1c\xde\xef\xd4\xb2\x83\xe5\x06\xb8\xf3\x0d\x6b\x40\x4a\xa9\xb1\xff\xdc\x28\x59\x16\xaf\x48\x3f\xc2\xf1\x4b\xb7\xe1\x48\x2c\x07\x58\xca\xb8\x36\x7f\x3d\xf8\xe1\x2d\xd7\x06\x7e\x2c\xb2\x52\xd1\xac\xbd\xb5\xf0\x83\xe6\x62\x53\x66\x54\x35\x7f\xfa\x8a\x90\x42\x31\xcd\xd4\x8e\xfd\x20\xee\x84\xbc\x17\xdf\x71\x96\xa5\xfa\x15\x59\xd3\x4c\xdb\xa9\xea\x44\xda\x89\x5f\xd9\x29\x15\x34\x61\xa9\xfd\x5b\xb9\x52\x8e\x70\xf5\x2b\xf2\x9f\xff\xf5\x15\x21\x3b\x9a\xf1\x14\x90\x80\xf3\x96\x05\x13\xe7\xd7\x97\x1f\x7f\x7f\x93\x6c\x59\x4e\xf1\x8f\x07\xfb\x53\x4f\x9e\xa4\x96\xfe\x99\x26\xb4\xfd\xc7\x22\x93\xfb\x9c\x09\xb3\x74\x9f\x17\x4a\x16\x4c\x19\xee\xb1\x63\x9f\xc6\xb9\xab\xfe\x76\x30\xd0\x89\x9d\x89\xa3\x39\x3f\x92\xa9\xe9\x90\xa5\x44\xc3\x2c\x2d\x55\x98\x2d\xd7\x96\x5a\x2c\x56\x04\x9e\xbd\x06\x58\x62\x5f\xa1\x82\xc8\xd5\x7f\xb0\xc4\x2c\xc9\x8d\xc5\x9c\xd2\x44\x6f\x65\x99\xa5\xf6\x78\xee\x98\x32\x44\xb1\x44\x6e\x04\xff\x47\x05\x59\x13\x23\x61\xc8\x8c\x1a\xe6\x36\xca\x3f\x70\x98\x04\xcd\x2c\x0e\x4b\x76\x4a\xa8\x48\x49\x4e\xf7\x44\x31\x3b\x06\x29\x45\x03\x1a\xbc\xa2\x97\xe4\x9d\x54\x8c\x70\xb1\x96\xaf\xc8\xd6\x98\x42\xbf\x3a\x3b\xdb\x70\xe3\x39\x4d\x22\xf3\xbc\x14\xdc\xec\xcf\x80\x5f\xf0\x55\x69\xa4\xd2\x67\x29\xdb\xb1\xec\x4c\xf3\xcd\x82\xaa\x64\xcb\x0d\x4b\x4c\xa9\xd8\x19\x2d\xf8\x02\x26\x2e\x80\xd1\x2c\xf3\xf4\xeb\x6a\x77\x4f\x1a\x33\x3d\x38\x89\xf8\x00\x7d\x0e\xe2\xdd\x12\x29\xe1\x76\x5b\xf1\x33\x9c\x7f\x8d\x5e\xfb\x27\x8b\x95\x0f\x6f\x6e\x6e\x89\x1f\x14\xb6\xa0\x8d\x73\xc0\x76\xfd\x99\xae\x11\x6f\x11\xc5\xc5\x9a\x29\xdc\xb8\xb5\x92\x39\x40\x64\x22\x2d\x24\x17\x06\xfe\x91\x64\x9c\x89\x36\xd2\x75\xb9\xca\xb9\xb1\x3b\xfd\xf7\x92\x69\x63\xf7\x67\x49\x5e\x03\xbf\x25\x2b\x46\xca\xc2\x9e\xd4\x74\x49\x2e\x05\x79\x4d\x73\x96\xbd\xa6\x9a\x7d\x72\xb4\x5b\x0c\xeb\x85\x45\xe9\x38\xe2\x9b\x62\xa2\xfd\x22\x62\xab\xfa\xb3\xe7\xdf\xfd\x3b\x74\x53\xb0\x84\xaf\x79\x02\x84\x8e\xf4\x5f\x33\xcd\x15\xdb\xd2\x1d\x97\xca\xff\xbd\x71\x36\x93\xac\xd4\x86\xa9\x65\x0b\xa9\xfd\xe8\xd9\x96\x2b\xcb\xd7\xce\xac\xb0\x52\x82\x19\xa6\x1b\x98\x5a\x65\x72\x75\x96\x53\x0b\xeb\xb1\x58\xb3\x0b\x5c\x50\x91\x2e\xb4\xa1\xa6\x6c\x61\xae\x8f\x5f\x00\xcf\xa8\x64\xd9\x79\xc6\x94\x79\x47\x05\xdd\x58\x81\x26\xd6\x7c\x73\xf0\x6a\x87\x95\x84\x3e\x25\x34\xcb\xe4\xbd\x06\x9c\xf3\xf5\xde\x92\x37\x25\x77\x6c\x7f\x00\x11\xb9\x08\xb9\x61\x89\x62\x06\x64\x3a\xe5\x02\x5e\xae\x80\x37\x71\xdd\x1c\xc8\xbe\xbd\xe6\x9b\x52\xa1\x56\xb0\xec\x40\x0e\xbc\xec\xa6\xc5\x59\x4a\xa8\x62\x84\x16\x05\x13\x29\x4b\x3d\x6b\x6a\xbf\xdc\x01\xbc\x61\x82\x29\x7b\x28\xc8\x6a\x7f\x48\x0d\xef\x0b\xfb\x93\x54\x4b\xf2\xbf\xe5\x6a\x70\xd4\x0e\xc8\xbc\xd4\x86\x6c\xe9\x8e\x01\xbc\xb5\x54\x39\xa1\xcd\x59\x72\x01\x3f\xc8\xf5\x9a\x27\xbc\x8d\x93\x54\x26\x65\xee\x19\xf4\xe1\x8e\x91\x8a\xfc\x6a\x49\x67\x0f\x68\x2a\x13\xdd\xf8\xd3\x19\x32\xe3\xb3\xd6\x7c\x0f\xfe\xf5\x35\xb5\xf8\xcc\x11\x9f\x3f\xe1\x6f\x3d\x48\xef\xdd\x24\xdd\x42\xf3\x29\xac\xa5\xd4\x4c\x11\x90\x30\xba\x90\x42\xf3\x55\xc6\x2c\xfe\x73\x7a\xc7\x3a\x50\x75\x69\x8f\x93\xb1\xaf\x83\x78\x5d\x92\x2b\x69\x2c\xae\xa8\x21\xa5\x46\xde\x69\x79\x1e\xa3\xf6\x68\x00\x2b\x64\x0f\x85\xd4\x88\xce\x42\x6a\xcd\x57\x3c\xe3\xa6\x4b\x7e\x46\x92\x95\x62\xf4\x8e\x94\xc5\x46\xd1\x94\xe9\xb6\x3e\xb4\x24\x97\x30\x2a\x4d\x77\x5c\x23\x81\x28\xb6\xe3\xec\xfe\x50\x11\x69\x3e\x8a\x65\x8c\x6a\x46\x84\x34\x0c\xc4\x1d\x13\xb0\x00\x98\xae\x90\x84\x8b\x44\xe6\x05\x35\xb0\xe4\x3e\x6c\x75\x20\x5a\xec\x6d\x24\xac\xd3\xcf\xb7\x41\x01\x74\x6d\x80\xeb\x33\xbf\x88\xe5\xc9\x01\x84\xa1\xd3\x6f\x9f\x3b\xb6\xef\xfe\xb1\x47\x7f\xbc\x63\x7b\xcf\xfd\x34\x1e\x57\x23\x89\x66\x99\x95\x47\x56\xd8\x2c\x09\x79\x67\xa9\x78\xc5\x08\xc5\x5d\xea\x81\x4a\xfc\xb7\x77\x6c\xdf\x25\x9e\x01\x06\xef\x1f\x50\x23\xc7\xa6\x7a\x62\xf5\x33\x3f\x51\xc5\xd6\x4c\x59\xad\xa9\x8f\x21\xd7\x5c\xb8\x3a\x11\x89\x14\x09\x2b\x8c\x3e\x93\x3b\xa6\xec\x36\x9f\xdd\x4b\x75\xc7\xc5\x66\x71\xcf\xcd\x76\x81\xf2\x44\x9f\x81\x56\x7a\xf6\x35\xfc\x4f\xef\x22\x6f\xdf\x5f\xbc\x7f\x45\xce\xd3\x94\x48\xb3\x65\xca\xd2\xfa\xba\xcc\xc8\x1a\x34\xca\x65\x43\x51\x3b\x05\xb5\xe1\x94\x94\x3c\xfd\xf7\xc3\x4d\x1b\xc5\x87\x2c\x90\x43\x8e\xe2\x04\x45\xdb\x9e\xdc\x6f\x19\x4c\xc7\xa2\xc6\xb1\x5c\xa9\x88\x15\xfe\x76\x73\x73\xb7\x7b\xa8\x17\xf6\xed\x1e\xce\x66\x25\x65\xc6\xa8\x38\xf8\xdd\xaa\x0f\x56\x54\x1e\x4e\x66\xd1\xc3\xf5\x7b\xa5\x33\xe9\x4a\xa3\x0f\x2c\xa3\x2b\x96\x3d\x46\x1a\xb5\x3f\xfd\x34\xd2\x08\x18\xa2\x3d\xed\x76\xa4\x38\x71\x34\xf0\xf6\x2f\x21\x8f\x42\xe3\x77\x19\x6e\x35\x9f\xc7\x4b\xa6\x0e\xd0\xb6\xa4\x3a\xb6\x64\xfa\xc9\x2d\xcd\x89\xa6\xbe\x1d\xe8\xdf\xb2\x78\xe1\xd4\x15\xdb\xf4\x8e\x3d\x4d\x38\x75\x40\x36\x84\xd5\xa3\x85\x53\x07\x68\x83\x20\x26\x09\xa7\x16\xba\x3a\x50\x9b\xe8\x9b\xa5\xd3\x2c\x9d\xda\xcf\xaf\x59\x3a\xdd\x24\x8a\x16\x6c\xa2\x5c\x6a\x7d\x34\x24\x91\x9a\x12\xa8\xef\xc0\x85\x25\x92\x86\x21\x0e\x45\x11\xb9\xe9\xfb\x73\x80\xe7\x8f\xcb\xa0\x90\xcc\xe9\x00\x8e\xbb\x13\x8d\x49\x9a\x0e\xd8\xe8\x3b\xd1\x11\x25\x0d\x22\x38\x74\xfb\x69\x6d\xc1\xc4\x7b\x0f\x88\x92\xee\x3a\x7f\x95\xf7\x9e\x1e\x3c\x81\x0c\x19\x9e\xe9\x2c\x53\xfa\xa7\x3a\xcb\x94\x2e\x4e\xfe\x75\x64\xca\x1a\xdc\x5d\x1d\x82\x6c\xad\xe6\x72\x5d\xb3\xc1\x53\x77\xb4\xd3\x13\x0d\x16\xf5\xb4\xcc\x2c\x1f\x48\xa4\xd0\x46\x51\x2e\x4c\x47\xf1\x0d\x1d\x05\x21\x53\x76\x3e\x30\x85\xce\x34\x2e\xe0\x1f\x2b\xa6\xe1\xb3\x6a\xea\xcd\x69\xa8\x32\x63\xda\xf2\x6e\x3f\xcb\x3e\x92\x0f\x4d\x08\x7f\xb7\x44\xac\x58\x7a\x51\x5a\x2a\xb8\xa9\xc0\x5f\x6e\x84\xac\xfe\xfc\xe6\x81\x25\x65\xbf\xcd\xab\x67\xee\xf6\x3c\xbb\x79\x32\x45\xee\x79\x96\xb9\x61\xe0\x4c\xbb\x1f\xec\x84\x81\x71\xd9\xf5\xf5\xd3\xb9\x7d\x80\x9f\x69\x6a\xb8\x5e\xa3\xec\xab\x30\xc1\x1e\x0a\xc5\xb4\x3e\x10\x6c\x20\x21\x2d\x9b\xb6\x87\xe1\x74\x10\xec\xaa\x34\x96\xd7\x5b\x26\x9e\x6c\xa5\x65\xe2\x14\x11\x0d\xe3\xed\xb8\x04\x01\x45\xa4\x60\x96\x86\x73\x7b\xbc\xf1\xd0\x0f\x42\x6c\x4c\x67\x09\x18\xa8\xc1\x71\x4d\x72\xa9\x4d\x8d\x6b\xfb\x17\x10\xa7\x82\x11\x7b\xf4\x03\xab\x67\x64\xa3\x18\x08\x4b\xa2\xcb\xdc\x4e\xe2\x9e\xf1\xcd\xd6\xe8\x53\xc2\x97\x6c\x09\xdb\xcf\x68\xb2\x6d\x0c\x97\x33\x66\x86\x11\x4a\xb3\xac\x62\xb4\x0d\x5a\xc2\xf3\x65\xe5\xb8\x26\xcf\x2b\x9f\x88\xf3\x53\x9c\x56\xe7\xef\x90\x4a\x86\x87\xe9\xd9\xa6\x53\xc2\x4c\xb2\x7c\x71\x4a\xac\x68\x2a\x8d\xc5\xb9\x5d\xd3\x6a\x4f\xb8\xb1\x5a\x0b\xca\x58\x25\xcb\x4d\x18\x23\x2c\x73\x13\xf5\x8e\x33\xd8\x6c\xf0\x60\x59\x55\x4d\x6c\xc8\x33\x44\xd2\x33\xaf\x50\xe9\x32\x1f\x84\xc8\x11\x19\x80\xbf\x9c\x9a\x64\xeb\xdc\x74\x89\x54\xa8\x36\x00\x44\xf8\xe5\x4d\xbd\x96\xff\x19\x24\x06\x0b\xec\xb9\x7e\x01\x9b\x0b\xc0\xb6\x7c\xb3\xf5\x7b\x48\x15\xaa\x0c\x6d\x9a\xe8\x3b\xbc\x30\x3d\xc3\xf2\x81\xb3\x4b\x0e\x0f\xde\xb9\x20\x2c\x2f\xcc\xbe\x41\x69\x8d\x3d\x36\x4c\xe5\xd5\x0a\x69\xd6\xbd\x63\xd6\x8f\x13\x45\x38\x7f\x9e\x17\x19\x4f\xb8\x71\x94\x47\xbe\x21\xcf\x81\xf4\xb8\x39\xd1\x70\x6c\x16\xb2\x78\xb1\x24\xe7\xde\xc7\x3f\xf4\x8c\x4f\x4a\xc8\x6a\x64\x37\x84\x9d\xa8\xee\xda\x02\xea\xa7\x1a\x7f\xf0\x9d\x31\x0e\xd8\x9c\x1c\x13\x49\xaf\x0e\x50\x3f\x6d\x7c\x23\xd5\xa0\x9a\x62\xf9\x30\x53\xf9\x29\xa1\x5a\xcb\x84\x83\xbe\xee\xf7\x3f\x08\x92\x1c\x90\x1a\xa2\x79\x78\x41\xf1\x8b\x22\x60\x36\x69\x13\xee\xd8\xfb\x9d\x25\x66\x5c\x1b\x7b\xd2\xda\x4b\x6d\x32\x8c\x51\x88\xc4\x9e\x71\xfb\xfd\x89\x26\x60\xde\xe8\x31\x18\x1d\x3e\x23\x74\x3f\x38\xdd\xc1\x69\x3a\x8f\xb0\xfb\x25\x02\xb0\x13\x3e\xee\x22\xa8\x9d\x17\xfc\x14\xef\x8e\xe8\x30\xa7\x82\x48\x77\xe1\x82\x97\xa3\xa0\x2a\x86\xc2\xc5\x38\xb5\xd7\x02\x72\x1e\xf6\x88\xef\xe3\x77\x1e\x9f\x01\x05\xbc\xef\xe9\x08\x71\xb4\xdc\xd9\x39\x02\x26\x50\x39\x9f\x80\x3f\x02\x81\x12\x45\xc6\xe1\x8a\x12\xb3\x3a\x32\xa6\x95\xf6\x3d\x7e\x0b\x1e\xb5\xce\x0f\x95\x7b\x1f\x37\xf6\x44\xe3\x06\xd9\xb3\xb2\xe5\x45\xf4\x3a\x8d\x04\xea\x82\xa3\xe2\xe3\x25\x3e\xda\x7b\x4a\x35\x3d\xbc\x78\x5d\x8a\x61\xad\xe4\xf0\xb9\x92\xe6\x52\x9c\x92\x37\x0f\x5c\x5b\x81\x7f\x21\x99\xbe\x92\x06\xfe\xb9\x24\xdf\x1b\xa4\xc1\xb7\x23\xac\xa2\x31\xc5\xa9\x88\xc5\x75\x3c\x0a\xad\xe7\x82\x50\xa5\x28\x5c\xea\x9a\x51\x18\xf6\xb6\x1b\x56\xa4\x0e\x9f\xea\x80\x71\x4d\x2e\x85\x55\xc7\x1c\x5a\x20\x96\x06\x60\xe2\x50\xd1\x10\xfd\x55\x44\x48\xb1\x00\x79\xe9\xe7\xd4\x1a\x0b\xb1\x1e\x3f\x4d\xd5\xda\x9f\xee\xf4\xfc\xb0\xd1\x10\x87\xa7\xf6\x3d\xdc\xac\xde\xb6\x06\x89\x3f\x90\xf5\x64\xc0\x00\x44\x21\x44\x2b\xab\xd4\xaa\x53\x72\xbf\xe5\xc9\x16\xf4\xf6\x68\xa0\x2b\x86\x01\x45\x85\x62\x56\xee\x51\x6d\x59\xa3\x0b\x60\xb3\xea\x30\xf7\x48\xe0\xf1\x13\x55\xac\xc8\x68\xc2\x52\x92\x82\xd2\x89\xe1\x3c\xd4\xb0\x0d\x4f\x48\xce\xd4\x86\x91\xc2\xca\xb6\x58\xea\x8f\x16\x28\xf8\x4c\x3e\x2c\xfe\x93\x58\x5a\x1c\xba\xd2\xf6\x3d\x7d\xd7\xdc\xfe\xf7\x3c\x99\x44\xbc\x3c\x78\x4f\x1e\x7e\x39\x66\x6d\xa0\x70\xb8\x78\xbe\xcf\xac\x6b\x38\x8b\xc8\xac\x6b\xcc\xba\xc6\xc0\x33\xeb\x1a\xfe\x99\x75\x8d\x59\xd7\x98\x75\x8d\x59\xd7\xf8\x17\xd2\x35\x22\x81\xa2\x3d\x65\x82\x59\xe7\x47\xb4\x73\x1d\xda\x71\x40\xb1\xf1\xb1\xe3\x2d\x93\xcd\xc8\x8a\xac\x9a\x70\xe3\x64\xd9\x2d\x98\x88\x9c\x3b\x55\x51\xb1\x61\xe4\xe5\xe2\xe5\x37\xdf\x84\x29\x6b\x2d\x55\x4e\x0d\xa4\x84\xfc\xfe\xdb\x08\x9c\xd4\xa9\x23\xfd\xcf\x38\x3d\x2c\x1a\x16\xb1\xc0\x4b\x88\xdb\x61\x6b\xed\xf8\x0e\x8d\x6d\xf6\x90\xe5\xf9\x09\xfe\x09\xc7\xe5\x2a\x13\x75\xcb\xf8\xdd\x71\x25\x0c\x2e\xce\x59\x9d\x15\x38\x61\x49\xce\x0c\xa1\xa6\x65\xda\xe4\x39\xab\x3c\x48\xe8\x06\xc1\x38\xff\x41\x88\xde\x37\x92\x12\x29\x9c\xe5\xda\xd2\xce\x32\x72\xc6\xc3\xde\x8e\xa6\x53\x84\x24\xe0\x38\x36\xd2\x32\x52\x3f\x6b\x99\xdb\x59\x72\x61\x3c\x03\xb4\x53\x66\x1e\xab\x83\x80\x9f\xb3\xe5\x66\x49\xd2\x12\xc0\x51\xe1\x12\x18\x5e\xe0\xaa\xf5\x5e\x1b\x96\x83\x8f\x45\x2a\xf8\x1f\xbb\x7c\xa3\xf6\x7d\xd1\x5d\xfe\x61\x3b\x26\x4c\x49\xb3\x6c\x4f\xd8\x8e\x27\xa6\xc2\x1f\xe4\x58\x70\x83\xfe\xb0\xa1\xd3\x12\xa3\xb0\x1e\x9e\xc6\x20\x9f\x3e\x50\xdf\x90\x14\x97\x83\x37\x15\x63\xe1\x81\xfb\x27\x7c\x48\xed\x6b\x40\x39\xef\x3f\x0c\x5b\xfe\x49\x9c\x20\x39\xbc\x93\x94\x59\x66\xf1\x8d\x8e\x80\xee\xf4\xbc\xb1\x7d\x94\x67\x79\x53\x3c\x7a\xb3\x5a\x14\x87\xfe\x23\xf4\x64\x9c\x5f\x5d\x58\x8c\x8c\x2d\x99\x90\x5b\x59\xc8\x4c\x6e\xf6\x4d\xdc\xc3\xe9\x07\x07\x83\x83\x4c\x89\x2e\x57\x4e\xb3\x1d\x57\xdc\xae\x0e\xb6\x72\xb6\x99\xcf\xf7\xd8\xbe\x67\xbe\xc7\x76\x9e\xf9\x1e\x1b\x39\xc5\xf9\x1e\x0b\xcf\x7c\x8f\x9d\xef\xb1\xa3\xcf\x7c\x8f\xed\x79\x79\xb6\x99\xcf\xba\x46\xe0\x99\x75\x8d\xce\x33\xeb\x1a\xb3\xae\x31\xeb\x1a\xb3\xae\x11\x7c\x66\x5d\xa3\xe7\xe5\xa3\xd9\xcc\xc7\xc1\x8d\xa1\x67\xd1\x35\xb4\x05\x2d\xc0\x83\x53\x0a\xfe\x5c\xc8\xf4\x11\x21\xf5\x85\x4c\x03\x11\xf5\x68\xd4\x4c\xe4\x22\x93\x09\x16\x4e\xea\x99\x94\x3d\x31\x16\x8c\xb3\xe4\x6b\x9a\xa3\xad\xf6\x94\xfc\x43\x0a\x86\x91\xce\x90\x52\x25\x73\xe6\xd2\x34\x0a\x99\x3e\xd7\x2f\x7a\x23\x55\xe7\x28\xfd\xde\x67\x8e\xd2\x9f\xa3\xf4\xdd\xd3\x8c\xd2\xdf\x52\x8d\x74\x89\x82\x70\x38\x68\xbf\xc1\x1d\x2c\x03\xfa\x9f\xc1\xf9\x7e\xa6\x98\x7d\x4b\x84\x8e\x58\x20\x1f\xb5\xde\x78\x5c\x57\xea\xdc\x91\x2c\xbd\x6e\xaf\x26\xc0\xbd\xf1\x0e\x87\xf9\x90\x69\xca\x52\x52\x30\xb5\x40\xd2\x93\x64\xcd\x45\xda\xb3\x16\xbf\xfe\x41\xb0\x91\x71\xf4\xed\x49\x4e\x70\x5d\x34\xbd\x2b\x2d\x06\x7d\x18\x55\x3f\x22\x0b\xab\xfd\xfb\x94\x51\xf5\x70\xf3\xf2\xc2\x6d\xfa\x95\x1d\xee\x6d\x7f\x2f\x99\xda\x13\xb9\x63\xaa\xbe\x99\x54\x25\xd0\x62\x2e\x21\x20\x7b\xb8\x26\x09\xd5\xc8\xa8\xc7\x55\xad\x69\xb7\xd3\xe9\x7e\x90\xce\x62\x0f\x41\xe0\x2d\xdf\xdb\x2c\xfa\x6b\x1d\xf4\x3f\xbd\xa6\x8d\x1e\xe7\x14\xed\x49\xeb\xed\x7f\xd0\x75\x15\xf5\xf2\x24\xe5\xb4\x77\xb7\x07\x4c\x1e\xf1\xd7\x82\x86\x1b\x6f\xc4\xec\x11\x0f\xf3\xc0\x3c\xf2\x44\xd3\x07\x79\x84\xf9\x83\x4c\x33\x81\x90\x43\xf4\xda\x59\x3a\x39\xdd\xb5\x86\x4c\x00\xda\xa0\xaf\xe9\x16\x11\xf2\xb8\xfb\xc8\x74\xcb\x08\x39\x5c\x7e\xb5\x7d\xaa\x63\x26\x99\xb4\xf8\xa6\x49\x65\xd8\x54\x32\x09\x64\xc7\xac\xd2\x36\x97\x00\x6d\xb5\x2c\x26\x9f\x1a\xd9\xd3\xac\x25\xe4\x10\xd5\xce\x56\xc0\xe1\xea\x7c\x60\x3b\x99\x84\x98\xb6\x9d\x65\xd0\x7e\x32\x09\xe6\x90\x31\xa3\x6d\x43\x99\x0c\xb2\x6b\x6f\xe9\xd8\x51\x8e\x33\x4d\x37\xc5\xda\x10\x31\x09\x2c\xd6\x4e\x3d\xa6\x31\x82\x4c\x37\x48\x90\xc7\xd2\xe5\x54\xc3\x04\x99\x68\x9c\x20\x13\x0c\x14\x64\xaa\x91\x82\x4c\x35\x54\x90\xc9\xeb\x05\x15\xe2\x2d\x84\x40\xc4\x2d\xb7\x59\x33\x7a\xaa\x34\x9a\xbc\x83\x5d\x6d\x07\xa7\x8a\x8a\x4e\x4e\x0b\xcb\x25\xfe\xd3\x8a\x66\x20\xfc\xff\x8a\x95\xa3\x94\x2b\x6d\x55\x61\x67\xfc\x6b\x40\xf0\x36\x87\xc6\x60\x91\x40\xed\x6c\xb8\x26\x96\x76\x76\x34\xb3\x0a\x08\x86\x6d\xb9\xab\x9a\x9d\xe9\xa1\xbe\x16\x7b\xbe\xef\xb7\xf6\x7a\x6e\x85\x2f\x5e\xf3\xb8\x26\xcf\xee\xd8\xfe\xd9\x69\x87\x8f\x3c\xbb\x14\xcf\x62\xa1\x52\x77\x55\x69\xf1\x8c\x4a\xf3\x91\x22\xdb\x93\x67\xf0\xdb\xb3\xd8\x83\xdd\xa7\x2e\x4e\x51\x04\x1f\x61\x94\x8b\x7a\x59\xf8\x4a\xd7\x53\x1d\x80\xf5\x87\x95\x7d\xc5\x5f\x8c\xeb\x9f\x62\xac\x8d\x5e\x83\xba\xe9\xea\x41\xe4\x79\x95\x36\xbe\xb1\x98\x37\x2f\x86\xaf\xd2\x8d\x25\xb5\x22\xd1\x40\xe5\xcf\x19\x15\x9a\x3c\xf3\xd6\xb3\x13\x5d\xcf\xf1\xd9\xf1\x3c\x8e\x93\xce\x70\x3c\x2f\x32\x2e\x80\xed\xaf\x31\xea\xea\xc1\x1d\xdf\x59\x0b\x5d\xc1\xee\x15\xab\xcd\x8b\x29\x79\xee\x6f\xba\xc3\x77\xef\xfa\x91\x0a\xa2\x28\x5b\x9f\x0b\xc3\x17\x15\x8c\xfa\xfe\x6b\x6f\x84\xb1\xec\xd5\x87\x35\xb7\x29\xc0\x1b\x37\x2b\xbb\x5d\x4d\x51\x31\x27\xf8\x7e\xcb\x54\x6b\xa5\xdc\x97\x5c\x07\x0f\x84\x2a\x05\x94\xd7\x92\xc2\x99\xf5\xa2\x40\x5a\x36\x83\xf5\xbc\x9d\x99\x04\xd5\x7e\x58\x35\xe8\xfe\xf5\x2e\x45\x86\x3a\x12\x6f\xc0\x84\x22\xeb\x2e\x66\x52\x0a\x77\x88\xec\x5f\xaa\xc2\x44\x16\x2f\x2c\x8d\xc5\x2c\xaf\xd6\xb8\x24\x6f\xe0\x10\x34\x27\xc7\x35\xec\x24\xd4\x26\x8b\xe1\x3e\xd1\x54\x1d\xa7\x1b\x2c\x9a\x93\x39\x86\xcb\x60\x72\x98\xfd\xfd\x91\xc3\xec\x0f\x4c\x4f\xff\x22\x51\xf6\x91\x46\xbd\x39\xd4\x7e\x0e\xb5\x6f\x84\xda\xc3\x47\xc8\xf9\xc6\x63\xee\x87\x69\x06\x62\xf1\x63\x63\xee\xc9\x8f\x5b\x06\x27\x2a\x60\x60\xb3\x5b\x94\x97\x99\xe1\x45\xed\xb0\xd6\x38\xb5\x0c\xaf\x8f\x18\xa8\xa4\x0f\xac\xb3\xa1\x8c\x00\x9a\x6c\x0f\x8f\x09\x8c\x03\x0e\x6d\x0d\x1c\xd9\xb9\x59\x68\x96\xb9\xd8\x7a\x7b\xaf\x1c\xde\x23\xe6\x7c\x55\xfc\x38\x26\xfc\x8b\xaa\x8d\x88\x33\x9a\x80\x73\xe2\xb9\x15\x96\x99\x25\x07\x2b\xb2\x3c\x57\x0b\xf9\x5c\x3b\xf2\x17\xad\x32\x3b\xe6\x1d\x24\x1b\xbe\x63\xa2\x16\xc2\xcf\xf5\x8b\x17\x63\x61\x4d\x26\x52\xf5\xe8\x2a\x16\x01\xa0\x7d\x2a\xc7\x69\xa4\xb8\x0f\x80\xad\x14\x81\x08\x31\xff\xa7\x86\xf4\xfa\x5f\x01\x98\xb5\x73\x68\x50\xc0\x03\x7a\x2a\x11\x5f\x6d\x60\x00\x28\x1f\x5f\x4d\x9c\x1d\x74\x82\x1b\xe1\x11\x2e\x04\xc2\x87\xd9\x09\x3e\x53\xdc\x07\xbf\x58\xfa\x44\x84\xcb\x60\x4a\x98\xdb\xb8\xbb\x20\xf6\xfe\xf7\xd8\x90\xc7\xa0\x03\x60\x8e\x79\x0c\x3e\xf1\xc6\xfe\x5f\x5f\xe8\x63\xc0\xb8\xff\x85\xc6\x40\x3e\xda\xa8\xff\x4b\x86\x3e\x86\x0c\xf9\x13\xbd\x5d\x64\xcc\x88\xff\xc4\x00\xc0\xb1\x20\xc8\x68\x98\x03\xc6\xfb\x7e\x83\x7c\x34\xd4\x3e\xc3\x7d\xaf\x31\x3e\x1a\xe2\x1c\x41\x38\xfa\xde\xe7\x8e\x20\x9c\x68\x90\x7f\xac\x31\x7e\xd2\xee\x4c\x35\xc2\x3b\xf3\x7a\xc4\x34\x22\x0d\xf0\x5d\xd3\x7a\xcc\x12\x47\x8d\xef\x87\x66\xf5\x38\xa3\x53\xc8\xf0\xde\x6b\x52\x8f\x00\xdb\x6f\x74\x7f\x92\x3a\x15\x4d\x9d\x91\x2f\xc6\x9a\xd0\xa7\x9b\xcf\x23\x62\x09\x26\x98\xce\xbd\x61\x7c\x04\xe2\x31\xcc\xe6\x51\x1c\x31\xfa\xa4\xc5\x71\x88\x68\x33\xf9\xa7\x30\x91\x4f\x34\x8f\xc7\x5c\xcb\x49\xef\xd5\x3c\x64\x1a\xc7\x9b\xf0\x08\xc8\x78\xb3\x78\xf3\x36\x3c\xb6\xfc\x58\x93\x78\xf3\x3e\x3c\xe6\x99\x8a\x32\x87\x77\x8d\xdd\xf1\xde\x94\x49\xa6\xf0\x28\x6a\x8d\xb1\xbc\xc6\x98\xbf\x9f\x6c\x54\x1d\x0d\x5e\x17\x86\x3f\x36\x80\xbd\x49\xd7\x03\x51\xec\xbd\x73\xa6\x3b\xc9\x53\x52\x94\xc6\x54\x4d\x2d\xa6\x45\xb2\xf7\x42\xfd\x4d\x45\xb7\xb7\x50\x1f\x0c\x71\x0f\x9b\xb4\x4f\x1f\x11\xe2\x3e\x08\xd1\x1d\xcb\x47\x84\xb8\x0f\x83\x74\xa1\xef\x8f\x0a\x71\x1f\x84\x0a\xa1\xef\x8f\x0b\x71\x1f\x3d\xf1\x87\x24\x34\xbc\x57\x3e\xce\x7d\x10\xe4\x78\xfc\x7b\x20\xce\x7d\xd8\x42\x1e\x8c\x7f\x0f\xc4\xb9\x0f\xa3\x33\x3a\xfe\xbd\x13\xe7\x1e\x20\xf9\x39\xfe\xfd\xe0\x99\xe3\xdf\x1b\xcf\x1c\xff\x1e\xb9\xd8\x39\xfe\x7d\x8e\x7f\x1f\x7b\xe6\xf8\xf7\x39\xfe\x7d\x8e\x7f\x9f\xe3\xdf\xe7\xf8\xf7\x39\xfe\xbd\xe7\x99\xe3\xdf\xe7\xf8\xf7\x39\xfe\xbd\xf1\xcc\xf1\xef\x23\x4b\x99\xe3\xdf\xe7\xf8\xf7\x39\xfe\x7d\x8e\x7f\x9f\xe3\xdf\x7b\x5e\xf9\x2c\xf1\xef\x2d\x23\xf4\x60\x10\x7c\xc0\x1c\x5b\xd7\x4f\x99\x18\x04\x3f\x08\x73\xc5\xc6\x83\xe0\x07\xa7\x3d\x08\x75\xa0\xc6\x4f\x54\x24\xfc\xb0\xe9\xb5\x19\x21\x3f\x29\x12\x3e\x60\x34\xef\xa9\x4a\xff\xc4\xea\xf3\xa4\x11\x21\xff\xd8\x48\xf8\x61\x12\x90\x73\x24\xfc\x1c\x09\x3f\x47\xc2\xcf\x91\xf0\x73\x24\x3c\x3e\x73\x24\xfc\x1c\x09\x3f\x47\xc2\xcf\x91\xf0\x73\x24\x7c\xe7\x99\x23\xe1\x7b\xa7\x3b\x47\xc2\xcf\x91\xf0\x73\x24\x7c\xfd\xcc\x91\xf0\xed\x67\x8e\x84\x9f\x23\xe1\x03\xcf\x1c\x09\xff\x69\x22\xe1\x07\x7f\xa2\x99\x95\x92\x62\x73\x38\xf9\x1e\x9b\x13\x49\x99\xa1\x3c\xb3\x1a\xd7\x86\x2a\x88\x78\xf4\x5f\x1f\x62\x31\x74\x47\x83\x6f\x72\x2a\xe8\x86\xa9\x5e\x76\xd1\xbe\xd0\x36\xde\x7e\x23\x52\xb0\x65\x6a\x72\xad\x64\xce\xcc\x96\x95\xda\x1f\xe1\x35\x57\x0c\x41\xf7\xeb\xa9\x8e\x21\xf6\x6d\x77\x80\x6f\x45\x4c\x25\x6d\xd8\xe3\x2c\x89\x72\x29\x80\xd4\x9d\x28\x1f\xd8\xc8\xfa\x7b\xdc\x13\x2f\xf2\x2a\xa4\xba\x71\xc8\xe5\xb5\xc6\x88\xda\xf0\xf2\x82\x0b\x8c\xb9\x33\xd3\x82\x7f\x64\x4a\x07\x8c\xee\x07\xd8\x70\x6f\xfb\xf3\xd9\x44\x0e\x39\xbf\xbe\xc4\x33\x5f\xef\x53\xe0\x98\x95\x1a\x85\x97\x66\x22\x75\x6b\x5c\x92\x4b\x43\x12\x2a\x2c\x67\x7e\xb6\x7b\xf9\xcc\xb2\xda\x67\xbb\x6f\x03\x2e\xf8\x88\x93\xba\x62\x54\x31\x75\x2b\xef\x98\xf8\x8e\x67\x2c\x72\x9d\x7f\x6e\x7f\x65\x27\xaa\x18\x75\xe6\xea\x35\xcf\x98\xab\x07\x63\xa4\x5d\x48\xc8\x79\xb5\x65\x82\xd0\xd2\x6c\x99\x30\x3c\x71\x41\xee\xb2\x85\xb8\x27\x2d\xcf\xca\x84\xc8\x35\x5d\xd1\x1c\x4c\x9d\x1d\x2a\xe4\x02\x7e\x03\xd1\xf2\xe4\xc9\x00\x94\x09\x33\x82\xf7\xfb\xa6\xf5\xa4\x99\x14\xd4\x6c\xaf\x15\x5b\xf3\x87\xc8\xa9\xe0\xcb\x90\x6c\x61\x09\xfb\x2f\xb7\xb7\xd7\x00\xc4\x91\x26\x28\x9d\x45\xa9\xb7\x2c\x0d\xda\x72\x62\xa6\x26\x55\xc0\x99\x49\xc5\xfe\xfd\x3a\x28\x53\xa2\x3c\x84\x8b\x38\x21\xd6\x46\x81\x54\xa6\xff\x54\xdb\x5b\xc7\x43\x21\x35\xf8\xb3\x86\x17\xff\xb0\xb8\x2b\x57\x4c\x09\x66\x98\x5e\x70\x61\x16\x52\x2d\x70\x02\xaf\x88\x51\x83\x9a\x85\x4e\xb6\x2c\x9a\x88\x6f\xe0\x65\x77\xee\xf0\x74\xad\xb9\xaa\x18\x68\xe0\xc2\x15\x81\x10\x93\xe9\xd7\x52\xac\x79\x47\x2e\x0e\x4c\xe6\xf6\xed\x0d\xc1\x0f\xfc\x84\x2c\xfd\xb4\x38\x79\x22\x85\x40\xf9\x30\x3c\xb3\x38\xdb\x66\x42\x27\xe8\xba\x37\xa6\x6c\x8b\x17\xbb\xaf\xaf\xcf\x49\xc2\x94\x69\xce\x75\xfc\xd6\x61\xa8\xda\xb0\x10\x5e\xe3\x57\x40\xf0\x92\xb7\xe6\x9b\x77\xb4\x98\x68\xb1\x7f\xed\xbf\x6b\x2e\x2a\xa5\x86\x36\x56\x13\x73\x1f\xde\xb2\xb8\x15\x4d\x5b\x15\x99\x62\x71\xee\x64\xe9\xa0\x02\xed\x34\x89\x29\xd1\x62\xd1\x86\xa5\xb0\x94\x18\x9c\xdc\x89\x17\x19\x10\xed\x80\x5d\xeb\xcd\x92\xbc\x93\xe0\x1a\x5d\xcb\x58\x43\xd8\xd6\x98\x42\xbf\x3a\x3b\xab\xd9\xc3\x92\xcb\xb3\x54\x26\xfa\x2c\x91\x22\x61\x85\xd1\x67\x72\xc7\xd4\x8e\xb3\xfb\xb3\x7b\xa9\xee\xb8\xd8\x2c\xec\xdd\x62\xe1\x5a\x65\x9f\x81\x64\x39\xfb\x1a\xfe\x27\x72\xd0\xdb\xf7\x17\xef\x5f\x91\xf3\x34\x75\x5d\x82\x4a\xcd\xd6\x65\xe6\xdb\x30\x36\x54\x9f\x53\x72\xc7\x45\xa0\x59\x4e\xfb\x29\x79\xfa\xef\x27\x9f\x62\x8f\x64\x81\x36\xac\x47\xec\xd3\x0d\x5c\x11\xf7\x96\x1d\xc2\x52\xe1\xb0\x57\x07\x26\xda\x5d\xc1\x8d\x06\x5a\xf4\x76\x61\x77\x63\x9c\xb0\xd8\x95\x94\x19\xa3\x63\x2e\xc1\x29\x66\xcb\x38\xa3\xe5\x04\x2b\xa4\x66\x89\x62\x23\xd1\x44\xa4\x83\x60\xf8\x28\xc0\x7a\x22\x93\x42\xbe\x48\xd6\x53\xdd\xb5\x61\x8d\x15\x23\x02\x5d\x77\x49\xc8\xbb\x78\x73\xfd\x8a\x11\x4a\x76\xe0\xed\x71\xd0\xee\xd8\x7e\x66\x68\x33\x43\x8b\x78\x46\x19\x9a\x3b\x83\x52\x59\x3e\x15\xb9\xb6\x5f\x39\x37\x8b\x7c\x31\xa1\xe1\x9b\x2f\xe9\xdc\x04\xec\xc5\xc7\x05\x04\x79\xa5\xd1\x59\x23\x1b\x36\x18\xc7\x0d\x03\xb7\x10\x37\xcb\x16\x97\x8c\xe3\x81\x91\xa4\x66\x67\x36\x49\x2b\x56\x3d\x6a\x71\x92\x71\x26\x0c\xae\xd2\x5e\xed\x23\x54\xc9\xe8\x75\xcc\x8a\xf1\xac\x18\x07\x9e\x59\x8e\xcc\x8a\x71\xeb\x99\x15\xe3\x91\x67\x56\x8c\xc3\xcf\xcc\xd0\x7e\x73\x0c\x6d\x56\x8c\x1f\xfb\xa2\x55\xf9\x9e\xa0\x1a\x77\x14\xc7\x8e\x8e\x3c\xae\xf3\xa1\x06\xfd\x49\x94\x63\x2e\x34\x4b\x4a\xc5\x6e\xee\x78\xf1\x91\x29\xbe\x9e\x12\x2c\x71\xc1\x35\x5d\x65\x7e\x42\xb0\x46\xbe\xe6\x09\x35\x0c\xf9\x18\x0d\x9b\xb4\xc9\x04\x5a\xb9\x63\xfb\xa7\x6f\x02\xc6\x2f\x7d\x71\x7b\x70\xc7\xf6\x37\x11\x72\x75\x44\xa6\xf6\xad\xf3\xb3\x5c\x52\xa2\xe4\xe9\x27\x94\xa5\x8f\x94\xa3\x13\xf8\x73\x9c\xfc\x9c\x26\x3b\x7f\x79\xa9\xf8\x09\x24\x62\x9c\x34\x9c\x80\xe9\x78\x29\x38\x4d\x02\x46\x46\xb9\x4e\x95\x7e\xf1\x92\x2f\x36\x4d\x76\x6c\x9e\x91\x42\x4c\x33\xb5\x63\xea\x6a\x94\x6e\x5b\x58\xfc\x41\x83\x23\x9b\xec\x40\x2e\x60\x55\x3a\xa9\x8d\xa5\xaf\x4f\xc0\x07\x47\x57\x12\x46\xd9\x02\x4e\x65\xe0\x27\x88\x21\x18\xf8\xbd\x90\xaa\x7f\xcc\x91\x49\x0d\x07\x5d\x0d\x4d\x76\xd1\x0e\x72\xfa\x2a\x72\x38\x5a\x70\xdc\xc2\x7e\xd7\x73\x3b\x18\xe9\xfa\xf2\xa6\xf1\x2e\x86\xb3\xf9\xb0\xd2\x3d\x96\xa7\xb1\xfb\x88\x59\x3a\xa5\xd9\x12\x2b\x04\xfb\x32\xcd\x8c\x24\x34\x49\x98\xd6\xf5\xf8\x10\xfd\x9f\xb1\xb5\xc1\xb8\xd0\xd3\xa6\xad\x8f\x6b\x42\xb5\x2e\x73\xa4\x1a\x55\x0a\xab\x5d\xf0\x9e\xcc\x7a\xc7\x06\x93\xac\xd4\x86\x29\x98\x07\x24\xcc\xa6\x5c\x27\x90\x44\x76\x7e\x7d\xe9\x48\x56\xdb\x19\xca\x9c\x1a\x9e\x40\x62\xa8\x7d\xb7\x2f\x98\xc6\x45\x52\x9e\x68\x6f\x8b\xf4\x8a\x88\xfd\x00\xc3\x7b\x88\x91\x77\x10\x09\x90\x31\x42\x0d\x39\xdb\x51\x75\xa6\x4a\x71\x86\x42\x42\x1f\x30\x5e\x3b\x3c\x4f\x18\x4d\x12\x59\x0a\x73\x36\x25\x8c\x6d\x45\x35\x4f\xce\x4b\xb3\x1d\x0d\x61\xfb\xb3\x7f\x13\x37\x09\xc2\xb0\x5d\x84\x0b\x20\xbf\x0e\x09\x62\x98\x5d\x07\xa0\x7b\x29\xb5\x19\x3e\xd4\xdb\xc8\x6a\xb4\x0e\x2c\xd5\xfa\x5e\xaa\x41\x8e\xd4\x2d\xf0\x8a\x0c\xd5\x47\xa0\x22\xbe\x48\x2e\x05\x37\x52\xd5\x47\x2e\x9c\xfc\x55\xc5\x73\xc3\x06\xba\x29\x60\x84\x44\x6b\x41\x43\x0c\x26\x46\x2d\x19\x51\x48\x3e\x89\x2a\x32\x59\x09\x89\xe2\x91\x63\x8a\xc7\x97\xab\x72\x4c\x55\x36\x46\x55\x89\x28\x7c\xc5\xa8\x0f\xd3\x15\x87\xf1\xe4\xa4\x28\x95\x21\x46\x59\x18\x53\x13\x42\x0a\xc2\xa8\x40\x2d\x35\x53\x21\x8a\xfa\x05\x4e\xbc\x9f\xc2\x7c\xe2\x07\x9e\xf9\xc4\x4f\xc3\xd7\x7c\xe2\xc7\xb4\xd5\x81\x9f\x1b\x21\xd0\xe3\x6a\x4b\x4b\x9f\xb2\x27\x17\xb4\x44\x50\x2d\x2b\x45\x71\x70\x02\x03\x3b\x18\x11\x83\xdd\x9a\x44\x2b\xe4\x7a\xf5\x29\x66\x64\x95\xe4\xd1\x69\xfc\x45\x62\x3d\x80\x86\x86\x7c\xee\xd9\x00\xa6\xf2\x26\x52\x68\xae\x21\xa8\x1b\xa2\xff\xfd\x1d\xaa\x77\x13\xa5\x22\x97\xd7\x64\x2d\x31\x05\x85\xac\xf6\x98\x47\x8f\x44\x0d\xf7\x14\x22\xca\x7c\xd5\xeb\x4f\x0f\x2e\x26\x18\xb6\x1a\x13\xb0\x1a\x87\xd0\x31\xee\x3c\x1c\xa0\xfa\xd8\xd0\xd4\xb1\x2b\x68\x8c\xbc\x88\xf2\xab\x4f\xf6\xa8\xc7\x5e\x90\x63\x4d\x6b\x11\x86\xb5\xa7\x79\xc7\xa3\x0d\x33\x31\x06\xb0\x2f\x57\x32\x91\x4f\x21\x9d\x26\xe1\x2f\xd6\xac\x35\xc9\x4f\x1d\x6d\xd7\x9a\x66\xd5\x8a\xb5\x69\xc5\x58\xb4\xc6\xec\x59\x51\xd6\xac\x71\x1f\xf4\x74\xef\xf3\x97\x70\x4c\x8f\x61\xfd\x7e\x94\xed\x7b\x3e\xf6\xff\x6a\xc7\xfe\x11\x0a\x2a\x89\x55\x52\xc9\x97\x77\xe6\x47\x5f\x09\x07\x2f\x7e\x92\xb0\xc5\x69\xfc\x63\x94\x44\x42\x41\x8a\x8f\x0c\x4f\x0c\x46\xd5\xcc\x4a\xd3\xc0\x1c\x67\xa5\x69\xf8\xf9\x95\x70\xcf\x59\x69\xea\x7b\x66\xa5\x69\x56\x9a\xfa\x9f\x5f\xc9\xb1\x9f\x95\xa6\xf6\x33\x16\xd8\xf6\x29\x42\xda\x26\x07\x52\x8d\x92\x49\x7c\x00\xdb\xf1\x42\xd7\xc6\x77\x7a\x24\x5c\xed\xf1\x81\x6a\x11\x9a\xe9\xb1\x30\x3b\x1a\x96\xf6\xb8\x80\xb4\x63\xd9\xec\x66\x1f\xcf\xe7\x97\x0e\xb3\x8f\x67\x60\x05\x9f\xd1\xab\x3b\x1e\xea\x75\xec\x20\xaf\x91\x4d\x0b\xcc\x78\x38\x4a\xca\xce\xe1\xab\x48\x38\x54\xad\xb8\x51\x54\xed\xbf\xbb\x39\x07\x2f\xc5\x2d\x36\x88\xbd\x79\xd7\x61\x1f\xed\x40\xa9\xe1\xef\xdc\xe5\xb6\x54\x50\x85\x0f\xa9\xc6\xff\xa9\x3f\xc0\x66\x45\xb1\xf2\x09\x54\x7b\x6a\x3b\xc6\x13\x2a\xaa\x38\x2a\x3f\x24\xd6\x07\xb2\xef\x5b\x04\xdb\x7f\x74\x20\xba\xea\x41\xee\xa8\xf7\x89\x00\x02\xb5\xf8\x3b\xd1\x4d\x9d\x8d\x0a\xb1\xd3\x94\x89\x5e\x3e\x1a\xa2\xe3\xc1\x9d\xb0\x48\xb8\xcc\xe9\xa6\x43\x7a\x87\x51\x4f\x8c\x70\xfb\x5a\xcb\xc1\xd4\x5c\x62\xca\x8a\x4c\xee\x73\xcb\xda\x7a\xc7\xee\x21\xb6\xca\x1c\x11\xde\xf4\xea\xf2\x77\x50\xcf\xbb\xf9\xf7\x66\x2f\xee\xc1\xc8\x41\xaa\x0f\xf7\x05\x11\x72\xea\x2a\xd4\xe9\x2d\xcd\x32\x68\xb8\x20\x4b\x01\xe5\xf5\x7c\x97\x87\x80\x9e\x74\x2d\x53\x57\x1c\xbc\x31\x1f\x68\x66\xd0\x04\x72\xc6\x4c\x72\x56\x54\x50\xce\x70\xe9\x39\x2d\xf4\xd9\x9f\xaa\xff\x5e\xd8\xa9\xff\xaf\x43\xf4\x0d\x54\x34\x0b\x1c\xe1\xa1\x18\xc7\x8a\x0a\xc3\xf8\x3e\x79\x5d\xbd\xe7\x23\x11\xb9\xb0\x78\x02\x57\x62\x55\x94\xb5\x01\x0e\x5b\x6d\xa7\x18\xab\xd8\x99\x69\x55\x49\x74\xc3\x84\xfd\x2f\x96\x36\x3e\x75\x05\x80\x5d\x79\xb0\xd2\xb1\x36\x17\x5b\x87\x6d\x9f\x7b\x98\x72\x3b\xee\xc4\x9e\x96\x87\x3d\xd6\xa8\x6e\x6c\x2e\x14\xe7\x87\xfe\xe5\xc9\x16\x5a\xba\xd8\x9d\x5c\xb1\x2d\xdd\xf1\x9e\x20\x7b\xa8\x68\x18\x9c\xeb\x92\x34\x10\x93\xba\xde\xf2\x29\x81\xde\x05\xb8\xfa\xee\x3c\xc3\x10\x5d\xf7\xea\xbd\xa5\x3c\xd7\x30\xba\x22\x61\x08\x83\x04\xb0\x6e\x95\x5d\xd2\xb3\xdf\xa4\x52\x30\xb2\xe3\x74\xb0\x81\x21\x90\x66\x52\x2a\x05\x17\x80\x6a\xe4\x7e\x4d\x81\x2a\xf6\x8a\xfc\x5c\xd3\xe9\xcf\xa7\xcd\x7f\x2d\x90\x52\x17\x8a\x65\x92\xa6\x4c\xd9\x5f\xa1\x79\xfe\xa2\x26\xe1\xfa\xb7\x1e\x64\xa4\xe4\x67\xb3\xa5\x42\xea\x85\xe6\x29\x4b\xa8\xfa\x79\x49\xde\xef\x98\x52\x3c\x75\x6e\x77\x8f\x5e\xae\x89\xdd\x5f\xc5\xb2\x3d\x91\xa5\xb1\xaf\xf7\x1a\x47\x75\x22\x0b\xd0\xad\xee\x7d\x2d\xf7\x9c\xf2\x0a\x0a\x84\xa8\xea\xb2\x00\x27\x3c\x84\x95\xee\x49\x2a\xed\x50\x5a\x9e\x92\xbd\x2c\x81\xc9\x17\x5d\xa9\xec\x2a\xc3\x73\xed\xe9\xa5\xc4\xd6\x27\x2b\xc5\xe8\x1d\xa1\x06\x8a\x59\x1a\x9e\x63\xb7\x77\x59\x1a\x22\xa4\xe1\x09\x5b\x1e\x6a\x4a\x03\x87\xf7\xa0\xcc\xbf\x2b\x14\x0c\xb5\x5f\x1d\x49\xd7\x3b\x05\x73\xb1\x73\xbd\xa7\x18\x63\xaa\x4a\x01\xc3\xf6\xf6\x68\x80\x9e\x14\x5d\xb1\x1f\x56\xcf\xa9\xda\xc4\xd4\x4c\x3c\x39\x57\x9b\x12\x8b\xf5\x3a\xbe\xc8\x84\x51\x7b\x08\x7e\x45\x3a\x4b\x65\x72\x67\xc9\xda\x4a\x8a\x93\xc1\x96\xb2\xaf\xdf\x5d\xd8\x0d\x86\xc3\xce\x5d\x13\x78\x57\xc8\xb3\x50\x72\xc7\x53\x96\x2e\xc9\x47\xaa\x38\xdc\xf7\x9c\xc6\x9c\x30\x4d\x7e\xf7\xfc\xe3\xf9\x87\x9f\xae\xce\xdf\xbd\x19\xaa\xe6\x6a\x8f\x04\x7b\x28\xa8\x48\x59\x4a\x4a\x5d\xb7\x85\x72\xd8\x3c\x39\xb1\x84\xb5\xe3\x4a\x0a\x10\x55\xe4\x72\x0d\xf7\x03\x1c\x6b\x00\x68\x42\x85\x9d\xdb\x8a\x41\x87\x8c\x6c\xc7\xd2\xd3\xa6\x2e\x9f\x54\x97\x3e\x2e\x8a\xd2\xf8\x20\x12\x20\xbe\xd5\x10\xcc\x52\x20\x53\x4a\x11\x71\x8d\x95\x11\xbd\x17\x86\x3e\x78\x96\xc8\x74\x42\x0b\xdf\xeb\x8a\x92\x54\x96\xc3\x13\xfd\xdd\xef\x4e\x09\x67\xaf\xc8\xef\x1a\xe0\x96\xe4\x8d\x83\xd0\x40\x24\x36\x3b\x62\x10\x9f\x5c\x23\x6c\x28\x5f\x04\x4b\x84\x66\x56\x1b\x82\x93\x56\xab\xe4\x1e\x71\x84\x55\x55\xe2\x85\x34\x4b\xf2\xda\x63\x6c\x68\xf5\xd0\x79\x28\x8d\xbd\x04\x19\xaa\xef\xf4\x19\x0a\xa1\x45\x4a\x0d\x5d\x34\x8e\xca\x19\x6a\xf8\x8b\x44\xe6\x39\x15\xe9\x82\x3a\x22\x5d\x54\x9b\x7e\xf6\xb5\xab\x2f\xbb\xa0\xd5\x5b\x5c\x2c\xe8\x42\x6f\x59\x96\xf5\x5f\x6e\x82\xf5\x8f\x47\xef\x3c\xe1\xd2\xae\x6e\x0e\x31\x27\xee\x4d\x75\xc0\x10\xda\x92\x5c\x49\xe3\x7a\x3b\x39\xa2\xe0\xa0\xc0\xda\x95\x00\x29\x0d\xdd\x20\xda\x27\x93\xbc\xb9\xba\xfd\xf0\xb7\xeb\xf7\x97\x57\xb7\xa3\x47\x71\x00\xe2\xc8\x01\x8d\x39\x8a\x03\x90\x87\x0f\xe8\xf8\x51\x1c\x00\x19\x38\xa0\xe3\x47\x71\x98\x2d\x0c\x1e\xd0\xe8\xa3\x38\x00\x7b\xe0\x80\xc6\x1f\xc5\x01\xb8\x9d\x03\xfa\x1b\x3f\x8a\x4c\xec\x22\x8e\xe1\x5b\x77\xe3\x68\x10\x66\x85\x6f\x57\xed\xb6\x72\x49\xd7\xea\xe2\x90\xf4\xeb\xa0\x7e\xfa\xaa\x5b\xb3\x7b\x23\x76\x1f\x69\xbb\xd5\x8b\xe8\x9d\x2a\x71\x2f\x0c\xda\x42\x80\x95\xbc\x1e\x5b\x40\x8c\xa9\x6f\x92\x81\xac\x69\x1f\xeb\x9b\xf7\x12\xcc\x7c\x60\xca\x0b\x5a\x7b\x5e\xff\x74\x79\xf1\xe6\xea\xf6\xf2\xbb\xcb\x37\x1f\x9e\x6c\xe2\x83\xa2\xe9\xf1\x36\xbe\x29\xdc\x30\xb8\x88\x9a\x53\x16\x8a\x59\xcd\xb3\x2e\xf1\xde\x4f\x7e\x48\x77\x41\x98\xb5\x32\x89\x6d\x9e\xf6\x95\xc1\xa3\x17\x24\x32\xdd\x20\xc4\x78\x86\xdc\x62\xbd\x41\x98\x53\xd9\xb2\x63\xc0\x41\x98\x9f\x84\x39\xe3\xf3\x78\x16\x1d\x9e\x71\x5b\x93\xba\x60\x6b\x5a\x66\xa8\x71\x3f\x7b\xd6\xb9\x5f\x34\x9f\x78\xb2\xfe\x4e\xc9\x3c\xde\x14\x0b\x3d\xe1\x2a\xcb\x62\x1f\xc5\x9c\xb8\x76\x62\x61\x0f\x6c\x83\xf1\x39\x75\x03\xdb\xf4\x39\x7d\x03\xfb\x01\x05\x20\xc4\x3a\xa6\x2b\xb3\xd2\x5f\xd9\xfe\x03\x0b\x54\x5d\xee\x5b\x2c\x78\x17\x5c\xb3\x2c\x0c\xfe\xae\xcc\x3a\x63\xfe\xe5\x29\x35\x6c\x22\x2b\xd8\x3c\xbd\x74\xd6\xa4\x1a\x26\xb1\x55\x66\xbe\x5c\xf7\x86\x7f\x3e\x49\xed\x98\xd8\xca\x31\x93\x70\x3e\xa5\x6a\xcc\xe4\x38\x99\xa8\x65\x3d\xae\x68\xcc\x94\x92\x31\xb1\x05\x63\x62\xca\xc5\x44\x17\x8b\x81\xbd\x9e\x7a\xfe\x4f\x6a\x06\x80\x7d\x78\x1d\x5d\x17\x32\x7d\xe5\x2d\x49\x9a\xe4\xcc\x50\xab\xfb\x2e\x2d\x41\x8e\xd3\x4e\xeb\x75\x30\x4d\x9f\xd6\x7f\x83\x8e\x2b\xba\xf1\x07\xe0\x92\x68\xf1\x1b\x07\xad\x0b\x96\x2c\x85\x4c\x99\x3d\x84\xa7\xf8\x4f\x27\xdb\xcf\x31\x0f\xda\xfd\x60\xa8\x29\xf5\x72\x2b\xb5\xb9\xbc\x8e\x00\x8b\xaf\x17\x32\xbd\xbc\x3e\x6d\xfd\x4b\x07\x45\x10\x99\xc8\x06\x63\x1a\x55\xd4\x4f\xa8\x65\x05\x54\x9b\xa7\xf0\x9f\xdf\xd9\x8d\xbb\xa6\x66\x1b\x45\xfd\x5c\x93\x7b\xc5\x8d\x61\x02\x34\x15\xe8\x01\x2c\xd7\xa7\xf6\x24\xd4\x82\x77\xf7\x32\xd0\xad\xa2\x7e\x26\x1d\xfc\xb5\x9f\xe6\xe4\xa5\x43\xf8\x81\x5b\x37\x52\x69\xed\x17\x8f\xd0\x06\xfd\x53\x77\x20\x3a\xbf\xbe\x24\x3b\xc4\xe7\x91\x97\x19\x7f\xf2\xd7\x91\xbb\x16\x7d\xfe\x7d\x37\xdb\xef\x9e\xc8\x07\x3c\x9c\xaa\x06\x82\x57\xa6\x5f\x41\x47\xb3\x51\x7c\x55\x5d\x75\x49\xc6\x73\xee\x3a\x5d\x5a\xbc\x30\xab\xe7\x3d\xc7\x3f\x2e\x93\xa2\x3c\x75\x2f\x2c\x73\x96\x4b\xb5\x1f\x3f\xa5\xee\x75\x56\x6c\x59\xce\x14\xcd\x16\xda\x48\x45\x37\xec\xb4\x02\x8f\x60\xab\x7f\x21\xe0\xf1\x53\xd9\x98\x60\x17\x3a\xde\x65\x9c\x47\x21\xdb\x7b\xae\xc8\xd2\xa3\x72\x86\x0a\xcb\xe3\x15\x50\xf0\x19\x70\x61\xa1\x4e\x53\xd1\x21\xa8\xb1\x3b\x99\x95\x39\x8b\xe0\xae\xa4\x21\x9f\xe1\x4b\x26\x76\x56\xe9\xd5\x47\xd7\x02\x52\xbe\xe3\x3a\xae\xd9\x6b\x8f\x12\xc0\x5d\xff\x5d\x59\x9a\xa2\x34\x76\xa6\x39\xf6\xe8\x8a\x65\x05\xbe\x0d\x48\xa3\x03\x74\x8b\xff\xbd\x0c\x37\x8b\x7b\xc4\x82\xfd\x48\xd3\xb7\xf6\x83\x67\x29\xf5\xc9\xac\xd8\xdf\x91\xf7\x25\x9e\x7b\xf9\xa9\x1c\x8b\x79\x61\xac\xd2\x71\x2e\x30\xed\x1a\x00\x50\x72\x25\xea\x26\x30\x5c\x7e\xa7\x7e\x7e\xa9\x3b\xcf\xb1\x6a\x76\x3e\xba\x62\xe7\x7c\x8f\xfa\x2d\xdd\xa3\x1e\x53\x79\x6c\x7a\xed\xb1\x2f\xfe\x12\x15\xf1\xda\x78\x60\xdc\x60\xe2\x7c\x04\xfc\x51\xe3\xfd\xb0\x25\xab\xd7\x80\xef\x35\x31\x23\x49\x21\x8b\x32\xa3\x66\xc0\x04\x1a\x76\x23\x35\x42\x42\x1c\x83\xaa\x8d\xb4\xb5\x4b\x0e\x65\x53\x3e\x62\xba\x6e\x19\xad\xc9\x79\x96\x11\x2e\x90\x41\x01\x58\x6f\x0d\x55\x0c\x95\x2c\x42\xd1\xbc\xbf\x1b\xb6\xe3\x43\xf7\xac\xd6\x34\xed\x25\x47\x1b\x8a\xdd\x1d\xc9\x8f\xd0\xbb\x0e\xd8\xaa\x33\x36\x72\x41\xf2\x32\x33\xbc\x18\xb4\x4d\x56\x6a\x41\xd5\x00\x98\x50\xad\x65\xc2\xa9\x77\x43\x12\x6c\x1f\xaa\x8d\x5f\x38\xcc\xdc\xd0\xbb\x21\x90\x85\x62\x09\x4b\x99\x48\x18\xb4\x92\x2f\x59\x8d\x43\xac\xa1\xf0\x46\xec\x2a\xbb\x6d\x89\x3e\x26\x14\x06\x16\xf2\x10\x45\xd1\x3b\xd6\x82\xfc\x29\xbc\x2d\x96\xe8\x9c\x55\xb4\xe1\x74\x01\xf9\x54\xdd\x14\x7c\xb7\xfc\xc1\xd3\x55\x47\x8b\x3d\xc1\xcd\x52\x99\x3a\x47\xd4\x84\x8e\x4c\xad\x0d\x45\x6d\x59\x7a\x04\xf3\xeb\x9c\x3d\xd3\xfb\x7c\xce\xa4\xb9\x4f\x93\x09\x17\x25\x44\x8a\x91\x6e\x8d\x87\xb1\x50\x8d\xd2\x29\x3c\x65\xc2\xd8\xcb\x0d\xc4\xf0\x15\x8a\x15\x4c\x80\xa9\x83\xd1\x64\x3b\x2a\xe4\x1c\xab\xae\xad\xf7\xb5\x13\xf1\xb8\x8e\x42\xd4\x23\xa7\x1e\xc0\x9b\x3e\x4d\x76\x3e\x7d\xbf\x9e\xd3\xe7\x36\xf8\xb3\x1d\xbd\x27\xea\x56\xbc\x2f\x26\xbc\x67\xe9\x27\x17\x8d\xc0\x22\xa0\xbe\xc9\xb4\x53\x87\x7d\x9e\x01\x94\x21\x12\x81\x40\x61\xb4\x77\x72\x5d\xb3\x89\x2a\x5c\x78\xcb\x37\x16\xf9\x19\xdb\xb1\xcc\x49\x46\x82\x55\x5b\xf3\x61\x65\xc9\x48\x6f\xe9\xb0\xda\xbe\xc4\x60\xd4\x96\xea\x04\x53\xb2\xec\xc4\x92\x76\x26\x29\xc6\xef\x2a\x99\x65\xdd\x6a\xb0\xfe\xc9\xf8\x1d\x23\x17\x55\x44\x3c\xda\xfc\x6e\x0c\x35\x96\x94\x6f\x98\x19\xb2\xa2\x8f\x90\x29\xcc\xe5\xba\xcc\xb2\x6b\x99\xf1\x64\xe0\x36\xdd\xde\x1e\x88\xed\x27\x45\x99\x65\xa4\x80\x8f\x96\xe4\xbd\x80\xf3\x7e\x9e\xdd\xd3\xbd\x3e\x25\x57\x6c\xc7\xd4\x29\xb9\x5c\x5f\x49\x73\x8d\xca\xcc\x10\x4f\x6c\x3a\xa3\xf1\x73\xc2\xd7\xe4\x95\x55\xa3\xb5\x21\x86\x6e\x40\xd1\xf4\x66\xe5\x53\x28\x8d\xd5\x00\x3b\x00\x15\x8e\xf9\x3d\xd7\xbd\xda\xda\x93\x89\xe9\x6b\x80\x64\x59\x12\xfe\xfb\x51\x88\xcf\xf8\x9a\x25\xfb\x64\x28\x3d\xb0\x2d\xc2\xa0\x2d\xac\xf6\x31\xc4\xac\x41\x83\x3e\x41\xc4\xb5\x39\x07\x65\xb5\x37\x8a\x97\xa0\x85\xac\x90\x42\x83\x75\xab\x26\xc7\x6a\x26\x78\x05\xd0\xd1\x1a\xee\xb8\x00\x29\xa4\x36\x37\xf6\x96\x30\xcc\xfb\xda\xb4\x75\xed\x3f\x20\x10\xc1\x9f\x65\x2c\x25\x3c\xcf\x59\x6a\x6f\x05\xd9\x9e\xd0\x35\xd4\x0a\x8e\xea\x28\x66\x21\x28\x86\x5b\x7e\x89\xc2\x68\x4b\x45\x9a\x31\x45\xd6\x94\x67\xee\xe6\xd1\xba\xd1\x18\xa6\x72\x2e\xec\x27\x01\xb8\x68\xcb\x86\xcb\x8f\xbd\x3c\x25\x89\xc4\x66\xf7\x46\xc2\xd5\xde\xfd\x54\x9f\x0d\xe0\xdf\xa3\x5c\x83\x34\x4a\x22\x57\x53\x5a\x65\x32\xb9\xd3\xa4\x14\x86\x67\x2e\x2b\x4b\xde\x91\x44\xe6\x45\x06\xb4\x1a\xd7\x76\x65\x22\x91\x57\xff\xb9\xa8\x28\x63\x61\xc7\xd5\x67\x5f\xd7\x3f\xc1\x1f\x86\x45\x64\x9c\x6e\xc1\x1e\x58\x32\xa1\x14\xb9\xe5\x32\x16\xf9\x52\x64\x7b\x22\x45\xa5\x62\x60\xa1\x3c\x88\xc1\x87\x53\x30\x22\x11\x57\xac\x66\x28\x4b\xf2\xe6\x81\x25\xd5\xbf\xf1\xca\x45\xb1\x4b\xbf\x91\x70\x9c\x8e\xd7\xb6\x2d\x10\xa2\x3b\xb8\xe6\xd7\xf8\x15\x10\x27\x90\x06\xfe\x33\xe3\x02\x4e\xb1\x0b\xdb\x8d\xb0\x0b\x61\x15\xee\x36\x7d\xe1\x09\x70\xfa\x15\x49\xb9\x62\x89\x91\x6a\x3f\xa1\x11\x9c\x9f\x8f\x9d\x9f\x92\xd2\x90\xe7\x27\x67\x27\x2f\x3a\x46\x8d\x13\xdd\x68\x85\x1f\x63\x1b\xbd\x6d\xc0\xb6\x02\x80\xe7\x45\xb6\x87\xd5\x9e\xa4\xa7\x84\x1b\x1f\xe1\x13\xa8\x2f\xde\x7d\x5c\x4c\xf3\x29\xd1\x92\x18\x45\xab\xac\x23\xf8\xab\x05\x03\x55\x75\x80\xd3\x3e\x3f\xf9\xe7\x49\x8c\xe5\x91\x99\xe4\x05\xb9\x97\xe2\xc4\x00\x1a\x97\xe4\x16\x73\xd9\xaa\xa1\xf6\xb2\x24\x82\x61\x0a\x12\x7b\x28\x32\x9e\x70\x13\xe1\xe1\x23\xc0\xfc\x88\x2c\x0d\xe6\x45\x50\xe3\xe3\xb1\xdf\x3c\x70\xe3\xdc\xe7\x96\xfe\xbf\x01\xca\x40\x36\x17\x83\x02\x4d\x32\xbe\x63\x67\x5b\x46\x33\xb3\xc5\x4a\xea\x42\x8a\xc5\x3f\x98\x92\x10\xb5\x2d\xdc\x2f\xe3\x9b\x14\xb4\x6f\x34\x9f\x49\x36\xd7\xb0\x0a\x79\xf8\xde\xa8\xb9\xd1\xb2\xbe\xef\x27\xf5\x54\xf9\xcb\xed\xed\xf5\xf7\xcc\x1c\xb0\x04\x0b\xc7\x3b\x30\xe1\xea\xc8\xd4\x5a\xaa\x11\x52\x8e\xe7\x0d\x43\x45\x46\x43\xf3\x94\xda\x60\x56\x17\x0a\x73\x61\x6f\x7c\x46\xb6\xbc\x6c\x91\x87\xb8\x90\x29\xb9\xbc\x5e\x92\xbf\xc9\xd2\xce\x79\x45\x57\xd9\xbe\x4a\x0d\xd2\xcc\x90\x67\x76\xb0\x67\xf6\x54\x5b\x3c\xfc\x85\xd1\x74\x58\x4f\x6d\x3e\xf6\x48\x31\x3a\x18\xee\xdf\x98\x45\x3c\x89\x34\x66\x30\x95\x95\x96\xda\xc8\x9c\x6c\xf1\xe3\x83\x18\x6b\xb7\xb7\x31\xbc\xc9\x52\x88\xcf\x62\x54\xac\x80\xa3\xe7\xa1\x1e\xf1\xd8\x74\xa8\x12\x57\x5d\xa5\x09\x6a\xab\x06\x35\x97\x14\xe5\x50\x30\xb2\x8e\x96\x14\xb8\x14\xbb\xe5\x51\xbe\x9b\x69\x1d\xf5\xa6\x74\x98\xeb\xb1\x66\xe0\x9a\xdc\xe5\x2c\x60\xf0\x3f\x7c\x26\x76\x58\x8b\x88\xca\x8e\x9f\x26\x80\xfa\x34\xf3\x8c\x6f\x90\x36\xe2\x20\x69\xbf\x18\x3b\xe3\x09\xdd\x21\xe3\x79\x38\x21\x45\x54\xac\x52\x6f\xa1\x14\x97\x4b\xef\x72\xe7\x81\x90\x87\x0b\x12\xf7\xcd\x2f\x0a\xf5\x85\x1c\x6b\x1b\x4c\xe0\x46\xb0\x7f\x3f\xea\x53\xb7\xe8\xc6\x91\xb9\x30\x6c\x13\x71\x5e\x17\x13\x03\x3e\xba\x09\x10\xca\xd5\x89\xae\x63\x0e\xb1\x72\x32\x22\x2f\x62\xdf\x65\xc7\x3b\x75\x85\x00\xbd\x11\xca\xb3\x4f\xc8\x86\x7e\x19\x43\x49\x92\xfc\xf1\xbf\xff\xf7\xdf\xff\xf7\x25\x4e\xb1\xf2\x65\x09\x72\x79\x7e\x75\xfe\xd3\xcd\xc7\xd7\x10\x3c\x3f\xbe\x8b\x0f\x8b\xfa\x3e\xb3\xe0\xc2\x2c\xa4\x5a\x20\xa6\x5e\x11\xa3\x46\xa9\x1a\xa2\xfb\xa6\x36\xf0\xba\x81\x8f\x9a\x05\x0b\x9c\xe4\x75\xf7\x3f\x5f\x38\x23\x46\x8c\x34\x2d\x1f\x96\x7c\x8f\x48\xb7\xb1\x7d\xa5\x06\x3b\x1e\xb5\x47\x1c\x77\xea\x26\xc5\x8d\x4c\xee\x26\xe9\x59\x27\xb7\xaf\xaf\xf1\xa3\x86\xaa\x05\x35\x32\xe0\xf2\xc5\xc5\x4e\x66\xbb\x71\xb2\xa7\xe4\xf6\xf5\x35\x2c\x64\x09\xff\x05\xf7\x52\xb8\x1a\xec\x2d\x64\x1f\x48\xe6\x4c\xc0\xf6\x1a\x31\x76\x09\x47\xa8\x8a\xd1\x8c\x6b\xc3\x13\x80\x5a\x9b\x48\x2c\xfc\xb0\x65\xf8\x93\x6a\x7d\x27\xef\xbd\x31\x79\x5c\x01\x8c\x3b\x8c\x0d\x05\xf0\xa8\x4d\xdb\xfe\x75\x39\xa7\xe3\x98\x18\xe7\x37\x73\xce\x83\xe7\x97\xe5\x2d\x11\x2f\x15\x8a\xdd\x18\x19\xa8\x3f\x7b\x60\x61\xc4\xd7\x07\xec\x8b\x2b\xb6\x96\x8a\xc5\x1b\x18\x6b\x83\x21\x49\x4b\x38\x89\x54\x40\xec\xb3\xbf\x2b\xca\xa6\xe9\x2f\x18\x63\x61\x1f\x5d\x26\x5b\x7f\x47\x17\x4c\xeb\x33\x30\x25\x96\x05\xea\xe8\x60\xb6\x2c\x15\x3b\xb5\x6b\x66\x39\xac\xe8\x34\x26\x4e\xd0\x2e\x86\x09\x7c\x9d\x99\x04\x43\x4c\xbc\x2d\xd4\x59\x52\x3c\x32\x0e\x4c\x90\x21\xa8\x8a\xea\x2d\x83\xbc\x32\xf6\xc0\x8d\x2b\x59\xa3\x18\xd5\x12\xdb\x6f\x78\xe4\x00\x3f\xd7\xd0\xd8\x0b\x0c\x21\x21\x49\x52\x4f\x0c\xc1\x5d\xcb\xf4\xe4\x44\xb7\x40\x6d\x14\x4d\x98\xbd\x81\x73\x99\x12\x48\x48\x48\xe5\x7d\xc8\xb5\xb5\x62\x1b\x2e\xb4\xdf\x5b\x2c\xbe\x83\x44\x60\xb9\x39\x03\x0b\x93\xcf\x7f\x5f\x92\x0f\x55\xb2\xdd\xb8\xa5\x56\x96\x26\x91\x35\x93\x70\x33\x3f\x34\x2c\x43\xd8\x0a\x6c\x7d\x49\xb3\xa0\xf1\xa7\x22\x27\x1f\xf3\x63\xc6\x51\xe0\x2c\xcc\x01\xa8\x0d\x02\x9c\x6a\x61\x0e\xa1\x40\x35\xbe\x1a\xdc\x1f\x6e\xef\xc8\x34\xd9\xb6\xfd\x2e\xb3\xb1\x7a\x36\x56\x87\x9e\xd9\x58\x3d\x1b\xab\x67\x63\x75\xef\x33\x1b\xab\x67\x63\xf5\x6c\xac\x1e\xff\x76\x36\x56\xcf\xc6\xea\xd9\x58\xdd\xf3\x7c\x89\x26\x97\xd9\x58\x1d\xfe\x7c\x36\x56\xcf\xc6\xea\x00\xd4\xd9\x58\xdd\xfb\xfe\x6f\x81\x73\xce\xc6\xea\xd0\xc7\x5f\x98\xb1\x7a\xe4\x05\x6f\xf5\xbd\xb6\x3a\x6e\x4c\x24\xf6\x35\xd8\xd8\x78\xe2\xcc\xc3\x72\xdd\x8a\xea\x45\x60\x8d\x12\xd3\x03\x13\xaf\xf3\x01\x7d\x4c\xab\x33\x02\xd7\x46\xe7\xde\x98\x60\xb0\xe7\x0d\xc0\x8c\x8f\xae\xf6\x21\xf0\xfa\xac\x90\xf8\xff\x6a\x4b\x5e\xc3\x84\x87\x7a\x7f\xff\xa1\x1f\x67\x62\x61\xdb\xdd\xa3\xec\x76\x6d\xcb\x5c\x80\x78\x9e\x60\xb3\x8b\xe3\xce\x51\xb6\xba\x47\xd8\xe9\xe2\x6c\x55\xb1\x36\xba\x43\x0b\xdc\x08\xd8\x68\xfb\x5c\xd3\xfa\x36\x02\x33\xce\x36\x37\x64\x79\x1b\x53\xd1\x06\xec\x72\xa3\x56\xb7\x11\xb8\xfd\x36\xb9\xa0\xc5\x6d\x6c\xa6\xbd\xf6\xb8\xa0\xb5\x6d\x1c\xb1\x91\xb6\xb8\x28\x83\x42\xb4\x38\x8c\xb9\xbb\x45\x70\x6e\xe7\x56\xbb\xdd\x2a\xa6\xb7\x32\x0b\x9c\xa4\xd6\x29\x7a\xc7\x05\xcf\xcb\x1c\x5a\xbb\xdb\x03\xc3\x77\x95\x87\x4e\x57\x14\x8f\x3c\x34\x68\xdd\x5a\x31\xec\x0e\x9f\x32\xa8\x26\x43\x79\x66\x77\x03\x12\x1d\xb6\x74\x07\x1c\xa7\x4c\x12\xc6\xa0\x86\xf9\x45\x94\xc1\xec\xf7\xcb\x6a\x76\x55\x41\xc4\x97\xc3\x3b\x83\xd5\x5d\x40\x63\xf9\xfd\xb7\x23\x98\x0c\x6b\x35\xa3\x26\xcc\x4f\x61\xbe\x8c\x63\x93\xe3\x0a\xec\x64\x93\x65\x44\x31\x9c\x4f\x62\xae\x8c\x32\x55\x46\x9e\xa2\x68\x13\xe5\x74\xf3\x24\xec\xef\xd8\xe5\xe5\x31\xa6\xc9\x28\x2e\x32\xd9\x24\x19\x63\x83\x7e\x94\x39\x72\x8a\x29\xf2\x51\x75\x5e\x1e\x6b\x82\x9c\x74\xef\x88\x36\x3d\x1e\xc7\xec\xf8\x49\x6a\x2a\x45\xe0\x25\xce\xcc\x18\x6d\x62\x8c\x33\x2f\x8e\x9b\x16\x8f\x69\x56\x8c\x44\xed\xf8\xa5\x38\xe2\x42\x3c\xe5\x32\x3c\xe1\x22\x3c\xd9\x7c\xe8\x90\x34\xb2\xad\xb1\x17\xe0\x83\xeb\xed\x08\xd4\xc7\x5d\x7e\x9f\x70\xf1\x8d\x31\x17\x7e\x12\x53\xe1\x34\x33\x61\xd4\x6e\x8f\x1f\xee\x91\xeb\x7b\xc4\x51\xe5\x82\x1b\x4e\xb3\x0b\x96\xd1\xfd\x0d\x4b\xa4\x48\x03\x9c\xfa\xa0\xd4\x41\x45\x73\x1a\x3f\x74\x9a\x5b\x3b\xca\x66\x4b\x5d\xb5\x9c\xa0\xdf\xdb\x05\x28\xf9\x9b\xbb\x13\x2e\x50\x1b\x11\x67\xf8\x98\xec\xe5\x23\xdc\xaf\xc9\x51\x55\x44\x0c\x0c\x9a\x86\xe6\xbf\xc8\x7b\x22\xd7\x86\x09\xf2\x9c\x0b\x8f\xe9\x17\x0d\xe5\xb0\xd6\xb5\x43\x24\xe7\xc8\xd3\x7e\xf7\xf2\x1b\x0f\xe6\x73\xa9\xca\xa0\xd4\x43\xbb\xc1\x27\xdf\x3a\x1c\xa8\xa7\x5c\x3b\x1c\x88\x75\x99\xb5\xaf\x1e\x78\x1d\x89\xbd\x77\xbc\xac\x4b\xa2\xbc\x84\xb9\x54\xb4\x6c\x6f\x93\x2e\x98\xb1\x8b\xf0\x20\xc4\x5f\x60\x2b\x22\x5c\x02\x8f\x72\x07\xa0\xc1\x7f\x44\xc4\x4e\x72\x05\x34\x8d\xfd\x01\xb8\x53\xdc\x00\x9f\xe4\xf6\x74\x44\xd3\xff\x14\xb3\xff\xaf\x4e\xb3\x89\x30\xef\xff\x86\x34\x9b\x5f\x42\x17\x30\x3c\x67\xb2\x34\x47\x52\x03\xb0\x0b\x68\x83\x23\xf3\x70\xbd\x22\x59\x1e\x34\xe8\x78\xe9\x00\xf6\x4a\xa9\xe3\x45\xd4\x7e\x61\x5a\xc2\xc8\x3e\x0d\x5f\x92\x07\x9b\x00\xd5\xba\x58\x5d\xa3\x9c\x6a\x42\xc9\xc5\xd5\xcd\x4f\x6f\xcf\xff\xfc\xe6\xed\x92\xbc\xa1\xc9\x50\xa9\xf0\x46\x95\x10\x81\x0d\x11\x91\xf6\xb7\x74\xc7\x08\x25\xa5\xe0\x7f\x2f\x5d\x93\xcd\xe7\x15\xc4\x17\xde\x6b\x32\x00\x74\xac\xbe\xca\x08\xcf\x80\xc6\x01\x13\x2a\x55\x62\xa3\x01\x34\x23\x4b\xab\xe6\x2b\x99\x1f\xba\xfd\xde\xd8\x9f\x86\x59\x14\x45\xde\x03\xfd\x49\x37\x7c\xe7\x0c\x76\xae\x04\x4d\xa3\x8f\xab\x25\x49\x4b\x09\x56\x1a\xd2\x15\x98\xa9\x07\x39\x94\x60\xc6\x52\x5f\x75\xe3\x90\x42\x37\xf3\x2f\xec\x8d\x44\x9f\x92\x55\x09\xa6\xfa\x42\xf1\x9c\x2a\x9e\xed\x9b\x43\xd0\x6c\x88\xdf\x5c\x49\x2f\xa1\xf7\x28\x8e\xeb\xe9\x5f\xbc\x7f\x73\x43\xae\xde\xdf\x42\x4f\x24\x2b\x59\xc1\x8a\x0e\xbf\x03\x62\x56\x6c\x18\x0d\xae\xb6\xf5\x92\x9c\x8b\x3d\x7e\x82\xe7\x9c\x6b\xe8\x24\xcc\xa0\xf3\xbd\xbb\x95\xfb\x52\x50\xcf\xbe\x59\xc2\xff\x0d\x95\xbd\xa6\x69\xaa\x2c\x37\xaf\x9c\x10\x07\xf9\x03\x96\xcb\x02\xbf\xe7\xab\xac\xb1\x77\x0e\x7b\xbf\x58\x67\xb0\xca\x99\x78\x6d\x97\xdd\x6c\x10\x56\x6d\x24\x20\x04\xeb\x95\x42\x13\xd2\x41\x3e\x30\xda\xd7\x2c\xb2\x5e\x65\x3d\xa1\xe8\x7a\x79\x35\xbf\xf6\xc2\xd4\x1d\x0a\xd9\x28\x69\x4d\x2e\xaf\xfd\xb6\x84\x05\x1a\x94\x11\xab\x64\xa1\x2b\x06\x0d\x80\xd1\x24\x71\x4a\xbe\x21\x7f\x22\x0f\xe4\x4f\x20\x5a\xff\x18\x02\x16\xc7\x41\xe3\xd4\x5a\xd4\xda\x2e\xaf\xa3\xb1\xf2\xa3\x3d\x02\xf6\x1b\xbb\x72\x23\xc9\x8a\x8b\x14\x3b\x34\x3d\x18\xa6\xec\xc1\x76\xd8\x7a\x72\x85\x43\x3b\xc8\x51\x37\x0c\xac\x13\xe4\x72\xdd\xa8\x15\x16\xd6\x14\x27\x6e\x99\x05\x6d\x35\xd9\x2b\x24\xf2\xb0\x79\xba\x55\xb1\xac\x1e\x29\xa7\x26\xd9\xb6\x4f\x90\x15\xe1\xba\xd1\x44\x39\xac\x0c\xa7\x12\x6e\x08\xe8\x0e\xdc\xf2\x20\x55\x1e\x97\x90\x26\x35\xdf\x6b\xed\xc2\x01\xa6\x0f\x14\xc5\x11\x25\x3c\xf5\x92\xb5\x91\x0e\x55\xc8\x14\x45\x35\x4c\x2a\x6d\xb0\x1b\x2f\x95\x83\x40\xbb\x12\xdb\x85\xa8\x54\x57\x67\xa0\x2f\x7b\x12\x5c\x37\x4e\xa8\x60\xa9\x46\x32\x16\xec\x69\xa9\x7a\xe0\x05\x37\x26\xea\x7c\x14\x4a\x1a\x99\xc8\x60\xcd\xc8\xb6\x49\xd8\x7d\x00\xcb\xc0\x6b\xa5\xbf\x89\xff\x70\x71\x7d\x6a\x6f\x84\x50\x3c\xef\xe6\xf5\x98\x55\xae\xd5\x1e\xee\xf6\xf5\x75\xb0\x4d\x4d\xc4\x62\xc6\xcb\x79\xb7\x58\xf8\x90\x5a\xfe\xb4\xda\x93\x8a\xd1\x94\x1f\x2d\xb6\xc6\xb7\x3a\xac\xa0\x4e\x09\xb2\xc9\xe5\x8e\xa5\x28\xc0\xeb\x96\x89\x29\x34\xe4\xd5\x81\xc8\x9b\x71\x1d\xf2\x33\x58\x06\xe7\xc8\x9b\x39\xf2\x66\x8e\xbc\x99\x23\x6f\x02\xef\xcc\x91\x37\x73\xe4\xcd\x1c\x79\xd3\x8b\x96\x39\xf2\x66\x8e\xbc\x99\x23\x6f\x1a\x2f\xcd\x91\x37\x6e\x52\xff\x32\xfe\xa9\x39\xf2\xa6\xfd\xcc\x91\x37\x9d\x51\xe6\xc8\x9b\x2f\xc3\xa7\x36\x47\xde\xf8\x67\x8e\xbc\x99\x23\x6f\xe6\xc8\x9b\x39\xf2\xe6\xe0\x99\x23\x6f\xe6\xc8\x9b\x39\xf2\x26\xbc\x4f\x55\x37\xef\x18\x17\xca\x6b\x99\x17\xa5\x61\xe4\x43\xd5\xae\xbe\xea\x99\xbe\xda\xa3\x5f\xb0\x71\x38\x3e\x95\x9b\x03\xdb\x76\x95\x0a\x42\x45\xce\xb0\x16\xe2\x22\xc1\xa9\x2d\xaa\xf5\x2c\xaa\x99\x9c\x3d\xd6\xd5\x81\xbd\xf3\x87\xe9\xa1\x8e\x8f\xb9\x8e\x62\xfc\x51\x8c\xab\x8d\xf1\xb7\x30\x85\x86\xa1\x05\x9b\x45\x3d\x00\xf9\xd2\x5c\x96\x58\x02\xd2\xad\x3e\x30\x76\x85\x17\x34\x13\x7d\x3e\xb4\x93\xf8\x9e\xc1\x4c\x7f\x66\xec\x7f\x70\x93\x38\xc4\xbf\x63\x1f\x8f\xc3\xbf\x3f\x32\x10\x81\x50\x8d\xc0\x35\x91\x39\x37\x56\x4f\xb1\xca\x5e\x23\x5a\x28\xe4\xd5\xe0\xa6\x65\x43\x75\xd4\x02\x3e\x47\x6a\xb0\x0a\x6a\xe5\xe6\x68\xf6\x5c\xf3\xdd\xd4\x42\xe8\x82\xca\xb7\x95\xb6\x04\xbb\xbe\xf0\xcd\x77\x81\x71\x7e\xd1\x14\x34\xf2\x82\xd5\xf7\x15\x37\xfb\xd7\x52\x18\xf6\x30\xa0\xc1\xb4\x89\xe1\xc6\x7d\xe2\xba\x0a\xea\x4a\x95\x72\x4e\x4c\x55\x0a\x88\x6a\x88\x10\x25\x31\xc8\xc2\x6e\x63\x67\x7e\xa2\x80\x15\xf6\x60\xce\x06\x40\xc6\x6d\x85\xa1\xfa\xae\xde\x07\xb6\xb0\xc2\xa9\x46\x77\x67\xac\xc7\x32\x4e\x60\x31\xd7\x8a\xef\x78\xc6\x36\xec\x8d\x4e\x68\x06\x7b\x1e\xab\x02\x9c\x0f\x7c\xef\xbb\x2a\xea\xaa\x8b\xe6\x50\xc7\x6c\x37\x4f\x50\xea\x12\x2a\xc8\x86\x72\x41\x72\x8b\xa3\xc2\x83\x85\xee\x7b\x02\x3a\xbc\x15\x54\xd9\x0b\x81\xfb\x20\xa4\x71\x41\x60\xd8\x4a\xca\xcc\x79\x64\xb3\x7d\x3d\x27\xe7\xea\x17\xf2\x27\xc1\xee\x7f\xb2\xe3\x68\xb2\xce\xe8\x26\xd4\x8b\x9a\xb8\x8a\xb0\xcc\x74\x4a\xb6\x54\xd3\x21\x43\xe8\x08\x31\x06\x0d\xea\x1f\xa1\xd8\x81\xb1\xb7\xdd\xf7\x2b\xf2\xf2\x05\x50\x2d\xd5\xa4\x82\x1e\x32\xaa\x7c\xfb\x02\xac\x2f\xaf\xcf\xaf\x7f\xba\xf9\xdb\xcd\x4f\xe7\x17\xef\x2e\xaf\xc6\x8e\x68\xb8\x4f\x69\x42\x0b\xba\xe2\x19\x0f\xf3\xee\x8e\x15\xbc\xf9\x19\x30\xaa\x34\x3d\x4b\x95\x2c\x70\x9d\xaa\x14\x10\xaf\x59\xc7\x60\x45\x18\x32\xbc\x0f\xaa\x0a\xef\xc4\xd6\xdc\xed\xa1\x36\x8a\x0a\xe3\x95\x9d\xb1\xfa\xdc\x88\x66\x55\x0a\xab\xa8\x3e\xd5\xe3\x46\xd3\x29\x41\x09\xe7\x69\xca\xd2\xd6\xd4\x8f\xec\x03\x7a\xed\x41\xef\xeb\x88\x51\x72\xfd\xfe\xe6\xf2\xff\xc6\x8f\x4a\x1c\x8d\x44\xb9\x07\x8e\xe4\xc1\x26\xc4\x92\xc9\x04\x4c\x7e\x70\xd1\x3d\x33\x2e\x07\xde\x19\xa9\xe4\xef\xb9\x4a\xe4\xe1\xfe\x50\x8a\x76\x64\x7e\x0d\x81\xe4\x32\x65\x4b\x72\x8d\x4c\x11\xba\xed\x06\x79\x7f\xf5\x5d\xcd\x06\xc0\xfc\x6b\x3f\x16\x86\xd3\x2c\xdb\x13\xab\x89\xed\x68\xc6\xd0\x85\xac\xe4\xe0\x6d\x85\xd4\x25\xb5\x30\x2e\xb5\xc9\x35\xd6\x34\xd3\x81\x03\x1e\xc3\x07\x2d\xab\x7f\x67\x95\xc9\x48\x3c\x55\xef\x93\x94\x09\x69\x9c\x5e\x6a\x47\x82\x80\x5a\x25\x13\x82\xba\x29\xba\x21\x02\xab\xaa\xc3\x89\x2a\x66\x09\x2c\xd6\xb3\x41\xae\xfd\x5a\xaf\xab\x31\xe1\x26\x1e\x80\x59\x6a\xa6\x0f\xa4\x8d\x63\x83\xb5\xb6\x6a\xc7\x55\x8c\xa6\x10\x1b\x56\x50\xb3\x05\xbb\x66\x00\x68\x4e\xf5\x1d\x4b\xf1\xd5\x25\xca\x61\xa7\x49\x6b\xd7\x01\xc0\x4d\xef\xd6\x62\x61\xcd\xa8\x29\x15\x03\xf9\x1b\x56\x72\x57\x8c\x30\x41\x57\x59\x28\xf2\x2c\x2a\x28\x92\xa6\xef\x45\xb6\xff\x20\xa5\xf9\xae\x0a\xa9\x8a\xdc\xce\x1f\xab\x9e\xe0\xcd\x1b\x34\x08\x5b\x30\x52\xa6\x0b\x40\x13\x04\x72\xc5\x55\x32\xbf\xa8\xb7\xef\x08\xe4\xa9\x4a\x71\xae\xbf\x57\xb2\x8c\x6d\xca\x61\x29\xe8\xfb\xcb\x0b\x38\x55\x25\x9e\x1b\x26\x8c\xda\x43\x50\x64\x27\x83\x67\x5c\x87\x5b\x92\x1f\x2c\x4d\x1d\x50\x91\xd5\xb8\x4a\xa1\x99\x59\x92\x77\x74\x4f\x68\xa6\xa5\x53\xa6\x42\x9a\x91\x20\xd7\xe0\x33\x69\xea\xff\x4b\x02\x31\xce\x18\x77\xb1\x92\x66\x4b\x0e\x5e\x18\x21\xce\x2e\x44\x0c\xdf\x43\x03\x53\x9d\xa0\xc4\xc5\x21\xe0\x10\x71\xd2\x3b\xa6\x49\xa1\x58\xc2\x52\x26\x92\xc0\x1e\x36\x6c\x45\x7f\xfc\xc3\x93\xcc\xf7\xb0\xd3\x57\x52\x58\x32\x8e\xdc\xeb\x4b\x91\xf2\x84\x22\x0f\x72\xdd\xac\x6b\x12\x06\xab\xa6\xd3\x31\x29\xc4\xc0\x8d\x70\xd9\x52\x33\x85\xdd\x9d\x55\xc9\x10\x89\x7f\x2d\x57\x2c\x63\x06\x23\x6e\x21\xae\x9f\x1a\x6c\x25\x80\x0d\xe5\xa9\xf1\x84\x11\x3e\xe9\x4c\xe8\x12\xda\x85\xd8\xab\xb1\x21\xa9\x64\x75\xbc\x22\xd5\xe4\x87\xcb\x0b\xf2\x0d\x79\x6e\xe7\xf7\x02\x7c\x2c\x6b\xca\x43\x6a\xbb\x91\xe8\x85\x39\xd4\xab\xd7\x1e\x38\x2c\x03\xe8\x93\x48\x85\xc7\xf0\x94\x88\x90\xcf\x07\xba\xc5\xb8\x15\xda\xeb\x8e\x8f\x31\x76\x9e\x39\x30\xda\xb4\x09\x3d\x40\xce\xa1\x71\xc2\x84\x3e\x44\xce\x01\x88\xe3\x84\x3e\x81\x9c\xa3\x59\xd2\x0f\x9a\xa9\x09\x1c\xe9\x87\xa3\x72\xa4\xa6\x0a\x60\xa9\xb6\xbd\x7a\x24\xcd\x9c\x19\x9a\x52\x43\x09\x0f\x6d\x47\x29\x1a\x1d\x41\x7e\x0b\x1b\x7c\x3c\x7e\xa5\xd9\x5b\x2e\xca\x07\x74\x91\x4d\xb9\x42\xde\xbc\x81\x0f\x49\xe2\x27\x0f\x08\xa7\x45\x91\x71\x0c\x10\x6e\xe7\x51\x06\x30\x83\x87\xbc\x99\x1e\xd3\xa7\xf8\xc0\x51\xa6\x59\x26\x2d\xab\xb4\x52\x9d\x8a\x54\xe6\x01\xb0\x87\x13\xb4\x0a\x13\xa3\xc9\xb6\x69\x61\xef\x21\x96\x49\x42\xea\x5f\x5c\xec\xc5\x5d\x9d\x33\xb6\x63\xc1\xb4\x9b\xc3\xec\x5a\xfb\xbe\x55\x9c\xfc\x0e\x00\x00\x92\xd1\x15\xcb\x50\x78\x20\x95\x44\x3a\x5b\xa3\x68\x28\xfa\x6a\xa6\x64\x36\x25\x18\xe9\x83\xcc\xc0\xbf\x45\xab\xc5\x58\x00\x5f\xc8\x5a\xe0\xb5\xf8\xb5\x80\x5e\xdf\x5a\x0b\xdc\x77\xbe\x8c\xb5\x94\x41\x49\xd4\x59\x8b\x15\x5c\xed\xb5\x80\x04\xf9\x12\xd6\x12\x71\xad\xbf\xe7\x22\x95\xf7\x7a\x3a\xd3\xfd\x11\x3f\xf4\x9c\x21\xb1\xac\xc7\x70\xb1\xd1\x4d\xc6\x4b\x83\xc6\xd2\xe6\x3d\xb5\x8f\xf3\x7a\xe3\x7c\x95\x4f\xdd\xe5\x51\x01\xe8\x5e\xe1\x2a\xb5\xf3\xcf\x3c\x42\x90\x86\x28\x3e\x8a\x37\x1e\x9d\x03\x6e\x72\x4d\x5f\x2b\x0b\xcb\x70\x9a\xdd\x14\x93\xda\x9e\x7d\xff\xee\xe6\xbc\xfd\xb1\x25\xdc\x7b\x48\xb9\xb7\xeb\xb1\xbf\x13\x9a\xe6\x5c\xeb\xb0\x49\x1a\xf0\xcb\x56\xd0\x8e\xee\xb9\xf7\x51\x6c\xb8\xd9\x96\xab\x65\x22\xf3\x86\xbb\x62\xa1\xf9\x46\x9f\x39\x2a\x5b\xd8\xd9\xbf\x18\x81\xcb\x45\xc6\x45\xc3\xe8\x00\x09\xec\x4e\xa9\x83\x09\x26\xd5\x0a\x00\xf5\x98\x69\x3a\x02\x14\xad\xbc\x3d\x08\xc0\xec\x52\xce\xb2\xd4\x19\x22\x30\x1c\xdb\x9e\xe7\xac\xd8\xd2\x05\x08\x8c\x11\xe0\x2e\x67\x0c\xee\xf5\x5b\x29\xa4\xf3\xa1\x63\xcc\xb1\xbb\x4a\xa1\x5d\x02\x26\xe1\x4e\x8e\x9d\xcb\x08\xe0\xa6\xe5\xe3\x28\xac\xad\x4b\x3d\x57\xa3\x81\xf5\x23\x14\x04\x08\x74\x19\x73\x8d\x68\x9c\x91\x95\xf5\x6e\x24\x2a\xdf\xbf\x85\x7d\xa8\x6e\x3c\x13\xd1\x0f\x37\x1f\xf7\x99\xe5\x36\x9e\x09\xf7\xde\x84\x46\x16\xd5\xa9\xbd\xd2\x7b\x1b\xb2\xaf\xb4\x6f\x44\xa3\xc7\xb7\x7b\x5f\x1a\xbb\x15\x8d\x80\xec\x53\x76\x9f\xa4\xeb\xf6\x03\x3d\x82\xbe\x4b\xfa\x74\xde\x03\x7a\x5e\x31\xe3\xc8\x19\x08\x36\xa7\x7b\xb2\x1a\x3b\x2e\x29\xd7\x60\xd6\x04\xa7\x74\x93\x78\x3f\x34\x09\xe9\xd8\x74\xfa\x64\xc7\x3c\x06\xb6\x46\x67\x75\xdf\x34\xde\x27\xbc\x6b\x8a\xba\x96\x29\x86\x8c\x57\x41\xb9\x83\xfd\x0f\x5d\xe8\x3a\xff\x87\x97\xfd\xb5\x66\x21\x24\xc6\x4c\x34\xe3\xc8\x7d\x83\x59\x6c\x9a\x3a\x00\xd3\x59\x74\x5d\xf3\xd5\xd6\x2c\xd0\xca\xb5\xe5\xba\x99\x1c\x7e\x5a\x4d\x3a\xe0\x34\x6e\xb6\x76\x38\x25\xff\x51\x6a\x43\x68\xe5\x7e\x6e\xf5\x9c\xa8\x62\x8e\x81\x9c\x92\x41\x6b\x8a\xcf\xc5\x32\xd2\x4e\x66\xc7\x53\x46\x52\xbe\x5e\x33\xef\x16\x5f\x31\x52\x50\x45\x73\x66\xc0\x8d\x82\xa8\x85\x2e\xbc\x62\x98\x18\xe4\x9a\x50\xdf\xeb\xb6\x8a\x80\x3b\x45\x1f\x2d\x37\x24\xe7\x9b\x2d\xea\x3a\x84\x92\x4c\x8a\x0d\x44\xf4\xd9\x29\x64\x92\x0e\x9d\x44\x60\x0e\x52\x91\x7b\xaa\x72\x42\x49\x42\x93\x2d\x58\x09\xa9\x20\x69\xa9\x20\xc1\xd3\x30\x9a\xee\x17\xda\xd8\x7b\xb6\xd5\x8e\xc0\x94\x86\x18\x18\xf4\x42\x77\x3a\x61\x00\xbe\x38\x46\x22\x5b\x59\x52\x1d\x13\xe7\x2b\xf0\xca\x41\x93\xfc\x06\xa0\xb7\x0e\xd8\x9c\xd2\x7f\xf0\xcc\x29\xfd\x73\x4a\xff\x9c\xd2\xef\xdf\x9c\x53\xfa\x3b\xcf\x9c\xd2\x3f\xa7\xf4\xcf\x29\xfd\x73\x4a\x3f\x3c\x73\x4a\xff\xf4\xb9\xcd\x29\xfd\x73\x4a\xff\x9c\xd2\xdf\x78\xe6\x94\xfe\xce\x28\x73\x4a\xff\x97\x91\xac\x37\xa7\xf4\xfb\x67\x4e\xe9\x9f\x53\xfa\xe7\x94\xfe\x39\xa5\xff\xe0\x99\x53\xfa\xe7\x94\xfe\x39\xa5\x7f\xcc\x85\x96\xf2\x81\x54\xcb\x98\xac\x03\x67\xc0\x6f\xc4\x2a\xae\xca\xf5\xda\xde\x50\xe5\xa0\xb0\xb6\x23\x76\x2c\xd1\x55\xee\x5b\xe5\xe8\x72\xd6\x64\xcd\xcc\x29\xa4\x35\x60\x98\xce\x34\xa0\x2e\x90\x12\xd2\x1a\x15\xd3\x90\x06\x20\xc8\x9b\xf7\xdf\x2d\x1b\x49\x0f\x83\xa6\xcc\xc1\x54\x88\xb1\x98\x63\x98\xcd\x7b\x91\xc4\x38\x25\x6b\xc4\xf6\x45\x82\x3a\xfc\x26\x99\xd4\x18\x53\x00\xa0\x87\x5c\x53\x5b\x2a\x04\xf3\x5a\x07\x37\xa0\x2b\xaf\x18\x13\x44\x16\x4c\xa0\x1f\xca\xb7\x65\x20\xd4\x18\x9a\x6c\x97\x76\x7c\x11\x84\xea\xb3\x43\xab\xd1\x2d\xeb\x65\x34\x47\xe4\x2a\x96\x53\x8e\x03\x10\x9a\x28\xa9\x35\xc9\xcb\xcc\xf0\xa2\x1a\x62\x68\xc7\x18\xc4\x00\x61\x64\x56\x85\x30\x70\x2c\x30\x34\xc5\x43\x4c\xbf\xdb\x58\xed\x97\x20\xc5\x68\xe0\x35\xe8\x46\xa7\x90\xd0\x9e\x17\x66\x8f\x2e\x57\x74\x3c\x71\xa5\x0d\x49\x32\x0e\xe2\x1f\x66\x87\x39\xa1\x30\xca\x69\xc0\xa9\x6f\x20\x57\x14\xd6\xaa\xdd\x62\x45\x0a\x52\xa3\x30\x1a\x1d\x8d\xf5\x30\x6e\x80\x94\x6b\x27\xa3\xf5\x90\x67\x82\xfa\xde\x21\xb8\xd9\x7e\xad\xb0\xdd\x29\x0c\xe1\xc7\x74\x7f\x6a\x0c\x32\x82\x05\x48\x79\x72\x17\xa5\xfa\x50\x41\x8a\xb1\xcf\xf3\x39\x6d\xf5\x19\x29\xaa\x64\x39\xb3\xa5\xc3\x95\x16\xfc\x41\x74\xb3\x05\x22\x10\x6c\x67\x69\x96\x25\xcc\xaa\xd0\xb4\x73\xc2\x70\xb8\x47\x1d\x25\xc3\x54\xce\x05\xb8\x65\xdf\x31\xad\xe9\x86\x5d\x0f\x1a\x78\x86\xd4\x26\xb0\xf1\xd4\xa8\x06\x42\xc8\x40\x87\xaa\xff\x52\xbb\xc4\x4e\x86\x18\x42\x63\x2a\x24\xc7\xb9\x54\x31\x80\xf7\x8a\x1b\x7b\xa7\xe2\x1a\x73\xe9\xc0\xae\x79\x18\x70\x39\x0c\xba\xe9\x84\x7b\xe7\x41\xd7\x20\x2d\x7f\x17\x29\x3a\xae\x56\x8c\xac\x14\x67\x6b\xb2\xe6\x82\x66\xce\x03\x35\x44\x5f\x90\x23\x42\x51\xa1\xd6\xda\xaa\xa6\x52\x78\xc7\x8a\x5f\xc3\x92\xfc\xe8\x16\x61\x54\x29\x12\x3a\x9a\xb3\x2c\x64\xca\x08\x5f\x93\x0d\x78\xbb\x14\x3a\xd4\xff\xf0\xcd\xff\xf8\x23\x59\xed\xad\x44\x04\x43\xa5\x91\x86\x66\x15\x9a\x32\x26\x36\x76\x0f\x80\x41\x0c\x9d\x85\x2c\x6b\xa6\x5f\x7a\xcc\x42\x5d\x15\x5c\xfa\xcb\x6f\xef\x56\x6d\x91\x7e\x96\xb2\xdd\x59\x63\x5f\x16\x99\x1c\x8c\x4b\xe9\x36\xc3\xe9\x17\xbe\x23\xea\x65\x0f\x41\x42\xf1\x85\x08\x92\xf4\xc9\x4f\x64\x2b\xef\x31\x07\xb3\x87\xa2\x6a\x97\x78\x21\x8b\x32\x1b\xee\xda\x43\xc8\x77\x96\x8a\x01\x4f\xa5\x93\x0e\xad\x70\xc6\xde\x93\x03\x17\x7d\x07\x78\x98\xd7\x35\x25\x3c\xba\x38\xfd\xf4\xa4\x8b\x87\x72\x97\xdc\x2a\xf7\xa9\x54\x6c\x49\xbe\xa3\x59\xb6\xa2\xc9\xdd\xad\x7c\x2b\x37\xfa\xbd\x78\xa3\xd4\xa0\x1a\xd0\x9a\x77\x46\x2d\x5f\xde\x96\xe2\xae\xdd\x6a\x21\x93\x1b\xab\xc7\x15\xa5\xf1\x11\x2b\x8d\x55\x0d\x00\xf6\x33\x85\x33\x5e\x09\x01\xea\x7a\xd9\xd4\xb0\xd9\x03\xd0\x15\x04\x3c\x51\x41\x98\x9d\xeb\x10\xa6\x2d\x45\x37\xe7\xa2\x9b\x64\xf9\xed\x37\x7f\xf8\x37\x24\x7d\x7b\xbb\xf8\xb7\x6f\xc0\xf9\xaf\x4f\x91\xb9\x58\xce\x38\xcc\xa1\x75\x4e\xb3\xcc\x5e\x24\x9a\x44\x6d\xb7\x75\x19\xdb\xbb\x69\x8c\x5a\x4d\x0c\x61\x46\x2b\x77\xb7\xb7\x7f\x0b\x68\x76\xdc\x68\x96\xad\x4f\x31\xf6\xae\xca\xb7\x3d\x01\x41\x71\xe2\x78\x97\x95\xea\x5d\xd1\xf0\x38\x35\x6b\x27\xb3\x32\x67\x17\x0c\x9a\xae\x44\x2c\xb3\xf5\xbe\x8f\xd8\xc8\x5c\x7f\xb4\x55\x26\x93\x3b\x92\xba\x1f\x61\xb2\x03\xcb\x04\xaf\x95\x0b\xe9\x69\xdc\x05\xab\x28\x20\x08\xc0\xf3\x91\x3c\x4f\xed\xb8\xd5\x9c\x73\xcb\xdf\x96\xd3\xa2\x80\x46\x63\x6b\x48\x10\xba\xc7\x05\x04\xee\x58\x00\xc1\x75\xd2\xa1\xc7\xe9\xbe\x85\x40\x87\x05\x72\xcf\x7a\xea\x4f\xfc\x06\x14\xf0\xdf\x18\x2f\x32\x21\xb5\x8e\xd4\x61\x7b\xd5\xda\x50\x62\x58\xcc\xc0\xc9\x7c\x72\x1f\x9e\x49\x7d\x8f\xc0\xac\xd0\xe8\xf4\xd4\x8c\x57\xa6\xa4\x60\x4a\x43\x73\x38\xf3\x11\x76\xf4\x75\x46\x79\x28\xa3\x8b\x90\xba\xe1\xd1\xd3\x96\x31\xde\x81\xa7\xde\x93\xc1\x57\x02\xde\xbe\x27\xf6\xe6\x41\x02\x87\x64\xfc\x98\x33\x7c\x2d\x53\xf7\x09\x1c\x52\x2c\x5c\xd0\xa3\x6a\xe9\x88\xdc\xf7\xa3\xb7\xc7\xfb\x58\xaf\xa5\x7d\x56\xed\x5f\xaa\xc3\x8a\x6f\xb9\xa3\x38\xb8\xb7\x47\x3a\xa2\x30\xf4\xa4\x13\x0a\x67\xb3\xd1\x71\xab\x96\x07\x2d\x15\x1a\x37\x21\x48\xc1\xb5\x2a\xe3\x74\xe2\x25\x41\x9b\xb6\xc5\xba\x03\x4b\x4e\x5e\x9d\x3c\xf9\x9c\xe2\x22\x95\x2c\xe8\x66\xa4\x74\xd4\xc1\x5a\x0f\x3f\x24\x29\x43\x05\x83\x69\x50\xd2\xe0\x77\x70\x1b\x05\x17\x5a\x38\x08\xbe\xb3\x93\xf7\xf1\x39\x33\xad\x47\x9f\x53\x41\x30\x38\xf8\x3e\xe8\xc5\x26\x84\x2a\x59\x8a\xd4\xdd\xcf\x2b\x43\xc8\xbb\x83\x09\x5f\x49\x01\x4a\x0e\xe6\x20\x05\xc2\x56\xf1\x69\xc5\x88\x5b\x0e\xf3\x72\xf9\xf2\x9b\x5f\x96\x4d\xde\x1e\x34\xc4\xb3\x18\xb9\xaa\xd8\x24\x9e\x8d\x27\xcf\xc8\x17\xd8\x88\x9e\xd5\x3b\x77\x69\xab\xeb\x67\x70\x5f\x55\x00\xfe\x64\x2f\x63\x2c\xaa\x14\x1e\x21\xcf\x41\xa5\xb1\xba\x60\x23\x2b\xe1\xc5\xa4\x32\x30\x71\x69\xed\xf6\x7e\xb7\x7a\xd2\xd9\xc6\x43\x8c\x44\xdb\x77\x17\x0e\x53\x93\xfb\xba\xe7\x98\xb7\xba\xc8\x3d\x23\xcf\xf1\xcd\x13\x0d\xb1\xa8\x2f\x9e\xbc\xbd\x6e\xd9\x6f\x1e\x8a\x60\x1e\x65\x6b\xe9\x6f\x1e\x0a\x0a\x77\xe8\x62\x0c\x07\x23\x4a\x47\x5b\xca\x0c\xe3\xe0\xcf\x6c\x4b\x77\x0c\xe2\x64\x79\x46\xd5\x60\x26\x81\x83\x2b\xc9\x0d\xae\x0a\x9a\xdd\x32\xb1\xe3\x4a\x0a\xf0\x53\xed\xa8\xe2\x90\x53\x04\xad\x08\x99\xb0\xfa\xe9\xef\x9e\x7f\x3c\xff\x00\xfe\x81\x70\xb6\x1b\xe6\x1e\xb8\x95\x97\x1a\x62\x10\x0e\x56\xd0\x18\xaa\xde\xb8\xb1\xb9\xf6\x6c\xaa\x9f\xbf\xdd\x15\xe0\x75\x7e\x3d\x76\x0e\x79\x69\x4a\x3a\x9c\x4d\x81\x0f\x7b\x48\xb2\x52\xf3\xdd\x53\xcf\xff\xb8\xc6\x53\x49\xc5\xcf\xa0\xf0\xb8\x90\xee\x0b\x3e\x40\xbb\xfd\x0d\x77\x4f\x74\x37\x16\x1c\xcc\x7a\x42\x9a\xf1\xae\xa7\xbd\xc6\xe5\x13\x5d\xd5\xc6\x69\xa6\xb2\xba\x8b\xab\x4b\xb9\x18\xbc\x05\x55\x75\x21\xd3\xae\xd9\x1d\xf2\xb3\x8e\x73\x85\x1d\xde\xcb\x81\x3d\x0a\xec\xce\xd0\xbe\xb8\xe4\xa7\xd7\x32\x2f\xd0\xed\x7c\x38\x58\x6b\x4b\x2e\xf0\x6d\x2b\xf4\x73\x7b\x6d\x2e\x31\x67\x07\xbf\x3c\x5c\xe1\x30\x1b\xc7\xdc\x90\xf3\x34\xe7\xe2\xfc\xfa\x32\x38\xe2\xc9\x1b\xcc\x29\x74\x4e\x4a\xcc\xbb\xf1\x63\xdf\xb3\x15\x64\xd4\x0a\x72\x7e\x7d\x19\x0e\x2e\xa8\xb3\xcf\xe4\x9a\xfc\x0c\x22\xe8\xe7\x25\xf9\xf1\xfc\xc3\xd5\xe5\xd5\xf7\xaf\x08\x8c\xe2\x39\x44\x05\x52\xbb\x99\x5a\xa1\x6d\xa8\xe9\xdb\xa3\xaa\x81\xe5\xa9\x9d\x5b\xca\x32\x66\x18\xd8\xc4\x4f\x89\xde\x96\x26\x95\xf7\x82\x5c\x57\x33\x3e\xc5\xac\x34\xa9\xd8\xb2\x1a\xb2\x67\xaa\x5c\x37\x98\x6a\x6a\xd5\x1c\xb0\xd4\x24\x96\x9b\x78\x4d\xaa\xf4\x99\xf1\xe9\x8e\xbb\x8c\x24\x9a\xa6\x8d\x62\xbf\x1d\xb8\xb4\x34\x5b\x26\x0c\x4f\x5c\x77\xf2\xd2\x6c\xa5\xe2\xff\xc0\x7f\xed\x38\xb5\x37\x35\x25\x1f\xf6\x8d\x12\x40\xa0\x0d\xa0\x49\x5f\x57\x1f\xf4\x04\x1f\xb5\x23\x68\xb4\x4f\x4d\xc1\x92\xa2\xa9\x24\x5a\x2e\xc9\x77\x52\x61\x61\xd1\x66\x8b\x74\xcd\x58\xe5\x58\xac\x37\xb6\x72\x2c\xd6\x7f\x3a\xcb\xa8\x61\xda\x9c\xfd\xbd\x64\x6a\xcf\xc5\xe6\x8c\x16\xfc\xec\x6b\xa3\xd3\xd5\x02\xb6\x6b\x41\x0b\xde\xf1\x28\x86\x28\x70\x2d\x55\xc2\x52\xab\x7d\xe9\x82\x26\xec\x2d\x5d\x75\x8b\x5f\xb4\x85\x68\xef\x27\x1e\x92\x06\xcc\x43\xac\x86\xf0\x2f\x60\x99\x82\x0e\xb2\xe4\x9a\x48\xc5\x37\x5c\xd4\xa5\x4a\x68\xc6\x14\xe6\xc9\xe7\xcc\x28\x9e\x54\x65\x89\x61\x97\x13\x4c\xad\x40\xe3\x72\x3f\x4c\x24\xed\xa6\xcb\x6f\xc5\xaa\x5b\x38\x4e\xc6\xd9\x17\x90\x3b\x54\x03\x40\xb3\xf7\x6a\x84\x5e\xfc\xf5\x70\x27\x66\xc7\x83\x1d\xbc\x14\x86\xa9\x1d\x0d\xa3\xce\xbf\x64\x55\xef\x7b\xc6\x44\x2b\xea\xa8\x86\xd5\x09\xd7\x1e\x1e\xdf\x75\xe5\x86\x2d\xe8\xdc\x00\xe3\x0a\x5e\x07\x58\x6f\x27\xf4\x18\x90\xee\x2b\xa8\x62\xc5\xe7\xbd\xf3\x5b\x31\xc5\xd1\xf8\x09\x7b\xe8\x2a\xc8\x26\x32\xcf\x4b\x01\x27\xad\xe7\x80\xc3\x61\xae\x1a\x8b\xe3\x3d\x5d\x93\xe7\x6b\x96\xba\x24\xbc\x53\x68\x96\x6b\x18\xd1\x46\x2a\xba\x61\xa7\xe4\xdc\x02\xc7\x42\xd0\xaa\xa3\x43\x0e\xb2\x7d\x3f\xc6\x0f\x2a\xbc\x3f\xb7\xcd\x46\xe7\x3f\x7c\x78\xeb\xeb\x04\x7a\x3e\xcb\x85\x36\x14\x74\xaf\xaa\x21\xff\x8e\xf2\xcc\xb2\xc6\xce\xe2\x4a\x91\x36\x2d\x82\x82\x59\xbe\x4d\x15\x70\x95\x0d\x13\x76\x85\x56\x5c\x2a\x2b\xc7\xed\x58\xba\xe7\xdd\x0e\x50\xbe\x6e\x4d\xc7\x7b\xc7\x55\xd5\x4f\x18\xf2\xbc\xe0\x16\x75\x71\x75\x83\xbd\xad\x63\x69\x89\x6f\x84\x54\xac\x3a\xd5\x37\x2c\x03\x0d\xa3\x43\x31\x6d\x8a\x1e\xf8\xc8\xce\xb4\xe1\xc3\x45\x7c\xe1\x08\xa4\xf3\x76\x67\x99\x55\x95\x8f\xea\x26\x5d\xc8\x34\x97\x82\x1b\x89\x6a\xa5\x6b\x9b\xec\xff\x84\x7a\x88\x93\x2a\x66\xcb\xba\x88\x83\xf1\x81\x8b\x83\x47\x76\xc7\x54\xa3\xe5\x72\x7d\x11\xe0\x8a\x24\xa5\x82\x24\xd6\x8a\x61\x2c\xc9\xb0\x46\x3c\x74\x8b\x1b\x66\xb8\xa0\x16\x85\x51\x0a\x89\xed\xbc\x91\x4e\x0c\x3e\xfc\x3a\xd7\x9b\xc0\xf4\x57\x54\x33\x78\xf5\x94\x18\xba\xe9\x75\x5b\xeb\x2d\xb5\x27\x70\xe5\x7c\x25\x7a\x49\x6e\x00\xe4\xde\x0b\xf8\x1d\x53\x1a\x22\xec\x34\xd1\x06\x9d\xb8\x0d\x2a\x45\xd9\xd7\xab\x41\x34\x88\xf0\x3d\x64\xcc\x4a\x45\xee\x84\xbc\xb7\xc7\x9e\x9a\x0a\xae\x3c\x24\x57\xe0\xb2\x1d\x88\xb5\x1a\x19\x4f\xac\x76\xe5\xd7\x65\x96\xdd\xb0\x44\xb1\xae\xd5\xb0\x5d\xdd\x58\xb8\x2a\x2f\x34\xab\x4c\xfd\x8d\x7b\x14\x64\xdb\x00\x14\xaf\xc5\x6a\x9a\x37\x24\x46\xdf\xae\xfb\xb8\xee\xa2\xcc\x40\x5d\x6a\x28\x63\x10\x14\xd0\x60\x53\x38\x57\x47\xcb\x8a\x6d\xb8\x5d\x4e\x4f\xd4\x92\x57\x01\xfa\x43\x8b\xac\x00\x5c\x6c\x4a\x9e\xb2\x33\x84\xf7\xb5\xae\xf6\x72\x01\x7f\xb1\x53\x71\xeb\x58\x48\xb1\xa0\x8b\xae\xd5\x78\xc0\x8a\xd9\xae\x66\x25\x13\x9a\xbd\x07\x1e\xfa\xc1\xe3\xc8\xab\xf5\x56\x0f\x94\xe5\x66\xdb\x52\x5d\x8c\x24\x59\x6f\x01\xcd\xbd\x2c\x89\xf3\x1a\x61\x1a\x93\x83\x96\x7a\xd9\xeb\x0c\xfe\x5d\x8c\x77\xef\x08\x61\x33\xe7\xb0\xf1\xe9\x20\xac\xac\x11\xf5\xe7\xa6\x63\x26\x47\x80\xdb\xd3\xb7\xe3\xec\xfe\xcc\xdd\xc5\x16\x96\x7d\x2c\x70\x49\xfa\x0c\xd6\x70\xf6\x35\xfc\xcf\xc0\xad\x09\x63\x50\xcf\xd3\xd4\x59\x01\x4b\xcd\xd6\x65\x86\x76\x39\xbd\x24\xb4\xe0\x1f\xf1\xfc\x9c\x92\x3b\x2e\xd2\x53\x52\xf2\xf4\xdf\x1f\xe1\xa7\x7e\xc4\x2d\x88\x0b\x6e\xaa\xeb\x66\xf8\x50\x9d\x5c\xb6\xde\xf5\x99\x67\x4e\xfb\x6b\x03\x6a\x04\x9d\xf6\x10\xdf\x1a\xa2\xf1\x31\xe5\x5e\x6a\x06\xba\x72\xa3\xbe\x00\x5b\x6e\x96\x64\xcd\x4c\xb2\xad\x8e\xa9\x3d\x79\x5c\xd8\x75\xf5\xb9\x80\x2b\x4f\xc0\x75\xf3\x76\xd6\xe8\x24\x81\x47\xb1\x56\x3c\xb0\x8d\xc4\x92\x9c\x8b\x3d\xba\x80\xbb\x3b\xe7\x6a\x05\x40\xed\x13\x48\xe7\x76\xec\x8d\x8a\xf6\x52\x51\xd0\x64\x8c\xa2\x76\xe4\xc3\x6f\x88\xec\x16\x5f\x74\x75\x1b\x9e\x9a\x81\x60\x87\xaf\x5b\x32\xe8\x6e\xbb\x87\x1f\x74\xcf\x86\x40\xcb\x10\xb1\x07\x3e\x96\x50\xed\x0d\xd2\x10\xe2\x84\x58\x46\x94\xc3\xa7\x5d\x74\xd8\xeb\x93\x62\xd9\x9e\xc8\xd2\xd4\x67\x38\x91\x58\x4e\xfa\xde\x3b\xe5\x72\xca\xdb\xb1\x1c\x2e\x10\xbb\x57\x5a\xad\xf6\x24\x95\x90\x9e\x2b\x4f\x81\x77\x60\x64\x95\x77\xf1\x81\xf4\xd8\xd2\x1d\x97\xa5\xc2\x7a\x26\x8a\xd1\x3b\x42\x4d\xa5\x83\xf6\xea\x97\xb2\x04\x57\x03\x4f\x58\x27\xd4\x23\x86\x1b\x9e\x57\xa1\x72\x45\x91\xf9\x1b\x63\x6d\xe4\x80\xb9\xd9\xb9\xfa\x14\x54\xdf\xd3\xa3\xd7\xa9\x43\xed\x01\x98\xca\xdb\xa8\xda\x44\xb5\x5a\x3a\x57\x9b\x32\x87\xfb\xa9\xa3\xfe\xba\x46\x8f\x2b\xd0\x2d\x93\x3b\x2f\x8d\x86\xa3\x90\x5e\xbf\xbb\xf0\xbe\x04\x0c\xb7\xa8\xa3\x30\x5d\xa1\x8f\x74\x49\x3e\x3e\xca\x1a\x39\x6a\x87\x3c\x34\x44\x5e\x5a\x3d\xd6\x5b\x3e\x87\x4c\x50\x95\x7d\x49\x31\x2d\xb3\x9d\x2f\xeb\x56\xcd\xcc\xcb\x74\x2e\x8a\xd2\x38\x56\xe9\xd5\xf7\x01\x98\xa5\x48\xb6\x54\x6c\xfc\x4d\xb3\xb1\x32\xa2\xf7\xc2\xd0\x07\xcf\xa2\x98\x4e\x68\x51\xc5\x8f\x90\x54\x96\xc3\x13\xfd\xdd\xef\x4e\x09\x67\xaf\xc8\xef\x1a\xe0\x96\xe4\x8d\x83\xd0\x40\x64\x23\x9a\x6e\x55\x23\x6c\xc8\xaa\xa7\xd8\x86\xaa\x34\x83\xc0\xf5\x75\xd5\xe5\x04\xad\x3c\x6e\x93\xd8\x03\xd7\x06\xae\x66\x42\x9a\x86\x45\x6e\x68\xf5\xd3\xba\x6c\x61\x87\x18\xe4\xc6\x8b\x94\x1a\xba\x68\x1c\x95\x33\xec\xff\xb3\x70\x05\x25\x16\xd4\x11\x69\xa3\x87\xcc\xd7\xae\xfb\xc6\x82\x56\x6f\x71\xab\xbd\x40\x01\x86\x7e\xa9\x17\x74\xc6\x8e\xda\x86\xc3\x96\xd9\x60\xf5\x8f\x43\x8b\x5c\x55\x0e\x18\xa0\x2d\xc9\x95\x34\x75\x95\x9f\x2a\xcc\xc2\x95\x92\xb8\x1d\x0c\xa6\x3b\x38\x99\xe4\xcd\xd5\xed\x87\xbf\x5d\xbf\xbf\xbc\xba\x1d\x3d\x8a\x03\x10\x47\x0e\x68\xcc\x51\x1c\x80\x3c\x7c\x40\xc7\x8f\xe2\x00\xc8\xc0\x01\x1d\x3f\x8a\xc3\x6c\x61\xf0\x80\x46\x1f\xc5\x01\xd8\x03\x07\x34\xfe\x28\x0e\xc0\xed\x1c\xd0\xdf\xf8\x51\x64\x62\x17\x71\x0c\xdf\xba\x0b\x5d\x9f\xb7\xec\xb0\x92\xc2\x68\x34\xc5\xd1\xa3\x41\xde\x88\xdd\x47\xaa\xea\x3e\x2d\x10\x86\xdb\xeb\xd8\x73\x2f\x0c\x7a\xbd\x80\x95\xbc\x3e\x46\x38\xc8\x24\x57\x7d\xf3\xca\xd4\x37\xef\x3a\x43\x31\xd4\x59\x8b\x90\xd7\x3f\x5d\x5e\xbc\xb9\xba\xbd\xfc\xee\xf2\xcd\x87\x27\xfb\x7e\x47\x6b\x27\xb4\x19\xf5\x14\x6e\x18\x5c\x44\xcd\x29\x0b\xc5\xac\x26\xaa\x89\x6f\x70\xd7\x4f\x7e\x7c\x3c\x97\xac\x1d\x1b\x62\x75\x59\x67\xdc\xea\x07\x89\x4c\x37\x08\x31\x9e\x21\xb7\x58\x6f\x10\xe6\x54\xb6\xec\x18\x70\xd8\xd5\xfb\x29\x98\x33\x3e\x8f\x67\xd1\xe1\x19\xb7\x35\xa9\x76\x84\x43\x30\x97\x32\x9e\xac\xbf\x53\x32\xd0\x05\xe6\xb0\xd0\x00\x5c\x5d\xab\x34\xe5\x3e\x8a\x39\xd1\xae\xf9\x62\xf8\x78\xd6\x8c\xcf\xa9\x1b\x55\x5e\x9c\xfd\x3b\xc4\x4f\x87\x20\xc4\xd6\x64\xc1\x7b\xf8\x3b\x5a\xfc\x95\xed\x3f\xb0\x91\x94\xd0\xc3\xc5\x82\xb9\x58\x13\x4a\xee\xd8\x1e\x8d\xdc\xaf\x3d\xb8\xb1\x4a\x0a\x53\x6a\xc6\xdc\xb1\x60\xcc\x50\xef\xdc\xec\x29\xb0\xb3\x02\x79\x63\xa7\x39\x36\x21\x32\xb5\x5e\xcc\xa3\x2a\xd9\x7c\x21\x16\xaf\xf6\x33\xd5\xfe\x15\x05\x74\xd8\x46\xd6\x7e\x26\xe1\xdc\x5b\x8d\x27\xe3\xdd\xd9\xd9\x5b\x1c\xa6\xa2\x55\xcb\x3f\xf8\x68\x9e\x36\x3e\x96\xa6\x7c\x56\xb0\x13\x35\xd1\x8b\x1c\x0b\x1c\xc3\x27\xbe\xda\xcf\x5d\x8f\x5f\xa5\x6f\xdc\x88\x32\x3e\xb0\xd7\x53\xcf\xff\x49\xcd\x00\x30\x86\xb1\xca\xdf\x4e\x5f\x79\xcb\x92\xae\x2a\x02\x2f\x2d\x41\x8e\xd3\x4e\xeb\x75\x30\x3e\x9f\xd6\x7f\x43\x77\x67\xe3\x0f\xc0\x25\xd1\x99\x32\x0e\x5a\x17\x2c\x59\x0a\x99\x82\x7b\xec\x14\xff\xe9\x64\xfb\x79\x92\xc8\x52\x18\xf7\x03\x64\xd7\x2c\xb7\x52\x9b\xcb\xeb\x08\xb0\xf8\x7a\x21\xd3\xcb\xeb\xd3\xd6\xbf\xf4\x48\x3a\xff\x34\x36\x58\x9f\xc3\xc9\xe4\xff\xb1\xf6\xff\xa0\x61\x70\xcb\x72\x0a\xff\xf9\x9d\xdd\xb8\x40\xd0\x55\xfb\xe1\xba\xce\x80\x13\x90\xf6\x63\xe5\x76\xbb\x66\xdc\xb3\xdd\xcb\x67\x47\x67\xb6\x6b\x3f\xcd\xc9\x4b\x87\x68\x37\x5f\xe3\x14\xa8\xb4\x12\x09\x31\xda\xa0\x7f\x6a\xdf\xdf\xf9\xf5\xa5\xf7\xa7\x1d\x79\x99\xf1\x27\x7f\x1d\xb9\x6b\xd1\xe7\xdf\xf7\x6e\xfe\xee\x89\x7c\xc0\xc3\xe9\x24\x8d\xbc\x02\x67\xef\x28\xbe\xea\x26\xdb\xd8\xba\xdd\xa5\xdb\xba\x16\xdb\xcf\xf1\x8f\xcb\xa4\x28\x4f\xdd\x0b\xcb\x9c\xe5\x52\xed\xc7\x4f\xa9\x7b\x9d\x15\x5b\x96\x33\x45\xb3\x45\x15\xc2\xe0\xc1\x23\xd8\xea\x5f\x08\x78\xfc\x54\x36\x26\xd8\x85\x8e\x77\x19\xe7\xc2\xce\xf6\x75\xe1\x93\xa3\x72\x86\x0a\xcb\xe3\x85\xe5\xf1\x69\x6f\x5f\xed\x2c\x01\x9d\xa6\xa2\x43\x50\x63\x5d\x5e\x47\x9c\xd0\xaf\xbc\xba\x10\x40\x24\x76\x56\xe9\x0d\x94\x53\xa8\x9f\x49\xcc\x20\xe5\x3b\xae\xe5\x48\xb7\x96\x9e\x85\xde\xb4\xca\x70\xba\xb4\x41\xf4\x9b\xc6\xf5\x2f\xc0\x87\x3d\x14\x90\xf6\x5d\xd1\xea\x01\xff\x7b\xf9\xec\xd8\x0b\xf6\x23\x4d\xdf\xda\x0f\x9e\xa5\xd4\x27\xb3\x62\x7f\x47\xde\x97\x78\xee\xe5\xa7\x72\x2c\xe6\x85\xfe\xb1\xe3\x5c\x60\x9c\xaf\xad\xce\xf3\x1a\x09\xb7\x27\xee\x26\xd0\x1f\x98\xd0\x7e\x7e\xa9\x3b\x8f\x97\xf2\xb8\x94\x5a\xdc\xad\x95\xcc\x5d\xb6\x4f\x14\xa1\xaf\x18\x58\x93\x33\x9e\x7a\x58\x77\x6c\xa4\xfe\x31\x3e\xf3\x3d\xea\xb7\x74\x8f\xc2\x88\x1f\x77\x89\x8a\xb8\x94\xe0\xf3\xab\xbb\x44\x45\xbc\x36\x9e\x03\xf1\xe9\x32\x1c\x98\xd8\x0d\x5b\xb2\x7a\x0d\xf8\x5e\x13\x6b\x14\x27\xe8\x37\x81\x86\xdd\x48\xad\x6c\x6c\x60\x50\xb5\x91\xb6\x76\xc9\xa1\x6c\xca\x47\x4c\xd7\x2d\xa3\x35\x39\x87\x82\xf4\xc8\xa0\x00\xac\xb7\x86\x2a\xe6\xaa\xcb\x61\x95\x0d\xb6\x1b\xb6\xe3\x43\x54\xec\x41\xa2\x84\xab\x65\xc9\xc5\xc6\x65\xfa\xa1\x7c\x70\xc6\x46\x2e\xaa\x62\x3a\x03\x30\x2b\xb5\xa0\x8e\xed\xa7\x5a\xcb\x04\x0a\x5c\xd6\xcd\x5c\xa0\xbe\x82\x5b\x38\xcc\xdc\xd0\xbb\x21\x90\xcd\xc6\x32\x1f\x2d\xc4\x1a\x87\xab\x3d\x14\x77\x11\xbb\xca\x6e\x5b\xa2\x8f\x09\x85\x41\xa0\x0b\x09\x74\xee\x68\x42\xfe\x14\xde\x16\x4b\x74\xce\x2a\xda\x70\xba\x80\x7c\xaa\x6e\x0a\x14\x7c\x42\x3d\x21\x39\xfe\xa9\x4c\x35\x43\xb4\x16\x23\x5a\x2b\x53\xe7\x88\x9a\xd0\x91\xa9\xb5\xa1\xa8\x2d\x4b\x8f\x60\x7e\x8d\x11\x7e\x5f\xb6\xe0\x3b\x62\xf0\x5c\xfd\x44\x0b\xb3\x58\x41\x36\xc1\x18\x38\x4d\x30\xc5\x0a\xa5\x28\x21\x52\x28\xb6\xe6\x0f\xd1\xb4\xd9\x0c\xa3\xe5\xd0\x53\x6d\xcd\xa1\xcc\xbb\x05\x54\x30\x81\xd1\x7a\x34\xd9\x8e\x0a\x39\xc7\xaa\x6b\xeb\x7d\xed\x44\x3c\xae\xa3\x10\xf5\xc8\xa9\x07\xf0\xa6\x4f\x93\x9d\x4f\xdf\xaf\xe7\xf4\xb9\x0d\xfe\x6c\x47\xef\x89\xba\x55\x6f\x0e\x41\xcf\xd2\x4f\x2e\x1a\x81\x45\x98\x0c\x32\x95\x76\x1a\x81\xa5\x18\x76\x3e\xb0\xa2\x76\xf7\xb9\x8a\x4d\x60\x77\x56\x79\x4f\xb6\x7c\x63\x91\x8f\x1d\xe9\x50\x32\x12\x8c\x8f\xcf\x87\x95\x25\x48\x24\xc4\xe4\x54\xa9\x20\xeb\x41\xf1\xb4\x93\x63\x0a\x2a\x92\x0f\x8a\x85\x1f\x95\xcc\xb2\xe1\xae\x1f\x19\xbf\x63\xe4\x82\x15\x99\xdc\xe7\x2e\x22\x23\x25\x37\x86\x1a\x4b\xca\x37\xcc\x0c\x59\xd1\x47\xc8\xb4\xca\x48\x88\x2e\x05\x76\x82\x99\x1e\x45\x99\x65\xa4\x80\x8f\x96\xd0\x2e\x4b\xae\xc9\x39\xe4\xae\x9d\x92\x2b\xb6\x63\xea\x94\x5c\xae\xaf\xa4\xb9\x46\x65\x66\x88\x27\x36\x9d\xd1\xf8\x39\xe1\x6b\xf2\x0a\xd3\x05\x21\x45\x84\xeb\x66\x87\x3a\xa9\x5a\x60\x07\xa0\x56\xd5\x0e\x9e\x10\x96\x34\x4c\x4c\x5f\x03\xa4\x2a\x83\x61\xc0\x74\x37\x82\xf8\xaa\xb0\x6a\x04\xca\xcf\x5d\x3a\xa6\xa9\x23\x94\x3d\x0d\xba\xfc\x33\x9f\x70\x0a\xca\xea\x60\x69\x16\xc5\x74\x21\x85\x66\xed\xe2\x1e\x75\x89\x68\xb8\x02\xe8\x68\x0d\x77\x5c\x80\x14\x52\x1b\x68\x1d\x17\x5b\x41\xf7\xda\x7f\x00\xb5\x24\x69\x96\xb1\x94\xf0\x3c\x67\xa9\xbd\x15\x64\x7b\x57\x1f\x94\x46\x95\x59\xb2\x10\x7c\xea\xe5\x25\x0a\xa3\x2d\x15\x69\xc6\x54\xb3\x07\x61\xeb\x46\xe3\x4b\xb4\x05\xb9\x2a\xda\xb2\x5d\x7d\x4a\x42\x93\x44\xaa\xd4\x75\x48\xb0\x57\x7b\x1f\x3b\x5f\x9d\x0d\xe0\xdf\xa3\x5c\x83\xf4\xb5\x1d\x85\xc2\x58\xba\x51\x3a\x13\xba\x0a\x57\x7d\x16\x8f\x58\xfa\xb7\x41\xe4\x75\xa1\xdf\x8a\x32\x16\x50\x98\xfc\xac\x51\x03\x18\xfe\xf0\xd4\x72\xe2\xe1\x86\x7c\xe4\xb1\x4d\xf9\x46\x24\x62\xab\x65\xdf\x53\x1a\xf3\xc5\x2f\x94\xc4\x36\xe8\xeb\xac\x39\xae\x49\x5f\x84\x5d\xa8\x91\xb5\x14\xd3\xa8\x2f\xc6\xd2\xd4\x6e\xe5\x17\xdf\xac\x2f\x02\x76\xa3\x9d\x5f\x64\xc3\xbe\x08\xa0\x03\x2d\xfd\x06\x9b\xf6\x45\x80\x1c\x6b\xeb\x37\xd0\xb8\x2f\x02\x72\xa8\xb5\xdf\x40\xf3\xbe\x18\x14\x04\xda\xfb\x4d\x68\xe0\x47\x62\xdb\x6f\x91\xa9\x36\xd7\xb8\x4e\x49\xd1\xe6\xc6\xd1\x4e\x74\xe4\x13\x75\xa3\x23\x93\x78\xc3\x78\x5f\x85\xee\x3c\x23\x3a\xd3\x45\x1e\xe2\x4f\xd2\x9d\x8e\xc4\x76\xa8\x23\xd3\x48\x24\xba\x53\x1d\x79\x54\xb7\xba\x88\x55\x41\x87\xad\x47\x75\xac\x23\x53\x8e\xcd\xe4\xce\x75\x51\x0e\x05\x2c\x65\x3a\xbd\x7b\x1d\x99\xe8\x99\x23\x13\x7c\x56\xe4\x58\x9d\xec\xc8\x54\x6e\x43\xa6\x74\xb4\x1b\x9f\x66\x6c\x57\xbb\x47\xcc\x33\xd6\x55\x43\x62\x3b\xdc\x91\xe8\x2e\x77\x64\x8a\x97\x99\x4c\xe0\xe1\x31\x1d\xef\xc8\x91\xbb\xde\x91\x69\xa8\x1f\xef\x11\x43\xe2\xfa\xc4\x90\x89\xbd\x62\xc8\xb4\x7e\x31\xe4\x31\xdd\xf0\x22\xf6\x5d\x76\xbc\x53\xc1\xbe\x31\x31\x94\xd4\xea\x2c\xf3\xc8\xde\x31\xe4\x69\x9d\xf1\x48\x64\x77\x3c\xf2\xa9\x3a\xe4\x91\xc9\x5d\xf2\xc8\x14\xba\x8d\x63\x16\x23\x5d\x72\xc8\x04\xa7\xee\x78\xe7\x2c\xf2\xd8\xee\x59\x23\x58\x81\xde\x5a\xd3\x3b\x68\x8d\x42\xad\xfa\x6b\x4d\xea\xa2\x45\x3e\xb5\xd6\x77\xc4\x8e\x5a\x64\x62\x57\x2d\xf2\x5b\xe1\x9c\x11\xdd\xb6\x7e\xc3\x9c\xf3\x97\xe5\x2d\x11\x2f\x15\x8a\xdd\x18\x59\x44\x5b\x18\xf1\xf5\x01\xfb\xa2\x6b\xbe\x19\x6d\x60\xac\x0d\x86\x24\x2d\x19\x96\x16\x83\xd8\x67\x7f\x57\x94\x4d\xd3\x5f\x30\xc6\x82\x34\x9a\x9e\xf8\x86\x89\x67\xae\x59\xa2\xeb\x1b\xe6\xba\x55\x9c\xda\x35\xb3\xbc\xf0\xb5\xc6\x46\xe3\x04\x5d\x6f\x0d\x78\x9d\x99\x04\x43\x4c\xbc\x2d\xd4\x59\x52\x3c\x32\xe2\xcb\xd8\x27\x8a\xea\x2d\x16\x4f\x63\x0f\xdc\xb8\xee\x29\x8a\x51\x2d\xb1\x36\x5e\xb3\x47\x08\xd7\xa4\xa0\x1a\x6b\xa3\x84\x24\x49\x3d\x31\x04\x77\x2d\xd3\x93\x13\xdd\x02\xb5\x51\x34\x61\xae\x81\x28\x81\x84\x84\x54\xde\x87\x5c\x5b\x2b\xb6\xe1\x42\xfb\xbd\xc5\x12\x2b\x48\x04\x96\x9b\x33\xb0\x30\xf9\xfc\xf7\x25\xf9\x50\x25\xdb\x8d\x5b\x6a\x65\x69\x12\x59\x33\x09\x37\xf3\x43\xc3\x32\x84\xad\xc0\xd6\x8f\x15\x92\xad\xc8\xa9\x59\xe5\x77\x04\x05\xce\xc2\x1c\x80\xda\x20\xc0\xa9\x16\xe6\x10\x0a\x54\xe3\xab\xc1\xfd\x81\x5e\x4e\x34\xd9\xb6\xfd\x2e\xb3\xb1\x7a\x36\x56\x87\x9e\xd9\x58\x3d\x1b\xab\x67\x63\x75\xef\x33\x1b\xab\x67\x63\xf5\x6c\xac\x1e\xff\x76\x36\x56\xcf\xc6\xea\xd9\x58\xdd\xf3\x7c\x89\x26\x97\xd9\x58\x1d\xfe\x7c\x36\x56\xcf\xc6\xea\x00\xd4\xd9\x58\xdd\xfb\xfe\x6f\x81\x73\xce\xc6\xea\xd0\xc7\x5f\x98\xb1\x7a\xe4\x05\x6f\xf5\xbd\xb6\x3a\x6e\x4c\x24\xf6\x35\xd8\xd8\x78\xe2\xcc\xc3\xed\xfe\xc3\x0e\xd8\xb2\xae\xbe\x37\x30\xf1\x3a\x1f\xd0\xc7\xb4\x3a\x23\x70\x6d\x74\xee\x8d\x09\x06\x7b\xde\x00\xcc\x47\xd7\x85\x2e\x64\x5a\x5b\xf2\x1a\x26\x3c\xd4\xfb\xfb\x0f\xfd\x38\x13\x0b\xdb\xee\x1e\x65\xb7\x6b\x5b\xe6\x02\xc4\xf3\x04\x9b\x5d\x1c\x77\x8e\xb2\xd5\x3d\xc2\x4e\x17\x67\xab\x8a\xb5\xd1\x1d\x5a\xe0\x46\xc0\x46\xdb\xe7\x9a\xd6\xb7\x11\x98\x71\xb6\xb9\x21\xcb\xdb\x98\x8a\x36\x60\x97\x1b\xb5\xba\x8d\xc0\xed\xb7\xc9\x05\x2d\x6e\x63\x33\xed\xb5\xc7\x05\xad\x6d\xe3\x88\x8d\xb4\xc5\x45\x19\x14\xa2\xc5\x61\xcc\xdd\x2d\x82\x73\x3b\xb7\xda\xed\x56\x31\xbd\x95\x59\xe0\x24\xb5\x1b\x6f\x72\xc1\xf3\x32\x6f\x75\x43\x72\xa0\x74\x45\xf1\xc8\x43\x83\xd6\xad\x15\xd0\xb6\x25\x3d\xa8\x26\x43\x79\x66\x77\x03\x12\x1d\xb6\x74\x07\x1c\xa7\x4c\x12\xc6\xd2\x83\xf6\x94\x01\x90\xbf\x5f\x56\xb3\xab\x0a\x22\xbe\x1c\xde\x19\xac\xee\x02\x1a\xcb\xef\xbf\x1d\xc1\x64\x58\xab\x19\x35\x61\x7e\x0a\xf3\x65\x1c\x9b\x1c\x57\x60\x27\x9b\x2c\x23\x8a\xe1\x7c\x12\x73\x65\x94\xa9\x32\xf2\x14\x45\x9b\x28\xa7\x9b\x27\x61\x7f\xc7\x2e\x2f\x8f\x31\x4d\x46\x71\x91\xc9\x26\xc9\x18\x1b\xf4\xa3\xcc\x91\x53\x4c\x91\x8f\xaa\xf3\xf2\x58\x13\xe4\xa4\x7b\x47\xb4\xe9\xf1\x38\x66\xc7\x4f\x52\x53\x29\x02\x2f\x71\x66\xc6\x68\x13\x63\x9c\x79\x71\xdc\xb4\x78\x4c\xb3\x62\x24\x6a\xc7\x2f\xc5\x11\x17\xe2\x29\x97\xe1\x09\x17\xe1\xc9\xe6\x43\x87\xa4\x91\x6d\x8d\xbd\x00\x1f\x5c\x6f\x47\xa0\x3e\xee\xf2\xfb\x84\x8b\x6f\x8c\xb9\xf0\x93\x98\x0a\xa7\x99\x09\x23\xfb\xa1\x8f\x1d\xee\x91\xeb\x7b\xc4\x51\x85\x4e\x4e\x34\xbb\x60\x19\xdd\xdf\xb0\x44\x8a\x34\xc0\xa9\x0f\x4a\x1d\x54\x34\xa7\xf1\x43\xa7\xb9\xb5\xa3\x6c\xb6\xd4\x55\xcb\x09\xfa\xbd\x5d\x80\x92\xbf\xb9\x3b\xe1\x02\xb5\x11\x71\x86\x8f\xc9\x5e\x3e\xc2\xfd\x9a\x1c\x55\x45\xc4\xc0\xa0\x69\x68\xfe\x8b\xbc\x27\x72\x6d\x98\x20\xcf\xb9\xf0\x98\x7e\x71\xd0\xb7\x16\xf1\x15\x22\x39\x47\x9e\xf6\xbb\x97\xdf\x78\x30\x9f\x4b\x55\x06\xa5\x5e\xeb\x63\xdc\x3a\x1c\xa8\xa7\x5c\x3b\x1c\x88\x75\x99\xb5\xaf\x1e\x78\x1d\x89\xbd\x77\xbc\xac\x4b\xa2\xbc\x84\xb9\x54\xb4\x0c\xed\x2f\x31\x98\xb1\x8b\xf0\x20\xc4\x5f\x60\x2b\x22\x5c\x02\x8f\x72\x07\xa0\xc1\x7f\x44\xc4\x4e\x72\x05\x34\x8d\xfd\x01\xb8\x53\xdc\x00\x9f\xe4\xf6\x74\x44\xd3\xff\x14\xb3\xff\xaf\x4e\xb3\x89\x30\xef\xff\x86\x34\x9b\x5f\x42\x17\x30\x3c\x67\xb2\x34\x47\x52\x03\xee\xb7\x3c\xd9\x36\x39\x32\x0f\xd7\x2b\x92\xe5\x41\x83\x8e\x97\x0e\x60\xaf\x94\x3a\x5e\x44\xed\x17\xa6\x25\x8c\xec\x53\x64\xe3\xd4\x66\x19\xaa\x5a\x17\xab\x6b\x94\x53\x8d\x0d\xa7\x7f\x7a\x7b\xfe\xe7\x37\x6f\x97\xe4\x0d\x4d\x86\x4a\x85\x37\xaa\x84\x08\x6c\x88\x88\xb4\xbf\xa5\x3b\x46\x28\x29\x05\xff\x7b\x89\xb5\x8a\xc8\xf3\x0a\xe2\x0b\xef\x35\x19\x00\x3a\x56\x5f\x65\x84\x67\x40\xe3\x80\x09\x95\x2a\xb1\xd1\x00\x9a\x91\xa5\x55\xf3\x7d\x97\xea\x06\x6f\x78\x63\x7f\x1a\x66\x51\x14\x79\xcf\x96\x29\x46\x36\x7c\xe7\x0c\x76\xae\x04\x4d\xdd\xb7\xbd\xd5\x68\x97\xae\xc0\x4c\x3d\xc8\xa1\x04\x33\x96\xfa\xaa\x1b\x87\x14\xba\x99\x7f\x61\x6f\x24\xfa\x94\xac\x4a\x30\xd5\x17\x8a\xe7\x54\xf1\x6c\xdf\x1c\x82\x66\x43\xfc\xe6\x4a\x7a\x09\xbd\x47\x71\x5c\x4f\xff\xe2\xfd\x9b\x1b\x72\xf5\xfe\x16\x7a\x22\x59\xc9\x0a\x56\x74\xf8\x1d\x10\xd3\xdf\xf3\x19\x1f\x57\xdb\x1a\x5b\xaf\xc2\x27\x78\xce\xb9\x86\x46\xcd\x4c\xd8\xc1\xdc\xad\xdc\x97\x82\x7a\xf6\xcd\x12\xfe\x6f\xa8\xec\x35\x4d\x53\x65\xb9\x79\xe5\x84\x38\xc8\x1f\xb0\x5c\x16\xf8\x3d\x5f\x65\x8d\xbd\x73\xd8\xfb\xc5\x3a\x83\x55\xce\xc4\x6b\xbb\xec\x66\x83\xb0\x6a\x23\x01\x21\x58\xaf\x14\x9a\x90\x0e\xf2\x81\xd1\xbe\x66\x91\xf5\x2a\xeb\x09\x45\xd7\xcb\xab\xf9\xb5\x17\xa6\xee\x50\xc8\x46\x49\x6b\x72\x79\xed\xb7\x25\x2c\xd0\xa0\x8c\x58\x25\x0b\x5d\x31\x68\x00\x8c\x26\x89\x53\xf2\x0d\xf9\x13\x79\x20\x7f\x02\xd1\xfa\xc7\x10\xb0\x38\x0e\x1a\xa7\xd6\xa2\xd6\x76\x79\x1d\x8d\x95\x1f\xed\x11\xb0\xdf\xd8\x95\x1b\x49\x56\x1c\x1b\xd3\xd7\x4d\x87\x1d\xb6\x9e\x5c\xe1\xd0\x0e\x72\xd4\x0d\x03\xeb\x04\xb9\x6c\xb4\x9f\x0f\x3b\xd6\xcc\xc4\x2d\xb3\xa0\xad\x26\x7b\x85\x44\x1e\x36\x4f\xb7\x2a\x96\xd5\x23\xe5\xd4\x24\xdb\xf6\x09\xb2\x22\x5c\x9b\x9a\x88\xc3\xca\x70\x2a\xe1\x86\x80\xee\xc0\x2d\x0f\x52\xe5\x71\x09\x69\x52\xf3\xbd\xd6\x2e\x1c\x60\xfa\x40\x51\x1c\x51\xc2\x53\x2f\x59\x1b\xe9\x50\x85\x4c\x51\x54\xc3\xa4\xd2\x06\xbb\xf1\x52\x39\x08\xb4\x2b\xb1\x5d\x88\x4a\x75\x75\x06\xfa\xb2\x27\xc1\x75\xe3\x84\x0a\x96\x6a\x24\x63\xc1\x9e\x96\xaa\x07\x5e\x70\x63\xa2\xce\x47\xa1\xa4\x91\x89\x0c\xd6\x8c\x6c\x9b\x84\xdd\x07\xd8\xde\x1f\x29\xcb\xe1\xfc\x87\x8b\xeb\x53\x7b\x23\x84\xe2\x79\x37\xaf\xc7\xac\x72\xad\xf6\x70\xb7\xaf\xaf\x83\x6d\x6a\x22\x16\x33\x5e\xce\xbb\xc5\xc2\x87\xd4\xf2\xa7\xd5\x9e\x54\x8c\xa6\xfc\x68\xb1\x35\xbe\xd5\x61\x05\x75\x4a\x90\x4d\x2e\x77\x2c\x45\x01\x5e\xb7\x4c\x4c\xa1\x21\xaf\x0e\x44\xde\x8c\xeb\x90\x9f\xc1\x32\x38\x47\xde\xcc\x91\x37\x73\xe4\xcd\x1c\x79\x13\x78\x67\x8e\xbc\x99\x23\x6f\xe6\xc8\x9b\x5e\xb4\xcc\x91\x37\x73\xe4\xcd\x1c\x79\xd3\x78\x69\x8e\xbc\x71\x93\xfa\x97\xf1\x4f\xcd\x91\x37\xed\x67\x8e\xbc\xe9\x8c\x32\x47\xde\x7c\x19\x3e\xb5\x39\xf2\xc6\x3f\x73\xe4\xcd\x1c\x79\x33\x47\xde\xcc\x91\x37\x07\xcf\x1c\x79\x33\x47\xde\xcc\x91\x37\xe1\x7d\xaa\xba\x79\xc7\xb8\x50\x5e\xcb\xbc\x28\x0d\x23\x1f\xaa\x76\xf5\x55\xcf\xf4\xd5\x1e\xfd\x82\x8d\xc3\xf1\xa9\xdc\x1c\xd8\xb6\xab\x54\x10\x2a\x72\x86\xb5\x10\x17\x09\x4e\x6d\x51\xad\x67\x51\xcd\xe4\xec\xb1\xae\x0e\xec\x9d\x3f\x4c\x0f\x75\x7c\xcc\x75\x14\xe3\x8f\x62\x5c\x6d\x8c\xbf\x85\x29\x34\x0c\x2d\xd8\x2c\xea\x01\xc8\x97\xe6\xb2\xc4\x12\x90\x6e\xf5\x81\xb1\x2b\xbc\xa0\x99\xe8\xf3\xa1\x9d\xc4\xf7\x0c\x66\xfa\x33\x63\xff\x83\x9b\xc4\x21\xfe\x1d\xfb\x78\x1c\xfe\xfd\x91\x81\x08\x84\x6a\x04\xae\x89\xcc\xb9\xb1\x7a\x8a\x55\xf6\x1a\xd1\x42\x21\xaf\x06\x37\x2d\x1b\xaa\xa3\x16\xf0\x39\x52\x83\x55\x50\x2b\x37\x47\xb3\xe7\x9a\xef\xa6\x16\x42\x17\x54\xbe\xad\xb4\x25\xd8\xf5\x85\x6f\xbe\x0b\x8c\xf3\x8b\xa6\xa0\x91\x17\xac\xbe\xaf\xb8\xd9\xbf\x96\xc2\xb0\x87\x01\x0d\xa6\x4d\x0c\x37\xee\x13\xd7\x55\x50\x57\xaa\x94\x73\x62\xaa\x52\x40\x54\x43\x84\x28\x89\x41\x16\x76\x1b\x3b\xf3\x13\x05\xac\xb0\x07\x73\x36\x00\x32\x6e\x2b\x0c\xd5\x77\xf5\x3e\xb0\x85\x15\x4e\x35\xba\x3b\x63\x3d\x96\x71\x02\x8b\xb9\x56\x7c\xc7\x33\xb6\x61\x6f\x74\x42\x33\xd8\xf3\x58\x15\xe0\x7c\xe0\x7b\xdf\x55\x51\x57\x5d\x34\x87\x3a\x66\xbb\x79\x82\x52\x97\x50\x41\x36\x94\x0b\x92\x5b\x1c\x15\x1e\x2c\x74\xdf\x13\xd0\xe1\xad\xa0\xca\x5e\x08\xdc\x07\x21\x8d\x0b\x02\xc3\x56\x52\x66\xce\x23\x9b\xed\xeb\x39\x39\x57\xbf\x90\x3f\x09\x76\xff\x93\x1d\x47\x93\x75\x46\x37\xa1\x5e\xd4\xc4\x55\x84\x65\xa6\x53\xb2\xa5\x9a\x0e\x19\x42\x47\x88\x31\x68\x50\xff\x08\xc5\x0e\x8c\xbd\xed\xbe\x5f\x91\x97\x2f\x80\x6a\xa9\x26\x15\xf4\x90\x51\xe5\xdb\x17\x60\x7d\x79\x7d\x7e\xfd\xd3\xcd\xdf\x6e\x7e\x3a\xbf\x78\x77\x79\x35\x76\x44\xc3\x7d\x4a\x13\x5a\xd0\x15\xcf\x78\x98\x77\x77\xac\xe0\xcd\xcf\x80\x51\xa5\xe9\x59\xaa\x64\x81\xeb\x54\xa5\x80\x78\xcd\x3a\x06\x2b\xc2\x90\xe1\x7d\x50\x55\x78\x27\xb6\xe6\x6e\x0f\xb5\x51\x54\x18\xaf\xec\x8c\xd5\xe7\x46\x34\xab\x52\x58\x45\xf5\xa9\x1e\x37\x9a\x4e\x09\x4a\x38\x4f\x53\x96\xb6\xa6\x7e\x64\x1f\xd0\x6b\x0f\x7a\x5f\x47\x8c\x92\xeb\xf7\x37\x97\xff\x37\x7e\x54\xe2\x68\x24\xca\x3d\x70\x24\x0f\x36\x21\x96\x4c\x26\x60\xf2\x83\x8b\xee\x99\x71\x39\xf0\xce\x48\x25\x7f\xcf\x55\x22\x0f\xf7\x87\x52\xb4\x23\xf3\x6b\x08\x24\x97\x29\x5b\x92\x6b\x64\x8a\xd0\x6d\x37\xc8\xfb\xab\xef\x6a\x36\x00\xe6\x5f\xfb\xb1\x30\x9c\x66\xd9\x9e\x58\x4d\x6c\x47\x33\x86\x2e\x64\x25\x07\x6f\x2b\xa4\x2e\xa9\x85\x71\xa9\x4d\xae\xb1\xa6\x99\x0e\x1c\xf0\x18\x3e\x68\x59\xfd\x3b\xab\x4c\x46\xe2\xa9\x7a\x9f\xa4\x4c\x48\xe3\xf4\x52\x3b\x12\x04\xd4\x2a\x99\x10\xd4\x4d\xd1\x0d\x11\x58\x55\x1d\x4e\x54\x31\x4b\x60\xb1\x9e\x0d\x72\xed\xd7\x7a\x5d\x8d\x09\x37\xf1\x00\xcc\x52\x33\x7d\x20\x6d\x1c\x1b\xac\xb5\x55\x3b\xae\x62\x34\x85\xd8\xb0\x82\x9a\x2d\xd8\x35\x03\x40\x73\xaa\xef\x58\x8a\xaf\x2e\x51\x0e\x3b\x4d\x5a\xbb\x0e\x00\x6e\x7a\xb7\x16\x0b\x6b\x46\x4d\xa9\x18\xc8\xdf\xb0\x92\xbb\x62\x84\x09\xba\xca\x42\x91\x67\x51\x41\x91\x34\x7d\x2f\xb2\xfd\x07\x29\xcd\x77\x55\x48\x55\xe4\x76\xfe\x58\xf5\x04\x6f\xde\xa0\x41\xd8\x82\x91\x32\x5d\x00\x9a\x20\x90\x2b\xae\x92\xf9\x45\xbd\x7d\x47\x20\x4f\x55\x8a\x73\xfd\xbd\x92\x65\x6c\x53\x0e\x4b\x41\xdf\x5f\x5e\xc0\xa9\x2a\xf1\xdc\x30\x61\xd4\x1e\x82\x22\x3b\x19\x3c\xe3\x3a\xdc\x92\xfc\x60\x69\xea\x80\x8a\xac\xc6\x55\x0a\xcd\xcc\x92\xbc\xa3\x7b\x42\x33\x2d\x9d\x32\x15\xd2\x8c\x04\xb9\x06\x9f\x49\x53\xff\x5f\x12\x88\x71\xc6\xb8\x8b\x95\x34\x5b\x72\xf0\xc2\x08\x71\x76\x21\x62\xf8\x1e\x1a\x98\xea\x04\x25\x2e\x0e\x01\x87\x88\x93\xde\x31\x4d\x0a\xc5\x12\x96\x32\x91\x04\xf6\xb0\x61\x2b\xfa\xe3\x1f\x9e\x64\xbe\x87\x9d\xbe\x92\xc2\x92\x71\xe4\x5e\x5f\x8a\x94\x27\x14\x79\x90\xeb\x66\x5d\x93\x30\x58\x35\x9d\x8e\x49\x21\x06\x6e\x84\xcb\x96\x9a\x29\xec\xee\xac\x4a\x86\x48\xfc\x6b\xb9\x62\x19\x33\x18\x71\x0b\x71\xfd\xd4\x60\x2b\x01\x6c\x28\x4f\x8d\x27\x8c\xf0\x49\x67\x42\x97\xd0\x2e\xc4\x5e\x8d\x0d\x49\x25\xab\xe3\x15\xa9\x26\x3f\x5c\x5e\x90\x6f\xc8\x73\x3b\xbf\x17\xe0\x63\x59\x53\x1e\x52\xdb\x8d\x44\x2f\xcc\xa1\x5e\xbd\xf6\xc0\x61\x19\x40\x9f\x44\x2a\x3c\x86\xa7\x44\x84\x7c\x3e\xd0\x2d\xc6\xad\xd0\x5e\x77\x7c\x8c\xb1\xf3\xcc\x81\xd1\xa6\x4d\xe8\x01\x72\x0e\x8d\x13\x26\xf4\x21\x72\x0e\x40\x1c\x27\xf4\x09\xe4\x1c\xcd\x92\x7e\xd0\x4c\x4d\xe0\x48\x3f\x1c\x95\x23\x35\x55\x00\x4b\xb5\xed\xd5\x23\x69\xe6\xcc\xd0\x94\x1a\x4a\x78\x68\x3b\x4a\xd1\xe8\x08\xf2\x5b\xd8\xe0\xe3\xf1\x2b\xcd\xde\x72\x51\x3e\xa0\x8b\x6c\xca\x15\xf2\xe6\x0d\x7c\x48\x12\x3f\x79\x40\x38\x2d\x8a\x8c\x63\x80\x70\x3b\x8f\x32\x80\x19\x3c\xe4\xcd\xf4\x98\x3e\xc5\x07\x8e\x32\xcd\x32\x69\x59\xa5\x95\xea\x54\xa4\x32\x0f\x80\x3d\x9c\xa0\x55\x98\x18\x4d\xb6\x4d\x0b\x7b\x0f\xb1\x4c\x12\x52\xff\xe2\x62\x2f\xee\xea\x9c\xb1\x1d\x0b\xa6\xdd\x1c\x66\xd7\xda\xf7\xad\xe2\xe4\x77\x00\x00\x90\x8c\xae\x58\x86\xc2\x03\xa9\x24\xd2\xd9\x1a\x45\x43\xd1\x57\x33\x25\xb3\x29\xc1\x48\x1f\x64\x06\xfe\x2d\x5a\x2d\xc6\x02\xf8\x42\xd6\x02\xaf\xc5\xaf\x05\xf4\xfa\xd6\x5a\xe0\xbe\xf3\x65\xac\xa5\x0c\x4a\xa2\xce\x5a\xac\xe0\x6a\xaf\x05\x24\xc8\x97\xb0\x96\x88\x6b\xfd\x3d\x17\xa9\xbc\xd7\xd3\x99\xee\x8f\xf8\xa1\xe7\x0c\x89\x65\x3d\x86\x8b\x8d\x6e\x32\x5e\x1a\x34\x96\x36\xef\xa9\x7d\x9c\xd7\x1b\xe7\xab\x7c\xea\x2e\x8f\x0a\x40\xf7\x0a\x57\xa9\x9d\x7f\xe6\x11\x82\x34\x44\xf1\x51\xbc\xf1\xe8\x1c\x70\x93\x6b\xfa\x5a\x59\x58\x86\xd3\xec\xa6\x98\xd4\xf6\xec\xfb\x77\x37\xe7\xed\x8f\x2d\xe1\xde\x43\xca\xbd\x5d\x8f\xfd\x9d\xd0\x34\xe7\x5a\x87\x4d\xd2\x80\x5f\xb6\x82\x76\x74\xcf\xbd\x8f\x62\xc3\xcd\xb6\x5c\x2d\x13\x99\x37\xdc\x15\x0b\xcd\x37\xfa\xcc\x51\xd9\xc2\xce\xfe\xc5\x08\x5c\x2e\x32\x2e\x1a\x46\x07\x48\x60\x77\x4a\x1d\x4c\x30\xa9\x56\x00\xa8\xc7\x4c\xd3\x11\xa0\x68\xe5\xed\x41\x00\x66\x97\x72\x96\xa5\xce\x10\x81\xe1\xd8\xf6\x3c\x67\xc5\x96\x2e\x40\x60\x8c\x00\x77\x39\x63\x70\xaf\xdf\x4a\x21\x9d\x0f\x1d\x63\x8e\xdd\x55\x0a\xed\x12\x30\x09\x77\x72\xec\x5c\x46\x00\x37\x2d\x1f\x47\x61\x6d\x5d\xea\xb9\x1a\x0d\xac\x1f\xa1\x20\x40\xa0\xcb\x98\x6b\x44\xe3\x8c\xac\xac\x77\x23\x51\xf9\xfe\x2d\xec\x43\x75\xe3\x99\x88\x7e\xb8\xf9\xb8\xcf\x2c\xb7\xf1\x4c\xb8\xf7\x26\x34\xb2\xa8\x4e\xed\x95\xde\xdb\x90\x7d\xa5\x7d\x23\x1a\x3d\xbe\xdd\xfb\xd2\xd8\xad\x68\x04\x64\x9f\xb2\xfb\x24\x5d\xb7\x1f\xe8\x11\xf4\x5d\xd2\xa7\xf3\x1e\xd0\xf3\x8a\x19\x47\xce\x40\xb0\x39\xdd\x93\xd5\xd8\x71\x49\xb9\x06\xb3\x26\x38\xa5\x9b\xc4\xfb\xa1\x49\x48\xc7\xa6\xd3\x27\x3b\xe6\x31\xb0\x35\x3a\xab\xfb\xa6\xf1\x3e\xe1\x5d\x53\xd4\xb5\x4c\x31\x64\xbc\x0a\xca\x1d\xec\x7f\xe8\x42\xd7\xf9\x3f\xbc\xec\xaf\x35\x0b\x21\x31\x66\xa2\x19\x47\xee\x1b\xcc\x62\xd3\xd4\x01\x98\xce\xa2\xeb\x9a\xaf\xb6\x66\x81\x56\xae\x2d\xd7\xcd\xe4\xf0\xd3\x6a\xd2\x01\xa7\x71\xb3\xb5\xc3\x29\xf9\x8f\x52\x1b\x42\x2b\xf7\x73\xab\xe7\x44\x15\x73\x0c\xe4\x94\x0c\x5a\x53\x7c\x2e\x96\x91\x76\x32\x3b\x9e\x32\x92\xf2\xf5\x9a\x79\xb7\xf8\x8a\x91\x82\x2a\x9a\x33\x03\x6e\x14\x44\x2d\x74\xe1\x15\xc3\xc4\x20\xd7\x84\xfa\x5e\xb7\x55\x04\xdc\x29\xfa\x68\xb9\x21\x39\xdf\x6c\x51\xd7\x21\x94\x64\x52\x6c\x20\xa2\xcf\x4e\x21\x93\x74\xe8\x24\x02\x73\x90\x8a\xdc\x53\x95\x13\x4a\x12\x9a\x6c\xc1\x4a\x48\x05\x49\x4b\x05\x09\x9e\x86\xd1\x74\xbf\xd0\xc6\xde\xb3\xad\x76\x04\xa6\x34\xc4\xc0\xa0\x17\xba\xd3\x09\x03\xf0\xc5\x31\x12\xd9\xca\x92\xea\x98\x38\x5f\x81\x57\x0e\x9a\xe4\x37\x00\xbd\x75\xc0\xe6\x94\xfe\x83\x67\x4e\xe9\x9f\x53\xfa\xe7\x94\x7e\xff\xe6\x9c\xd2\xdf\x79\xe6\x94\xfe\x39\xa5\x7f\x4e\xe9\x9f\x53\xfa\xe1\x99\x53\xfa\xa7\xcf\x6d\x4e\xe9\x9f\x53\xfa\xe7\x94\xfe\xc6\x33\xa7\xf4\x77\x46\x99\x53\xfa\xbf\x8c\x64\xbd\x39\xa5\xdf\x3f\x73\x4a\xff\x9c\xd2\x3f\xa7\xf4\xcf\x29\xfd\x07\xcf\x9c\xd2\x3f\xa7\xf4\xcf\x29\xfd\x63\x2e\xb4\x94\x0f\xa4\x5a\xc6\x64\x1d\x38\x03\x7e\x23\x56\x71\x55\xae\xd7\xf6\x86\x2a\x07\x85\xb5\x1d\xb1\x63\x89\xae\x72\xdf\x2a\x47\x97\xb3\x26\x6b\x66\x4e\x21\xad\x01\xc3\x74\xa6\x01\x75\x81\x94\x90\xd6\xa8\x98\x86\x34\x00\x41\xde\xbc\xff\x6e\xd9\x48\x7a\x18\x34\x65\x0e\xa6\x42\x8c\xc5\x1c\xc3\x6c\xde\x8b\x24\xc6\x29\x59\x23\xb6\x2f\x12\xd4\xe1\x37\xc9\xa4\xc6\x98\x02\x00\x3d\xe4\x9a\xda\x52\x21\x98\xd7\x3a\xb8\x01\x5d\x79\xc5\x98\x20\xb2\x60\x02\xfd\x50\xbe\x2d\x03\xa1\xc6\xd0\x64\xbb\xb4\xe3\x8b\x20\x54\x9f\x1d\x5a\x8d\x6e\x59\x2f\xa3\x39\x22\x57\xb1\x9c\x72\x1c\x80\xd0\x44\x49\xad\x49\x5e\x66\x86\x17\xd5\x10\x43\x3b\xc6\x20\x06\x08\x23\xb3\x2a\x84\x81\x63\x81\xa1\x29\x1e\x62\xfa\xdd\xc6\x6a\xbf\x04\x29\x46\x03\xaf\x41\x37\x3a\x85\x84\xf6\xbc\x30\x7b\x74\xb9\xa2\xe3\x89\x2b\x6d\x48\x92\x71\x10\xff\x30\x3b\xcc\x09\x85\x51\x4e\x03\x4e\x7d\x03\xb9\xa2\xb0\x56\xed\x16\x2b\x52\x90\x1a\x85\xd1\xe8\x68\xac\x87\x71\x03\xa4\x5c\x3b\x19\xad\x87\x3c\x13\xd4\xf7\x0e\xc1\xcd\xf6\x6b\x85\xed\x4e\x61\x08\x3f\xa6\xfb\x53\x63\x90\x11\x2c\x40\xca\x93\xbb\x28\xd5\x87\x0a\x52\x8c\x7d\x9e\xcf\x69\xab\xcf\x48\x51\x25\xcb\x99\x2d\x1d\xae\xb4\xe0\x0f\xa2\x9b\x2d\x10\x81\x60\x3b\x4b\xb3\x2c\x61\x56\x85\xa6\x9d\x13\x86\xc3\x3d\xea\x28\x19\xa6\x72\x2e\xc0\x2d\xfb\x8e\x69\x4d\x37\xec\x7a\xd0\xc0\x33\xa4\x36\x81\x8d\xa7\x46\x35\x10\x42\x06\x3a\x54\xfd\x97\xda\x25\x76\x32\xc4\x10\x1a\x53\x21\x39\xce\xa5\x8a\x01\xbc\x57\xdc\xd8\x3b\x15\xd7\x98\x4b\x07\x76\xcd\xc3\x80\xcb\x61\xd0\x4d\x27\xdc\x3b\x0f\xba\x06\x69\xf9\xbb\x48\xd1\x71\xb5\x62\x64\xa5\x38\x5b\x93\x35\x17\x34\x73\x1e\xa8\x21\xfa\x82\x1c\x11\x8a\x0a\xb5\xd6\x56\x35\x95\xc2\x3b\x56\xfc\x1a\x96\xe4\x47\xb7\x08\xa3\x4a\x91\xd0\xd1\x9c\x65\x21\x53\x46\xf8\x9a\x6c\xc0\xdb\xa5\xd0\xa1\xfe\x87\x6f\xfe\xc7\x1f\xc9\x6a\x6f\x25\x22\x18\x2a\x8d\x34\x34\xab\xd0\x94\x31\xb1\xb1\x7b\x00\x0c\x62\xe8\x2c\x64\x59\x33\xfd\xd2\x63\x16\xea\xaa\xe0\xd2\x5f\x7e\x7b\xb7\x6a\x8b\xf4\xb3\x94\xed\xce\x1a\xfb\xb2\xc8\xe4\x60\x5c\x4a\xb7\x19\x4e\xbf\xf0\x1d\x51\x2f\x7b\x08\x12\x8a\x2f\x44\x90\xa4\x4f\x7e\x22\x5b\x79\x8f\x39\x98\x3d\x14\x55\xbb\xc4\x0b\x59\x94\xd9\x70\xd7\x1e\x42\xbe\xb3\x54\x0c\x78\x2a\x9d\x74\x68\x85\x33\xf6\x9e\x1c\xb8\xe8\x3b\xc0\xc3\xbc\xae\x29\xe1\xd1\xc5\xe9\xa7\x27\x5d\x3c\x94\xbb\xe4\x56\xb9\x4f\xa5\x62\x4b\xf2\x1d\xcd\xb2\x15\x4d\xee\x6e\xe5\x5b\xb9\xd1\xef\xc5\x1b\xa5\x06\xd5\x80\xd6\xbc\x33\x6a\xf9\xf2\xb6\x14\x77\xed\x56\x0b\x99\xdc\x58\x3d\xae\x28\x8d\x8f\x58\x69\xac\x6a\x00\xb0\x9f\x29\x9c\xf1\x4a\x08\x50\xd7\xcb\xa6\x86\xcd\x1e\x80\xae\x20\xe0\x89\x0a\xc2\xec\x5c\x87\x30\x6d\x29\xba\x39\x17\xdd\x24\xcb\x6f\xbf\xf9\xc3\xbf\x21\xe9\xdb\xdb\xc5\xbf\x7d\x03\xce\x7f\x7d\x8a\xcc\xc5\x72\xc6\x61\x0e\xad\x73\x9a\x65\xf6\x22\xd1\x24\x6a\xbb\xad\xcb\xd8\xde\x4d\x63\xd4\x6a\x62\x08\x33\x5a\xb9\xbb\xbd\xfd\x5b\x40\xb3\xe3\x46\xb3\x6c\x7d\x8a\xb1\x77\x55\xbe\xed\x09\x08\x8a\x13\xc7\xbb\xac\x54\xef\x8a\x86\xc7\xa9\x59\x3b\x99\x95\x39\xbb\x60\xd0\x74\x25\x62\x99\xad\xf7\x7d\xc4\x46\xe6\xfa\xa3\xad\x32\x99\xdc\x91\xd4\xfd\x08\x93\x1d\x58\x26\x78\xad\x5c\x48\x4f\xe3\x2e\x58\x45\x01\x41\x00\x9e\x8f\xe4\x79\x6a\xc7\xad\xe6\x9c\x5b\xfe\xb6\x9c\x16\x05\x34\x1a\x5b\x43\x82\xd0\x3d\x2e\x20\x70\xc7\x02\x08\xae\x93\x0e\x3d\x4e\xf7\x2d\x04\x3a\x2c\x90\x7b\xd6\x53\x7f\xe2\x37\xa0\x80\xff\xc6\x78\x91\x09\xa9\x75\xa4\x0e\xdb\xab\xd6\x86\x12\xc3\x62\x06\x4e\xe6\x93\xfb\xf0\x4c\xea\x7b\x04\x66\x85\x46\xa7\xa7\x66\xbc\x32\x25\x05\x53\x1a\x9a\xc3\x99\x8f\xb0\xa3\xaf\x33\xca\x43\x19\x5d\x84\xd4\x0d\x8f\x9e\xb6\x8c\xf1\x0e\x3c\xf5\x9e\x0c\xbe\x12\xf0\xf6\x3d\xb1\x37\x0f\x12\x38\x24\xe3\xc7\x9c\xe1\x6b\x99\xba\x4f\xe0\x90\x62\xe1\x82\x1e\x55\x4b\x47\xe4\xbe\x1f\xbd\x3d\xde\xc7\x7a\x2d\xed\xb3\x6a\xff\x52\x1d\x56\x7c\xcb\x1d\xc5\xc1\xbd\x3d\xd2\x11\x85\xa1\x27\x9d\x50\x38\x9b\x8d\x8e\x5b\xb5\x3c\x68\xa9\xd0\xb8\x09\x41\x0a\xae\x55\x19\xa7\x13\x2f\x09\xda\xb4\x2d\xd6\x1d\x58\x72\xf2\xea\xe4\xc9\xe7\x14\x17\xa9\x64\x41\x37\x23\xa5\xa3\x0e\xd6\x7a\xf8\x21\x49\x19\x2a\x18\x4c\x83\x92\x06\xbf\x83\xdb\x28\xb8\xd0\xc2\x41\xf0\x9d\x9d\xbc\x8f\xcf\x99\x69\x3d\xfa\x9c\x0a\x82\xc1\xc1\xf7\x41\x2f\x36\x21\x54\xc9\x52\xa4\xee\x7e\x5e\x19\x42\xde\x1d\x4c\xf8\x4a\x0a\x50\x72\x30\x07\x29\x10\xb6\x8a\x4f\x2b\x46\xdc\x72\x98\x97\xcb\x97\xdf\xfc\xb2\x6c\xf2\xf6\xa0\x21\x9e\xc5\xc8\x55\xc5\x26\xf1\x6c\x3c\x79\x46\xbe\xc0\x46\xf4\xac\xde\xb9\x4b\x5b\x5d\x3f\x83\xfb\xaa\x02\xf0\x27\x7b\x19\x63\x51\xa5\xf0\x08\x79\x0e\x2a\x8d\xd5\x05\x1b\x59\x09\x2f\x26\x95\x81\x89\x4b\x6b\xb7\xf7\xbb\xd5\x93\xce\x36\x1e\x62\x24\xda\xbe\xbb\x70\x98\x9a\xdc\xd7\x3d\xc7\xbc\xd5\x45\xee\x19\x79\x8e\x6f\x9e\x68\x88\x45\x7d\xf1\xe4\xed\x75\xcb\x7e\xf3\x50\x04\xf3\x28\x5b\x4b\x7f\xf3\x50\x50\xb8\x43\x17\x63\x38\x18\x51\x3a\xda\x52\x66\x18\x07\x7f\x66\x5b\xba\x63\x10\x27\xcb\x33\xaa\x06\x33\x09\x1c\x5c\x49\x6e\x70\x55\xd0\xec\x96\x89\x1d\x57\x52\x80\x9f\x6a\x47\x15\x87\x9c\x22\x68\x45\xc8\x84\xd5\x4f\x7f\xf7\xfc\xe3\xf9\x07\xf0\x0f\x84\xb3\xdd\x30\xf7\xc0\xad\xbc\xd4\x10\x83\x70\xb0\x82\xc6\x50\xf5\xc6\x8d\xcd\xb5\x67\x53\xfd\xfc\xed\xae\x00\xaf\xf3\xeb\xb1\x73\xc8\x4b\x53\xd2\xe1\x6c\x0a\x7c\xd8\x43\x92\x95\x9a\xef\x9e\x7a\xfe\xc7\x35\x9e\x4a\x2a\x7e\x06\x85\xc7\x85\x74\x5f\xf0\x01\xda\xed\x6f\xb8\x7b\xa2\xbb\xb1\xe0\x60\xd6\x13\xd2\x8c\x77\x3d\xed\x35\x2e\x9f\xe8\xaa\x36\x4e\x33\x95\xd5\x5d\x5c\x5d\xca\xc5\xe0\x2d\xa8\xaa\x0b\x99\x76\xcd\xee\x90\x9f\x75\x9c\x2b\xec\xf0\x5e\x0e\xec\x51\x60\x77\x86\xf6\x05\xbb\x36\xbf\x95\x09\xed\xa4\xfe\x77\x5a\x69\xbb\xf7\x48\x0e\x49\x58\xae\x96\x54\x6e\xaf\xcf\xa5\x76\x11\x63\x0e\x1e\x91\x82\x64\x52\x16\x2b\x9a\xdc\x75\xf7\x45\xcb\x6e\x6d\x19\x68\xb8\x4b\x37\x94\x0b\x5d\xe7\x23\x5d\x76\x22\x7f\x86\x45\x43\x26\x37\xdf\xa1\xdb\x28\xb8\x0c\xb9\x71\xde\x25\x88\x2b\x68\xcc\x1f\xaf\xe8\x8d\x9d\x85\x12\xa5\xbd\xc3\xf7\x6c\x57\x26\x37\x6f\xfb\xca\x27\x74\x06\xc7\xdc\xb4\xa3\x8e\x2d\x64\xca\x6e\x58\x06\xe7\xe2\x70\xfc\xb8\xda\xbf\x01\x2a\x6c\x2d\xe0\x02\xaa\xda\xba\x33\x72\x25\x53\x4f\x05\x32\xc5\xf0\x22\x9d\x6c\x59\x5a\x66\xe0\xaa\xe8\x9f\x7e\x0f\x6d\xca\x1d\x53\x8a\xa7\xec\x2f\x52\x48\xf5\x96\xae\x58\xd6\x99\x61\x3b\xb3\xa6\xfb\xbe\x55\x58\x1a\x9e\x93\x0a\x24\xd4\x70\xc6\x0c\xcb\x1a\xb9\x9d\xd5\x43\x36\xeb\x4f\x50\x52\x40\xbb\x6e\xc7\x0d\xc8\xda\x87\x24\xdf\x60\xcb\xd2\x77\x52\x70\x23\xc1\x99\x7e\x2d\x53\xf7\xaf\x2e\x46\x65\x55\x97\x89\xeb\xc6\x7c\x9a\x63\x0d\xea\x42\xc3\x44\xde\xc2\xd5\x2d\xcf\x99\x36\x34\x2f\x26\xe0\xab\xfe\xc6\x87\x4c\x1b\x49\x36\x99\x5c\x61\x99\x3f\xb1\x96\x2a\x61\x38\xcb\x3e\x8e\x64\xea\xcf\xb9\x00\xe4\xea\x44\xd1\xc2\xd3\x6e\x27\xde\x7a\x78\x25\x05\xb5\xfc\x36\x38\x71\xd0\xfe\x69\xf3\x9c\xa4\xac\xc8\xe4\x1e\x14\x03\xae\x1d\x08\xc8\x39\xa4\x2e\x55\x86\x3d\x24\xac\xe8\x0a\x26\x7b\xdc\x52\x96\xb1\xfe\x5a\x51\x3e\xf0\xb5\x14\x29\x53\x19\xb4\xcb\x47\x32\x9d\xb2\x1c\x99\xbe\x73\x29\xb9\xc1\x35\x5d\xd7\xef\xd5\x24\xa9\x89\x23\x36\xab\x39\x9c\x5b\xb9\x41\x71\x39\x78\xd0\xfa\x6e\x60\x8d\x5b\x97\x0f\x6c\xa9\xd1\x54\xc8\xb4\x33\xf5\xd0\x7d\x99\xd6\x43\xf6\x89\xe5\xf8\xfa\xe1\x23\xfa\xc9\x41\xed\xe2\xc6\x42\x31\x81\xb0\x74\x59\x4f\xc0\x02\xef\xd8\xde\xc5\x28\xe4\xb4\x20\xda\xc8\xa1\x3e\xd4\x68\xc4\xae\xea\x86\xa3\x68\xc1\xc4\x5f\x38\xba\xab\x7d\xdd\xc4\xdd\x48\x99\x39\xa7\xa7\x54\x6c\xd0\xe7\xa9\x98\x51\x9c\xed\x18\xa1\x6a\xc5\x8d\xa2\x6a\x5f\x25\x5c\x83\x87\x67\x0f\xdc\xce\x8a\xad\xbf\x97\x4c\xed\x41\x41\x85\xc8\x34\xd0\x84\x7b\x41\x5a\x82\x53\x0c\x84\x64\x8a\x99\x9d\xb9\x4c\xf9\xba\x45\x6d\x87\x31\x99\xfd\xc1\x16\x96\x9d\x2d\x36\x25\x4f\xd9\x59\x63\xe3\xfa\xfc\x39\x41\x65\x2d\xeb\xe5\xb4\x9f\x70\xbf\xdf\xd1\x02\x02\x5b\xe0\x6d\xbb\xbd\x48\xef\xb0\xc7\xba\xd5\x76\xdc\x65\xd8\xf6\x0e\x29\xd5\x86\x0a\xfe\x0f\xc4\x77\x42\x0d\xdb\x48\x65\xff\xf9\x5c\x27\xb2\x70\xbb\x00\xb2\xf0\x45\x03\xad\x74\x8f\x17\xee\x5e\x88\xda\x89\x4e\x70\x1c\x29\x56\x64\x3c\x69\xd5\xd0\xce\x20\x93\x17\xe0\xba\x16\xe7\x63\xf1\x32\x51\x7b\x87\xf8\x9f\xb8\x6d\x83\x3f\x15\x95\x28\xba\xa2\x39\xd3\x05\x4d\x06\x55\x82\x4e\xcc\x3b\xbc\xed\x95\x10\xc4\x86\x2b\xae\x5f\x0b\x38\x74\xe8\xef\x18\x2a\xde\x9d\x49\x0b\x9e\x9d\x62\xaa\x6b\xb2\x65\xc9\x1d\x91\xf7\x02\x34\x54\x00\x3d\x85\x15\xc1\x36\xd9\x5b\x94\x8b\x90\xe8\x43\x70\xdb\x8a\x75\xf0\x01\x7a\x21\xbc\x63\x03\xeb\x04\xf9\x1d\xf6\x0a\xb5\x15\x20\x03\xa9\x41\xb7\x2e\xef\xc8\xbf\x05\x07\xfd\xfc\xea\xa2\x5f\x7f\x0f\x58\x47\xdb\x65\xa6\x03\x13\xc1\x09\x57\xbf\xe0\x39\xc0\xdb\xc4\xd0\x4d\x14\x8f\xcc\x29\xa1\xf6\x14\x9d\x62\x34\x86\x70\x29\xdc\x1e\x84\x62\x19\xf5\xe5\x6e\x2d\x2b\xad\x8f\x5a\xff\xc2\xc7\xed\xa9\x77\x2c\x60\x52\x6a\x2d\xd7\x8e\xe7\x3d\x4c\xb0\x6e\xfb\x87\xca\x63\x51\x2d\x75\xbc\x72\x53\xc8\x8d\x11\x71\x17\xf6\x18\x89\x9c\x76\x85\xc0\xaa\xba\xb4\x46\x14\xdb\x6b\x3e\xc3\x4a\xf2\x7a\xcb\x0b\x88\x99\x0c\xcc\xda\x15\x44\x77\xd8\x26\x1f\x69\xc6\xd3\x0a\x38\x52\xd4\xa5\x38\x25\x57\xd2\xd8\xff\x79\xf3\xc0\xb5\x19\xab\xe9\x7b\x21\x99\xbe\x92\x06\xde\x7d\x12\x4a\x70\x52\x91\x08\x71\xac\xd9\x65\xf7\xdb\xab\x63\x83\x81\xfb\xe5\x5d\xae\x5d\x39\x29\x5c\x5f\x60\x11\x5c\x93\x4b\x61\xf5\x66\xb7\xf2\xaa\x20\x88\x76\xc0\x7d\x18\xa8\x90\x62\x01\x9e\x6b\x0f\x3d\x00\xb4\xda\x34\xae\x3d\x2a\xa5\x6a\xe1\x6b\x60\xa0\x00\xcc\x15\x23\x6e\x78\x30\xd8\xe2\x37\x10\x53\x54\x64\x34\x61\xa9\xaf\xa0\x40\x2d\x2e\xac\x08\xe2\x09\xc9\x99\xda\x84\xe6\x59\x58\x3e\x35\xbc\x75\xa3\xa9\x88\x13\x6a\x8a\x0c\x67\x89\x85\x8d\x43\x0b\x4b\xeb\x03\xbf\x04\xb7\x77\xc4\x28\x14\x9a\x15\xb0\xef\xfe\x4b\x1f\xf9\x64\xaa\x48\x63\x50\xe4\xbe\x39\xaa\x26\xff\x69\xd9\x29\x10\xca\x7f\x91\x82\x72\xa5\x97\xe4\xdc\x85\x0c\xf6\x8e\xd9\x7c\xdf\xd9\x81\x9a\xa0\x2d\x54\xae\x0f\x6a\xa7\x53\x41\x18\xc6\xe0\xf7\xab\x37\xeb\x8e\x44\x3b\x25\xf7\x5b\xa9\x91\x8b\x57\x3e\x8c\x67\x77\x6c\xff\xec\xb4\x75\xf2\x86\xa2\x39\x9f\x5d\x8a\x67\xa7\x95\x03\xa6\x75\x0e\xbc\x9c\x41\xd1\xfd\x0c\x7e\x7b\xb6\xec\x08\xc1\x5e\xb0\x41\xc1\xf8\x34\x15\x26\x4a\x73\x39\xf9\x6f\x6f\x1e\x0a\xa6\x38\xf4\xdc\xc9\xfe\x5b\x43\x57\xe9\x55\x65\x0c\x55\x1b\x66\x1a\x6a\xcc\xa1\xe6\x35\x6b\x25\xb3\x56\x32\x6b\x25\xb3\x56\x32\x6b\x25\x0d\xdc\xcc\x5a\xc9\xac\x95\xfc\xd6\xb5\x12\x65\xfa\xea\x48\x1e\x58\x75\x95\xcb\x4d\x04\xd3\x55\x95\x3d\x0b\x7e\x11\x91\x92\x8d\x55\x39\xa0\xd5\x96\xb3\x21\x0d\x84\xab\x34\x6b\xc2\xdc\xb3\x55\xef\x1c\x7b\x88\xa9\x50\x5c\x42\x09\xc5\x8c\x6a\x3d\x3e\x59\xf7\x36\x49\xec\xeb\x84\x6a\xcd\x37\xa2\xb6\x23\x5f\xcb\xf4\x70\x62\x81\x81\xbd\xcd\xf9\x8d\xb3\xb0\x02\x91\x8d\x4e\xc1\xc7\xbc\x34\x4c\xfb\x95\x89\x16\x65\xb3\x2f\xb2\x87\x5d\x7b\x1a\x2f\x76\x70\xc6\x85\x36\x54\x24\x18\x6f\xd8\x2d\xaf\x89\x26\x64\xb9\x26\x3f\xd7\x93\xfd\x79\x49\xde\xb4\x86\xeb\x00\x05\x1f\xc1\x4f\x42\x9a\x9f\x20\x2d\x11\xba\x84\x81\xd1\xb6\xca\x9a\x73\xee\x26\x0c\xb0\x76\xc2\xe7\xf9\xcf\xcf\x9e\xfd\xdc\x89\xf0\x18\xc4\x1e\xd8\x8e\x83\x78\xfa\x3f\xf6\x0d\xa8\x24\x8c\xfd\x24\x51\x7b\x81\xef\xda\xd5\xd6\xd6\x19\xdd\xb8\xe6\x75\x90\xf6\xd2\xc7\x6e\x6a\x1c\x4e\x31\xc8\x65\x52\xde\xad\x68\x72\x77\xc1\xb2\xae\x6b\xa3\x33\x61\x6c\x88\x94\x19\x5a\x55\x45\x4c\x98\xef\xa3\xea\x3a\x19\x81\x65\xdd\x62\x2b\xb7\xff\x99\xf4\x1f\x63\x27\xca\x58\xc5\x6f\x08\xb3\x98\x47\x65\x67\xf8\x68\x0f\x30\xda\x9c\x3e\xbc\x96\x22\x29\x95\x9d\x4f\xaf\xba\xd8\x9b\x2d\x0b\xc1\xf8\xf8\x15\x1a\xfa\xf9\x81\x9d\x1a\xfa\xa1\x18\x22\x07\x2a\x4f\x8f\x65\x31\x86\xf3\x17\x73\xfa\x70\x43\xf3\x22\xeb\x17\x2d\xed\x00\x2e\xd7\xe6\xb6\x2e\x5c\xa2\xf1\xcb\x3a\xe3\xcd\xd1\x0c\x15\x50\x33\x12\x82\x46\x7b\x11\x9f\xb3\x1c\x82\x2b\xae\xa4\x71\x9e\x14\xbf\x70\x38\x12\x6b\xca\x33\x97\x8d\xb0\x27\xf7\x10\xf6\x03\xf0\xa0\x61\xa4\x1b\xb4\x5f\x10\x6e\xa9\x70\xa9\x8d\xc2\x48\x37\x0c\x96\xc6\x03\x65\x26\xd3\xd2\x75\x11\xc6\xd8\xe1\xc3\x95\xf4\x33\xfb\xc6\xb2\x14\x33\xa5\xea\x38\x9d\x9f\xbe\x0d\x2e\x8f\x37\x7a\x0f\x20\x99\xcd\x4f\x2c\xa7\x7b\xac\xdb\xe9\x4a\x72\xac\x18\x28\x68\x2b\xc8\xc9\x9f\x48\xc6\x83\x12\x4a\xb1\x5c\x1a\xf6\x81\xd1\xb0\x37\xb5\x5d\xa7\x15\xeb\x6b\xd9\x0f\x7f\x52\x8c\xa6\xf0\x53\xab\x98\x27\x6b\x5c\xae\x3b\x13\x75\xf1\xfd\x50\xf8\xd0\xae\x31\xd9\x42\xd6\x37\x17\x84\x8a\x3d\x29\x8b\x44\xe6\x76\xa1\x8a\x65\x8c\x6a\xfc\x3b\x59\x29\x46\x21\x84\xe7\x9e\x76\x8a\xfb\x0d\xe8\x99\x9d\x06\x83\xb8\xcc\x0e\x43\x6c\x2e\xa4\xd5\x3a\xb7\x9f\x1a\x1a\x62\xab\xbb\x07\xe1\x1b\xe7\x8a\x6a\x9e\x9c\x97\x51\x49\x78\x7f\xf6\xef\x56\xfa\xc0\x0f\x1f\xde\x3e\xf6\x9a\x5b\x50\xad\xef\xa5\x8a\xad\xee\x71\x0b\x37\xda\x44\xd5\xc5\xd4\x9c\xe2\x41\x72\xe7\xcf\xa9\xbc\x33\xa1\x8c\x47\x52\x67\xfc\xfb\x7c\x05\x9c\x06\xb6\x5e\x2e\xcd\x96\x09\xe3\xdc\x65\x4f\xad\xab\x17\xbc\xc8\xf7\x2e\xd0\xaa\x9e\x2e\x69\xc2\xad\x15\xea\xc7\xd9\x7b\x3c\x44\x34\xba\x88\xeb\x20\x50\xb8\x56\x51\x6c\x25\xe5\xa1\xdc\xb1\x91\xea\x93\x91\x45\x18\xc6\x6b\xb0\x1d\x24\xff\x37\x6a\x33\xb8\x70\x47\x33\xb9\x4e\x8f\xd5\x34\x77\x9c\xdd\x9f\xb9\x88\xb9\xc5\x3d\x37\xdb\x85\x73\x85\x9e\xc1\xae\x9f\x7d\x0d\xff\x33\x82\x17\xac\x18\x72\x9e\xa6\x2e\x66\xbb\xd4\x6c\x5d\x66\xa8\xeb\xeb\x25\xa1\x05\xff\xc8\x94\x15\xcd\xa7\xe4\x8e\x8b\xf4\x94\x94\x3c\xfd\xf7\xa3\x94\xd5\x90\x3e\x79\x35\x1e\x77\x37\xc0\xd9\xf6\x55\xb7\x63\xa8\x38\x8c\xbb\x69\xaf\x20\x46\x03\xb1\x8c\x5c\xb0\x09\x52\x83\x6b\xdd\x1d\xb1\x92\xb1\x08\xe5\x98\x3a\x13\x43\x97\x5b\x12\x57\x66\xa2\xd4\x56\x8d\x0d\xd1\xd9\x2f\xc2\x17\xfc\x34\x66\xbe\x30\xf3\x85\x99\x2f\x7c\x76\xbe\x30\xf2\xc2\x8a\x51\xc5\xd4\xad\xbc\x63\x31\xd5\x4f\xf0\x6d\x62\xec\xeb\xee\x0e\x67\xd5\x2d\xc8\x0d\x79\x54\x5e\x6e\x63\xf8\xef\xf8\x50\x97\xae\xd6\x14\xbe\x73\x25\x0b\x40\xc3\x3b\xfa\x7c\x0a\x25\x1f\xf6\x3f\xa8\x01\xba\x6a\xc7\x52\x3a\x12\xb4\x97\xe9\x87\xfd\x0f\x1f\xde\x3e\x66\x3c\x3b\xd1\x0f\x2c\x61\x43\x4d\x8c\x7b\xd3\x93\xb1\xf8\x44\x23\xd5\x82\xa6\xc8\x6d\xfd\xfd\x0c\x94\xcc\xe1\xd6\x9e\x50\x97\xa9\xd1\xee\x21\x83\x48\x6e\x6d\xa4\x6a\x24\xde\x6f\xe9\x8e\x55\x4d\x18\xb0\xb2\xc7\x7a\x28\x31\x7c\x8c\xd4\x71\x57\x6e\x87\xaf\x4f\x87\x9c\x1b\xdf\x74\x3b\x0a\x95\x7f\x2b\x23\x4e\x63\x87\x09\x13\x29\x34\x60\x79\xd4\x56\xfb\x93\xf7\x8e\x9a\x64\x3b\x58\xaa\x38\xde\xbe\x1b\xc1\xbb\xda\x2e\x37\x51\x71\xb1\xca\x1b\xc8\xfe\x5e\x52\x68\x6a\x9e\xbb\x49\xb9\xb0\x4f\xbb\x19\x43\x83\xca\x2a\x9e\x10\x32\x40\x5b\xae\x3a\xe9\x2e\x9f\x8f\x41\xdc\xb0\xb5\x3c\xd3\xaf\xe1\x66\x15\xb3\x93\x6f\x6f\x08\xbe\xdc\xac\x04\x3a\x7a\x4a\xc7\xd5\x81\xa4\xd7\x00\xd5\x33\x83\x1b\x53\x26\x95\xbf\xd2\xe7\xfd\xbc\x3e\x27\x09\x53\xa6\x39\x27\x28\xaa\x00\x8e\xe1\x40\xa5\xe8\xd8\xee\x09\x76\xc1\xef\xe8\x94\x9e\xf9\xaf\xfd\x37\xcd\xa9\xc2\xa9\x6b\xcf\x71\x44\x36\x8d\xae\x20\x7e\x15\x24\x46\xe1\xea\xac\xc3\x2b\x5d\x95\x9a\x35\x56\xdf\x75\x52\x59\xe6\xb8\x52\xd6\x5f\xb2\xca\x44\x1e\xa1\x36\x45\x80\x1c\x57\xac\xc8\x34\x4c\xc7\x29\x58\x24\x46\xc9\xaa\x49\x1b\xf5\xac\x88\xe5\x78\x4d\x2c\x56\xd7\x22\xd1\xfa\x16\x89\x2e\xee\x1d\xd6\xbb\x48\x7c\xc5\x6e\xbc\x32\x4c\xd1\x54\x51\x2b\x0d\x33\x82\x2f\xe7\xa8\x3f\xfd\x7e\x45\x1e\x77\xc7\x22\x33\xf3\xf8\xd5\x33\x8f\xce\x0d\x2d\x62\x3d\xbf\x12\xce\x11\xf1\x52\x42\x87\x6f\x4d\x64\xa8\xc4\x7f\x53\x01\x72\x96\x9f\x86\xf3\x35\xa6\xe6\xcc\x54\x4e\x14\x41\x3a\x76\x36\xd1\x1a\x9d\xea\x51\xe9\x5c\xb1\x41\x58\x15\x94\xbc\x1a\x57\x98\x66\x75\xef\xe0\x99\xd5\xbd\x99\x63\x8f\x01\x9d\xd5\xbd\x59\xdd\x9b\xd5\xbd\x99\x79\x34\x9e\x59\xdd\xfb\xa5\xd4\x3d\xa6\xcc\x23\x15\xbe\x8e\x7a\xd4\xd1\xfc\xc2\x1a\x8e\xab\x68\x72\x4c\x95\x8f\x43\xb7\x11\xc5\x6e\xee\x78\xf1\x91\x29\xbe\x8e\x8d\xde\xbf\xc0\x26\xcd\x3e\x8f\xc3\xae\x89\xaf\xb1\xa2\x2c\x70\x94\x11\x5f\x63\xcc\xfe\xdf\xb1\xfd\xd3\x10\x8d\xb1\xb0\x5f\x04\x9e\xef\xd8\xfe\x66\x44\x26\x8d\xc8\xa3\xbe\x75\xfd\x62\xea\xf5\xec\xf4\xfd\xb2\xa4\xd2\xec\xf4\x1d\x5d\xc9\x67\x77\xfa\x12\x57\x82\xa9\x2f\xfa\xba\x7e\x5a\x98\xfa\xc1\x45\x59\xef\x80\x13\x57\xa5\x1b\xab\x48\x8e\xe3\x70\xa3\x91\x99\x97\x51\x9e\xd7\x5b\x8c\x9f\xf3\x47\xc2\x3b\xb3\xf0\x94\x8b\xb4\x8a\x78\x1d\x4a\xce\x7a\x74\xa1\xad\x52\x75\xe3\x1f\x1f\x51\x67\x0b\xdd\x5f\x3f\x2a\x6e\xc2\xa1\xf1\x83\x61\x9a\x58\x85\xf1\x5f\x25\x4e\x13\x16\x3a\x14\xa8\x89\x4b\x99\x23\x35\xe7\x48\xcd\x59\x38\xcf\xc2\xf9\x37\x22\x9c\xe7\x48\xcd\x99\x2f\xcc\x7c\x61\x10\x77\xbf\x51\xbe\x70\xd4\x48\xcd\xa8\x30\x49\x50\xbe\xbe\xa4\xb8\xcd\xc7\x4f\xe8\x97\x0e\xdc\xfc\x7b\xc9\x4a\x16\x1d\x06\xf7\x7f\xea\xb7\xab\x5a\x9b\xa5\x70\x9d\x10\x1a\xc1\x79\xa8\x0d\x03\xec\x41\x95\x52\xd1\x9c\x19\xa6\x1e\x5d\x25\x63\x45\x4d\xb2\xbd\x61\x22\xbd\x60\x34\xcd\xb8\x88\x95\x42\x7f\x3e\xfc\xce\x57\xd0\xc8\xdb\xe9\x6e\x78\xfb\x0a\x1c\x38\xc8\x1e\xbc\xa7\x1c\xa4\x19\xb6\x49\x7c\x9a\xeb\x98\x16\x34\xe1\x43\x0d\x7e\x3a\xeb\x78\xed\x5e\xf7\xd3\xef\x66\x4a\x1a\xe9\xbb\x37\x16\x41\x37\xb8\xde\x52\x95\xfa\x7c\xbe\x7b\x86\xe9\xb6\x24\x55\x12\x3b\xd2\x98\xed\x70\xcb\x8d\xb8\x26\xc2\x39\x7d\xf8\x33\x4d\xee\xe4\x3a\xd0\x37\xf6\x30\xf3\xd0\x7d\x70\xb8\x39\x8a\x19\xb5\x27\x29\xcb\xba\x37\xb9\xc3\x39\x05\x91\x9d\xd3\x87\x0f\x90\xb7\x1b\x5b\xa2\xe3\x5d\xf5\xc1\xe1\x94\x1a\xbd\xf5\x39\xb6\x31\x09\xe0\x1a\xe7\x4f\x91\x7a\x89\x14\x44\x31\x28\xde\x03\x86\x60\xe8\x59\x35\x6a\x96\x18\xc5\xb5\xcb\xb1\xbd\x66\xca\x92\x79\xfc\xfa\xda\xdf\x0d\x2f\x33\x94\xbf\x8a\x4f\xc1\x14\x98\x30\x9e\xbe\x14\x4b\x9a\x13\xb6\x08\xdf\x0f\x4c\x1d\x7e\x3f\x25\x7c\x19\x2c\x4a\x4f\xb1\x0f\x4d\x33\x5d\x3a\x19\xa5\xb7\x91\xc5\x70\x31\xf1\x0c\x54\x1f\xf8\xe5\xb8\x5e\xfc\xad\x33\x40\xbe\x67\x46\x93\x54\x96\xab\x2c\xa8\x1d\x58\xe1\xc4\x76\x4c\xed\xf1\xeb\xa7\x9d\x1d\x2e\xa6\xed\x8b\x7f\xbf\xda\x17\xd7\xaf\xf7\xf3\xef\xcb\x88\xae\xf2\x09\x02\xfe\x51\x34\x3e\x29\xe2\xff\x68\x81\xeb\x01\x35\x65\x8e\x5c\x9f\x43\x99\xfa\x9e\x39\x1a\x61\xe0\xf9\x92\xa3\x11\xe6\x50\xa6\x39\x94\x69\x0c\xf0\x1c\xca\x34\x33\x8f\x39\x94\x69\xf2\x4b\x73\xe4\xfa\x1c\xb9\xfe\x45\xc8\x80\x59\xdd\x1b\x7e\x7e\x63\x1c\x7b\x56\xf7\x66\x75\x6f\x0c\xf0\xac\xee\xcd\xcc\x63\x56\xf7\x26\xbf\x34\x47\xae\xcf\x91\xeb\xbd\x8b\x99\x23\xd7\xe7\x20\x98\x39\x08\xa6\x07\x77\xbf\xd1\x20\x98\x39\x72\xfd\xd1\x91\xeb\x04\xfd\x52\x1f\x18\xd4\x31\xc7\xcb\x4c\x4c\xef\x17\x3b\x29\x5f\x80\xaa\xe5\x6c\x53\x08\xa9\x1d\x9d\x3d\x80\xc3\x60\x7b\x88\x36\x53\x68\x4d\xd0\x87\xc3\xa4\x7b\x41\x73\x9e\x10\xc5\xec\xd8\x75\x64\xcc\xe0\x86\xf9\x7e\x35\xe6\xd4\x97\x52\x86\x66\x2d\x40\x09\x1e\x8d\x2e\x34\x83\x8b\x0d\xd3\x20\x59\xc9\xa5\xf1\x41\xe8\x83\x80\x7f\xfe\x13\x56\x23\xff\xc9\x2d\xff\x27\xd7\xcf\xf6\x7f\xfd\xbc\xd0\x0c\x7a\xcb\x1e\x94\xab\x6f\xa1\x67\x98\xc2\x7a\xb8\x5e\x23\xa4\xdd\x73\xbd\xfa\x4f\x67\xd0\x1e\xc7\x9c\xb5\xc0\x1f\xfc\xeb\xeb\xfe\xa9\x0e\xf1\xac\x18\xb1\x85\xed\x73\x43\x8c\xaa\x5d\xc5\x0c\x31\x62\xa4\xef\xa1\x4b\x56\x54\x63\x1f\x5d\xc5\x36\xec\x01\x2b\x99\x71\xb1\x09\xcb\x1f\x57\xaa\x9f\x70\x4d\x4e\x5c\x13\x93\x10\xe3\x8d\x62\xbb\xb9\x4c\xcb\xac\x0c\x4a\xe8\xb6\xbb\x1d\xdf\x07\x75\x88\xde\x55\x72\x6b\x4b\xf5\xb6\x12\xca\xd8\x56\xb6\xbf\x51\x40\xf3\x09\x35\x32\xc2\xa7\x51\x8a\xfc\x8f\x7f\x18\x5d\x6a\x38\x46\x82\x20\xae\xa3\x57\xfa\x81\x6d\xca\x8c\xaa\x66\x4d\x7d\xdf\x6e\x1d\xeb\xcd\x01\x73\x7a\x30\x8a\x26\x66\x44\x6c\x54\x4d\x10\xb0\x62\x5d\xba\x6c\x6d\xe5\xf3\xe5\x7f\x7b\xf1\xe4\x7d\x74\xf4\x90\x0f\x16\x49\xec\x5d\x61\xf5\x8d\x9b\x62\x7b\x81\xd4\x51\xa7\x83\x1d\x5c\x22\xd7\x8d\xfe\xd0\xdc\x2b\x33\x1d\x0c\x22\x02\xf4\xd2\x62\x97\x3d\x04\x21\x26\xb4\x30\xa5\x62\x64\xa3\x64\x59\x60\xbf\x25\xba\xa3\x3c\xb3\x77\x83\x36\x02\x7f\xf7\xf2\xc9\xe8\xd3\xac\xa0\x23\x4d\xa6\x3a\x6a\xb4\xfb\x82\xb8\x6e\x42\x2b\x66\xee\x19\x83\x2e\xb8\xf6\xae\x22\xa0\xd7\x34\x9e\x85\xe0\x3a\x91\x47\xfb\x3e\x4c\x69\x63\x5d\xff\xf3\x24\x74\x36\xe2\xd6\x05\xe3\x0f\x77\xe6\xe9\x5d\xda\xed\xc1\x21\xd6\x5e\xbb\x76\x5d\x67\xac\x92\x4d\xd8\x03\xd7\xbd\x6d\x33\x3a\x6b\xd3\xd0\x8a\x86\x43\x4b\x79\xe3\x5a\xa5\xb5\x90\x54\xea\xea\x16\x32\xdc\x74\xbe\xb5\xaa\x0a\xf7\x54\xa4\xfe\x50\x55\xc4\xdb\x06\xd4\x43\x85\x41\xd8\x5e\x19\x72\x44\x7f\x4a\xee\x18\x2b\xb0\xf1\x4e\xaa\x64\xe1\x3b\xa7\x87\x76\x66\xb4\x0b\x54\xb4\x4a\x3c\xd6\x09\x8a\x54\xf7\x30\xd8\xe2\xe8\x1d\x86\xb7\xa1\x69\x4e\xc5\xc9\x14\xd3\x65\x66\xaa\x96\x60\x76\x93\xac\x92\x61\x58\x18\x5d\x90\x02\xe7\x70\xe5\x70\x03\x0a\x04\x30\x3b\x91\xda\x4d\xda\xbb\xa8\xa0\xe6\x3b\x23\x86\x4e\xe0\x0e\x61\x0e\xf0\xb4\x93\x11\x19\x67\xde\x8f\xf9\x5f\x24\xfb\x11\xda\x6a\x7f\xe2\x2e\x41\x6e\x94\xce\x84\xe3\x3b\x03\xfd\xe4\x40\x7c\x21\x1d\x82\xdc\x6c\x3a\x87\x6f\xa0\x5d\x8d\x6f\x85\xa4\x11\x27\x45\x26\x91\x56\x69\x13\x85\xf8\x77\x2b\x24\x0f\xa7\x11\x6a\x94\x32\xac\x91\xf8\xbe\xfb\xe1\x49\x5e\x80\x02\x5e\xbf\x5c\x47\xfc\x61\x0f\x23\xe8\xfc\x62\xe7\xea\xfa\xd5\x5c\xcb\x74\x5a\x9b\x22\x80\xd0\xc7\x30\x3e\x51\x37\xfb\xb7\x38\x65\xfc\xe3\x8a\xb5\x63\x68\x9b\xa1\x97\x79\x51\x9a\xc6\xc2\x7b\x47\x76\x1d\x92\x26\x5b\x49\xda\x17\x83\x9c\x0a\xba\x61\x0b\x37\xe4\xa2\x1a\x72\x51\x19\xea\xce\x26\xb6\x9b\x27\xd5\x36\xfd\x82\x98\xfd\xe0\x29\xe3\x00\xb7\x2e\x0e\x76\x2a\x6e\x3d\x77\x83\xae\x8d\x15\x6c\xae\x89\xcc\xad\x38\x70\x09\xb2\xb5\x31\x13\x92\xa5\x7d\x23\xb6\xfe\xd5\x48\xe2\x76\x1f\x14\x43\x0a\xd2\x81\x3d\xd8\xa3\xca\x4d\xb6\x6f\xe6\x6f\x83\xcd\xe9\x9e\x6b\xe6\x9a\xec\x71\x7b\x47\x85\x64\x6d\xbb\xd8\x45\xc8\x46\x03\x7c\xe4\x8b\xa3\x88\x40\x17\x22\xab\x0b\xf5\xdc\x22\x3b\x31\xbf\x24\x75\xd3\x6b\x72\x25\xbd\xa5\x19\x04\x6b\x53\x2e\xea\xc2\xe3\x9e\x67\x77\xe6\x68\xd5\xc9\x6f\xff\xb0\x3d\x41\x45\x06\x5c\x2a\xa0\x36\x0d\xe9\xe9\x3f\xff\xbf\xdf\x2c\xfe\xc7\xff\xf7\xff\x3c\xcf\xf5\x3f\xf5\x3f\xf3\x7f\x6e\xff\x99\xfe\xf3\xfe\x9f\xfb\x17\x3f\x77\x00\x3f\xcf\x79\x96\x71\xcd\x12\x29\x52\xcb\xc2\xf1\x7f\x73\x2e\x4a\xc3\x34\xd9\xca\x52\x69\x92\xd2\xbd\x26\xf7\x8c\xdd\x69\xb2\x67\x54\xe9\x29\xfc\xdc\x21\xe9\x86\xff\x23\x2c\xfb\xde\x75\x38\x49\xca\xf5\x1d\xc1\x7c\x4f\x10\x7b\xab\x3d\x59\x65\x32\xb9\xeb\xb0\xc9\xe1\xd1\x65\x69\xd8\xb5\x62\x6b\xde\xb9\x35\x76\xf4\x65\x78\x97\x14\xf0\x72\x73\x9f\x14\xdb\x70\x6d\x98\xd2\xe4\x2f\xb7\xb7\xd7\xff\x3f\x7b\xdf\xff\xdc\xb8\x8d\xe5\xf9\xfb\xfe\x15\xa8\xce\x55\xd9\xbd\x65\xc9\x9d\xd9\xd4\xec\x54\xdf\x5c\xae\x1c\xdb\x9d\x71\x4d\x7f\xf1\x5a\xee\xa4\xea\x6e\xaf\x76\x21\x12\x92\x30\xa6\x08\x86\x00\xe5\x56\xfe\xfa\x2b\xbc\x07\x90\xa0\x44\x02\xa0\x24\xdb\xdd\x13\xf1\x97\x74\x64\xf2\x11\x00\x81\xf7\xfd\x7d\x1e\x59\xd0\x3c\xcd\xf4\xff\x75\xc2\xc4\x5b\x98\x02\xf4\xb9\x9e\xe9\xe3\x82\xba\xb1\x95\xad\x9f\xef\xde\x63\x9f\x60\x2c\xe5\xc2\x6e\xa6\xd6\x17\xa4\x5f\xb0\xcd\x8f\x04\x7c\x08\x31\x03\x35\x0d\x0e\x73\xd3\x45\x92\x26\xaa\xa2\x59\x8b\xba\x96\xc3\x4a\x8b\x6a\x55\x56\xec\x8c\x4c\xab\xed\xbd\x64\x6b\x6b\xa1\x0c\xa3\x5c\xb9\xb2\xa9\xca\x53\xa6\x99\x83\x6d\x66\xa7\x5a\xeb\x32\x26\xef\x84\xde\x65\xdd\xb5\x4f\x9a\xad\x54\x92\x91\x47\xae\x16\xe4\xbf\xf5\x99\x4d\x54\x86\xf3\xfc\xef\xf8\x4f\x56\x65\xec\xa3\xad\xf3\x8d\x6a\x8b\x5d\xdf\xdd\xd9\x05\xbb\xf9\x92\x77\x55\xc6\xa4\xd3\x0e\x7b\x6b\xfc\x37\x33\x52\xe5\x2e\x2b\xcb\x33\xf4\xb3\x4a\xad\x96\x35\xc5\xc7\x54\x6e\xe6\x64\x21\x77\xe8\x6a\xfc\xc9\x73\xb3\x1d\xb6\x8a\x5d\x8e\xdd\xb7\x8f\xdd\xb7\x8f\xdd\xb7\x8f\xdd\xb7\xb7\x9a\x01\x1f\xbb\x6f\xf7\x3f\x1f\xe5\x75\x09\xf9\x5c\x8e\xdd\xb7\x1b\x99\x71\xec\xbe\xfd\x95\x75\xdf\xd6\xfa\x4f\x94\xda\x73\xd1\x6a\x80\x63\xfc\xbb\xe8\x0d\xdc\xd4\x79\x94\x20\xa8\x54\xcf\x3a\xb6\x6e\x26\x68\x0a\xc7\x38\x63\xd0\x45\x19\x46\x20\x4d\x1e\xc6\xe7\x5c\xf1\x8c\x9c\xb2\x2f\x49\x56\xe9\xbb\x5e\xbb\x5a\xcf\xa7\xbe\xd3\xb0\x7a\x33\xfe\xd3\x0f\xe3\x37\x5d\xf7\xa2\x17\x69\xc9\xe7\x9a\x63\x00\x26\x57\xc6\xe6\x34\x59\xc3\x5b\x9b\xd4\xd4\xed\xc5\x56\x62\x63\x5a\x24\xa9\xa4\x12\x4b\xc7\xc1\x52\xeb\x7d\xd3\x35\xb9\x73\x96\x71\x4c\x3e\xd0\x87\xed\xbd\x2b\x2b\x6d\x67\x2a\x92\x0a\x26\x49\x2e\xac\x3d\xa5\xc7\x84\x36\xa5\xde\xba\xa6\x7f\xd4\x5a\x54\x24\x15\x70\xd7\x23\xc5\x2d\x3c\xdd\xa6\x68\xa6\x75\x54\xf5\x8e\xaa\xde\x51\xd5\x3b\xaa\x7a\x47\x55\xef\xa8\xea\x1d\x55\xbd\xa3\xaa\xe7\x53\xf5\xfc\x31\xa4\xf3\xd1\x08\x6e\x1a\xff\xeb\x39\x49\xc4\x72\x49\xf3\x74\x04\x98\x44\xb4\x9c\x57\x9d\x42\xdd\x27\xd5\x40\xc3\x0b\xea\x17\xf5\x3b\xe1\xf6\xfe\x37\x77\xd0\x09\x89\xd4\x99\x28\x7f\x2e\x69\xc2\x6e\x59\xc9\x45\x6f\x72\xe5\x26\x38\x08\x78\x85\x6b\x0f\xba\x4d\xd2\x80\xd1\xc1\x47\x2e\x99\x54\xa2\x64\x29\x39\x99\x89\xb2\x3f\x8f\x44\x2a\xaa\x58\x03\x24\xbb\xa4\x1c\x03\x02\x29\xee\x05\x88\x89\x68\x9a\x12\xfd\x97\x11\x89\x0c\xf0\x3e\xc4\x83\x9a\x97\x8c\x2a\x48\x5f\xa5\x39\x99\xeb\x39\x92\x02\x26\xd9\xc7\x00\x83\xdc\x6d\x26\xca\x4f\x95\xa2\x73\x76\x2f\x32\x56\xd2\x3c\xe9\xcd\x13\xdd\xf4\xa2\xe3\x88\x94\x20\x0a\x9e\x04\xe7\x6d\xe3\xa9\x04\x9a\x26\x9e\xaf\xd7\xcd\xc7\x5d\x71\x82\xb0\x70\xe0\x7f\x86\x0d\xb1\xeb\x84\x40\xc1\x48\xaf\x58\x46\x7b\xb5\xaa\xce\x2f\xdf\xc4\x03\xec\xbc\x00\x54\xcb\x24\x3d\x22\x55\xdf\x24\xa8\xdd\x2b\x4a\x90\x0b\xfd\x0f\x0c\x11\xf5\x82\x71\x85\xd0\x55\x76\x38\xe8\x32\x29\x69\xc1\x6e\x72\xc5\xca\xd5\x76\x76\x74\x1b\x0c\xd9\xdc\xe4\x26\x23\x49\x96\x54\x8a\xaf\x98\xa1\x13\x1f\xfe\xc0\xb4\x78\x3f\x8b\xc1\x64\xeb\x0d\x2b\xa2\xfe\x31\xef\xf7\x7f\x6f\xad\xcd\x96\x3f\xfc\xcc\x98\xa3\x18\xe9\x9a\x32\x34\x42\x59\x4a\x78\x6e\x12\x12\x9c\x47\xba\xc2\xdf\x68\x9d\xd8\xc1\x68\xfe\xdb\xa2\x70\xce\x54\xe2\x66\x92\x9a\xe9\x9e\xff\x15\xff\x31\xd2\x23\xfe\x31\x12\xd0\xd9\xf3\xd5\xfb\xa4\x39\x14\xc7\x70\xb5\xbe\x14\xb9\x62\x5f\xb6\x18\xeb\xe6\x2a\xbb\xf7\x92\x85\xc8\x52\x49\x0a\x91\x8e\x32\xb6\x02\x3b\x09\xff\x4e\xa8\x52\x25\x9f\x42\xc4\xa7\x4b\x41\xd6\xac\x58\xe4\x4e\x1d\x8a\x64\x4a\x1b\xed\xd2\x30\xb6\x74\x23\xe3\xc3\x26\xa3\xdd\x8a\x74\x63\x08\x43\x04\xc7\x4c\xfe\x5c\x8a\xaa\xb3\x7c\xba\x35\xcb\x57\x17\x18\x09\xa6\x19\x91\x55\x61\xe3\xbe\x19\xa6\xff\xa0\x3d\x64\x4c\x20\x50\x0c\xb2\xac\x99\x48\xb7\xc8\x85\xdc\xa4\x42\xa4\x63\x32\x11\x4b\x46\x56\x22\xab\x34\x0b\x58\x17\x7a\x79\xb2\x4c\x3c\xc2\x24\xff\x5e\x4d\x59\x86\xa9\x27\x06\xee\x1b\xb4\x84\x47\x4d\x76\xc1\x8b\x3e\xb5\x03\xc6\x63\x49\x42\xe0\x48\x3f\x02\xde\x03\x80\x93\x16\xe9\x5b\xf2\x9f\x39\xf9\x1e\xd5\x03\xf1\x08\x95\x36\x3f\xdf\x5c\x81\x0b\xa3\x93\xe8\x14\xdf\xfc\x6e\x02\xcb\x45\xfe\x34\x36\x98\xb6\x6a\xce\x53\x32\xe5\xca\xe6\xc8\x9c\xe6\xec\x11\x8a\x74\x24\x49\x40\x70\xe8\x0d\xdd\xad\xe4\x2d\xea\x59\x83\xe3\xc4\x1d\xa4\x79\xcd\x6b\xf2\x6f\xf8\x9e\x82\x95\x4b\x8e\xc1\xdf\x29\xc7\xf3\xd2\x49\xf3\xd3\xdd\x49\x8a\x32\xae\x7c\x1c\x95\x8f\xa3\xd1\x68\xa4\xe7\x89\xd1\x2f\x66\xac\x07\xbb\xa6\xf0\x56\x70\x8e\x88\xd4\x94\x1d\x74\xaf\xa7\x5d\x6d\x10\xc9\xcd\x50\x30\x70\x99\xaf\xcd\x2c\xc6\xaf\x3a\x9e\x0e\xe5\x08\xfb\x73\x83\xcb\x2a\xbf\x88\xdc\x9f\x7a\x95\xf4\x07\x54\x42\x3f\x65\x6a\x13\x54\xb9\xc6\xea\x04\x93\xfc\xdc\x9c\xad\xa2\x14\x09\x93\x3d\xee\x83\xcf\x92\x49\x4d\x05\x84\x52\x9d\xf3\x69\xd6\x70\x4c\x3e\xd0\x35\xa1\x99\x34\xf1\x48\xc0\x71\xd8\x3c\x80\x84\xdc\xcc\x3a\x49\x9b\xfb\xa7\x42\x2d\xb6\x18\x87\x5e\xdd\xed\xc3\xec\x58\x7c\xdd\x14\x6d\x50\xb3\x63\x1c\x90\x05\x2e\x49\x51\xb2\x84\xa5\x2c\x4f\x6c\x35\x49\xe3\x95\xe9\x96\x95\x07\xf8\x6a\x1f\x45\x7e\x27\x44\x58\x25\xbd\xc9\x53\xa8\x1e\x74\x9a\xb9\x37\x5f\x09\x6c\x68\xfd\x39\xa9\x96\x60\xda\x92\x2e\x85\xe8\xb6\x35\x2a\xc9\x4a\xb4\xb0\x21\x34\xbe\xb5\xcf\x4d\x71\x22\x9e\x62\xbe\xd4\x8a\x12\x55\xf6\x23\x77\x9f\x4f\x41\x58\x0e\x8e\x44\xcc\x8a\x71\xbc\x89\x66\x48\x9f\x6f\xae\xc8\x1b\x72\xaa\xc7\xf4\x1a\xbe\xde\x8c\x72\x48\xdc\x04\x18\xcd\xde\x43\xdf\xcc\x8f\xcf\x2c\xd9\x71\x7d\x46\xb5\xc5\x3f\xa3\x99\x64\x67\x24\x17\x44\x56\xc9\xc2\x29\xac\xec\xa4\x69\xb9\x47\x9d\xe2\x1d\xbd\x45\xf5\xdf\xfa\x98\xf3\x6e\x5b\xb4\xd9\x8e\x7d\x74\x43\x5b\xb4\xdf\x02\xeb\xab\xec\x82\xfd\xf6\x59\xb2\x4e\xd7\xd8\x76\xf1\xd2\x81\x98\x84\x9b\x80\xa9\x37\x5f\xfb\x20\xe2\x0e\x5b\x32\x45\x21\xfd\x87\xb7\xd2\x0f\xe0\xfb\x74\xdb\xa1\x71\xdf\xac\xef\xfb\x74\xd3\x8c\xff\x66\x1d\xef\xec\xde\xc5\x2f\xc1\x56\x24\x7b\xcf\xf3\xea\x0b\x62\x1f\x87\x7d\xe9\xa0\x5e\x5e\xc3\x23\x98\xdb\xfe\xc5\xb8\xf6\xdd\x32\xab\xb6\x9e\xd2\xfd\xa1\x37\x53\x47\xda\x7b\xc4\x8a\x09\x38\x84\x5a\x6f\x81\x52\x68\x4a\x4a\x9a\xa7\x62\x69\x47\xd0\x49\xd8\x8e\x0a\x00\x3a\x69\xb2\x70\x16\x8f\xfc\x01\x84\x4c\xc8\xa3\x00\xda\x73\x94\x39\xf9\x1e\xf4\x6c\x2e\xeb\xef\x8d\x8a\x37\xba\xeb\x37\x55\x53\x9f\x07\xd6\x3b\x5e\x12\x65\x09\x8b\xfe\xc2\xf5\x76\x79\x8f\xc8\x18\x1a\x66\x76\xd0\xfa\xd1\x17\x19\x33\xdc\x10\x33\xe6\xfb\x75\xb1\x31\x66\xfd\xe8\x8b\x8c\xb9\xea\x61\xf7\x5b\x63\xd6\x72\xa1\x3d\x66\x60\xd6\xcf\x3f\x66\xaf\x5f\xd9\x35\xa9\x40\xdf\x0d\xf3\xb7\x8b\xda\xa2\xb7\x15\x18\x0d\x5b\xd3\x87\x79\xc6\x4b\xa9\xac\x08\x03\x71\xd7\x63\x87\xb4\x59\xcf\x19\x18\x66\xc6\x53\x5d\xe3\x2a\xd8\xbf\x9e\xe8\x73\xce\x97\xb4\x5c\x6b\x65\xbb\x9f\x03\xb5\x18\x66\x2e\xec\x10\xad\xa6\x82\x05\x06\xe0\x40\x5e\xfb\x17\xd6\x13\x4a\x08\x97\x1f\x86\x0a\x0f\x7d\xbe\x7c\xb9\x96\x89\xea\xf6\xe3\xb7\xad\x7f\xbc\x0f\xac\x7e\xc7\xcb\x52\x7b\x54\x52\x4b\x09\xf3\x5c\xbb\xa2\xf4\xc4\xe8\x85\x60\x0c\xdf\x8a\xd4\x78\x29\xab\x5c\xef\x0a\x51\x2a\x87\xc6\xa9\x31\x60\xb7\xe4\xcf\xeb\x4e\xaa\x4b\x3e\x5f\xa8\x5a\x2b\xcd\x68\x95\x77\x87\x6d\x62\x43\xbf\x38\xd9\xba\x09\x16\x25\x0f\xac\xcc\x59\xd6\x40\xfa\xd7\x59\x9a\xdd\x7a\x43\x38\x2e\x3b\xa0\xa7\x8c\x2d\xa8\xa1\x96\xac\x41\x42\x0b\xa1\xbc\x84\x43\x8a\x91\x03\xf8\xc5\x96\xdc\x1c\x70\x04\xa1\xa0\x96\x5e\x9f\x9e\x3f\xf5\x4b\xef\x3d\x42\x5a\x8f\x3c\x4f\xc5\xa3\x1c\xa2\x74\xfd\x8a\x8f\x58\x9d\x21\xa9\xfd\x58\x87\x50\xbc\x10\x86\x02\x4f\x08\x78\x90\x5c\xd6\x14\xa3\xba\x5a\x16\x04\x69\xbb\x01\x75\xba\x4f\x59\xea\x77\xe7\x04\xd5\xe9\x28\x73\x27\x74\x4c\xe6\x4b\x49\x2f\x4b\xfd\xbc\xe2\x34\x9b\x14\x2c\x89\x12\x85\x3f\x7f\x98\x5c\xb4\x1f\x83\x3a\xc2\x05\x2b\xd1\x2a\xd6\x7f\x27\x34\x35\xde\x9d\xde\x3d\xfc\xc8\xa6\x0b\x21\x1e\xc8\xa9\xad\xe0\x98\x73\xb5\xa8\xa6\xe3\x44\x2c\x9d\x62\x8e\x91\xe4\x73\x79\x6e\xb6\xcf\x48\x8f\xb8\x9b\x45\x11\xb0\x0a\xb3\xba\xa9\x9e\x29\x43\x95\xd6\x1a\x83\x41\x25\xf5\xa8\x61\x71\xe1\x14\xa4\x64\xea\x29\xbb\x34\x4f\xb6\xa7\x0b\x1c\x03\xa2\x8e\xc6\xa5\x5a\x47\x20\x69\x56\x2c\x28\xfa\x6b\x3d\xc1\x06\xb8\x15\x22\x4a\x0b\x91\x43\x58\x6a\xba\x36\xc9\xf6\xc6\x7d\xc1\x72\x04\x47\x6a\x8e\x81\x1e\x45\x2f\x49\xd3\xd1\x90\xcc\x32\xda\x8b\x2e\x10\x64\x19\xdb\xbb\xc1\x87\x3c\x12\xd8\x11\xb0\x44\xb6\xad\x88\x03\x7d\xe3\x9d\xc6\xe6\xe7\x41\x8b\xd8\xb3\xc6\xee\x5a\xf6\x52\x1d\xb6\xc6\x87\x59\xcb\xda\x95\x10\xbd\x84\xe0\x52\x30\x0f\xe8\xf3\x6e\xb9\x5f\x9f\x8b\xc1\xbb\x65\xb7\x5d\x0f\x5b\x75\x9e\x3d\xae\x86\x5e\xb2\x3e\x17\xc4\xa6\x81\x19\x8e\x24\x34\xd7\x6e\x9c\xd3\xab\x61\xef\xc2\x3d\x61\x8f\xf5\x9f\x2f\xbb\xf7\xa6\x4c\xb9\x5b\x6f\x49\xd7\x00\x2a\x84\x58\x66\xc6\x63\xee\x6c\xa8\x3b\x77\x1b\x3c\xe5\xe9\xdd\x29\xe2\x88\x9d\xf3\x2e\x92\x44\x54\xb9\x0a\xd6\x1d\x4f\xb6\x6e\xef\x3a\xdf\xed\xbb\xba\x1a\xd9\x54\x58\xf6\x67\x37\x75\x20\xbc\xe7\x89\x5b\xc2\x8b\x3e\x60\xdb\xbf\x43\x56\x03\x4d\x5a\x94\x03\xc5\x40\x39\xcf\x4c\x11\x50\xb2\x60\xc9\x03\x11\x8f\x79\xa3\xb3\x1f\x73\x3c\x8f\x39\x9e\xc7\x1c\xcf\x63\x8e\xe7\x31\xc7\xf3\x98\xe3\xb9\xf9\xb7\x63\x8e\x67\xfb\xfa\x03\xe7\x78\xb6\x55\x99\x28\x0d\xa6\xad\xa3\x74\xaa\x31\x06\x58\xb7\x57\x7d\x39\x2a\x23\x47\x65\xe4\xa8\x8c\x1c\x95\x91\xa3\x32\xe2\xac\xcd\x51\x19\x39\x2a\x23\x7f\x70\x65\x64\xb1\xd5\x94\xb3\xad\x79\xfc\xed\x62\x1b\xf4\xd7\xa6\xa1\x41\xb2\x12\xea\x22\x08\xa8\xe6\xa0\xa0\x76\x96\xeb\xb6\x11\xe7\x56\x88\x39\xfe\xdf\x63\x32\xe1\x4b\x9e\x51\x08\x03\x52\xa2\xe8\x1c\x30\x6a\xd0\xc1\xf4\xb7\x0b\x07\x55\x6a\x8b\x26\xbe\x56\x22\xaa\xd4\xb2\x52\xe0\xe2\xdd\x18\xe1\x98\x18\x70\x73\xf8\x1c\xf7\x74\x0e\xab\xc8\xe7\xe0\x26\xde\xa2\xc8\x67\xf0\x4e\x4c\xcb\x8d\x77\x4f\x29\x51\xd2\x79\xc0\xa3\x86\xf7\xd4\xbe\x6e\x69\x70\xce\x17\xe2\xd1\x3e\xdf\xe4\xc5\x0f\x85\x87\x01\xd6\x79\xc5\xc3\xb9\x6c\x27\xd7\xe6\xce\x5f\x20\xfb\x76\x82\x90\xa0\xf8\x11\x2d\xa4\x52\x44\xf3\x83\x89\xa2\x8a\xcd\xaa\x6c\xc2\x14\x8a\x23\x27\xe0\x06\x64\x78\x8e\x18\xaa\xed\x64\xdf\xcb\x8c\xf2\xe5\x3d\x5b\x16\x5a\x4f\xea\x66\xcc\x03\xb1\xbe\xcc\xca\x9d\x23\x7d\x79\xfe\x1d\xac\x44\xca\x3b\xcb\x7e\x42\xfa\xd6\x92\xa5\xbc\x5a\xc6\x81\x79\xff\x0a\xaa\xd5\xba\x60\x28\x9e\xf1\xfb\x21\x01\x22\x17\xa2\xca\x52\x32\xa5\xc9\x03\x51\x90\x84\xcf\x4b\x50\xbf\x3c\xcd\x08\xee\x9d\xdc\x7c\xcd\x6b\x5e\x99\x52\x89\x25\xa3\xb9\xcd\x16\x44\xff\xab\x48\xd9\xc9\x49\x9d\xd8\x6f\xde\xe9\x81\xdf\x36\x02\x5e\x33\xc1\x16\x0c\xa3\x21\xf0\x5a\xcb\xee\x0f\x6c\xa9\x47\xb7\xe7\xea\x7b\x17\x9f\xc4\x08\x54\xc9\x7f\x67\x80\x2b\x17\xf7\x11\xee\x85\xa2\x99\x53\x0f\x94\x89\x84\x66\xf5\xd7\xb0\x92\xd7\x64\x96\x79\x3c\xfe\xf6\x50\xd8\x9c\x74\xcc\xd2\xe7\xbf\x33\xc4\x54\xc4\x38\x94\x14\xa8\x3d\x27\xc0\x65\x34\xcd\x25\xac\x9a\x27\x88\x02\x5f\x06\x88\x59\x54\xc4\x4a\xea\x91\x89\xdc\x3c\x6b\x77\x4c\x3d\x80\x47\xbd\x73\x7a\x29\x9a\x72\x02\x0b\x03\x88\xbc\xd4\xd6\x05\x01\xbf\xb4\xeb\xe7\x04\x44\x16\xac\x27\xed\x9f\x98\xf0\x24\x18\x08\xd5\x12\xe4\x20\x8e\xca\x60\x51\x42\x85\x97\x1b\x71\x77\xca\x2f\xee\x3d\x1a\xa2\xb3\x8f\x73\x9e\xb5\x37\xb2\xb5\x48\xea\x85\xad\x72\x83\x00\x88\xbb\xaf\x5f\x5b\xab\x77\x65\xf7\xa6\xac\x24\x2b\x47\xf3\x8a\xa7\x07\xdb\x8e\x5e\x15\xab\x83\xa1\x45\x24\x5f\xdd\xfe\x72\x59\x0b\x80\x5e\x8e\xdb\xe6\xae\x3b\xf0\xb1\xa6\xa1\x47\xdc\x31\xba\xb8\xbd\xb1\x32\xd2\x26\xe9\x80\xa8\xc6\xdf\x58\x4a\x64\xb2\x60\x4b\x8a\x51\x1f\xcf\x31\xaa\x6d\x38\x6a\xbb\x05\x68\x13\x19\xd6\x6f\x0c\x4e\x0c\xbd\x85\x0c\x73\x4c\x44\xbe\x62\xa5\xb6\x99\x13\x31\xcf\xf9\xef\x9e\xaa\x4a\x7c\x7b\x1d\xcb\xc4\xf6\x00\x90\xa0\x05\xd8\xb4\x70\x0a\xce\xea\x08\x5d\xc9\x00\x79\xad\xca\x23\x28\x5b\x7b\xaa\x83\xed\xcd\xb9\x1a\x3f\xfc\x05\xb6\x57\x22\x96\xcb\x2a\xe7\x6a\xad\x19\x1f\x16\x63\x89\x52\x9e\xa7\x6c\xc5\xb2\x73\xc9\xe7\x23\x5a\x26\x0b\xae\x58\xa2\xaa\x92\x9d\xd3\x82\x8f\x60\x72\x39\x82\x22\x2f\xd3\xef\x6a\x40\x92\x9d\xf9\xe2\x03\xcf\xe3\xaa\x63\x4f\xfe\xce\x31\x48\x4e\x5b\x36\x63\xf3\x69\x2c\x2c\xf7\xdd\xf5\xe4\xbe\x46\x4a\xe9\x37\x6e\xb4\xf4\x32\x58\x76\x8d\x85\xde\x7c\x4c\xbd\xe0\x3c\x9f\x31\xe4\xaf\x88\x22\xee\x36\xf8\xf0\x10\xae\xfb\x13\xc9\x6a\x0a\xdc\xc6\xe9\x7f\x3f\x26\x97\x34\xcf\x05\xc8\xad\xaa\x48\x01\x41\x45\xdb\xb1\x97\x74\xc9\xb2\x4b\x2a\x3d\x50\xd1\x4f\xfc\x29\xa1\xd2\x6c\xa4\x3f\xc7\xee\x1f\xd3\x06\xd7\xe3\x3e\xe8\x44\xd1\x3c\xa5\x65\x6a\x3e\x83\x16\xfd\x96\xc0\x93\x6f\x5c\xfb\x22\xff\x54\x3d\x90\xdb\x32\x36\xcb\xe8\x04\x12\x8b\x5c\xee\x93\x32\x09\xc2\x3b\x59\x50\x68\xc7\x50\x72\xa9\x78\x82\x42\xa9\xff\x40\x63\x65\x9c\xd9\x4a\xc8\x5c\x41\x60\x11\x5a\xa9\x05\x00\xff\xec\xa6\xe1\x14\x9a\x17\x4a\xc5\x72\x35\xb2\xd2\xa5\xf9\x09\x7f\x49\xb4\x2c\xd8\xb3\x05\x49\xc2\xa4\xfc\x20\x52\x7f\x7b\xad\x0d\xe6\xdd\x3c\xd4\xd8\x96\xee\x02\x22\x55\xb2\xd4\x77\x78\xa8\xb6\x4a\x0b\x0d\x93\x5e\xd0\xd5\x70\xf8\x5d\xcf\x92\xe1\x50\x46\x30\x94\x91\xb7\xc3\xc3\xf3\xe2\xed\xeb\x3d\x8e\xa6\xd0\x80\x86\x0a\x75\x96\x92\xd1\x33\x71\xd5\x8d\x5d\x95\xd3\x42\x2e\x84\xba\xaa\x09\x7b\xa7\x02\x49\x4e\x75\x66\xc8\x1c\x0a\xce\x40\x41\xc0\xac\xa5\x14\x84\x5b\x52\x95\x25\xcb\x55\xb6\xde\x78\x87\x97\xb2\x71\x09\x83\xaf\xa1\x49\x0c\x86\xd4\x1e\x64\xfd\xb5\x33\xb1\x28\xc5\x8a\x83\xbc\xf7\xf9\x13\x09\x49\x68\x6e\x29\x6d\x0c\xc4\x25\x0b\x08\xd2\x90\x35\x89\xf5\xac\xfe\xe9\x93\x9c\x3d\xda\xad\x07\x5d\x19\x34\x21\x9b\x73\x59\xa3\x39\x58\x0f\x82\xb9\xcf\x3f\xf1\xba\x4a\x5d\xf1\x65\xe7\x24\x9b\xba\xbc\xee\xd9\x78\xa9\xb7\x66\xea\x96\xe3\x1a\xa1\x65\x8b\x78\xad\x7a\x3d\xa3\x3c\xab\x3c\xca\x2d\x71\x72\x4c\x4b\x66\xbe\x12\x05\xc7\x06\x5b\x41\xef\xb8\x1b\x54\xf0\x67\x95\xde\x22\x67\xe4\x91\x69\xfb\x3a\xef\x4a\xb9\x71\x2f\x3b\xb5\xa5\x3e\xc2\xce\xa0\x6d\xc5\xb4\x19\xde\x94\x2d\xe8\x8a\x8b\x32\xd4\x7b\x8a\x20\x23\xab\x97\x50\x8b\x7f\x2c\xb0\xf6\xf5\x6e\x88\x6d\x71\x4b\x0b\xde\x5b\xb5\xeb\x5e\x6d\x9d\xfa\xf6\x06\x6b\xab\xcd\x4e\xc7\xca\xf2\xa6\xe3\x47\x44\xb7\x16\x02\x96\x15\x00\xdd\x61\xab\xbe\xc4\x24\xf9\xba\xb4\x61\xa3\xb4\xb2\x8a\x83\x34\x1b\x13\x0c\x94\x32\xeb\x69\x37\x5e\xcb\x44\x7f\x92\x8b\xdb\x1b\x1c\x31\xe0\x28\x07\x29\xd2\x7c\x6d\x5a\xf8\xa9\x05\x2f\xd3\x51\x41\x21\x7b\x5c\x7f\xcb\xb3\xd6\x68\x6b\xc0\xf7\x00\xc9\xe8\x96\xb1\x3e\x05\xd4\x5e\xad\xef\x62\xf5\x50\x68\x42\x67\xdc\x24\xf6\x6b\x6c\xad\xf6\xa1\x46\x19\xd3\x40\x78\xbb\x1a\x60\x23\xb1\xed\x89\x47\x19\xd3\xa1\x76\x04\xeb\xed\xbd\xa1\x37\xa5\xdf\x1d\x4c\xa0\x7f\x6d\x6f\xdb\x0a\xf7\xda\x6c\x4c\xd0\x34\xaf\xa8\x03\x76\xae\x4f\xc2\xdf\x88\xa0\x1e\xde\x93\xab\x1a\x41\x9b\x8b\x0c\xe0\x4c\xfd\x9d\x35\xdc\x2b\x3e\x70\xd2\x5a\x8a\xf8\xae\xcd\xbb\x74\xdf\x08\xbe\x7f\xab\x83\xc4\xcb\x76\xe2\xd8\x5e\x9a\x60\xfb\x76\x7f\x87\x0e\xf7\x7a\xe6\x2f\x14\xd5\xc5\x23\xf8\xfa\xae\x2e\x1f\xc1\x8e\x1e\x41\xaa\xbe\x8e\x1f\x9d\xdd\x3d\x82\x14\x0f\xde\xfd\xc3\xbd\x5e\xb0\x13\x88\x7b\x45\xee\xc8\xa8\xdb\x64\x4f\xea\x8f\x7b\x75\x66\xb4\xfc\x56\xb1\x72\x4d\xc4\x8a\x59\x7f\x35\x7c\xb0\x44\xe4\x92\xa7\xd8\x88\xda\x3b\x8b\x29\x07\x78\xac\x43\x68\x6c\x31\x99\x43\xbd\xd3\x19\x92\x45\x14\xdc\x1f\xad\x2c\xa3\x81\x19\x45\xee\x15\x61\x77\x6e\x4d\x24\x3e\xd3\x28\x48\x97\xb4\x73\x91\x62\xb2\x8e\x22\x68\x0e\xcd\x4b\x72\xaf\xd8\xad\x80\x57\xb0\xf3\xb7\xbd\x76\xc8\x5d\x8a\xa2\x4b\x9c\xc2\xec\xf0\xe4\xc8\x30\xee\x4e\xa2\xf2\x9b\xdc\x6b\xa7\x5c\xa7\xc8\x89\x42\xb4\x3c\x2e\xef\x29\x92\xe2\x56\x76\x54\x64\x0e\x54\x6b\x54\xc3\x96\x33\x94\x1b\xe5\x5e\x83\xf3\xa4\x22\xa7\xbd\x91\x4d\x15\xcc\x99\x8a\x24\xdb\x9b\x59\xd5\x91\x3f\x15\x49\x32\x2e\xcb\xaa\xc9\xa5\x8a\x24\x7b\xb8\x8c\x2b\xf7\x0a\x64\x5f\xb9\x57\x24\xd7\xc5\x6b\xe0\x0e\x8b\xf3\x00\xda\x2b\xc6\x3a\xc3\xcb\xdf\xef\xbd\xb9\x2b\x22\x49\xcf\x1d\x66\x84\xb6\x1b\x3f\xa3\x40\xa6\x97\x7b\x3d\xaf\x6a\x1c\x9f\x0d\x16\x1c\x82\xcd\x16\x1b\x9c\x19\x16\x9e\x9c\x9b\x39\x16\x95\x25\x16\x24\xd9\x9b\x45\xe6\xc9\x18\x8b\xb0\xe0\xa2\x32\xca\xe2\x95\xa0\x83\x6a\xb9\x68\xa2\x5f\x66\x54\x4a\x5f\x79\x2c\xd9\xb2\x9e\x3e\xba\x85\x86\x0e\x95\x26\xaf\xc3\xc2\x5a\x64\x94\x7b\x12\x60\xc8\xee\x59\x45\x1d\x7e\x85\x44\x0f\xc1\x1f\xbb\x88\x3a\x14\x48\xef\x83\x48\xe3\x57\xa4\x79\xa4\x0e\x94\x3d\xba\x59\x48\xc6\xa1\xe2\xb8\xff\xfc\x76\x80\xbb\x7a\x0d\x2c\xc5\x3b\x9e\x31\xb9\x96\x8a\x2d\x35\x25\x6d\xae\x71\xdb\xd6\x35\x0f\x05\x1b\xf2\x24\xab\x52\xcc\xfe\x02\xb2\x60\x08\x36\x08\xcb\x14\x2a\x6a\x6d\x9c\x63\xef\x46\xd8\x38\xdf\x41\x9b\xea\x97\xfa\x11\xab\x70\x1a\x6b\xa8\x71\xf3\x85\x10\x7d\xf4\x75\x5b\xef\x0b\x24\x08\xa9\x5e\x18\x59\xe7\x32\xbc\x1f\x0f\xd1\xcc\x58\x2a\xaa\xfa\x7b\xfc\x6f\x85\x90\x55\xb5\xe5\xb1\x33\xf1\x24\x38\x16\xe5\x12\x4d\x64\xa4\xda\x3b\x74\x44\x2d\xa9\x27\x6f\x77\x9c\xd9\x42\x77\x8c\xa6\x23\xcd\x83\xfe\x48\x51\x56\xd3\x6f\x71\x97\x20\x6b\xb3\x69\x18\x24\x06\x2d\x68\x77\x2a\xca\x3f\x59\xb0\x35\xa1\x05\x4d\xb8\xf2\x1a\x8a\xc3\xb5\x91\xc8\x01\xb6\xd1\xd4\xda\x07\xc2\x7c\xca\xc6\xc9\x66\x84\x0f\x74\xc0\xcc\xd6\x21\x15\xc7\xe4\x0e\xee\x2b\x30\x13\x91\xe3\xdc\xe3\x77\xe7\xa5\x39\xc9\x97\xf6\x51\x3d\xf2\xbe\x63\xea\x9d\x03\x80\xe7\xd8\xd9\x76\x90\x00\x50\x04\x64\x97\x92\xff\xce\x40\x59\xf1\x37\x93\xd7\x0b\xd8\x8c\xcb\xc6\x38\x4d\x5f\xf0\x93\x3b\x20\x33\x51\xb4\x54\x2c\x3d\xd9\xb3\x01\x7f\x6b\x4d\x36\x59\x34\x64\xea\x35\x03\xc1\x33\x9c\x49\x92\x32\xf8\x6f\x48\x3b\x9e\x8a\x4a\x35\xb8\xf7\xc5\x2a\x09\xc5\x48\x23\x55\xe8\x8c\x4a\x75\x5b\x8a\x29\xbb\xe7\xe1\xd0\xd5\x56\xc7\x7f\xa9\x10\x02\xff\x11\x22\xdb\x53\xfc\x1e\xcd\x0e\x0a\x2b\xcf\x16\x0d\x2d\xa5\x8a\x8d\x7a\x31\x6d\xdd\x6b\x80\xc6\xaf\xe7\x76\x5f\xd2\x5c\xc2\x60\xf6\x9a\x60\x6b\x5a\x44\xd5\x44\x23\x3c\xc7\x04\xb3\xd2\x44\xce\x8c\xcc\x44\xbd\x1e\xfc\xd2\x2f\xbc\x40\x4b\x26\x65\x47\xd9\xc0\xf6\xd5\x5a\x95\xbf\x55\x4b\x9a\x8f\x4a\x46\x53\x48\x44\x36\x44\x08\x47\x48\x64\x7d\x38\xe3\xf6\x34\xa9\xf7\x75\x06\xeb\x5c\x2f\x6a\x78\x55\x06\xcc\xb1\x64\x54\xf6\xe7\xa1\xf6\x4c\xf1\x73\xce\x7f\x43\x3c\x66\x5e\x27\x8c\x4e\x19\xa1\xfa\xdf\xa5\x3a\x23\x4b\x9a\x2c\x78\x1e\xe3\x88\x00\x6e\x26\x21\x85\x4e\x2f\x96\xf1\x0f\x81\x6f\x71\xce\x57\xc6\x27\x8a\x63\x0c\x3a\xce\xf1\xaa\xb7\xe1\x89\xdc\x5a\x38\xcd\x3f\xb9\x32\x19\x1c\x92\xbc\x6a\xb1\xb7\x2e\xa0\xf3\xcd\x0b\x06\x66\x33\xa5\x59\x1c\x2f\x8e\x72\x00\x03\xb7\x3e\xe8\x87\xf5\x2b\xa0\x3b\x91\xf4\x41\x8a\x36\xd7\x00\x36\x6f\xa0\x47\x63\x0e\x02\xc2\x65\x37\xe5\x49\x7e\xc2\x63\x4d\xf9\x70\x53\x8f\xf3\x3a\x8d\x48\x40\x3d\xc7\x9b\x54\x68\x68\x83\xcc\x7b\xbf\x2e\x57\x2c\xa8\x8c\xb7\xbe\x6e\xf5\xdd\x7d\x66\x08\x90\xea\x5d\xf9\xa7\x35\xa7\x76\x29\x9d\x53\x74\xee\xad\xf7\xba\xa7\xf3\x67\x28\x9d\xb3\x79\xfb\xda\xc0\xc6\x92\x36\xc2\x67\xf0\xee\x81\x25\x6c\x6a\x41\x73\xe1\x6f\x0c\xf3\xea\x1e\xee\x21\xad\xa8\x2a\x66\x0b\x34\x3f\xa2\xfb\xbd\xe4\xa2\x92\x84\x6a\xf3\xbf\x63\x3e\x60\x46\x3a\x0b\x63\x3a\xcf\x43\x71\x89\x79\x07\xcb\x57\xbc\x14\xf9\x12\x72\xdf\xfe\x33\x47\x17\x82\x64\x89\xc2\xc9\x6e\x91\x64\x5f\x0a\x56\x72\x84\xc2\x85\x58\x76\x93\x9a\x46\x24\x9f\xe7\x7c\xc6\x13\x0a\xc9\x93\x8f\x5c\x2d\xb4\xd0\x4b\xf5\x36\x4c\x70\x0e\xb9\x50\xbc\x23\x49\x4c\x0f\x28\x5f\x93\x92\x65\x8c\x4a\xd6\x8c\x83\xcb\xd6\xfb\xea\xd2\x83\xae\xf7\x6d\x11\xb5\xef\xd7\xd6\xdf\x23\x2d\x53\x08\xee\x53\xc5\xa7\x3c\xe3\x6a\xbd\xf9\xce\x4d\xa1\xe1\xd3\x2c\xa7\x54\xb2\x9b\x65\x8f\x42\xb1\x91\xbc\x0a\x8b\xac\x1f\x30\x7b\x91\xcf\xea\xc4\x32\x9a\xdb\x44\x80\xfe\x2a\xd3\x9e\xc3\x36\x2f\x8b\x04\x4b\x03\xee\x33\x89\xad\x5b\xc3\x15\x89\x3f\xdf\xdd\x5e\x9a\x87\xde\x4f\xf0\xa1\xa6\xd7\x96\x49\xea\xbb\xbb\xbd\xb4\xbb\x44\x6b\x73\x9d\xa7\x1c\xcb\x8c\xcc\xd4\xfe\xa3\x62\x25\x67\xa5\x16\xed\xa9\x84\x22\x93\x32\x65\x29\xf6\x94\xc5\xd4\xf9\x8f\x42\xb1\xda\x74\xea\x01\x14\xac\xfb\xfd\x5f\x5e\xbc\xe3\x19\x3b\x23\x97\xac\x54\xf8\x2f\xfd\xcd\xff\xce\xd6\xfa\x7f\xd0\xf7\x8b\xfe\xd5\x3a\xc7\x76\x4c\x3a\x9b\xd6\x92\xe6\x38\x9f\x9c\x8c\x46\x7a\xc1\x46\x38\xb1\x91\xca\xe4\xe8\x5f\x4f\x4e\xc8\xe5\xfb\x1b\x42\xcb\xb9\x1c\xef\x52\xc2\x98\xc4\x55\x15\x4c\x54\x95\xd4\x61\x66\xeb\x83\xb8\xbc\x20\x89\x69\x8b\x55\x49\x56\xe7\x50\x22\xb4\x48\xaf\x27\x3e\xc6\xd6\x49\x6c\x17\xdf\x78\x93\xd6\x3e\xe1\x0e\x12\x12\x58\x87\x8d\x2e\x76\x84\x24\x2e\x78\xbd\x05\xe2\x08\x91\x6a\xdb\x6c\xf9\x60\xd9\x96\x83\xf3\x18\x5b\xce\x72\xe3\xca\x54\x83\x9d\x49\x62\xc5\xca\x15\x67\x8f\xe7\x8f\xa2\x7c\xe0\xf9\x7c\xa4\x79\xd5\x08\x65\x9f\x3c\x07\xa0\xbb\xf3\xef\xe0\x3f\x41\xd5\xe7\xfe\xd3\xd5\xa7\xb7\xe4\x22\x4d\x0d\x5b\xa9\x24\x9b\x55\x99\x39\x29\x63\xa7\x42\xed\x0c\x52\x1d\xcf\x48\xc5\xd3\xff\x1d\x97\x7d\x13\xb1\x7e\x88\xf7\xbb\xdd\x58\xcd\xbb\x86\x13\x53\x90\xfd\xb8\x60\x86\x13\x3a\xed\xa7\x89\x28\x09\x57\x32\x2a\xe6\x67\x63\xb0\x71\xb9\x4d\xfe\x2e\x25\xcd\x15\x99\x37\xea\x1d\x5f\x64\x5e\x52\x52\xb2\xde\x02\x5c\xd2\xdd\x2e\xee\x1b\x38\xa6\xe6\x74\xe0\xf4\x9c\x0e\xe9\xd8\xd7\x1c\xea\xa4\x83\x9f\x16\x8c\x50\xb4\x14\x0c\x9d\x07\x16\x0c\xb3\x1f\x8f\xfd\xb7\x76\xec\xcd\x9e\x6e\xce\x7c\x08\xbd\x06\xaf\x6f\xf5\xcc\x07\x6f\x49\xa8\xd6\x73\xa2\x34\x8b\x5b\xaa\x16\x56\xc3\xb1\x0a\x05\xdf\x02\x7f\xad\x4d\xa1\xde\x81\x0f\xe3\x1f\xc1\x2d\x92\xf4\x34\xba\xdd\x1a\xff\x44\x95\x1d\xaa\x91\x29\x55\x85\xd9\xcc\x78\x56\x8f\xab\x7f\xf8\x47\xa5\xa9\x7b\x8c\x47\xa5\xa9\xff\xfa\x27\xe1\x9e\x47\xa5\xa9\xeb\x3a\x2a\x4d\x47\xa5\xa9\xfb\xfa\x27\x39\xf6\x47\xa5\xa9\x7d\x25\xc6\x57\x34\x58\x6d\xda\x52\x36\xb6\xf4\x27\x9f\xce\x60\x5c\xcc\x87\x52\x9c\x38\x34\x1b\x2f\xd9\xe4\x81\x17\xbf\xb0\x92\xcf\xe2\x7a\xb5\x5f\x61\x93\x04\x8b\x4b\xab\xe7\x02\x2e\x51\xc5\x9c\xbe\xa4\xfe\x41\xf9\xbe\xf4\x03\x7a\xde\x76\x5d\x5a\x4c\xd8\xec\x5a\xd9\x08\xcd\xf4\x50\x2b\xfb\xc0\xd6\x13\xaf\xd4\x08\x48\x8c\xae\xf9\x1c\xd0\x67\x17\x90\x18\x4f\x22\x2d\x06\x4b\x8a\x28\x2e\x17\x92\x10\x5f\xaf\x74\x38\xb8\x64\x88\x5a\xaf\x18\x89\xf0\x14\xd2\x20\x4a\x12\xc4\x48\x81\x90\x04\xf0\x71\xff\x70\xe2\x25\x78\xeb\xa3\x3b\xfd\x7c\x96\x88\x5c\xb1\x02\xde\x09\x4b\xb3\x10\x52\x41\xb1\xf9\x61\x38\x89\x77\xc4\x3c\x2a\x1e\x74\x63\x63\x40\x0e\x6a\x1c\x6d\x35\x67\x85\x6a\xc3\x3a\xc0\x74\x46\x14\xed\xde\x3f\x34\x4f\x89\x5c\x50\x92\x88\xe5\x94\xe7\x58\xd2\x34\xb6\x1b\xc4\x72\xad\x55\x13\xb4\x94\x0a\x50\x33\x58\xc2\xa4\xa4\x3d\x58\x7a\x6e\x4b\xed\x16\xaf\xfe\x64\xf3\xe7\x1f\x72\xf1\x68\x92\xa1\x2d\x6d\x31\x33\xa1\xa0\x6e\xa9\x66\xf3\xd8\xea\x40\x93\x07\x52\xb5\x67\xe5\x33\x08\x52\xbf\x17\x49\xf7\x49\x69\x67\x32\x35\xf7\x92\x25\x74\x23\xd2\x53\x31\xb1\x2a\xc9\x53\x96\xd0\xd2\x10\x24\x22\x27\x99\x10\xc5\x94\x26\x0f\xdd\x85\x5b\x52\x6c\xf7\x16\x9f\xf2\x3c\x25\x74\x4e\x79\x2e\xb1\x6a\xee\x56\xa4\xe4\xe6\x76\x78\x5b\x6c\xdc\x47\x36\xdf\x3e\x2e\x84\xf7\x69\xfb\x19\x37\x82\x67\xf0\xc3\x2c\x2c\x23\xcf\xcd\xc4\x77\x81\xb6\xf3\x48\xa5\x5d\x25\x12\x99\x7a\xe0\x11\xa3\xa5\x51\x90\xb3\xfa\xa4\xd0\xd7\x29\x81\x0e\x2a\x7d\x82\xeb\x13\x92\x3a\x3b\x4a\x9c\xb0\x54\x09\x49\x14\x9f\x34\xe9\x93\x24\x5e\x9e\xec\x85\xdd\xd8\x48\x50\xb6\xa9\xc8\x2e\x32\x5a\x0d\x50\xd2\xaa\xee\xf1\x79\x24\xdb\x8c\x06\xd2\xd4\x34\xd3\x00\x28\x9f\xd4\x34\xdb\xb5\x18\x0a\xe7\x06\xfc\xd3\x49\xd5\xdd\xe1\x9c\xfa\x11\x33\x86\xa5\x77\x47\x28\x2d\xbb\x20\x63\x58\x54\x85\xde\xf7\x7e\x45\x88\x18\x41\xad\x24\x84\x80\xf1\xc4\x2b\x1e\x85\x74\x31\x6c\xcd\x43\x08\x17\x5b\x08\x16\xbd\x34\x43\xc8\x16\x21\xe4\x0a\x5f\x8c\xa2\x17\xd1\xe2\xa5\x11\x2b\x76\xcf\x78\xeb\x44\x85\xdf\xfa\xe4\x06\x19\xbe\x49\x09\xdb\x2d\xb5\x8d\x3c\x11\x32\x3c\x79\x12\x74\x78\x12\x42\x88\x27\xa1\xc3\xd3\x91\x35\xb8\xb5\xb4\x26\x73\x70\x43\x3b\x0c\x2c\x71\xe7\x58\x37\xdb\x80\x0e\xca\x20\xec\x53\x9c\x77\x9a\x76\x49\x13\x9e\xcf\x23\xf5\xc9\x7b\xf7\xee\x56\x2e\x18\xfe\xc1\x51\x21\x6d\x42\x5e\x8f\x31\xd2\xce\xd3\x33\x85\x87\x9b\xf9\x81\x26\xe5\xae\x2a\x12\xb1\xc4\xda\x16\xc8\xbd\xeb\x71\x87\x11\x4a\xa6\x25\xa3\x50\xb9\xf5\x48\x3b\xf5\xc1\xa3\x12\x7b\x54\x62\x23\xd6\xe8\x9b\x56\x62\x57\xfd\x00\xe3\xed\x8a\xdb\x1a\x58\xdc\x55\x0c\xb6\xac\x74\xdb\xfd\x79\x18\x63\xe9\x4f\xce\x16\x19\x43\x19\xea\x4f\x69\x6e\x77\xae\x00\x84\x50\x91\x9e\x48\xf7\xf9\xcd\x21\xf5\x14\xa2\x6d\x1d\xdc\x42\xa4\x58\xbf\x72\x5f\xd3\x82\x1a\x68\xa5\x68\xb2\x30\x68\xa6\xf8\x17\x00\xe2\xec\xfc\x00\x94\xe7\xca\xd4\x84\x50\x95\x2c\xcc\xe2\xa9\x92\x17\x19\x23\x7f\xad\xf1\x0e\xce\xd8\x6c\xc6\x12\xf5\x23\xa9\xa4\x75\xb1\xc0\xfd\xdd\xbb\xb4\x46\x1d\xf8\xab\xfd\xd7\x8f\xdb\xcb\xee\x67\x61\xf8\xbe\xee\x4d\xde\x5a\x88\x6b\xb8\xd1\xd6\x26\xd9\xf1\xc3\xb4\x90\x86\x5e\x06\x18\xeb\x18\x7b\x20\xf4\x6c\x6f\x2c\x89\x81\x1b\xa1\x25\x81\x4b\x42\x8e\xc9\xaf\x0b\x96\xbb\x1f\xd2\xe8\xeb\x06\x46\xa1\x4f\x25\x2e\x19\xf9\x28\x26\xfa\x63\x54\x19\x3b\x23\xb7\xc0\xa6\x9a\x5f\x40\x23\xf8\x28\xae\xbf\xb0\xa4\xea\xeb\x56\x12\x60\x08\xbd\x8c\xbe\x0d\x95\xd9\xc0\x1f\xe1\xbc\x5a\xf0\x47\xcd\x56\x0c\x34\x6f\x53\xc2\xac\x61\xcf\x6a\x3d\xb0\x75\xd3\x3a\xcc\x40\x2e\x01\x4c\xcc\x59\x08\xa3\xc4\xb2\x20\xc4\xaa\xf9\x9f\xa6\xca\xbd\xf1\xf0\x35\x4d\x4a\x9a\x77\x5a\x04\x8b\x5e\x18\x4b\x7d\x13\x0c\x69\x97\x85\xf5\xa3\x30\xb5\x9d\x53\x03\x3a\xcc\xd5\x3a\x52\x9f\x80\xec\xc2\x57\x72\xe0\x92\xae\x7f\xab\x68\xd6\xee\xbe\x6e\x7e\xf2\xc2\xfc\x6c\x35\xac\x7a\xe4\x59\x9a\xd0\x12\x6d\x1c\xd3\xdf\xc0\x7a\xfd\x10\xce\x3c\x01\xec\x5f\x64\x1f\x9e\x05\x86\x2f\x2f\x4d\xdd\x3e\x2d\x15\x4f\x2a\xad\x4e\xeb\xb3\x38\xef\x6d\x47\x13\xf2\x37\xd7\x1b\x72\xc2\x12\x91\xa7\x31\xcd\x18\xef\x37\x9f\xd9\xac\x02\xd2\x5a\x9a\x48\x41\x61\x30\xf5\x9e\xbd\xbb\xbc\x3e\x0e\xa7\xa6\xb1\x88\xd9\x9d\x62\x66\x79\x4a\x7d\x68\x5b\xf0\x83\xfd\x9d\x2b\xea\x0e\x5f\x46\x01\x7e\xed\x70\xe6\xfa\x54\x8e\xc9\x4f\x6b\x6b\x47\x82\x06\x89\xa0\xc0\x3d\x24\x25\x53\x67\x1b\x1d\x7c\x90\xa2\x73\xcc\x67\xa2\x64\x2b\x56\x92\xd3\x54\x80\x3b\x86\xad\x78\xa2\x5e\xf7\x6d\xbd\xff\xc3\x4a\x01\x9b\x2c\x67\x73\xaa\xf8\xaa\x06\x89\xb1\x8e\x1a\x65\x31\xa7\x25\x79\x43\x4e\x81\x98\xb6\x7b\x58\xca\xa9\x62\xd9\xfa\x75\x0f\x5d\x03\x03\x82\x90\x1f\xdd\x2f\xb7\x45\xb0\x3c\x57\x7f\xfe\xc1\xb3\x65\x78\xae\xd8\xbc\x33\x72\x0a\x43\x8d\xd8\x27\x88\x42\xd2\x62\x86\x68\xb3\x6c\x70\xc2\x5a\x1c\xf6\x82\xbc\xf5\x42\x6d\x39\xa0\x59\x4e\x69\xa9\x65\x84\x01\x9b\xff\x1f\x7a\xaf\x51\x52\xb2\x39\x9c\x23\x3c\x23\x3b\x9c\xa2\x60\xc1\xd9\x76\xd9\x5d\x8f\xc2\xd5\xa9\x6c\xb5\xeb\xce\xfc\x96\x62\xef\x38\x2d\xdc\x4c\x95\x6f\xbb\x95\x3a\x40\x55\xf0\xc6\xcd\x72\xb0\xa6\x13\x4c\xed\x80\x6a\xdd\xbf\x1d\x7f\xc0\x88\xbc\xa8\x54\x51\x29\xb7\x13\x0e\x2a\xc0\xa6\xce\xb6\xf5\xca\x26\x68\xa5\x8f\xc2\x16\xc5\x29\xd3\x82\x93\xe5\x29\x2a\x5d\x68\x06\xb4\x08\x98\x2c\x80\xa2\x23\x0b\xe0\xac\x1b\x63\x51\xf3\xfd\x39\xcb\xe1\x44\x23\x50\x3b\x29\x99\xac\x32\xf0\x71\x99\x40\x08\x74\xb4\x30\xb6\xca\x2e\x4a\xa4\x33\x44\x47\x7b\xa6\x04\x7c\x69\x5a\xcf\x03\xae\xfe\x8b\x05\x9f\x57\x0b\x6d\x9b\x76\x6c\xc5\x7a\x2e\x43\xb5\x3c\x78\xd1\x2d\x55\x8b\x88\x83\x0b\x49\x16\x66\x10\xa6\x58\xdf\x78\x2b\xa8\x32\x7c\x70\x0b\xf3\xb9\x8f\x21\x31\x7c\x33\x4b\xad\x6d\xab\x99\xa3\x21\x48\x4e\xde\xf6\xc0\x44\x04\xa4\x16\x4e\xa6\x14\x05\x9d\xc3\x9e\x8c\x98\xd3\xe6\x23\x24\x65\x8a\x95\x4b\xf0\xc3\x2f\xc4\x23\xfe\x1d\x75\x80\xc2\xdc\xd5\x6b\x9f\xd5\x9d\x71\x16\x42\x2a\x03\xd7\x6a\x17\xc8\x60\x7e\xe1\xc6\x7c\xa4\x6b\x42\x4b\x51\xe5\xa9\x51\x6b\x03\x32\xe6\xc3\xc6\x20\x3f\x8a\x1c\x18\x28\x74\x10\x74\xbb\x54\x40\xc8\x53\x51\xbd\xd9\xbf\x1f\x7f\xff\x66\xa7\x45\xec\x37\xff\xb7\x7b\x63\x80\x58\x46\x7d\x50\xcf\xce\xfa\x03\xec\x8e\xdd\xe9\xfd\x25\xa3\xe9\xa7\x3c\x8b\x51\xaa\x3f\xe0\x16\x82\x47\x00\x94\x08\x1c\xbe\xa5\xd6\xa4\xe0\xa7\xc7\x92\x2b\xe6\xa8\x07\xa7\x33\x9a\xf5\xb2\x7d\x51\x92\x2a\xaf\xd9\xcc\xeb\xb6\x86\x07\x0f\xfa\xa6\xd3\x6f\x95\xcb\x6a\xba\xe3\xf9\x32\x07\x09\xb6\x55\x73\xbc\xea\x4d\x75\xd2\xdb\xc6\xba\x05\xba\xee\x1e\x35\x77\x4a\xaf\x5e\x91\x53\xbc\x53\x2b\xc9\x42\xf4\x69\x25\x81\xcf\x65\xa6\x77\xfd\xa5\x88\x51\xd4\xaf\xbf\x14\x14\x98\x74\xf1\xe4\x73\xfd\x89\x2d\xe8\x8a\x49\x22\xd1\xbd\x9c\x41\x3a\xfa\x04\x47\x0b\x1e\x66\xa7\xfc\xb8\x8f\x38\x2d\x39\x38\x94\x6b\xe0\x30\x49\xfe\xc7\xe9\x2f\x17\x77\xff\xf5\xf1\xe2\xc3\xf5\x6b\xe0\x0a\xcc\xce\xa8\xb1\xcb\xc3\xa3\x6e\x55\x3e\x07\x3e\x8a\x1d\xb3\x5e\x61\x8f\xa9\x65\x67\xa6\xc7\xb4\xac\x54\x45\xb3\x6c\x4d\xd8\x97\x24\xab\x24\x5f\xed\x72\x12\xfb\xbd\x49\xa3\x46\x6a\x74\xfc\xad\xb3\x69\xc1\x2e\xba\x10\x42\x5c\x45\x68\x25\x51\x0a\x89\x45\xd1\x46\xdd\x63\x5b\x25\x89\xd1\x45\x36\xd5\x10\x57\xed\xd8\x9e\xb2\x55\x43\x6a\xfc\x6e\xb0\xec\x9e\x4d\xa9\x68\xdb\xc2\xfa\xab\xa4\x35\xaa\x88\xe9\xf0\x68\xdd\x4e\xeb\x6e\xcf\x32\x82\x8b\x99\x06\x5b\xf9\xda\x8d\x4e\xe4\xd6\x8f\x36\x54\xdf\xa0\x8f\xf2\x3a\xa3\x52\xf1\xe4\xa7\x4c\x24\x0f\x7a\xc6\x31\xd2\xe6\xe4\xe2\xd7\xc9\xd6\x73\xad\x19\xe6\xe4\xe2\xd7\x09\xb9\xe2\xf2\x21\xd4\x10\xc6\x46\x04\x5d\x2f\x1d\x25\x0f\xd5\x94\x65\x0c\x5a\xaf\x81\xf8\x36\xf0\x33\x56\x72\x43\x94\x41\xc8\x7e\xdf\xac\xa8\x57\x64\xdf\x06\xab\xf4\x51\x32\x9c\xea\x54\x4f\x15\x1a\x23\x75\x3b\xab\xc3\x29\x9e\x33\x79\xef\xc5\x5b\x69\x2f\xb2\x03\x0b\x69\xf1\x26\x1d\xde\x0c\xeb\xb6\x16\x15\x79\xa4\x5e\x60\x55\x25\x90\x3f\x8c\xc9\x3d\x2f\xde\x92\x6b\x9b\xd6\x65\x7c\x5d\xb3\x8d\x97\x70\xd9\x14\xd4\x7b\xa8\x4e\x9b\xbc\x3a\x63\xf0\x69\x76\x6b\x2c\x5a\x72\xfd\x85\x2e\x8b\x8c\xc9\xb7\xe4\x15\xfb\xa2\x7e\x78\x75\x46\x5e\x7d\x99\x49\xfd\x9f\x5c\xcd\xe4\x2b\x5f\x7a\xe9\xcd\xb2\x0e\x0c\x43\x97\x43\xd3\x85\x6a\xca\x0c\x29\xad\x53\x38\x8a\x81\xfb\x79\x3d\x54\x0f\xf5\xe1\x3d\xaf\xc0\xa8\x87\x56\x52\x53\x81\xe8\x60\xd0\x46\x8a\xb0\xb2\x14\x65\x6d\xf0\x38\xcb\x0d\xc2\x35\x11\x4b\x6d\x03\x71\x19\x00\xf9\x03\xff\x32\x1c\x81\xfe\x5c\xd3\x88\x14\x02\x70\x48\xf5\xeb\xe2\x64\xbb\xdd\xaf\x3e\x45\xf6\x21\xd2\xd6\x0e\x5a\x3b\xd0\xdf\x16\xcb\xec\xc0\x9b\x99\x4d\x25\x40\x97\x80\xd3\xb5\xd6\x6e\x53\xbd\xb3\x0c\x7d\xcd\x24\x7d\x5b\xa5\xd9\x65\xef\x84\xe5\xeb\xe4\x3c\x65\xab\x73\x99\xd2\xef\xcf\x60\x68\xb6\xe5\xb7\x72\xe7\xe1\xa1\x49\x25\x79\xf5\xfd\xab\x3a\x0a\x9e\xad\xcf\xdc\x19\x37\x2b\x31\x13\x65\xfd\x2a\x3f\xdc\xd1\xab\x37\xaf\xc8\xa9\x28\x61\x34\x09\xcd\x49\xc6\xe8\x8a\x59\xe3\x57\xf3\x8b\x35\x7a\x42\x5e\x77\x82\x4f\xe0\xe5\x78\x83\xfe\xed\x4f\x81\xef\xdf\xef\x11\x22\x41\x75\x9e\x74\xf6\x88\xd4\xeb\xf7\x4a\xeb\xf1\xaf\x40\xf7\x16\x65\x82\x7c\x18\x10\x05\x17\x0c\x40\x48\x35\x4d\xcf\x22\xd4\x53\xe5\x79\xdb\x0f\xa0\x95\x2c\x20\xdd\xbb\x39\x3c\x54\xb9\x24\xaf\xc0\x14\x78\xf5\x8c\x5c\x9e\x44\x66\x44\x23\xe5\x9b\xab\xd8\x95\x46\x00\x36\x72\x73\x65\xf9\xbc\x03\x3f\x96\xba\x72\x94\x70\xdf\x06\xd6\x62\xf7\xf4\x62\x49\x7f\x17\x39\xb9\xfe\x69\x62\x86\xf1\xfa\x45\x16\xc8\xc3\x8a\xfc\xf9\xe2\xa3\x7a\xf5\x3c\x8a\x72\x6f\xa2\x0d\xfd\xbd\x2a\x99\x56\x3d\x22\x34\x99\x0b\x7b\xef\xa6\xf6\xa2\x7f\x27\x57\x54\x51\x54\x62\x4c\x36\x55\xdf\xca\xd7\xb2\x50\x9f\x0b\x48\x0c\xc6\x07\x1c\x3d\x64\x47\x95\x21\x01\xae\x3f\xf7\xa3\x56\xb7\x77\xd2\xdf\xf4\x40\x2e\xf1\x39\x80\xc7\x7d\x4b\x3e\x8a\x9c\x9d\xc1\x41\x25\xfa\xa4\x9a\x7f\xfe\xaa\x0d\x72\x0f\xdb\x89\xc9\x49\xe3\xf2\xc1\x0f\x07\xbd\x15\xa5\x75\xd3\x14\xa0\x04\x13\x76\xb7\x11\x2d\xd3\x4c\x4c\x6d\xda\xf2\xbe\xe3\xfa\x7c\x77\x33\x60\x58\x9f\xef\x6e\x9e\x76\x48\x83\x94\xbf\x4d\xdd\xaf\xd1\xe2\x4c\xea\x09\xa1\x8e\x2e\xe1\xd3\x1c\xf4\xd3\x4d\x1b\xd2\x90\xde\x36\xb6\x1a\x9b\x4f\xa2\xb5\x74\xb9\xc1\x1a\xdb\x3e\x6b\xe8\xef\x89\xd8\x3e\x06\xd7\x5f\x0a\x96\xa8\x3a\x24\x4d\x26\x0b\xaa\x19\x0e\x59\x56\x99\x82\x68\x3e\x7c\x58\xfd\xa5\x7d\xe2\xbb\x60\x65\x9d\x46\x4f\x93\x04\x4e\x35\xb9\x62\x18\x5c\x4f\xdf\xda\x4e\x08\x35\x2d\xf7\x01\x9f\x9e\x61\x49\x7d\x80\x7c\xc3\xf4\x2d\x72\x2d\x82\xe9\x87\xa9\xb3\x0b\x4f\xd1\x93\x96\xdb\x3f\xf9\x88\xae\x28\xcf\xa8\x41\x35\x93\x4c\xbd\x1e\xb7\xb2\x30\x25\x2c\xc0\x5e\xc7\x7d\xa0\xfa\xb0\xe5\xb3\x23\xa7\x9a\xc2\x39\x78\x02\x5f\x8f\x6b\xcd\x81\x2c\x98\x57\xb7\x06\xeb\x1e\x15\x0f\x57\xe1\xd0\x73\x54\x26\x39\xcd\xd5\x2a\x42\x5b\xcc\x27\xb8\x43\x82\xc9\x32\x3c\xcf\x9f\x3f\xdf\xdd\xec\x2c\xb6\xfa\x4b\x2c\xb7\xc5\x16\x00\xa1\x75\x89\x2d\xf8\xc3\x84\x95\x2b\x9e\x18\x0f\x5c\x9f\x93\x35\x7f\x42\xc9\xf5\xcf\xbf\x57\x2c\x06\xc1\x00\x01\xa8\x9c\xae\xa7\x36\xb9\xb0\xd5\x7e\x0c\xbf\xe0\x24\xc8\x40\x2e\x0c\x03\x01\x69\x6a\x90\xf1\xf6\x39\xd9\xc0\x1c\x06\x4c\x04\xb8\x29\xe9\x3d\x09\x51\x6f\x0d\x9d\xb5\x66\x75\xfb\x6e\xb0\x83\xde\xe5\xbc\x25\xac\x58\xcc\x62\x32\x29\x2e\x59\xb1\x78\x37\x69\x3b\xf0\xf4\x6f\xe4\xdd\xa4\xd6\x0b\x9d\x40\x53\x7f\x83\x38\x18\xae\x44\x67\xdf\x89\x24\x19\x9f\xb1\x5e\x7c\xeb\xf0\xf9\x5a\x8a\x9c\x2b\x51\x7a\x6a\x0a\xb6\x0b\x06\x60\xb5\xc9\x07\xf3\x24\x36\x08\x49\x44\x96\x19\x94\x4f\x31\xc3\x89\x59\xd2\x9e\xfd\xd7\x61\x4e\x30\x63\x8f\x8f\x1f\xfe\x02\x06\x85\x31\x1d\xce\x71\xa1\xcf\xef\xae\x2f\xae\x3e\x5c\x8f\x97\xe9\x77\x0b\xf1\x38\x52\x62\x54\x49\x36\xe2\xaa\x5f\x1e\x05\xf1\xe7\xa3\x4a\x6b\xc3\x98\xba\x45\x6f\x3c\x68\x7b\x11\x3f\xd9\x6c\x53\xac\x32\xa5\xa6\xe8\xc2\x46\xbe\x84\x50\x67\xa4\xa4\x35\xac\x67\xc0\xa5\x33\xab\xb2\x0c\x57\x5c\x95\x8c\x9d\xb9\xfe\x10\x4f\x5f\xcc\xc3\xcb\x69\x67\x5a\xb1\x6c\xd8\xe7\x6c\x63\x25\x1b\xcc\x86\x61\x43\xf9\x6c\xfd\x27\xdd\x6a\xf1\xbc\xde\x87\x81\xd0\xbf\xaa\x93\xfa\x59\x9b\x69\x53\x18\x88\x84\x07\xb6\x26\x01\xc0\x90\x99\x28\xf5\x6e\x2b\xdb\xfb\x83\xa9\x04\xa6\x7b\x5e\x49\x56\x8e\x8d\x2c\x79\x86\x53\x19\x23\x4b\x60\x30\x77\x6c\xb6\xeb\x42\xdd\xb1\x19\xf6\x54\x6a\x37\x08\x22\xb4\x52\x0b\x96\x2b\x8e\x18\xc2\x9e\x25\x33\xcb\xd1\xb9\x72\xa6\x31\xe0\x33\x2c\x55\x1c\x52\x50\x18\x4d\xe7\xeb\x4c\xf3\xc7\xeb\x09\x90\x74\x06\xb0\x75\x2f\x5c\x8c\x3e\x18\x3b\xf1\xf5\xd2\x1e\xd2\x92\xa6\x02\xf2\x3a\x4a\xf8\x4a\x67\x71\x3e\x49\x9a\x2e\x79\xfe\x55\x1c\xc5\x90\x82\xe5\x95\xf3\x21\xf5\x89\xe7\x69\xdf\xfa\xb6\xd7\xf6\x12\xee\x6c\xeb\x4f\xf8\xb4\xf5\xab\xd7\xb1\x3f\x6a\xed\x8f\x5e\x3b\x57\xe4\x36\x36\xd8\x8e\x0c\x46\x1d\xe8\xe5\x5a\xfe\x96\x8d\xf0\xdd\xa3\x22\x6d\x56\xfc\x65\x02\x7a\xcf\xe5\xd4\xd9\x08\xc6\xbd\x80\x6b\x27\x4a\x5f\x1c\xf8\x75\xc8\x51\x15\x3a\xe8\x2a\xc6\x68\x3f\x3b\xc9\xf4\x42\x70\x13\xea\xa1\x56\x30\x1b\x7c\x8a\x06\x5a\xc9\xe7\x81\xa3\x25\x5d\x32\xc5\x4a\xcc\xb0\x33\x99\x7c\xb9\xa9\x64\xf9\x54\xb0\x7c\xa2\x68\xf2\xe0\xf1\x63\x1f\xe5\xf0\x8b\xca\xe1\xa1\x91\x30\x9b\x16\x93\xd6\xdf\x9b\xa7\x5a\xeb\x33\x61\xdc\x26\x6b\x06\x37\xf9\x57\xc8\x75\x9e\x32\xba\x15\xc0\xa8\xed\x41\xa7\x6d\x0b\xdf\xfa\x67\xf0\x3d\x99\x6c\xbd\x42\x14\x55\xd6\x5f\xdb\x02\x15\x48\x38\xf0\x1d\x85\xa5\x51\x9e\x86\x84\xb2\x1a\x26\xb2\x14\x29\x23\x53\xae\x6c\xd9\xa2\x56\x04\x12\x53\x7e\x01\x32\xd3\xb3\x0b\xa6\x75\x15\x89\x2b\x69\xb1\x1e\x61\xca\xd4\x23\x63\x39\x79\x03\xba\xc7\x9b\x7f\xff\xf7\x7f\x0f\x94\xce\x9b\xd5\x10\xe4\xcd\x9f\x7f\xf8\x61\x4c\xae\x78\x09\xad\xf2\x39\x94\x85\xd4\x09\x94\x85\x4d\xfe\xcb\x85\x22\x14\x6a\x64\x40\x50\x7b\x1d\x02\x58\xe9\xad\x65\x82\x49\x23\x5e\xf2\xf9\x02\x46\xcb\xa1\x7d\xde\x2c\xe3\x89\x82\xb7\x98\x43\x8e\xb5\xaf\xde\x71\x42\x96\x9b\xa9\xfb\x33\xf9\x27\xb0\x96\x67\x24\xe3\x0f\x8c\xcc\xe4\xcf\xa5\xa8\x8a\xa6\x0d\x32\xa6\xbf\x79\x28\x26\x34\x87\xd2\x1f\x18\x40\xf3\x55\x24\x53\xcf\x92\xc0\x10\x70\x0a\x6d\x96\x9a\x3a\xda\xc9\x19\x61\x34\x59\x68\x83\x7b\x84\x9f\xbe\xa0\xbc\xce\x9d\xbb\xa2\xaa\x2b\x91\xbf\x1e\x3f\xe4\x73\xb7\x99\x7d\xc2\x52\xe7\x80\xd9\x04\xc4\xa2\x14\xff\xc0\x8f\xcd\x73\x6f\x4a\x8c\xc3\xca\x20\xef\x10\xbe\x0c\x36\xb7\xce\x9d\x66\xb9\x0f\x6c\x0d\xdf\x46\x8b\x4a\x68\x1d\xeb\xff\xda\xb6\x98\xae\xa3\xcc\x16\xb0\xae\x52\x28\x00\xdc\x1e\xad\x57\xdd\x30\xd6\x77\x93\x6d\xa9\x77\xb7\xc4\x3d\x53\xe5\x5b\x74\x01\x1c\xcb\xa7\xc0\x18\x56\x04\x83\xa4\xb6\x2e\xd2\xc9\xe5\x84\x84\x63\xac\xf5\xb2\xf7\x9a\xef\xe4\x21\x5a\x7f\x8a\x56\xc6\x8e\x64\xaa\x32\x1f\x07\x12\xb1\xf4\x78\x99\x94\xa6\x98\x6c\x49\xcb\x07\xef\xdc\x6d\x71\xf9\x18\xb2\xc1\x65\x5d\xf8\x86\x55\x8c\x2b\x56\xf7\x21\x72\xeb\x25\xfc\xe3\x3c\x19\x8f\x4f\x90\x3d\x88\x92\x48\x45\x4b\x73\xa2\xf5\xef\xfd\xa2\x2c\xe8\x0b\x6d\x67\xe2\xd3\x42\x6f\x29\xd3\x7a\xcf\x60\x7f\xd3\x56\x96\x37\x8d\x68\x9e\xfa\x0c\x80\xe4\x66\x03\x1e\x0c\x9a\x78\x19\xe8\xee\xbd\x35\x96\x80\x88\x51\x58\xcd\x91\x31\x9f\xd5\x64\x5e\x1d\x21\x59\x0c\x0a\x54\x73\x32\x83\x54\x9d\xbd\xec\xc8\xcf\xfa\x00\x3b\x35\x27\x56\x58\x04\x49\xfa\x85\x49\xa7\xc8\x08\x4f\x3e\x28\x52\xb6\x05\x47\x90\x68\x84\x60\xc1\x2b\x4e\xbc\xe0\x15\x23\x64\xf0\xf2\xc7\x05\xf0\xda\xda\xd7\x35\x67\xc0\x23\x3e\x6b\xa4\x2e\xd4\x6a\x17\x01\xee\x80\x17\x1e\x8e\x31\xf9\x60\x38\x8b\xde\x55\x39\xa1\x53\x29\xb2\x4a\x21\xe9\xe6\x8f\x86\xed\x44\xed\x24\x18\x14\x43\xec\x24\xe4\x38\x35\x19\x87\x15\x01\xb3\x8f\xe9\x1e\x49\x02\x5c\xcb\xbc\x38\xee\xf0\x1e\x02\x44\x7a\x04\x33\x0c\x86\x8c\x02\xc8\xf2\xe1\x90\x91\xdf\x56\xfc\x5a\xed\xc4\x03\xdb\x88\x11\xdf\x35\x8c\x6b\xbb\x53\x6b\x03\x19\x42\xb6\x8d\xc0\xb5\x0d\x3b\x3d\x42\x86\x98\xe4\x31\x26\xd8\xe4\x86\x9c\x5e\xd6\xa5\x1a\x26\xb0\x4f\x6e\x72\xc5\xca\x19\x4d\xd8\x6b\xd7\x34\xf3\xe7\x0d\xd9\x4a\x89\x05\xcd\xd3\xcc\xd6\x81\x10\xf6\x45\xb1\x32\xa7\x19\xbc\x29\x2d\x39\x94\xb7\x5f\x64\xc5\x82\x5a\xf0\xa5\x9e\x4a\xb2\x08\x83\x0d\xa8\xc5\xe6\x6f\xe0\xab\x8d\xda\x9a\x3b\x9b\xde\x19\x18\x4c\x01\xc7\xef\xd7\x63\x6b\x5b\x73\xac\x37\x00\xc8\x0f\x60\x4d\x6b\x51\x95\xc6\xc1\x6e\xa1\x7c\x13\x51\x6a\x13\xac\xbb\xd2\xa9\xb9\xa8\x24\x25\x9b\x6b\x5d\x15\xf0\xb6\x4c\xcd\x6c\x56\xe9\x1f\xf6\xca\x49\x3b\x50\x5e\x9f\x93\x7b\x67\xdc\xb0\x3e\x3f\xad\x75\xd0\x6e\xa2\x4a\xea\x49\x41\x80\xcb\x28\x21\x5c\x92\x82\x4a\xe3\x46\xf1\x8b\x1e\x2a\xa5\x48\x38\x18\xd4\xce\x17\x43\x65\x1c\xd4\x8d\xba\x16\xb7\x95\xbb\x1f\xe7\xb0\x16\x80\xa4\xe2\x01\x16\x8f\x58\xe8\x5c\xa4\xec\xb6\x9a\x66\x5c\x2e\x26\x03\xbd\x91\x1f\x3b\x1e\xc5\xec\x87\xad\x18\x23\x7a\x28\x7d\x36\xc1\xa6\xef\x92\x48\x06\xdd\xa8\x57\xc8\xd0\xb5\x2a\x02\x2d\xd3\x05\x2c\x7d\xdd\x99\x69\xd2\x9d\x15\x66\x46\x6b\xce\x87\x80\x8a\x90\x8c\x19\xd4\x0a\xfd\x21\x9c\xb1\x9b\x52\x32\x44\xc9\x49\xd9\xe7\xbc\x70\x7f\xf7\x1a\xed\x59\x26\x37\x6b\x93\x2d\x73\x46\x4d\xcd\x14\x9e\x99\xdd\xc3\xf5\xc6\x0a\xaf\x05\xdf\x00\x8d\x74\x30\xd3\xda\xcb\x24\xc9\x52\x60\xd9\x51\x4e\x84\xb7\x8d\x38\x3e\x0e\x80\x42\x96\x94\x53\xef\x09\x95\xdf\xb0\xa1\xfb\xb7\xd2\xd1\xdd\xfb\xa2\xee\xde\x81\x01\x97\x89\xb1\x85\xf0\x30\xda\xca\xf1\x76\xed\xa8\x65\xf5\x61\x93\x35\x10\xb3\xd9\x2b\x04\x82\x6f\xbf\x50\xaa\xe4\xd3\x4a\xf9\x76\xd7\x30\xe8\xd7\xc8\xa5\xef\x28\x2a\x6d\xc6\x02\xaa\x03\x93\x86\x8f\x8c\x8c\x81\x99\x38\x67\x21\xe8\x24\xac\x4f\x96\xc3\xb1\x0c\xbd\x46\x08\x83\xfc\xc5\x1f\x7b\xcb\xa9\x61\xb0\x22\xa9\x6a\x80\x56\xf8\x7e\x4d\xb8\x12\xf3\xb1\x43\xdf\x22\x80\xbc\xeb\xcd\xd1\x85\xf1\xed\xa2\xd3\xa5\xe2\x31\x7f\xa4\x65\x7a\x71\xdb\x53\x3a\xd0\x56\x79\x9a\xbb\x5d\x2d\xce\x12\x21\xfa\x77\x3a\x15\x06\x3e\xb5\x10\xbd\xd5\xaa\x1d\x5e\xf8\xa3\xbf\xbd\xbd\x44\x47\x7f\xfb\x37\xe0\x6f\xd7\xf7\xa2\x5a\x95\x71\x09\x35\xf4\xad\xb3\x60\x51\x25\x7c\x0e\xa5\x61\x8e\x4e\xe7\x04\x22\x47\xdc\xcc\x89\x77\x14\x32\xbf\xf0\x13\x66\x77\x37\x5f\x6d\xa3\xef\x4f\x21\x52\x14\xaf\x07\x70\x98\x02\x1d\xaf\xf6\xda\x31\x57\x27\x81\x77\x02\x60\xb4\x18\x35\x70\x02\x13\x85\xf0\x3a\x4f\xf0\x02\xf1\x4a\xf3\x5c\x20\x6f\x96\x67\x24\xa3\x53\x96\xc9\x33\xb4\xd9\x00\xee\x4c\x2b\x20\x05\x4d\xd8\x46\x7f\xf5\x90\x1b\x2e\x76\xfa\xfa\x6a\x34\x94\xf0\xbd\xfd\x90\x5b\xa0\x6f\x26\x0b\xb6\xa4\xf0\xcf\x77\x7a\x35\x3a\x81\x30\xba\x2e\x2e\x89\x56\x0b\x14\xc3\xc2\x66\x56\x2e\x25\x11\xb3\xb3\x56\xcd\xcc\xab\xd5\xf7\xde\x72\x75\x7b\x45\x3b\xa8\x89\xfd\xfc\xfd\x28\x34\x9e\xa9\xdf\xb6\x9c\x8a\xfa\xd3\x37\xd0\xc4\xc1\xc8\x43\x73\x35\xb1\x16\x38\x96\xb8\x9e\x07\x9e\x66\x8c\x3b\x8f\x80\xb8\x9e\x45\x7e\xb5\x28\xdf\x1d\x39\x06\x01\x8e\x41\x80\x97\x0c\x02\x38\x6c\x1a\x4e\x2b\x97\xc4\x2c\x80\x1b\x18\x08\x38\xab\xf0\xda\x88\x1e\x4c\x99\xd5\xc0\xc6\x0d\x48\x9b\xde\x6b\x36\x2e\xd0\x8b\x26\xdb\x5c\x4e\x8c\x92\x9c\x9c\x8c\xc7\x27\x27\x36\x9a\x60\x36\x6e\xa5\x66\xa3\xbf\x10\x96\x27\x22\xc5\x4d\x15\x1e\xe6\x8c\x97\x52\x81\xe0\x6e\xec\x63\x77\xae\x4b\x3b\xd6\x26\xc4\x10\x8e\x2b\xc0\xd8\x0e\xd6\x71\xd3\xd6\xce\xbf\xdb\x49\xf0\x36\xe2\xb6\xae\xc1\x37\x13\xad\x31\x78\xde\x82\x5c\x0d\x4e\xab\xe9\xb5\x61\x5a\xbe\xe8\xe3\x61\x1b\x89\x90\x53\xfc\x71\x9c\x14\xd5\x99\xb9\x61\xbc\x64\x4b\x51\xae\xc3\x2c\xc2\x12\xd1\x0f\xb7\xa8\x1a\x0a\x08\x8f\x95\x54\x65\xc9\x72\xe8\xba\xf1\x24\x52\xbd\x5e\x0f\x7f\x25\x59\x73\x6d\x64\x0a\xd7\x7e\x72\xf0\xce\xd4\x32\x04\x41\x79\x31\x5b\x3a\xbc\x14\xc4\x09\x3c\xc0\x93\x2c\x5f\x91\x15\x2d\x65\x68\xa6\x64\xa8\x20\x4f\xf9\x8a\xcb\x3e\x48\x64\xcf\x44\x1b\x9f\x87\x03\xbc\x89\xfc\xcb\xec\xac\xa8\x49\x1a\x0c\xa4\x66\x57\x6d\xe8\x2e\xdf\xbf\x3a\xf4\x84\xed\x9b\x86\x7f\xda\x86\x2b\xd6\x67\xa8\x56\x5d\x0e\xfc\x5d\xe2\x35\x8f\x00\x34\x55\xfb\xdd\x41\xc5\x23\x2e\x80\xf9\x1c\x01\xca\x00\x11\x70\xf1\x5e\xf1\xa8\xe4\xfd\x6b\x73\x6f\x3b\x83\x50\xb1\x65\x21\x4a\x5a\xae\x49\x6a\xec\xf1\xb5\xf5\x62\xd0\xb2\x1f\xfe\x1d\x0a\x1f\x9d\xca\xc7\xbd\x51\x49\x60\x26\x29\x2f\x77\xcd\xdf\x5f\xb2\x94\x57\xcb\x58\xef\xc8\xaf\x00\x9a\x65\xa0\xb8\x2c\x28\x00\x92\xa8\x21\x0f\x69\xf2\xe0\xc3\xbd\x06\xa2\x76\xc9\x40\xbc\xba\xa5\x49\xaf\x5e\x6d\x00\x58\x83\x06\x0a\xf1\x34\x91\xb2\x13\xbf\xc7\xcd\x90\xc1\xf1\x38\x8e\x97\xdc\xb8\xf4\x4d\x36\xd0\xa9\xb9\xf1\x35\x11\x25\xf9\x00\xb2\x61\x60\x06\xed\xe1\x3e\x10\x89\xac\x27\xe3\xbf\x33\x68\x21\x15\x8d\x5a\x25\x14\xcd\x9c\x16\x58\x19\x74\x81\xb4\x5f\xac\x25\x55\x02\xdf\xaa\xde\xfe\x36\x1a\xa9\xbf\x98\x1e\x0f\xca\x67\x70\x76\x64\x12\xa3\x5b\x3c\x01\x74\x4a\x4d\x15\x65\xae\x87\xae\xfd\x4a\xf7\x4e\x9b\xb4\x4a\xea\xd1\x01\xb6\xbf\x7e\xda\xee\xac\x7a\x08\x8f\x1e\x04\x5f\x82\x41\x6f\xb7\x03\x58\xdb\x00\x81\x4e\x27\x76\x1d\xdd\xa6\xa3\xfe\x6a\x7a\xab\xbe\xcb\x0a\x94\x3b\x33\x32\xa3\xbc\x88\x19\x44\x69\x6a\xa1\x2f\x6b\x28\x43\xdf\x8e\xda\xd8\xf3\x39\xcf\xda\x9b\xde\x22\xd3\xd5\x0b\x5c\xe5\x26\x96\x3f\x60\x9f\x76\x6f\xd3\x4a\xb2\x72\x34\xaf\x78\x7a\xd0\x0d\x1a\xe0\xb6\xb3\x24\x82\xcf\xbe\xbb\x6c\x33\xd8\x77\x7c\x5a\x32\x72\xb9\xa0\x79\xce\x32\x47\x64\x6e\x80\x25\xf6\x39\x94\x5d\x08\xc5\x00\x82\xe2\x01\x90\x1e\xbe\x8d\x2a\xa8\x97\x84\xb6\xf9\x46\xe0\x01\xb3\x2a\x1a\x18\xb0\xf1\x98\xbc\xbb\xb4\x2d\xe7\xb3\x2a\x27\x79\xb5\x9c\x32\xcf\x69\x7a\x39\x28\xbb\x97\x2f\xec\xda\xaf\x02\x0b\x17\xf9\xd7\x5f\x3f\x46\x23\x3e\x74\x7d\xa3\x47\x51\x66\xe9\x23\x4f\x31\x45\x47\x92\x53\x4d\xf0\xf5\xcb\x83\x30\x3c\x3e\xf2\xbe\xb6\x26\x81\x89\x19\xc7\x18\x4c\x8c\xc0\xcc\x4c\xb9\x10\xd7\x12\xe9\x14\x08\xf7\x75\xe2\xd0\xd7\x35\x47\x14\x78\x7d\x9f\xd6\x89\xdc\x2e\x3b\xda\x18\xab\x97\x1d\x58\xa7\xde\xe3\xcb\x40\xf7\x37\x83\x13\x3f\xad\x8c\x8b\x46\xa8\x05\x91\x7c\x59\x65\x8a\xe6\x4c\x54\x32\x5b\x7b\xb6\xc2\xf3\x2c\x78\x48\x66\x65\xec\x0b\x6e\xdd\x18\xd9\x55\xdf\xdc\x96\x61\x00\xac\xcc\x13\xfb\x81\x5a\x42\xac\x2f\xda\x24\x31\x97\x49\x72\x91\xb3\xf4\xbc\xae\x0b\x46\x34\x6f\xc8\x76\x63\x09\x34\x45\x4f\x49\x91\x55\x73\xde\xe3\xb5\x7e\xb6\xdc\xb6\x26\x6f\x47\x6b\xea\x11\x0a\x65\x28\x85\xe1\x0f\x0c\x24\x77\xdf\x99\x55\x46\x52\x56\xb0\x3c\x05\xa8\xf0\x66\xa7\xf9\xce\x1e\x4c\x7e\xaf\x15\x36\x5e\xf0\x97\x4c\xf0\x70\x78\xdc\xf5\x17\x55\x42\x7b\xff\xa5\x66\x40\xd6\x43\xcf\x67\x84\xe6\x3e\x46\x72\xf8\x54\x9d\x6f\x5e\x84\x3e\x19\x30\xc9\x53\x25\x0d\x22\x8f\x0b\x6e\x76\x9b\xda\xd7\x9b\xc2\x67\xdf\xef\xd6\x59\x79\x51\xb8\xe3\x53\xf9\xdc\x84\x3d\xaf\x44\xd4\x77\xc9\x8e\x34\x23\x9c\x63\x3d\x93\x63\x19\xf7\x57\x99\xd7\xf7\x74\x39\x57\xb3\x4c\x24\x0f\x51\x48\x22\xef\xf0\xce\x0d\x4b\xd9\xfc\xb8\x09\x25\xa2\x6d\xe0\x9e\xe9\x76\x5b\xc6\xe6\x0c\x39\xe2\x06\x52\x0a\x0c\x79\xbd\xf9\x4b\xd1\xb7\xc3\xa5\x01\x5b\x9c\x32\xe8\x66\x5c\xe5\xbd\x98\x06\x11\x9a\x09\x55\x54\x0e\x02\x15\xdc\x44\xd4\x95\x4c\x61\x3e\x20\x00\x94\x2d\x99\xa2\x00\x27\x3a\xfa\x31\x14\x76\x34\x73\xb6\x34\xb4\x3a\x63\xe7\xdf\xb4\x74\x49\x44\x2e\x79\xca\x0c\xf5\x54\x7f\x8b\xc4\xd3\x86\x29\x0e\xae\x17\xdf\xf8\xf9\x73\x34\x4a\x80\xbe\x75\x63\xce\x75\x67\x6a\x52\x21\x96\x76\x63\x07\xf8\xe6\x3c\x73\x36\x91\xa1\xf4\x64\xbe\xa0\x79\xc2\x6e\x6b\x58\xef\x48\x88\xea\x93\x9f\x2f\xaf\xdb\x0f\xb5\x0f\xc0\xcf\x97\xd7\xff\x14\x8d\x36\xe6\x09\x6b\x20\xcf\x53\x2e\x1f\x8e\x5d\x36\xfe\x00\x5d\x36\xb6\xbe\xfa\xb7\xee\x43\x3b\xb6\xd8\xf8\x8a\x5b\x6c\x3c\x13\x8f\x22\x07\x75\x74\x16\xe9\x00\x5d\xc0\xf6\x91\x70\x9d\x14\xb7\x57\x6e\xf3\x08\x2d\x30\xc6\x00\x5f\xea\xe7\x67\x2d\xd0\x1d\x0b\x88\x0f\xcf\x3e\xdf\x22\x3e\x01\xbe\x57\x0b\x47\x3a\x64\x7f\x7a\x56\x68\x0b\xb5\x6b\xbb\x41\xe1\xb3\x2f\xd4\x3e\xc0\xe6\xb8\xcb\x76\x52\x6a\xb8\xba\x63\x45\x8f\x64\xd8\x50\x65\xf0\xd6\x0d\x3f\x21\x57\xfa\x07\x21\x39\xe4\x11\x60\xc3\xed\xba\x73\x76\xef\x67\x47\x2f\xe1\x98\x5c\x5d\xdf\xde\x5d\x5f\x5e\xdc\x5f\x5f\xbd\x25\x96\x3e\x77\x15\xd3\x31\xb9\x17\x8d\x5b\xb1\xd7\x2a\x68\xfa\xa9\x41\x3e\x64\x33\xae\x33\xc3\x36\x69\xde\xc4\x62\x01\x14\x85\xe6\xe4\x26\xe7\xaa\xce\x5a\xf2\x29\x5e\x49\x26\x72\x93\xef\xa3\x69\x1a\x8f\xe6\x9c\xab\x33\x54\xb3\x0c\xea\xfa\x82\xb5\xdf\xd1\x4b\x92\x91\x5b\xcc\xa5\x68\x7a\xcd\xee\xaa\x2f\xd5\xf9\x08\xb1\xdd\x32\x30\x92\xd0\x64\x7e\x80\x14\xd9\xee\x1b\x6b\xf1\x4d\x3c\x87\xa8\x41\x3e\x01\x9f\xc3\xc9\xf8\xc4\xaa\x46\x59\x8d\x5b\x63\x13\x5f\xeb\xd7\x75\xb6\x1c\x6e\x2e\x13\x06\x6f\xef\xaa\x31\x21\x9f\x6c\xe3\xd1\x33\xad\xdd\x6c\x80\xe3\x78\x0a\x6d\xec\x48\x9b\x48\x77\x07\x7d\x2b\xb7\x65\x35\x75\x07\xea\x4f\xf5\x01\x2a\x2b\x96\x07\xc4\x70\x14\x13\xb4\x03\x89\xfc\x86\x77\xcd\xc8\x3f\xdf\xbd\xdf\xef\xd5\x78\xae\x22\x5f\x7c\x29\x96\x4b\xae\xc8\x82\xca\x45\x5d\xd6\xd7\x64\x23\xd4\xa7\x7a\xf7\x11\x85\xf8\x5c\xb3\x54\x3b\xf1\x3a\x2c\x18\x8f\xc2\x8d\x3f\xf9\xd9\xde\xbc\x61\xb0\xd5\x3f\x6f\xa1\xc7\xfb\x38\x48\x0b\x3d\x3e\x94\x44\xd5\x07\x35\x5b\x8f\x7f\x7f\xec\x53\x96\xa7\x88\xec\x18\xdd\x90\xc5\x3e\xf0\xd1\xc1\xb7\xb2\x54\x50\x61\x81\x89\xa6\x4c\x51\x9e\xf9\x14\xbe\x66\x05\x95\x28\x44\x26\xe6\xc3\xf0\x9c\x3b\x16\xe1\x3b\xcc\xac\x1e\xd1\x91\x5e\xdd\xfd\xf4\xff\x78\x34\x79\x9b\x20\xae\x17\xa2\x99\x53\xad\x09\x43\x5e\xf6\x10\xc3\xeb\x45\x26\x7c\x50\x05\x6c\x73\x15\xfc\x2a\x6a\xd3\x60\x18\x25\x49\x53\x3f\x5c\xb0\x72\xc9\xa5\x66\x25\x9d\x9a\x99\x87\xec\x33\xee\xa3\x7d\xd4\xb5\xfa\xf4\xf5\xa9\x73\x7d\x69\xa6\x01\x06\xa7\xb9\x50\x64\x83\x6c\x68\x34\x06\x5b\xb8\xc5\xde\x8a\x92\x8d\xd8\x17\x2e\xc1\x57\x01\xb5\x0b\xa2\x6c\xa4\x77\x5f\xc4\xcd\xe9\xa0\x61\x5d\x50\xd6\x61\x85\xcf\x42\xff\xe4\x56\xc6\x92\xa7\xcb\x3e\x5e\xd6\x1d\x88\x1d\x7e\xb3\x6c\x8d\x80\xa2\x50\x8d\x8c\x0e\x02\x3a\x87\x41\x8b\xd2\xb8\xdb\x8b\x92\xaf\x78\xc6\xfa\xdb\x2c\xa9\x05\xcf\xe7\x4e\xf3\x60\x68\x75\xcc\x4c\x19\x16\xdb\x9a\x83\x3e\xbf\x52\x39\x19\x72\x3d\x64\xe1\x14\x7c\xfc\x74\x4f\x72\xa6\x89\x2d\xb8\xdc\xdb\x78\xd0\xc3\xf0\xe4\x1a\x8f\x46\x23\xf0\xa7\x9c\xfe\x43\xeb\xa5\x69\xf6\x9a\xfc\xca\xcc\xdb\xb5\x7a\xae\x4f\x7c\xa2\xc8\xe3\x42\x80\x45\x5d\x49\x33\xaf\xd0\x77\xb4\x0d\xfa\xf3\xd4\x3e\x7b\xae\x9f\xd7\x6a\x21\x0a\xbb\x16\x15\xa8\xfa\x97\xa4\x89\x1c\xee\xac\xc3\x0e\xe6\xba\xd6\x75\x5c\x2b\x6b\xce\x0e\xac\xa1\x2c\x02\xb9\xda\x50\xe9\x2a\xd7\xcb\x8c\xe7\x0f\x67\x84\x2b\xcb\xcc\xf4\x9e\x30\x29\x8c\xf9\x83\xdd\xad\x25\xa3\x19\xf2\xf4\x61\xcc\x67\x97\x6f\xbe\x17\x3f\x57\x03\x9c\xa7\xf7\xeb\x02\xb3\x1e\x6a\x56\x60\x12\x41\x36\xba\xa8\x0f\x42\xb4\x7e\xe6\x19\x07\x0d\xe3\x1d\x39\x29\x97\x71\x08\x51\x27\x37\x93\xcb\xc9\xcd\x46\x23\x2f\xfc\xad\xe5\xd6\xb7\xfc\xb0\x67\xa6\xbb\xb9\xf5\xfd\xb0\x40\x7d\x6e\xfd\x3e\x81\x08\x53\xde\x5f\xb3\x4c\x16\xb4\xb8\xa8\xd4\xe2\x8a\xcb\x44\xac\x58\xb4\x51\x63\x61\xc3\x8c\x6b\x9d\x70\xbb\x88\x48\x85\x5c\xfe\xed\xe2\x36\xb6\x87\x48\x4c\x3a\x81\x1d\xe7\x84\xc9\x01\x16\x50\xf7\x28\x0d\x8d\x83\x8f\xf1\x18\x0c\xf9\x86\x82\x21\x70\x7e\xbe\xf5\x00\x08\xcf\xb9\xe2\x54\x89\x40\x0d\x60\xdb\x2b\x50\x49\x25\x96\xe6\x28\xdc\x58\x02\x10\xd8\x06\x61\xdc\xa2\xe9\x97\xc8\x0e\x8e\x30\x07\xeb\x2a\x91\xbc\x46\xdb\xdb\x48\xc3\x3c\x23\x39\x7b\xc4\xb7\x7a\xa5\x93\x7d\xfa\xaf\x26\x89\x56\xef\x55\x9a\xfd\xf8\xf6\xaf\x4e\x18\xe5\xc7\xba\x1c\xdb\x14\xe9\x7a\x28\x36\xd0\x75\xd0\xc7\x60\x3f\x87\x07\x21\xfc\xb7\x58\xde\x63\x5c\x77\xb8\xce\xff\x51\xd1\x0c\x57\xea\xe3\xbe\xfe\xa7\xf6\x2a\x47\x0e\xc6\x7e\x6d\xbb\xba\x1f\x6b\x0f\x40\x25\x19\x48\x41\xbc\x43\x95\x34\x97\x7a\xc9\x63\x81\x9f\x4e\x4c\xd0\xeb\x84\x9c\xaa\xa4\x08\xa2\x3e\x1d\x28\x25\x1e\x07\x6b\x56\xf8\x7d\x9d\x0a\xdf\xff\xf6\x03\x46\x88\x60\x3f\xc6\x3a\x62\x5a\x03\xbd\x85\x47\xc9\x7b\x2e\x15\x66\x60\x22\x2d\x68\x94\x05\x89\xd1\xbe\x48\x5e\x4e\x6e\x6e\x01\x96\xb3\xf8\x2f\x9a\xa6\xe5\x5b\x94\x67\x16\x8c\xa4\x04\xeb\x4d\xd4\xcd\xf0\x22\xba\x27\x9d\xaa\x75\xc1\x13\x30\xd5\xee\x2f\x6f\x81\x86\x24\x7f\xf9\x33\xa2\x27\xfc\xdb\x9f\xfe\xfc\xc6\xf3\x31\x9f\x2b\x53\x7d\xa0\xbf\xe3\x19\xe3\x4d\x7b\x29\x0a\x43\x73\x23\x41\x51\x99\x34\x7d\xd6\xcc\x59\xc5\x5d\xa5\x3f\x57\xcd\xb3\x63\xd5\x99\x63\x7e\xdf\x8b\xe2\xf6\xe1\xa7\x43\x7e\xb0\x3b\x27\x41\x26\x72\xbb\xc1\x44\x88\xb7\x15\xe6\x2e\x4c\xc4\x61\x15\x3e\x85\x69\x28\x13\xd9\xdb\x5a\xe4\xbf\x75\xcf\x74\xa4\x25\x49\xcf\x5f\xdc\x95\xdf\xc5\xd2\xec\x3f\x12\xed\xa3\x80\xfc\x43\xdb\x84\x4e\xc4\x0e\x2a\x00\xae\x3e\x4e\xfe\xeb\xfd\xc5\x4f\xd7\xef\x4d\x4f\x07\x48\x21\x40\x78\x35\x4f\x04\x72\x97\xac\xaf\xf8\x93\xd4\xbd\xeb\x03\x1f\x28\x8f\x8b\xcc\x7c\xdc\xe8\xe7\x9b\x93\x8f\xbd\xcd\x7c\x07\xd6\xb4\xef\xeb\xc3\xc9\x67\x3d\x33\x7f\x02\x27\x98\xf5\xb0\xb2\x2f\xed\xaa\x0e\xbd\x18\x92\x95\x80\xfc\xf8\x64\xae\x9b\xde\x89\x92\x17\x88\x3b\xe8\x19\xe3\x2a\xa0\xe9\xe7\x99\xf1\x6e\x11\x87\x17\x5d\xc7\x90\xe4\x2f\xe3\x4b\xa1\x4e\x26\x70\xb7\x8d\x5a\xe9\x53\x82\xa9\x46\xa5\x66\xe3\x9a\x81\x33\x29\xc3\x20\x26\x9b\x3b\xec\xc5\xf6\xd1\xce\xde\xbf\x91\x19\xff\x2e\x0c\xbb\xc9\xea\x41\x96\x7c\x99\x51\xde\x83\x42\xb1\x71\x6a\xbb\x1e\xc4\x7f\x4e\xd0\x49\xd8\x0a\xc5\xd4\x75\x2a\x7d\x4c\x5c\x10\x4a\x3a\x69\xd6\xf9\x0c\xd4\x98\xb7\x80\x07\x18\xe1\xfa\x18\xf2\x05\x9b\x65\x18\xd9\x8f\xd9\xfc\x84\xbf\x24\x7a\x30\x3b\x33\x44\x78\x7a\x48\xf2\xdc\xa5\x7d\x60\xb3\xd6\xaf\x67\x99\xfc\xfa\xfa\xf6\x02\xda\x86\xe1\x85\xb0\x35\x8d\x2d\xa8\xfb\x83\xf3\x88\x3d\x57\x98\x3c\x09\x27\xfe\x75\x60\xcd\x57\xd8\xea\xdf\xdf\xfe\x09\xb1\x81\x7a\x27\xed\x74\xdc\x17\x42\x89\x7c\x70\xe2\xff\x6d\xc7\x63\xed\xf3\x8d\x77\x5c\x62\x69\x4a\xd6\xef\x1e\xa8\x49\x60\x1e\x67\x57\xbb\xdd\xde\xc6\xba\x3b\x1e\xbd\x7f\xd6\x22\xd5\x83\x41\x42\xc4\xa4\x92\xa4\xd1\xe5\x30\x37\x57\x46\x99\xb3\x25\x2f\xd2\x6c\x0e\xd2\xec\x0e\x67\x1f\x78\xe6\xeb\xcd\xc1\xdf\x5f\x9c\xa6\xbb\x75\xbd\xd4\x1f\xf4\x51\x94\xf1\x45\xe9\xb7\xad\x07\x36\x32\x14\xcc\xdf\x36\x6b\xc6\xfa\x54\xfc\xaf\xe5\x94\x4c\x20\xdc\xea\x4c\xa5\x2b\x9a\x62\xcf\x8e\xe7\x13\x77\x1d\xaa\xa8\xa3\xe3\xa1\xd9\x71\xa8\xf0\xe8\x84\x8f\x8c\x4f\xe2\x1d\xee\x30\x0d\x14\x52\xb1\x05\xce\x21\x00\xa5\xa1\x05\xce\x7b\x69\xf2\x03\x3b\xed\xfe\x62\x6e\x37\x06\xbf\xfe\x3e\x0d\xfb\xa0\xf5\x11\x0a\xa5\x62\xbd\x68\x3b\xdc\xba\x83\x65\x04\x4f\x40\x7c\xf2\x99\x28\x01\xb6\x8a\x63\xf9\x72\x03\xc9\x69\x4a\x94\xcf\x4c\xf3\x89\x25\x2d\x7a\xc1\x26\x35\x4b\x70\xa1\xcd\x77\x3c\xfe\xc3\x11\xfa\x3f\x84\x60\xf9\x5d\xf0\xfd\x28\x16\xe0\x81\xe5\xef\x84\xda\xf7\x10\xed\x03\xe1\x0f\x40\xed\x7b\x28\x0e\x85\x28\x76\x20\x88\x3d\x54\xa3\xc1\x89\x1b\xf0\xe1\x67\x08\xe2\x98\x6d\x18\xb9\x11\x2c\xc0\xbe\x4d\x16\xc5\x63\xe0\xed\x4e\x30\x0c\x5a\xff\xb6\xa6\x88\x2b\x6d\xb0\x05\x9a\xfe\xb6\x34\x13\xf9\x3c\x8c\xe6\x2b\xdc\x64\x07\x96\xd6\xb9\x04\xeb\xc2\xeb\x2c\x8f\x45\x9d\x0d\xb4\xc3\xee\x99\x9c\x0b\xb9\xd0\x74\xe8\x68\xfa\x62\x43\xbd\xb4\xb7\xdc\xae\x1e\x65\x10\x8d\x7c\x18\x82\x6e\xf0\x23\x75\xce\x27\xa2\xd3\x71\x04\x49\xe2\x76\x43\x0e\xf7\x3c\x8e\xa2\xd8\xdd\x17\xd9\xcd\x2a\xd9\xe8\x7e\x1c\x45\xd5\xdf\x21\x19\xa9\x77\xf4\x41\x8e\xa2\xad\x42\xbd\x92\x3b\x3a\x22\x47\x11\x8e\xe9\x9a\x5c\xf7\x46\x8e\xa2\x38\xa8\x7f\x72\xf4\xe4\x07\x75\x52\x8e\xdb\x56\x4e\xb7\xe5\x60\x4f\xe5\x28\x8a\x3d\x7d\x97\xfb\xba\x2b\x47\xd1\x8c\xe9\x65\x4a\x86\x1c\xd1\xc1\x5d\x99\xa3\x68\x92\xa8\xde\xcd\xcd\x35\x84\xfb\xe0\x15\xd1\xcf\xb9\xb9\xf6\xec\xec\xdc\x5c\x83\x80\xa8\xf1\x8a\x69\xf4\xd0\x33\x52\x7f\xcb\x87\x68\x9a\xc4\x69\x0e\xe1\x6f\xfe\x30\x80\x64\x4f\x9b\x88\x9e\x36\x10\x03\x08\x7b\x1a\x46\xb8\x0d\x21\x06\x51\x3c\x4c\xeb\x88\xe6\x8a\x6e\x22\x31\x80\xe6\xb0\xe6\x49\x9b\xd7\x90\xc6\x12\xcd\x15\xdf\x62\xa2\xb9\x62\x9a\x4d\x34\x57\x7c\xef\xe9\x21\xdb\xb9\xee\x52\x1d\xe8\x42\x3d\x80\x66\x67\xbf\xea\xa6\x6d\x57\xab\x1f\xf5\x00\xb2\xde\xce\xd5\x03\xa9\x0d\x66\x3e\xb1\x20\xf3\x78\x85\xfa\x56\xbb\x77\x06\x8a\x0e\x9a\x2b\xba\x1f\x8e\x7b\xbb\x2f\xb3\xa9\xb9\xc2\x49\x36\x78\x7d\xcd\xa9\x36\x78\x0d\x4d\xb8\x89\x22\x1a\x4e\xca\xc1\x6b\xd0\xae\x0a\xf7\xca\x6e\xae\xc1\x5d\xb3\xa3\xa6\x55\x77\xd6\x8e\xe9\x9f\xbd\x39\x4b\xbf\x67\xaa\x7d\x6f\xc4\x9e\x0d\x76\x62\x74\x6e\x0d\x5b\x76\x0e\x35\xb0\xed\x82\xb3\x6a\x14\x98\x97\xb7\xed\xb6\xbb\xea\x6d\xb5\xbd\x8b\xfa\xbc\x91\x92\x60\x57\xf5\x36\xd4\x8b\x2f\x92\x17\x6f\xa0\x21\xfa\xbb\xf2\xc5\xca\xd5\x88\xde\x7d\xce\xdd\x83\x15\xe6\xd8\x7e\x7e\xcd\x15\xdf\xd9\x6f\x90\x2a\x8a\x3d\x00\x03\x3d\xfe\x06\x50\xdc\xa7\x1b\x60\x73\x0d\x5f\x50\x32\xb8\x43\x60\x73\xc5\xf5\x0a\x1c\x44\x92\x34\x9d\x05\x83\x5d\x03\x07\x12\x1e\xd0\x63\xd0\x79\x68\xb8\xa9\x44\x86\xf6\x1d\x6c\xae\xd8\x0e\x84\x03\x67\x6e\x13\x24\x76\xed\x45\xd8\x5c\x3b\x2d\xc7\x30\x05\x8e\x0c\xea\x54\xb8\x39\xb4\x68\x1d\x8d\x1c\x8d\xda\xa3\x51\x1b\x79\xfd\x01\x8c\xda\x50\x2f\xc5\x81\x36\x68\x0b\x14\xad\xaf\xab\xe2\x00\x9a\xdb\xfd\x17\x7b\xfb\x2b\x0e\x31\x6b\x7b\x3b\x31\xb6\x3b\x2d\x0e\x54\x0c\x82\x3d\x19\x23\x7b\x2e\x3a\x54\x87\xb3\xdd\xa1\x7d\x18\x9b\x6b\x78\x47\xc6\x21\x47\x49\xeb\x4b\xf1\xbd\x19\x07\x50\x6e\x77\x71\x0c\x77\x69\x1c\xa2\x1f\xed\xd8\xcf\xb1\xb9\x76\xd3\xcb\x06\xf7\x78\x6c\xae\xb8\x6e\x8f\x03\xf5\x08\xb7\x37\xe4\xee\x7d\x1f\x9b\x6b\x47\xe5\x6a\x40\x2f\x48\xe7\xa1\xc8\xae\x90\x03\x97\xc4\x9c\x05\x7f\x7f\xc8\x81\x34\xe3\xba\x49\x36\xd7\x8e\xcb\x38\xa4\xc3\x64\x73\x1d\xb6\xd7\xe4\x9e\x93\xd8\x45\xb3\x8c\xec\x44\xb9\x39\xb2\x01\x8a\xe5\x50\x87\xe5\xcb\xbb\x21\xa3\x09\x63\xe2\xce\x01\xdc\x44\xa6\xdf\x81\x89\xfe\x7f\x3d\x1e\xa0\x67\x8c\xee\x9b\x8a\xce\x00\xc6\x62\x73\x0d\x09\xed\xc7\x7b\x1f\x8e\xa1\xfd\xa7\x09\xed\x4f\x4c\xaf\x8e\x63\x5c\xbf\x73\x36\xc7\xb8\x7e\x73\x1d\xe3\xfa\x47\x17\xc8\xd1\x05\xb2\x7d\x1d\xe3\xfa\xad\x69\x1d\xe3\xfa\xc7\xb8\xfe\x31\xae\xef\xbb\x0e\x1a\xd7\x37\xea\x39\x06\xf5\xa3\x37\xdf\x57\x12\xd3\x37\x5d\xb2\x2e\x92\x44\x54\xb9\xba\x17\x0f\x2c\x18\xda\x8b\x32\xda\xb6\xa8\x06\x27\xf8\x74\x16\x1e\xad\x52\xae\x2d\xa9\xc1\x5f\xfb\xc2\x3c\x68\x8d\x1c\x2d\x61\xf2\x94\xa5\x35\xc5\x58\x97\xaf\x7e\x58\xe9\x55\x18\x93\x0b\x52\xb2\x84\x17\x9c\x61\x1b\x7c\x8a\xbf\xe3\x76\xb0\xed\x3d\x22\x15\x7d\xc9\xb2\x99\x69\x8c\x90\x3b\x8d\xb5\x1c\xdb\xc4\xb0\x7e\x3b\xdc\x28\xba\x86\xa9\xc0\xb0\x50\x1d\x10\x16\xa5\xdf\x76\x1c\x2b\xd9\x3f\x8c\xc6\x11\x37\x7b\x9c\xf9\xbd\x33\x12\xd7\xe9\x85\x4b\x1b\xd3\x17\x6c\x6b\x90\xb4\xe0\x06\xb1\xe0\xd0\x1c\x82\x7d\x29\x78\x09\xdb\x7a\xc2\x12\x91\xfb\xfa\x20\x37\x57\x6b\xf3\x5c\x6f\x52\xb0\xbb\xc8\xf8\x97\x23\xcd\xd8\xb4\x2a\xeb\xbe\xc7\x2b\x9a\xf1\x94\xab\x75\x1d\x3a\x37\x2d\xee\x28\x9e\x33\xb3\xd0\x51\x64\x2f\x64\xf3\x95\x09\x2d\x8a\x52\xd0\x64\xc1\xa4\x33\x6f\xd4\x81\x4d\x65\x65\x14\x4d\x5b\xf7\x82\xcd\x23\x41\x01\x06\xba\x5a\x4f\xca\xd6\xa4\x14\xca\xa6\x8d\x98\x81\xc7\x99\x9f\xad\xc9\xa1\xd9\x83\x83\xc2\x57\xa0\x4a\xa2\xca\x35\xe4\x9f\xc4\xb9\x50\x9d\xa1\xe0\x0a\xf0\x99\xfb\x3f\x92\x88\x2c\xb5\xe0\x46\x7f\x79\x13\x67\xfa\xb1\x32\x31\x67\x1a\xcc\x1b\xbe\x04\x0f\x67\xa6\x75\x44\x2d\x1a\xda\x2f\x88\xdb\xe4\xcd\x20\xfe\xf4\x03\x59\x88\xaa\x94\x63\xb7\x06\xf2\x7b\xf8\x0d\xed\xf3\xd8\x28\x99\x56\x2c\x15\xc9\x18\x95\x8a\x7c\xff\x86\x2c\x79\x5e\x69\xd5\x20\xe2\x59\x47\x35\xff\xf3\x0f\xd1\xc7\x2d\x56\x29\x8f\x55\xc7\xb7\x13\x1f\xcc\xa9\x2a\x10\xf4\xdc\x68\xe5\x86\xab\x84\xaa\x6e\x9d\xf7\x43\xc3\x83\x8d\x38\xa4\x11\x45\xee\x97\xcb\x95\x38\x30\xaf\x89\xd5\x6e\xa3\xb4\xd5\x48\xb9\x1f\x75\x5b\x48\x89\x0d\x95\x90\x9a\x00\x47\xe7\x5f\x03\x03\xf8\xad\x12\xd3\xb5\x8a\xa9\x29\xff\x0f\xbc\xb3\x5d\x4c\x6e\x7f\xec\x06\x8f\xea\x99\x70\xab\x97\x47\x83\x1d\xd5\x79\x77\x58\xfb\x98\x6b\x6b\x3a\xb2\x6e\x10\x2c\x6f\x6b\x0d\x5a\x37\x6d\x92\x30\xec\x39\x7c\xd5\x74\x8b\xcb\x05\xd2\x0d\x7c\xb2\x43\xd6\x5c\x7b\x11\x9a\xec\x3a\xdb\xfa\x41\x1f\xf3\x3d\x7c\x5f\x88\x18\x7d\xb8\x64\x73\x2e\xd5\x80\x16\x3c\x78\x7b\x7b\x3b\x49\x9e\xcf\xb1\x65\xc2\xb2\xca\x14\x2f\xb2\x7a\xe6\x9e\xf9\xd6\xa4\x8c\xac\x73\x5d\xc6\xd4\xf1\x4d\x52\x04\x2d\x40\x88\xbd\x40\xd8\xe0\xb4\x7e\x3f\xcb\x15\x22\xf5\x97\x5a\x98\x16\xb4\xa4\xf5\xc2\x42\x53\x72\xf9\xda\xf8\xa5\x69\xe2\x4d\x7f\x33\xd8\x37\x5a\x72\x95\x34\xab\x97\xcb\x0d\xe0\xee\xb3\xd9\x14\xcb\x69\xee\x89\x02\xb5\xdd\x2a\x70\x33\x11\x8f\x36\x93\xd4\x74\x62\xda\xd8\x65\xc1\x92\xe7\x9f\x68\xf2\xc0\xf2\x14\xda\xe9\xe1\x92\xa4\xeb\x9c\x2e\x0d\x86\x69\xdd\x74\x8c\xa5\x1b\x94\x7b\x2b\xcb\xf5\x85\x5e\x46\x2c\x99\xb6\x40\x0c\x81\x4e\xe0\x11\xeb\x53\xc9\x68\x90\xaf\xcf\x52\xeb\x02\x7e\x1e\x21\x31\xa6\x5a\xf2\x55\xc2\x8c\xda\xe4\x99\x92\x7e\xf9\x3e\x83\x5f\x79\x70\x3f\xb6\x86\x6f\x30\x3f\xb8\xb3\xf3\xc1\x79\x59\x87\xb9\x00\xf1\x8f\x66\x9a\x2d\xf8\xec\x1f\x5b\x58\xbf\xb1\x29\xa6\xeb\x7d\x1b\x76\x85\x7b\x54\xe1\xd1\xe8\xf9\xb3\x07\x8f\x21\x20\xeb\xca\x69\x0c\x4e\xc2\xc9\xdd\x4f\x57\x6d\xae\x74\x47\x53\x21\xc9\x4f\x99\x48\x1e\xc8\x15\x03\x3b\xc0\x95\x77\x3d\x2b\xb1\x09\xa1\xb8\x67\xef\xaa\x72\x9a\xee\xdf\x5b\xe0\x88\x87\xff\x0d\xe1\xe1\x97\x53\xdf\x02\x7c\x1b\x68\xf8\x4b\x3a\x8f\x6f\xa7\xa2\x2d\x76\x38\x6a\xf0\x98\x85\x69\xdd\xf1\x88\x7c\xb7\x10\x8f\x23\x25\x46\x95\x64\x23\xee\x49\x7c\x89\x98\xc5\x03\x5b\xeb\xbf\xc6\xce\xe3\xef\x78\x7b\xcb\x5c\x52\x02\x02\x0f\xf0\xbb\x96\xf8\x77\x3f\x5d\x69\x31\x13\x83\xee\xc6\x25\x39\x67\x2a\x39\x4f\x58\xb1\x38\x37\x43\xf9\x2a\x96\x65\x29\x72\xae\x44\x19\xdd\x01\xef\x82\x24\x22\xcb\x0c\xaa\x86\x98\x91\x4b\x56\x2c\x6a\x22\x4f\x3f\xa3\xe7\x42\x48\x2f\x84\x88\x45\x90\x76\xb6\xbc\x7e\xca\xec\x78\xe7\xc3\x97\xd3\xa1\x0c\xe6\xb9\x37\xc1\x37\xd6\x80\xf8\x09\x96\xe7\xb0\xc0\xf2\x27\x13\xfb\x00\x98\xa1\x4e\xec\xa9\x8d\x23\x6f\x08\x7b\x56\xc8\x65\x33\xe4\x66\x86\xea\x78\xca\x52\x22\x56\xac\x2c\x79\xca\x24\xa9\xb9\x89\x6b\xf9\xf2\xec\x40\x0d\x02\x77\x5a\xd3\x23\x0c\xfe\x8b\xc2\xe0\x0f\x30\x93\x1c\xe6\xa5\x9f\xda\x66\x5e\x34\x5d\xf2\x7c\x20\xac\xeb\xf3\xb2\xaf\x20\x9c\xbd\xd6\x43\x7a\xfe\x66\x05\xd7\x2e\x86\x88\x4c\x68\xc6\x6e\x3e\x45\x18\x23\x13\xbc\xb3\x6d\x8f\xd8\x1f\x1d\x64\xd3\x9d\xb0\x1c\xff\x5e\x6f\x76\x92\x8b\xb4\xcf\x37\xfd\xc7\x45\x3b\x75\xf6\x32\x82\x39\xee\x23\x28\xe7\x54\xb1\x47\x1a\xdd\x65\xdc\x4e\xa5\x8d\x29\x5e\x7f\xfa\x8b\xdb\x1b\xf2\x33\x52\xdc\x0f\x64\xb5\x14\x0a\x35\xb2\x2b\xb1\xa4\x3c\xba\x93\x92\x03\x0e\xed\x0e\xeb\xb6\x26\x47\x90\x9e\x96\x42\x01\x3b\x03\x71\xc7\x2a\x6d\x67\x19\x0b\xe8\x88\x74\x79\x60\xa5\xa2\xd1\x29\x1c\x27\x90\x4d\xf5\x6d\x9a\xd8\x98\xaf\x18\x70\x64\x35\x81\x6a\x22\x59\x2e\x39\x44\x81\x9c\xe4\x04\xd3\x3f\x14\x9b\xcf\x62\xa6\x2e\x2a\x1e\xbe\x93\xf7\x5e\xcc\x79\x6e\xcf\xad\x30\x21\xcd\x19\xf5\xe9\x22\x47\x4d\xe1\x45\x35\x05\x29\xb3\xeb\x9c\x4e\x33\x5f\x38\xad\xcd\xf8\x33\x3a\xd7\x9b\x8e\xc1\x53\xe7\x29\x97\xfa\xbf\x64\x32\x79\x0f\x8e\xf4\x2a\xb7\x9a\x6d\x20\xb5\xd9\xb0\xbd\xba\x9a\x07\x8f\xed\x7e\xe7\x09\xf9\xce\x00\x24\xd2\x9b\x3c\xd5\xc3\x65\xb2\x95\x9f\x64\xe8\x20\xc8\x6a\x9d\x62\x0e\x99\x1c\xfe\x78\xcd\xfd\x82\x27\x0f\xb7\x8e\xbf\x5c\x94\xfa\xb7\xdc\xf9\xa9\x25\x8e\x36\xff\xb6\x0f\xc3\x34\x83\xbe\x8d\x37\x5b\xef\x1d\x8e\x3f\x31\x53\xd6\x8f\x13\x2a\xa5\x48\x78\x13\x20\x09\x00\xa6\x36\xc2\x22\x05\x61\xb1\xdf\x34\x40\xd2\xef\x28\xbf\xec\x87\xb3\x8d\xb1\xa5\x23\x95\xfc\x46\xa8\x59\x87\xbd\x86\x8e\x1b\x65\x40\xa7\x86\xfb\x56\x6f\x06\xab\xfb\xa1\x47\xbf\xf6\xdb\x1b\x0f\x60\x98\xa9\x5b\x6d\xcc\xb4\xc3\xd9\xfe\x88\x75\x8f\x06\x13\x68\x7e\x42\xdf\xbf\xd1\x92\x7a\xfe\x5a\xcb\xbd\xbe\xbf\xf7\xeb\x8c\x21\x8d\xdc\x53\x44\xd5\x65\x9f\x6f\x84\x2d\xf1\x37\xe3\xec\x87\xc4\xad\x42\x14\x55\x46\x7b\xe3\x96\x5b\x8d\x2f\xf6\x68\x01\x83\x6f\xdf\x35\x24\x30\x1c\x85\xd9\x5f\x64\xd0\x06\x64\xf6\x7b\xf0\x2d\x54\x73\x1c\x20\x73\x18\x62\x44\x09\xf2\xe6\xcf\x3f\xfc\xd0\x07\xde\xdc\x0b\xd1\xec\xd5\x50\x7d\xe0\xcd\x3e\x88\x66\x2f\x51\x2f\x78\x73\x5f\x89\x80\x2f\x58\xd7\x0f\xde\xdc\xaf\x0e\x1c\x0e\xbd\x39\xe0\x5b\x1d\x5a\xcf\xe7\xd6\xea\xf9\x3c\x5c\xe1\x2a\xbe\xee\xfa\x36\x0f\x4d\x4f\xed\x9e\xbf\x2e\xcf\x47\xb3\xa3\x62\x2f\xb2\x1a\x2f\x60\x3b\x35\x89\x0e\x87\xaa\xc1\x1b\x54\x79\xe7\x56\xd5\x05\x46\xea\xaf\xb7\xeb\xa9\xa5\xf3\xd0\xec\xae\xb2\x0b\x57\xd0\x79\x48\xb6\x6a\xeb\x02\x95\x16\xc3\xd0\xc4\xc3\x35\x72\x51\xd5\x6f\xb1\x99\xd8\x11\x95\x6e\x7b\xd6\xb7\x45\x27\xdd\xc5\xd4\xb2\x0d\x11\x2e\x4d\x5d\x5a\x80\x28\xf1\xd7\xad\xf5\x55\xa3\x05\xa9\x76\x57\xab\xf9\x6a\xd0\x82\x24\xfd\x62\x64\xb7\xca\xb3\xe8\x7a\x33\x47\x64\x04\x89\x46\x57\x99\x0d\xa9\x2d\x8b\x4f\x5e\x8d\x49\x5c\x8d\xaf\x1e\x73\x6a\xc2\x82\x13\xf7\xd7\x8c\x75\x57\x82\x45\xed\xa4\xed\x4a\x31\x7f\xfd\x57\x90\x68\x4c\x7d\x58\xe4\xe1\x8d\xc9\x96\x0d\x55\x80\x05\x33\x69\x0f\x92\x1e\x1b\x53\x65\x34\xbc\xb6\xa8\x96\x2e\x5e\x2e\xef\x2f\x29\x8a\x77\xe6\x0d\xe9\xd3\xe7\xfa\xa8\x8c\xe9\x61\x15\x5c\x4c\x30\x6a\x40\x0b\xbd\x1a\x44\xd5\x13\x24\x3d\x94\xf1\x41\x62\x36\x5b\xc8\x30\xc3\xf7\x89\x98\xc6\xb6\xc6\x17\xf1\x69\xb2\x11\x2e\xa9\x7f\x3e\x46\x49\xbe\xf1\x9e\x70\x47\xe7\xfe\xf6\x24\x1b\xe7\xbe\x6c\x41\x28\x59\xa7\x04\xea\x4e\x33\x51\x12\x31\x35\xe0\xb1\x01\x5d\xbd\x39\x30\x17\xb7\x37\xda\x9e\x87\x8a\x31\x9a\xc9\x31\xe9\xa8\xdf\x37\x6a\x50\xc8\xfe\x69\x2c\x1c\xaa\x14\x5b\x16\xca\xb7\x15\x8e\xbe\xfd\x17\xf5\xed\x0f\x76\x48\xfe\x52\x3f\x50\xb7\x46\xae\x96\x34\x1f\xe9\xd3\x06\x5e\x7e\xc7\xd9\xea\x99\xc1\x26\xa7\x1e\x13\x9b\xcd\x0c\x0b\x0a\xae\x1b\x28\x64\x68\xf5\x68\x27\x3e\x1f\x41\xd3\xbd\xf7\x30\x1e\x5a\xa0\x35\x78\x55\x50\x18\x6f\x9c\xcf\x44\x6c\xe6\xd4\x7a\x59\x10\x4c\xb5\x5e\x21\x7b\x14\x1d\x59\xdf\xb2\xd8\xd5\x82\x85\xb2\xf7\x6f\xa1\xfa\xa6\x79\xbe\x6d\xc3\xa0\x11\x43\xb3\x4c\x3c\xe2\x78\x1b\x39\x18\x58\x6e\x98\x19\x96\x08\x42\x2d\x0a\xd7\x86\xbe\xf1\x26\xbb\x53\x00\x9e\xa4\xb4\x95\xe4\x55\xfc\xc1\x34\x28\x4d\x68\x71\xc2\x94\xbb\xd9\xb4\x19\x9d\x63\x42\xba\xfe\xb7\xcd\x6c\x0a\x4c\xdc\x06\x8e\xa6\x6c\x41\x57\x5c\x54\x25\xd2\x55\x82\xbc\x32\x7f\x02\xa1\xb5\x16\x55\xed\x2c\xac\x02\x09\xb3\xf5\x2a\xca\x8e\x2f\xf5\xb1\xf9\x23\x18\x73\xa9\xb0\x7e\x94\x11\xfb\xc2\xbd\xe5\x84\x5b\x6b\x66\x3f\x92\x45\xed\x7c\x32\xc5\x6b\x25\x0b\x2d\x15\xa3\x5b\x8e\xfe\xe2\xde\xdf\x56\xc0\x56\x13\xf8\xd3\xb7\xd6\x70\xf4\xa8\x82\x75\x5d\x75\xb8\x30\xe3\xc9\x3a\xba\xd9\x66\x13\x26\xd4\x8f\x91\x9f\xa8\x64\x29\xf9\x40\x73\x3a\x47\xdb\xf7\x74\x72\xfb\xd3\x87\xd7\xfa\x13\x06\xdc\x1b\x37\x57\x5d\x51\x46\x4b\x1f\xc9\x7f\xdc\xaf\x3e\x65\x63\x8e\x03\xc4\xe0\xc1\x66\xb9\x67\x85\x8d\x15\x58\x7e\xb4\xf3\xed\x02\xdf\xcd\x26\xca\x1b\x07\x77\xb5\x4c\x9f\xb0\x39\x72\x33\xe4\xe1\xec\xaa\x9f\xf6\xa8\x1b\x76\xcf\x43\xad\xcf\xdb\xf0\x48\xb3\x4b\xb1\xd4\x6c\xad\x0b\x95\xbf\x0d\x48\x00\x29\x0e\x58\x6c\x81\xb7\x5b\x39\x0f\x96\xc7\x88\x2e\x18\x4d\x49\x26\xe6\xa6\x0d\xfe\x24\xa7\x45\xd1\x91\xc8\x05\x22\x78\x96\x51\xa8\x25\xc0\xb6\x06\x2b\xca\x33\x20\xce\x73\x0b\x17\x0f\xc9\x61\xb7\xa5\x58\x32\xb5\x60\x95\x24\x3f\xfe\x2f\xf2\xa7\xf1\xf7\xdf\x8f\xdf\x6c\x12\xec\xb3\x3e\x3a\x17\x43\x2a\xaa\xaa\x16\x27\x6d\x2b\xd3\x1f\x34\xff\x2a\x19\x56\xe2\x4f\x01\x1b\x22\x35\x0f\xd9\xc9\x3a\x63\x4a\xb2\x4a\x2a\x56\xa2\xc9\x05\xc5\xa8\xed\xc1\x7d\x14\x8a\xf0\x3c\xc9\xaa\x14\xa2\x0d\x2c\xb7\xd8\x0d\x50\x30\x51\x8a\x65\x1b\x84\xe2\x0c\x57\xa3\xfe\x43\xf3\xa6\x16\xd5\x4f\xc0\x5e\x45\x09\x76\x0c\xa2\x78\x74\xea\xfb\x73\xae\x16\xd5\x74\x9c\x88\xa5\xa3\xfa\x9f\x9b\xac\x14\xb5\x3e\x9f\x66\x62\x7a\xbe\xa4\x7a\x06\xda\x10\x50\x25\x9f\x56\x4a\x94\xf2\x3c\x65\x2b\x96\x9d\x4b\x3e\x1f\xd1\x32\x59\x70\xc5\x12\x55\x95\xec\x9c\x16\x7c\x94\x88\x7c\xa5\x0f\x92\xc8\xe5\x78\x99\x7e\xa7\x99\xef\x88\xe6\xe9\x08\x97\xc8\xd5\xe3\xfb\xe4\x56\xfd\xad\xef\x98\x66\xef\x74\x4b\xac\xb5\x9d\x9d\x42\xd1\x8c\xe4\xd5\x72\xca\x4a\xc8\x0b\xa8\x77\x4a\x21\x52\x89\x86\x2f\x56\x9b\xd6\xa8\x04\x4b\x9e\xeb\xcf\xb1\x36\xa8\x19\xdb\xf0\xcb\x8a\x96\x73\xe6\x76\xb1\x75\xbe\x68\xca\x8a\x4c\xac\x97\x1d\xe1\x24\x9f\xf7\xb7\xdf\xdb\x5b\x50\xad\x77\x7a\xa7\x78\xd7\x28\x15\xd6\x73\xa7\xb5\x3f\x8a\x9d\x5f\x6d\xf5\x79\x95\xa7\xac\xcc\x28\x80\x54\x2c\x81\xf7\x6e\x6b\x1a\xc6\x5c\x03\xf5\x6e\xca\xf4\x9d\x05\x2b\xf5\xb8\xb5\xe6\x0b\xa6\x7d\xaa\x95\x0e\x56\xd3\xae\xa3\x73\xf5\x6d\x91\x67\x4b\xf3\xa6\x1d\xbe\x5e\x2e\xf2\x91\x62\xe5\x92\xe7\x20\xe7\xe0\x13\x7a\xbe\xc6\xd6\x04\x9b\xaf\x43\x4e\xd5\x82\xf1\xd2\xf4\x40\x21\x4b\xaa\x12\xe3\x51\x06\x44\x60\x51\xbe\x3e\xcc\xf7\xab\xf2\xfd\xf6\xab\xf3\xfc\x3e\xd3\x3d\xd0\x64\x8a\x54\xaf\xfb\x4e\x13\x39\xe0\xa7\x03\x79\xbc\xa0\x2b\x74\x3b\xa5\x4c\x6a\x19\x67\xd9\x3e\x18\x7b\x87\x98\x6e\x97\xf0\x1c\x6d\x73\x9f\xd6\x5f\xf1\xb4\xb6\x7e\x2a\xbb\xee\xeb\xd8\x15\xed\xbf\xb7\x17\xda\x2f\x94\x36\x07\x3a\x82\x25\xf8\x97\xce\xfb\xcd\x22\xbd\x25\xab\xef\x9b\xff\x83\x0f\x39\x32\x80\xeb\xf0\x07\x84\xe5\x62\xe9\x5b\xa2\xca\x0a\xd5\x04\xa3\xfc\x99\x5f\x1a\x31\x48\x93\x84\x15\x8a\xa5\x60\xcd\xe1\x10\x1e\x78\x9e\xbe\x25\xaf\x10\x1a\xbc\xc8\xaa\x92\x66\xe6\x7f\x35\x43\xe5\xc0\x3a\xde\x92\xff\xfb\xff\xfe\x05\xa9\xb2\xf4\x17\x3b\x0e\xfd\xe3\xff\x0f\x00\x00\xff\xff\x49\x90\x26\xb5\x15\x49\x05\x00") - -func examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYamlBytes() ([]byte, error) { - return bindataRead( - _examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml", - ) -} - -func examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYaml() (*asset, error) { - bytes, err := examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml", size: 346389, mode: os.FileMode(420), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xcc\x57\x4b\x8f\xe3\x44\x10\xbe\xe7\x57\x94\x96\x43\x2e\xd8\x61\x81\x03\xf2\x0d\x0d\x0f\xad\x80\x65\x34\xb3\xcc\x05\xa1\x55\xdb\x5d\x49\x9a\x69\x57\x9b\xaa\x72\x76\xc3\xaf\x47\xd5\x76\x26\x8f\xb1\x67\x46\x8b\x90\xe8\x53\xdc\x5d\x8f\x2f\x5f\x7d\x55\x6d\x2f\x8a\xa2\x58\xb8\x2e\xdc\x21\x4b\x48\x54\x81\xeb\x02\x7e\x54\x24\x7b\x92\xf2\xfe\x1b\x29\x43\x5a\xed\x5e\xd7\xa8\xee\xf5\xe2\x3e\x90\xaf\xe0\xaa\x17\x4d\xed\x0d\x4a\xea\xb9\xc1\xef\x70\x1d\x28\x68\x48\xb4\x68\x51\x9d\x77\xea\xaa\x05\x80\x23\x4a\xea\x6c\x5b\xec\x11\xa0\x49\xa4\x9c\x62\x44\x2e\x36\x48\xe5\x7d\x5f\x63\xdd\x87\xe8\x91\x73\x86\x43\xfe\xdd\x17\xe5\x97\xe5\xd7\x0b\x80\x86\x31\xbb\xbf\x0b\x2d\x8a\xba\xb6\xab\x80\xfa\x18\x17\x00\xe4\x5a\xac\xa0\xe3\xd4\xa2\x6e\xb1\x17\xee\x23\x4a\xd9\x26\x0a\x9a\x38\xd0\xa6\x6c\x12\x63\x92\xb2\x49\xed\x42\x3a\x6c\x2c\xff\x86\x53\xdf\x55\x30\x6d\x34\x84\x1c\x71\x0e\xff\xf1\xfa\x21\xfa\x4d\x1f\x31\x1f\xc4\x20\xfa\xd3\xc4\xe1\xcf\x41\x34\x1b\x74\xb1\x67\x17\x1f\x21\xcb\x67\x12\x68\xd3\x47\xc7\x97\xa7\x0b\x80\x8e\x51\x90\x77\xf8\x1b\xdd\x53\xfa\x40\x3f\x04\x8c\x5e\x2a\x58\xbb\x28\x76\x2c\x4d\xea\xb0\x82\xb7\x86\xb0\x73\x0d\xfa\x05\xc0\xce\xc5\xe0\x33\x3b\x03\xe6\xd4\x21\x7d\x7b\xfd\xe6\xee\xab\xdb\x66\x8b\xad\x1b\x36\x01\x3c\x4a\xc3\xa1\xcb\x76\x17\xa0\xc1\x5b\xd9\x50\xc0\x45\x64\x0d\xb4\x81\x8c\x15\xd6\x89\xc1\x9d\xd8\x42\x20\x51\x47\x0d\x8e\x21\x3b\x4e\x9d\x39\x1c\xd8\xb2\x75\x22\x9f\x87\xbd\x8b\xe4\x4b\x43\x37\xd8\x3c\x64\xd6\x2d\xc2\x58\x76\xf4\x20\x19\x39\xa4\x35\xe8\x36\x08\x30\x66\x5a\x68\x90\xd0\x49\x58\x30\x13\x47\x90\xea\x3f\xb1\xd1\x12\x6e\x8d\x3a\x16\x90\x6d\xea\xa3\x37\x95\xed\x90\x15\x18\x9b\xb4\xa1\xf0\xf7\x43\x64\x01\x4d\x39\x65\x74\x8a\x63\xc1\x0e\x2b\x90\x22\x93\x8b\xc6\x6b\x8f\x9f\x83\x23\x0f\xad\xdb\x03\xa3\xe5\x80\x9e\x4e\xa2\x65\x13\x29\xe1\x97\xc4\x08\x81\xd6\xa9\x82\xad\x6a\x27\xd5\x6a\xb5\x09\x7a\x68\x98\x26\xb5\x6d\x4f\x41\xf7\xab\x2c\xfb\x50\xf7\x9a\x58\x56\x1e\x77\x18\x57\x12\x36\x85\xe3\x66\x1b\x14\x1b\xed\x19\x57\xae\x0b\x45\x06\x4e\xb9\x5f\xca\xd6\x7f\xc6\x63\x77\xc9\xf2\x04\xa9\xee\x4d\x09\xa2\xa6\xdf\x87\xed\xac\xd7\x59\xde\x4d\xb0\x10\x04\xdc\xe8\x36\xe0\x3f\xd2\x6b\x5b\xc6\xca\xcd\xf7\xb7\xef\xe0\x90\x34\x97\xe0\x9c\xf3\xcc\xf6\xd1\x4d\x8e\xc4\x1b\x51\x81\xd6\xc8\x43\xe1\xd6\x9c\xda\x1c\x11\xc9\x77\x29\x90\xe6\x87\x26\x06\xa4\x73\xd2\xa5\xaf\xdb\xa0\x56\xe9\xbf\x7a\x14\xb5\xfa\x94\x70\x95\xc7\x06\xd4\x08\x7d\xe7\x9d\xa2\x2f\xe1\x0d\xc1\x95\x6b\x31\x5e\x39\xc1\xff\x9c\x76\x63\x58\x0a\xa3\xf4\x79\xe2\x4f\xa7\xdd\xb9\xe1\xc0\xd6\xc3\xf6\x61\x06\x4d\x56\xe8\xb6\xc3\x26\xac\x43\x93\x75\x6e\xda\xf6\x28\x81\xd1\x9f\x37\xe6\xd0\x34\x79\xca\x0e\x3d\x7a\xec\xd0\xf2\x24\xf2\x54\x77\xda\xca\xd3\xef\x62\xef\x02\xc7\x55\x22\x45\x52\x43\x70\xd2\xfd\x39\xf7\x3a\x44\xbc\x70\x0d\x8a\xed\xa3\x78\x97\xda\xb3\x39\xf3\xa3\x65\x1e\x04\x68\xf3\xd3\xc2\x8b\x15\x9c\x34\xb8\x18\xf7\x80\xa6\x47\x2b\x74\xee\x58\xf6\xa7\x04\x1f\x97\x35\xe4\xf9\xa0\x2a\xe1\x6d\x52\xac\xe0\xda\xb1\x45\xba\x41\xe9\x12\x09\xde\x2a\x3b\xc5\xcd\xde\x32\x26\x8a\x7b\xe8\x05\x3d\xd4\xfb\x89\x98\xef\xb6\x8e\x52\x9e\x85\x9c\xe3\x7f\x08\x31\x9a\xf0\xc2\x86\x12\x67\xa7\xa9\x31\x28\x25\xc0\x9d\x4d\xdf\x89\x88\xc3\x68\xc8\xe5\x19\x5a\xc1\x26\x39\x38\x46\x58\x2e\x3f\x38\xa6\xe5\x12\x12\xc3\x72\xe9\xea\xc4\xba\x5c\x96\x30\xa3\xe6\x6d\x5f\xdb\xb5\xb4\xd2\x8c\xb0\x08\x69\xfc\xb5\xaa\x63\xaa\x57\xad\x13\x45\x5e\xf9\xd4\x88\xe9\xbd\x4b\x64\xfd\xb8\x32\x56\x4c\xc1\xdd\x40\x48\xc1\x23\x23\xcb\x47\x40\xe7\x44\x32\x56\xd6\x66\xe1\xce\xc5\xa9\xb3\x99\x46\x38\xae\x7c\x33\x7f\x8a\xe3\x88\xfa\xfd\x01\xf5\x7b\x19\x0b\xf9\x49\xd1\xb2\x42\xa6\x3d\x67\x84\x3b\xac\x33\xf9\x8e\xb7\xa4\xed\xd4\x76\x4f\xd2\x51\x81\x89\x8f\x6a\xcd\xc9\xca\x99\x80\x4f\x53\x3d\xac\x1c\x75\xfe\xf8\xd9\x3f\x3b\x46\xb9\x7c\xdd\x9a\x31\xf3\x3e\x0f\x11\x17\xaf\x5f\x00\xed\xc5\xd9\x67\x06\xdf\xe5\xc2\x8f\x1d\x3f\x89\x8e\xf6\xbf\xae\x9f\x32\x28\xc6\x3c\x26\xd2\x0d\xf2\x0b\x2c\x9f\x05\xfe\xb1\xb0\x37\x51\x26\x54\x94\x22\x90\x16\x89\x8b\xc1\xa9\x02\xe5\xfe\x72\xf0\x1d\xd7\x3a\x3d\xf9\x5f\x5e\x94\x3e\xba\x1a\xe3\xff\xb8\x60\x83\xca\xff\xe5\xdf\xb4\x0b\xde\x6e\xb4\xb9\x30\x45\xd6\xc5\xcc\xe1\xb3\x30\x07\x03\xc7\xec\x1e\x0f\xf9\xf9\xcc\x45\x1e\x55\x13\xdb\xc7\x37\xf6\x17\xa2\x98\xce\x3f\xe1\x70\x09\xa6\xc8\xef\x05\x8b\x49\xfb\xe3\xd7\xd0\xeb\xe3\x53\xae\x7b\x31\x7e\xfd\xe4\x03\x80\xfc\xe1\xe0\x4f\x94\x2a\x9a\xd8\x6d\x70\xdc\x11\x75\xda\x67\x3f\xd7\x34\xd8\x29\xfa\xb7\x97\x1f\x3a\xaf\x5e\x9d\x7d\xbb\xe4\xc7\x26\xd1\xa0\x3a\xa9\xe0\xf7\x3f\x16\x43\x54\xf4\x77\x07\x1c\xb6\xf9\x4f\x00\x00\x00\xff\xff\x01\x20\xcb\x98\x39\x0e\x00\x00") - -func examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYamlBytes() ([]byte, error) { - return bindataRead( - _examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml", - ) -} - -func examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYaml() (*asset, error) { - bytes, err := examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml", size: 3641, mode: os.FileMode(420), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5c\x6f\x6f\xe3\xb8\xd1\x7f\xef\x4f\x31\xc8\x3d\x40\x9e\x16\xb1\xdd\xbd\x5e\x8b\xd6\x2d\x5a\xe4\x76\xf7\x70\xc1\x65\xb3\xc1\x26\xbb\x6f\x8a\xe2\x8e\x96\xc6\x16\xcf\x12\xa9\x92\x94\x13\xb7\xe8\x77\x2f\x38\x14\x65\xc9\x16\x29\x25\xbb\x77\xb7\x38\x58\x6f\x12\x4b\x14\x39\xff\xf8\xe3\xcc\x70\xc4\xc9\x74\x3a\x9d\xb0\x92\x7f\x40\xa5\xb9\x14\x0b\x60\x25\xc7\x47\x83\xc2\xfe\xd2\xb3\xcd\x9f\xf4\x8c\xcb\xf9\xf6\xc5\x12\x0d\x7b\x31\xd9\x70\x91\x2e\xe0\x65\xa5\x8d\x2c\xde\xa1\x96\x95\x4a\xf0\x15\xae\xb8\xe0\x86\x4b\x31\x29\xd0\xb0\x94\x19\xb6\x98\x00\x30\x21\xa4\x61\xf6\xb6\xb6\x3f\x01\x12\x29\x8c\x92\x79\x8e\x6a\xba\x46\x31\xdb\x54\x4b\x5c\x56\x3c\x4f\x51\xd1\x08\x7e\xfc\xed\xef\x66\x5f\xce\xbe\x9a\x00\x24\x0a\xe9\xf5\x7b\x5e\xa0\x36\xac\x28\x17\x20\xaa\x3c\x9f\x00\x08\x56\xe0\x02\x34\xaa\x2d\x4f\xb0\x90\x82\x1b\xa9\xf4\xac\xfe\x87\x8b\xf5\x2c\x91\x0a\xa5\x9e\x25\xb2\x98\xe8\x12\x13\x3b\xfe\x5a\xc9\xaa\x5c\x40\x7f\x23\xd7\x65\x4d\xa7\xe3\xf1\xce\xf5\xfe\xc6\xb5\xa7\x07\x39\xd7\xe6\xbb\x9e\x87\xd7\x5c\x1b\x6a\x50\xe6\x95\x62\xf9\x11\x65\xf4\x4c\x73\xb1\xae\x72\xa6\x0e\x9f\x4e\x00\x4a\x85\xf6\x1e\xbe\x17\x1b\x21\x1f\xc4\x37\x1c\xf3\x54\x2f\x60\xc5\x72\x8d\x13\x00\x9d\xc8\x12\x17\x70\x63\x29\x2c\x59\x82\xe9\x04\x60\xcb\x72\x9e\x92\x74\x1c\xcd\xb2\x44\x71\x79\x7b\xf5\xe1\xf7\x77\x49\x86\x05\x73\x37\x01\x52\xd4\x89\xe2\x25\xb5\x3b\x20\x1a\x52\xab\x36\xd4\x2d\x89\xc0\x4a\x2a\x60\xa0\xd1\x80\x5c\x79\x32\xf5\xac\xee\xab\x54\xb2\x44\x65\xb8\x17\x93\xbd\x5a\x76\xd3\xdc\x3b\x18\xf5\xdc\x92\xe5\xda\x34\x43\x9a\x0c\xa1\xd6\x37\xa6\xa0\x89\x64\x3b\xa4\xc9\xb8\x06\x85\x24\x0f\xe1\x6c\xa7\xd5\x2d\xd8\x26\x4c\x80\x5c\xfe\x88\x89\x99\x11\x3f\xa8\x34\xe8\x4c\x56\x79\x6a\xcd\x6b\x8b\xca\x80\xc2\x44\xae\x05\xff\x77\xd3\xb3\x06\x23\x69\xc8\x9c\x19\xac\x35\xe5\x2f\x2e\x0c\x2a\xc1\x72\x2b\xd0\x0a\x2f\x80\x89\x14\x0a\xb6\x03\x85\x76\x0c\xa8\x44\xab\x37\x6a\xa2\x67\xf0\x46\x2a\x04\x2e\x56\x72\x01\x99\x31\xa5\x5e\xcc\xe7\x6b\x6e\xfc\x4c\x49\x64\x51\x54\x82\x9b\xdd\x9c\xec\x9d\x2f\x2b\x6b\x02\xf3\x14\xb7\x98\xcf\x35\x5f\x4f\x99\x4a\x32\x6e\x30\x31\x95\xc2\x39\x2b\xf9\x94\x08\x17\x34\x51\x66\x45\xfa\x85\xaa\xa7\x95\x3e\x6f\x51\x6a\x76\xd6\x04\xb4\xb1\x6a\x6a\x6e\x93\xa1\x06\xe5\x6e\x2d\x15\xb8\xb6\x0a\xa5\xd7\x1c\xfd\x7b\xf1\xda\x5b\x56\x2a\xef\x5e\xdf\xdd\x83\x1f\x94\x54\xd0\x95\x39\x49\x7b\xff\x9a\xde\x0b\xde\x0a\x8a\x8b\x15\x2a\xa7\xb8\x95\x92\x05\xf5\x88\x22\x2d\x25\x17\x86\x7e\x24\x39\x47\xd1\x15\xba\xae\x96\x05\x37\x56\xd3\xff\xaa\x50\x1b\xab\x9f\x19\xbc\x24\xbc\x80\x25\x42\x55\xa6\xcc\x60\x3a\x83\x2b\x01\x2f\x59\x81\xf9\x4b\xa6\xf1\x27\x17\xbb\x95\xb0\x9e\x5a\x91\x0e\x0b\xbe\x0d\x73\xdd\x86\x4e\x5a\xcd\x6d\x0f\x3e\xbd\x1a\xba\x2b\x31\xe1\x2b\x9e\x90\x9d\x5b\xdb\x4e\x51\x73\x85\xa9\x9f\xa8\xa0\x31\xc7\x84\x1e\xda\x89\x69\x98\x5a\xa3\x81\x94\xeb\x44\x6e\x51\xed\x3a\x22\x5d\xee\xe0\x56\xc9\x02\x4d\x86\x55\x33\x63\x43\xb3\xd6\x5e\x5e\x47\x07\xb7\x0f\x48\xbc\x24\xcc\xb3\xb4\x35\xed\x81\xe5\xb9\x7c\xc0\x14\x98\x86\x92\x29\xd3\xcc\xdb\x2e\xbc\xcc\x0e\xba\xe5\x06\x8b\xa3\xb1\x0e\x46\x7b\xed\xed\xc6\xe3\x04\x03\x9d\x28\x56\x22\x5b\xe6\x2d\xab\x22\x60\x12\xeb\x16\xc3\x47\xdd\x92\x8a\x14\x4f\xf4\x21\x19\x61\x81\xd4\x72\x64\x9a\x27\x97\x95\xc9\xfa\x1e\x1e\xce\xb0\xaf\x7d\x63\x27\x13\x8b\x4d\x7b\xd3\x97\xc0\x2a\x93\x59\x03\x4b\x98\x41\xb0\x2a\xeb\xed\xb2\x1e\xb3\xdd\xda\x6a\xbc\xc7\xda\xcb\xbd\x82\xb9\x9c\xa7\x32\xd1\x73\xcb\x0a\xb3\x33\xd9\x5a\xfd\x8a\xaf\x2b\x45\x6f\xcf\xbf\x68\xd4\x75\xde\x3b\x68\x5c\x08\xd4\x82\x69\xfd\x20\x55\x1a\x7a\x7e\x20\x8b\xfb\xcc\x9a\x6b\xa2\xd0\x00\x17\x34\xef\xeb\xe5\xc3\x2f\x2f\x6e\x81\xb5\xcb\x17\x98\x8c\x99\x60\xaf\xce\x4d\x60\x5c\xb8\x55\xc2\x93\xe1\x96\xa6\x8e\x88\x8e\x55\x3b\x9e\x3b\x7b\x6d\x70\x17\x7b\xdc\xc3\xe0\x06\x77\xce\xda\x1b\x5e\x8d\xac\x27\x29\x81\xdf\x0c\xe0\x4d\xa5\x63\xbc\xd9\x6b\x89\xc0\xdc\xfa\xed\x7b\xd9\xe0\x2e\xcc\x0c\x84\x40\xe8\xf8\x22\xb7\x68\x3c\x4b\xe7\xd6\xa3\xf0\x0c\x29\x5c\xa1\x42\x61\x7a\x71\xd6\xba\x6a\x4a\xa0\xc1\xbd\xe5\x25\x52\x24\x58\x1a\x3d\xb7\x86\xbd\xe5\xf8\x30\x7f\x90\x6a\xc3\xc5\x7a\xfa\xc0\x4d\x36\x75\x38\xa8\xe7\xa4\xf5\xf9\x17\xf4\x67\x40\x2e\xf7\x6f\x5f\xbd\x5d\xc0\x65\x9a\x82\x34\x19\x2a\xa8\x34\xae\xaa\x1c\x56\xe4\x0d\xcd\x5a\xae\xc6\x05\x2d\x7c\x17\x50\xf1\xf4\xef\xfd\xe6\xfd\x44\xb9\x49\x12\x08\xcb\x9f\x20\x3b\x87\xdd\x3b\x78\xc8\x90\x88\xb5\x22\xbc\x73\xda\x94\x0a\xec\xe2\x66\x8d\xa5\x18\x65\x0d\x0e\xed\xd2\x11\x9c\x2c\xa5\xcc\x91\x89\x60\x4b\xbb\xa0\xda\x15\x24\xcc\xc8\xd4\xd2\x15\x7c\xda\xbb\x86\x75\xaf\x4a\x5b\x7f\x29\x66\x67\x3f\x0b\x2e\x78\x32\x4e\xb8\x70\xc2\x85\x13\x2e\xfc\xe2\xb8\x30\xd0\x60\x89\x4c\xa1\xba\x97\x1b\x14\xdf\xf0\x3c\x60\x8b\x1d\x39\xda\x66\x76\x16\x29\x64\x69\xfd\x3a\x18\xfb\x3e\x4d\x78\xf2\x0a\x29\x7e\x21\x9f\xb8\xc7\xcb\x83\x61\x2d\xb7\x88\x72\x1a\x1a\x41\xd6\x5d\x33\xbd\x0b\x59\x39\x2f\x2f\x4e\x61\x40\xa4\x9e\xee\x36\x3e\x0a\xc4\x94\x42\xd5\x25\x36\x58\x69\x27\xe2\x1e\x20\x19\x61\x5f\xa0\xcb\x43\x5c\xb5\x91\x2c\x4b\x12\xd4\x9a\x5b\xef\x79\xb9\xa3\x1e\xf7\x3e\x33\xbc\x25\xdf\xf1\xd8\x53\x77\xd7\x30\x56\x46\x71\xf2\xb9\x18\x09\xcb\x10\x7f\xf6\x7a\x0a\x3e\x8e\x98\xe3\x4f\x58\xc7\x3e\x23\x4c\xfc\xc4\x78\x38\x42\x4e\xc3\x38\xf8\x4c\x0c\x8c\x6b\x7b\x08\xff\x86\xb1\x2f\x8e\x7b\x61\xcc\x1b\x80\xb3\x4c\x0a\xa9\xae\xd9\x12\xf3\xc0\xe4\xe8\x88\xe3\xdb\x7d\x6b\x48\x32\x29\x75\x9d\x00\x73\x11\xea\xb9\x86\xdc\x3d\x93\x02\x12\x99\xe7\x9c\xf2\xae\x01\xa6\xad\xbd\xf8\x44\x80\x7b\x2d\x06\x7d\x61\xd1\x10\x07\x4d\x5e\x75\x34\x17\xfb\x37\x7c\x32\x57\x37\x5a\x6e\x21\x8b\x42\x5d\x5a\x8b\x0e\x81\x5f\x86\x60\xf6\x3d\xd5\x79\x25\x8b\x79\x2e\xda\x4f\x21\x65\x86\x3d\x8f\x31\xca\xe7\x6d\x43\xa6\xda\xe1\xe8\xaa\x6e\x0a\xcc\xc0\x43\xc6\x93\xcc\xe7\x0c\x7c\x42\x71\x89\x9e\xa0\xe7\x2c\x2f\xae\xb3\x77\x48\x6a\xe2\x62\x3d\x46\xc8\x6f\xda\xef\xbc\xa4\x88\x9e\x56\x04\x56\x96\xf9\x8e\x00\x93\x15\x65\x8e\x1a\x96\xb8\x72\xc8\xb3\x46\x1d\xf6\x79\x03\x39\x97\x9e\x81\xcf\x3b\x63\xba\x74\x86\x86\x74\x27\x58\xc1\x13\x50\xf8\xa0\x38\xe5\x0b\x1d\x00\x06\x67\x24\xf5\x01\x1a\xcd\x05\x2c\xd1\xb6\xb7\x84\x73\x4c\xa3\xa4\xc3\x55\x93\xf0\x09\x76\xfc\xc3\x5f\x9d\x38\xbf\x57\x8e\xce\xef\x5d\xba\x43\xff\xed\x87\xa9\xae\x53\x64\x72\xd5\x36\xc1\x4e\x3a\x24\xbc\x48\x8c\xcb\xb2\xec\x6f\xcd\x5d\x0a\xf9\x20\xdb\x72\x90\x7b\xe9\x27\x35\x84\xc0\x63\x82\x12\x96\x98\x83\x14\x7b\x54\x9b\x97\x4e\x22\x46\x42\x89\x6a\x25\x55\x01\x4b\xa6\x31\xb5\x08\xa3\x70\x8d\x8f\x50\x30\x93\x64\x5c\xac\xe3\xd1\xc5\x2b\x5c\xb1\x2a\x37\xc0\x35\x9c\x2b\x2c\x73\x96\x60\xcc\xad\x1e\xe5\x54\x17\x32\xad\xf2\x2a\x1a\x7f\x75\x67\x84\x6b\x4f\x19\x7c\xb6\x69\x56\xe0\x8c\xe9\xac\x71\x27\x5c\xe2\x9a\x84\x1d\xe5\xa7\xce\xdf\x47\xda\x58\x59\x31\xb3\xb0\x28\xf2\xc7\xaf\x06\x59\xb5\x58\xb3\x0e\x66\xf5\xc0\xc9\x7a\x34\xa7\xef\x90\xb6\x87\x00\x1f\x2d\x20\xd2\x76\x09\x5b\xdb\x78\xd7\xa3\x13\x65\xd6\x1f\x8d\x62\x89\x19\x08\x0a\x5c\xa2\x9f\x6b\xa7\x67\x4c\x67\x1d\x55\xfe\xff\xec\xb7\xbf\xf9\x68\x3d\xd6\xf6\x50\xa0\x08\xb8\xcd\xbd\x1c\x36\xef\xd4\x24\x76\x19\x64\xb5\x75\xd6\x7d\x47\x59\xe4\xda\xdb\x36\xa6\xc0\xbd\x5b\x76\x24\x41\x27\x00\x3d\xb3\xd2\xc5\xc7\x68\x8f\x09\x2b\x4d\xa5\xd0\xed\x13\x6a\x60\x0a\x81\x6d\x19\xcf\xd9\x32\xc7\xae\x00\xff\xef\xc5\x47\x8b\x4f\x63\xc9\xc8\xf9\x1e\x2d\xbc\x3b\xff\x06\x90\x70\xec\xea\x64\x1e\x10\xad\xcf\x20\x12\x66\x50\x30\x83\x69\x3d\x17\xa2\x7c\x3a\x8c\xf6\x7b\x59\x69\x8b\xaf\xbf\x9c\xc7\xe6\xc6\x38\xbe\x68\xfc\x98\x6b\xd4\xc3\xda\xfd\xc1\x24\xd6\x3e\x2e\x70\x44\xba\x7d\x25\x7c\xe4\xda\xc4\xc3\x75\xf0\x2e\x91\xed\x91\x2b\x72\x51\xc8\xb1\xd0\x5d\x21\x55\xda\x6f\x7d\x79\xe0\x1e\x98\x4f\x8d\xb6\xea\xed\x41\x9a\x54\x8d\xf1\x76\x3b\xea\xb1\xc2\x68\xdf\xb4\xb3\x43\xc6\x4b\x7a\xbd\x80\x0d\x62\xe9\xf6\x21\x53\x25\xcb\x1a\xfa\xa3\xa8\x15\x5d\xe6\xdd\x35\x32\xe1\xe1\x9a\x31\xa5\x58\x24\x17\x40\xde\x27\xa9\x78\xb4\x86\xa9\xb5\xc5\xf0\x3d\x92\x29\xd4\x55\x6e\xf6\xdb\x92\x5c\x83\x75\x32\x0c\xc6\xc5\xc5\x05\xc1\x04\xc9\xaa\x96\x0d\x39\x10\x04\x76\x22\xb5\x4a\xda\x91\x4c\xbb\x6d\xa2\xf2\x03\x87\x0e\x71\x04\xf8\xb8\x99\x31\x32\x81\x12\x92\xbc\x35\xbf\x90\x8a\x59\x9a\x72\x17\x9e\xdd\x0e\x7a\x12\x03\x96\x32\x9a\x91\xb0\x85\x74\xd4\xfe\xb6\x8e\x1b\xe1\xdb\xfb\xfb\x5b\x78\xff\xee\xda\x31\x82\x06\x55\xbf\xab\x37\x20\xa6\x92\x8d\xda\x97\xa3\xd1\x6c\x5b\x72\x3b\xc9\x83\x27\x93\x08\x6e\x09\x8e\xe0\xbd\x94\x6a\x4c\x7e\xa8\x9d\x25\xf0\x09\x19\xfb\xaa\xdb\x21\x6d\x36\x07\x29\x81\x40\xdb\xde\x01\x31\xbf\xa9\x4c\xc5\xf2\x7c\x07\xf8\x98\xe4\x95\xe6\x5b\x6c\x87\x7e\xb7\x52\x99\xe7\x71\xa1\xe4\xe3\xee\xbd\x1a\x13\x1d\xdd\x52\xd3\x77\xd7\x80\x6b\x72\x8d\x9d\x67\xfc\xb8\xa3\x42\x15\xb5\xf8\xf2\xc5\x9f\xff\x00\xaf\xb8\xb2\x61\x5e\x2d\xe3\x60\xb8\x27\xdd\xb8\x60\x32\x25\xab\x75\xd6\x95\xc5\xb3\xf8\x50\x4f\x8a\xaa\xce\xc7\x07\x54\x3e\x6d\x17\xd4\xcb\x4f\x11\x2f\x74\x03\x85\x7e\xdf\xe2\x14\xca\x9d\x42\xb9\x53\x28\xd7\x5c\xa7\x50\xee\x14\xca\x85\xaf\x53\x28\x77\x0a\xe5\x42\x5c\x9d\x42\xb9\x56\x9b\x53\x28\xd7\x2b\xb5\x9f\x32\x94\xa3\x92\xe4\x31\x3b\xe0\x14\xc5\xb8\xd6\x56\xdc\x95\xc6\xce\xc6\xf2\xb3\xfc\x66\xe7\xa8\xdf\xf3\x02\x65\x35\x26\x9c\xa9\x5b\x02\x5b\x19\x54\x2d\x8d\xd7\x41\x95\x73\xe3\x9f\xb7\x3d\xb2\x8f\x64\x02\x61\xad\xd8\xbd\x5d\x85\xf6\xed\x86\x17\xed\xe9\xb0\x2a\x7b\x02\x37\x05\xa2\x2a\x96\xa8\xbc\x3f\x52\xca\x34\x1c\xbe\x05\xc3\x9d\x59\x30\x7c\x2b\x83\x81\xdb\xe3\x74\xbf\x6f\x3c\xe5\xc2\x4c\xa5\x9a\x3a\xda\x17\x60\x54\xd5\xb7\x0e\x98\x5c\x3b\x1f\x7f\x8c\x22\xaf\xef\xba\x7e\xb4\x37\xa9\x87\x0c\x45\xab\x9c\xa2\x55\xbc\xdd\xdb\xe9\xb0\x87\x9b\xb0\xb1\xbb\xc4\xa6\x4a\x8c\x2f\xea\xf2\x83\xbf\xbc\x84\x04\x95\x69\x1b\x3c\xed\x16\xc6\xca\x3c\xc6\xd1\x05\xae\x82\x6c\xc5\xd7\x6f\x58\xf9\x84\x82\x9e\x97\xfe\x9d\x36\xa9\x29\x33\xec\x80\xc6\x68\x8f\x30\xcc\xc1\x78\x2e\x60\x4c\x8d\xda\x11\x1f\xbe\x06\xa3\xa9\xba\x88\x93\x02\xe3\x57\x1a\x18\x55\x61\x76\x44\xd0\x67\x54\x51\xe1\xaf\xa7\x56\x56\x8c\xe8\x72\xb8\x16\x0d\x9e\x26\xe9\x71\x35\x69\x30\xa6\x26\x63\x6f\xda\xae\x2c\x63\x04\x3b\xad\xc2\x8d\x51\xe5\x69\x30\xba\x44\x0d\x46\x95\xa9\xc1\x60\xa9\x1a\x8c\x2b\x63\x05\xf2\x05\xc3\x55\x5f\xfe\xea\xab\xfe\x8a\x03\xc1\xe7\x33\xd5\x3f\xbe\x24\x15\x9e\x57\x96\x0a\x27\xf0\xf8\xd5\x83\xc7\x51\x41\xd7\x08\x7e\x7e\x25\xc8\x31\xa2\x51\xc2\xc2\x75\xae\x70\x94\x6a\xaf\xb7\x2a\xda\x0e\x50\x5d\x00\xda\x4d\x83\x5a\xd4\x89\x24\xa9\xe0\xc9\x48\x34\xc2\x74\x2c\x35\xa3\x3d\x3a\xd5\xe3\xd2\xb9\xef\xff\x1c\x57\x2b\x9e\x8f\x71\x98\x4e\xee\xde\xc1\x75\x72\xf7\x4e\x88\x3d\xd4\xe9\xc9\xdd\x3b\xb9\x7b\x27\x77\xef\x04\x1e\xad\xeb\xe4\xee\xfd\x5c\xee\x1e\x2a\xf3\x4c\x87\xef\xc8\x3d\x3a\xf2\xfc\xe2\x1e\x8e\xf3\x09\x3f\xa9\xcb\xc7\x85\xc6\xa4\x52\x78\xb7\xe1\xe5\x07\x54\x7c\x35\xf6\x3b\x9f\x57\x5c\xd3\x97\xfa\xf5\x07\x0a\x96\x27\x77\xbe\x01\xb6\xce\x2b\x19\x22\x2d\xae\xff\x0d\xee\x3e\x4e\xd0\x16\x29\x3f\x13\x39\x6f\x70\x17\xfb\xf0\xec\x88\x9b\xe3\xf5\xa8\x8f\xaf\x9f\xcd\xbd\x3e\x7d\x27\xfb\x79\xad\x4a\xa7\xef\x64\x07\x39\xf9\xc5\xbf\x93\x75\x9f\x69\xa2\xba\x19\xff\xe5\xe1\x7b\xed\x8a\xae\xb6\x84\xc4\xae\x64\x46\x6a\xd3\x7c\xfc\xfe\x69\xd0\x28\x4a\x79\xe4\x61\x68\xb3\xf3\x47\xb9\xec\xdd\x57\x3e\xc2\x84\xdc\xef\x27\x5b\x9f\x9a\x3e\xa7\x35\x8a\xe3\x16\x89\xaf\x1f\xe5\x12\x1c\xa3\x16\x1d\x7a\x87\xee\xe1\xa9\xf9\x60\xf6\x8e\xa0\xe5\xb8\x32\xe3\x00\x55\x5d\xa3\x16\x16\xb9\x8d\xce\xa6\x1b\xf7\xb9\xde\xeb\xe6\x00\x9c\x7a\x6e\x1e\x89\x89\x29\x6c\x4e\xe7\xc1\xb4\x97\xe6\x18\xb2\x32\xd1\x8b\xa7\x1d\x62\xbf\x76\x06\x5c\xdf\x5c\xda\x35\xc0\xcf\x20\x96\xe7\x6d\x92\x2d\x31\x8e\x9d\xc0\xcc\xe0\xc2\x7d\xc3\xc7\xb4\x3b\xac\xc6\x9d\xf4\xa3\xd0\x0a\x34\xf1\x87\x43\x1d\x31\x00\x83\x73\x89\x6a\x2a\x6e\xf6\xa7\xa9\x45\xb8\xb9\xae\xcf\x16\xda\x7f\xe1\x4c\xff\xf5\x8d\x19\x29\x8c\x18\xda\x68\x0e\x6e\xc7\x07\xcd\xba\x94\xe9\xfd\xbe\x34\x22\x7e\x42\xd2\x6d\xb7\x2d\x18\xc5\x84\xa6\xea\xde\xfd\x67\x9d\xd6\x7c\xbe\x6b\x96\x00\xfb\xca\x11\x9d\x52\xd4\x6e\x8a\x9b\xca\x23\x4f\x4f\x8a\xb0\x1e\x62\xdb\xd5\x6e\x5e\xf3\x82\x1f\xb9\x1d\xdd\x69\xb1\x6f\xd7\x1c\xc7\x54\xa2\x9a\xd6\x5b\xff\x39\x3d\x90\xa2\xb5\x61\x1e\xfa\x56\xd2\x57\x8b\x9a\x8c\x19\x78\xe0\x79\x4e\x2b\x78\x62\x57\x3f\x4c\x0f\x19\x8d\x95\xed\x85\x77\xfd\xf5\x33\x27\xfa\xd1\x9c\x7e\xca\x7c\x25\x43\x7f\xdd\x94\x06\x0d\x9b\xfb\xe1\x0b\xee\x70\x36\x7f\xc0\x96\x2f\xb8\xad\x89\xac\x97\xa2\x82\x4e\x5c\xeb\xb5\xfb\x7b\xf2\x3a\xf6\xad\x68\xca\x5f\xde\xbc\x3a\x16\x2a\xc4\x27\xd0\xe1\x89\x5f\x41\x42\xea\xd3\xe4\x1a\x39\x5a\x85\xfa\x53\x59\x02\x4b\x8f\xab\xfb\xba\x00\x66\xd7\x4d\x57\x0b\xc5\x04\xc8\xfa\xe8\x01\xd7\x85\x42\x2a\xc5\x25\xf3\xb7\xab\xbe\x6d\x14\x2b\xf0\xfc\x94\x47\x13\xd8\xf1\xb8\xae\x4f\x07\xb4\x7c\x53\xd2\xd4\x52\xe5\xbc\xd4\x9a\x55\x57\xfc\x1c\xf3\xc0\xc2\xb5\xfc\x23\x3f\xb1\xc7\x81\x22\xc2\x0e\xd9\x8d\x00\xf7\xc7\xf2\x39\x11\x9f\x6b\x27\x4e\x6b\x5f\x19\x2f\x09\xd9\xa3\x39\x31\xb2\x3d\x5f\x42\xf8\x81\xbc\x6a\xdf\xb9\xb3\xa8\x2b\x71\x01\x37\xd2\xd8\x3f\xaf\x1f\xb9\xb6\x03\x89\x98\xaf\xf5\x4a\xa2\xbe\x91\x86\xda\x7e\x94\x48\x1c\x51\x23\x05\x52\xd7\x17\x5a\x03\x15\x0e\xf5\x08\x92\x5a\x07\x1f\xea\x19\x5c\x39\x57\xdd\xf3\x17\x61\x82\x6b\xb8\x12\xd6\x13\xad\x39\xa7\x03\x2b\xdd\x10\xae\x73\x9f\xdb\x10\x52\x4c\xb1\x28\xcd\xce\xf7\x1e\x75\x93\x6b\xa5\x71\xed\x45\x29\x55\x47\x5e\x81\x81\x22\x7d\x2e\x11\xea\xe1\xef\x33\xee\xdf\x71\x87\x68\xba\xda\xd2\xb4\x22\x11\xd0\x21\x90\xcc\xe0\x9a\x27\x50\xa0\x5a\xc7\xe8\x2c\x2d\x4e\x85\x55\x37\x58\xa3\x38\x2a\x6a\x18\xaa\x4f\x7c\xee\xd1\x0d\xd3\xb8\x7a\x07\x3c\xf4\x18\x55\x04\xdf\xe1\x7a\xd8\xf1\xdf\x61\x0d\xc8\xe7\x78\xcd\xa8\x5d\x0b\x42\xdf\x82\x95\xd6\xb2\xff\x63\xe1\x94\x0c\xe5\xbf\x50\x32\xae\xf4\x0c\x2e\xe9\x88\xd9\xbc\x5f\xb3\xed\xf6\x75\xe6\xa3\xdd\xb5\xed\x95\x6b\xb0\x32\xdf\xb2\x1c\xeb\xf3\x0b\x05\x60\x4e\xc0\xdf\xdb\xa5\x5c\x1d\xad\x68\x17\xf0\x90\x49\x8d\x75\x32\x02\x73\x3a\x7f\xf4\x6c\x83\xbb\xb3\x8b\xce\xcc\x03\xde\x0f\xa5\x67\x57\xe2\xcc\x2d\x12\x47\xf3\xa0\x39\xfd\x4b\x8a\x7c\x07\x67\xf4\xec\x6c\x76\xb4\x08\xf6\x76\x1b\x5d\x18\x07\x83\x9b\x9e\x47\x66\xac\x77\xf8\x54\xd7\xb0\x3e\x43\xf3\x97\x72\x0f\xfb\x26\xdd\x74\x7f\xf4\x67\xe7\xae\x5f\x1b\x27\x51\x79\x1d\xf6\x38\xa5\x23\x51\x27\xbd\xed\xf7\x27\x40\xbf\xd8\xff\x22\xb6\xa6\xf5\x89\xcf\xf4\xa0\x8e\xa1\xd3\x56\x61\xa4\x36\x52\xb1\x35\xd6\x77\xb4\x61\xc6\x7d\x97\xe2\xbd\xcc\x9b\xc3\xc3\x9d\xcf\xce\xe8\x87\x3f\xaf\x99\x7e\x26\x52\xb8\x19\xac\x17\xf0\x8f\x7f\x4e\x5c\xaf\x98\x7e\xf0\x74\xd8\x9b\xff\x0b\x00\x00\xff\xff\xd1\x3c\x4c\x0a\x2d\x5b\x00\x00") - -func examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYamlBytes() ([]byte, error) { - return bindataRead( - _examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml", - ) -} - -func examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYaml() (*asset, error) { - bytes, err := examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml", size: 23341, mode: os.FileMode(420), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -var _examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYaml = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xbd\xfb\x73\xdc\xb8\x95\x28\xfc\x7b\xfe\x0a\x94\x27\x55\xb2\xbf\xaf\xbb\x65\x4f\xb2\xa9\xac\x37\xb5\x5b\x8a\x24\x4f\x54\xb1\x65\x5d\x4b\xe3\xb9\xf9\x1e\x35\x83\x26\xd1\xdd\x58\x91\x00\x03\x80\x2d\xf5\xdc\xdc\xff\xfd\x16\x0e\x00\x3e\x9a\x04\x08\xb6\x5a\x63\x27\x43\x6e\xd5\x66\xdc\x22\x0f\x80\x83\x83\x83\xf3\x3e\xbf\x99\xcf\xe7\xbf\xc1\x05\xfd\x4c\x84\xa4\x9c\xbd\x45\xb8\xa0\xe4\x51\x11\xa6\xff\x25\x17\xf7\x7f\x94\x0b\xca\x4f\xb7\x6f\x96\x44\xe1\x37\xbf\xb9\xa7\x2c\x7d\x8b\xce\x4b\xa9\x78\xfe\x89\x48\x5e\x8a\x84\x5c\x90\x15\x65\x54\x51\xce\x7e\x93\x13\x85\x53\xac\xf0\xdb\xdf\x20\x84\x19\xe3\x0a\xeb\x9f\xa5\xfe\x27\x42\x09\x67\x4a\xf0\x2c\x23\x62\xbe\x26\x6c\x71\x5f\x2e\xc9\xb2\xa4\x59\x4a\x04\x8c\xe0\xc6\xdf\xbe\x5e\x7c\xbb\xf8\xfd\x6f\x10\x4a\x04\x81\xcf\xef\x68\x4e\xa4\xc2\x79\xf1\x16\xb1\x32\xcb\x7e\x83\x10\xc3\x39\x79\x8b\xd4\x06\x33\x2e\x45\x99\x11\x21\x17\x39\x67\x54\x71\x41\xd9\x7a\x91\x70\x41\xb8\x5c\x24\x3c\xff\x8d\x2c\x48\xa2\x07\x5f\x0b\x5e\x16\x6f\x51\xff\x4b\x06\x9e\x9d\xa4\x59\xe0\x1d\x80\xfe\xa4\x41\xc3\xaf\x19\x95\xea\xaf\xfb\x7f\x79\x4f\xa5\x82\xbf\x16\x59\x29\x70\xd6\x9e\x10\xfc\x41\x52\xb6\x2e\x33\x2c\x5a\x7f\xfa\x0d\x42\x85\x20\x92\x88\x2d\xf9\x9e\xdd\x33\xfe\xc0\xde\x51\x92\xa5\xf2\x2d\x5a\xe1\x4c\x92\xdf\x20\x24\x13\x5e\x90\xb7\xe8\x5a\xcf\xaa\xc0\x09\x49\x7f\x83\xd0\x16\x67\x34\x05\x74\x98\x79\xf2\x82\xb0\xb3\x9b\xab\xcf\xbf\xbb\x4d\x36\x24\xc7\xe6\x47\x84\x52\x22\x13\x41\x0b\x78\xaf\x39\x57\x94\xea\x4d\x22\x12\xe1\xbd\x5f\x8b\x8c\xef\x72\xc2\xd4\xc2\x02\x28\x04\x2f\x88\x50\xd4\xe1\x43\x3f\x0d\xea\xa8\x7e\xdb\x1b\xea\x44\xcf\xc5\xbc\x53\x0d\xa5\x36\x04\xd9\x5d\x25\x29\x92\x30\x4f\xc4\x57\x48\x6d\xa8\x44\x82\x00\x12\x98\xa1\x90\x06\x58\xa4\x5f\xc1\x0c\xf1\xe5\x7f\x93\x44\x2d\xd0\xad\x46\x94\x90\x48\x6e\x78\x99\xa5\x9a\x88\xb6\x44\x28\x24\x48\xc2\xd7\x8c\xfe\x5c\x41\x96\x48\x71\x18\x32\xc3\x8a\xd8\x8d\x71\x0f\x65\x8a\x08\x86\x33\x8d\xc5\x92\xcc\x10\x66\x29\xca\xf1\x0e\x09\xa2\xc7\x40\x25\x6b\x40\x83\x57\xe4\x02\x7d\xe0\x82\x20\xca\x56\xfc\x2d\xda\x28\x55\xc8\xb7\xa7\xa7\x6b\xaa\xdc\x79\x48\x78\x9e\x97\x8c\xaa\xdd\x29\x50\x35\x5d\x96\x8a\x0b\x79\x9a\x92\x2d\xc9\x4e\x25\x5d\xcf\xb1\x48\x36\x54\x91\x44\x95\x82\x9c\xe2\x82\xce\x61\xe2\x0c\x8e\xc3\x22\x4f\xbf\x11\xf6\xf0\xc8\x93\xc6\x4c\xd5\x4e\xef\xbb\x54\x9a\x42\xab\x9f\x81\x22\xbd\x78\xd7\x54\x89\xa8\xde\x57\xf3\x99\x99\x7f\x8d\x5e\xfd\x93\xc6\xca\xa7\xcb\xdb\x3b\xe4\x06\x85\x2d\x68\xe3\x1c\xb0\x5d\x7f\x26\x6b\xc4\x6b\x44\x51\xb6\x22\xc2\x6c\xdc\x4a\xf0\x1c\x20\x12\x96\x16\x9c\x32\x05\xff\x48\x32\x4a\x58\x1b\xe9\xb2\x5c\xe6\x54\xe9\x9d\xfe\x7b\x49\xa4\xd2\xfb\xb3\x40\xe7\xc0\x15\xd0\x92\xa0\xb2\x48\xb1\x22\xe9\x02\x5d\x31\x74\x8e\x73\x92\x9d\x63\x49\x9e\x1d\xed\x1a\xc3\x72\xae\x51\x3a\x8c\xf8\x26\x33\x6b\xbf\x68\xb0\x55\xfd\xec\xb8\x4c\xff\x0e\xdd\x16\x24\xa1\x2b\x9a\x00\xa1\x1b\xfa\x27\xfa\x15\x2a\x48\x8a\x96\x64\x83\xb7\x94\x0b\xf7\x7b\xf3\x70\x26\x59\x29\x15\x11\x8b\x16\x56\xfb\xf1\xb3\x29\x97\x9a\x95\x9d\x6a\x9e\x2a\x18\x51\x44\x36\x50\xb5\xcc\xf8\xf2\x34\xc7\x1a\xd6\xa1\x68\xd3\x2b\x9c\x63\x96\xce\xa5\xc2\xaa\x6c\xa1\xae\x8f\x61\x00\xd3\x58\xc1\xad\xb0\x6b\xff\xba\x87\x9c\xab\x15\x20\x8f\xae\x28\x49\x67\x80\x80\x82\xa7\x27\x12\x8e\x74\x5a\x66\x9a\x78\x13\xce\xa4\x12\x98\x6a\x9a\xdc\x03\xe5\x1b\x5a\x3f\x8c\xa7\xe4\xcc\x33\x85\xce\x34\x2e\xe0\x1f\x4b\x22\xe1\xb3\x6a\xea\xcd\x69\x68\xd6\x2d\xd1\x8a\x0b\x37\xcb\xfd\xc9\x0c\x4d\xc8\xfc\x9d\xac\x88\x10\x24\xbd\x28\x35\xa5\xdd\x56\xe0\xaf\xd6\x8c\x57\x3f\x5f\x3e\x92\xa4\x54\x7b\xdc\xd6\x3b\xf7\xbb\x0d\x71\xf3\x24\x02\x3d\xd0\x2c\xb3\xc3\x68\x7e\xe8\xfe\xa0\x27\x0c\x0c\x52\xaf\x4f\x7a\xc0\x22\x7d\x4b\x29\x24\xb1\xa2\x72\xb5\x83\x75\x56\x98\x20\x8f\x9a\x31\x80\x48\x50\xef\x18\x5a\xee\x2c\x4f\xd0\x17\xd8\xcc\x0b\x76\x59\x2a\x44\x15\x30\x92\x64\xc3\xb9\x24\x08\x1b\x44\xc3\x78\x5b\xca\x81\x65\x23\xce\x08\xe2\x02\xe5\x9a\xc2\xcd\x71\xf0\x42\x6c\x4c\x67\x01\x18\xa8\xc1\x51\x89\x72\x2e\x55\x8d\x6b\xfd\x8b\x5e\x8b\x06\xff\x40\xd5\x26\xb0\x7a\x82\xd6\x5a\xe6\x20\x52\x21\x59\xe6\x7a\x12\x0f\x84\xae\x37\x4a\xce\x10\x5d\x90\x05\x6c\x3f\xc1\xc9\xa6\x31\x5c\x4e\x88\xf2\x23\x14\x67\x99\x3b\xd9\x4d\x5a\x22\x7f\x2f\xa9\x20\xfa\xda\x95\xe8\x65\xc5\x94\x2d\xa3\x9c\xb9\xbf\x77\xa8\xc4\x3f\x4c\xcf\x36\xcd\x10\x51\xc9\xe2\xd5\x0c\x25\x3c\x2f\x4a\xa5\x71\xae\xd7\xb4\xdc\x21\xaa\x88\xc0\xf6\x62\x10\xbc\x5c\x87\x31\x42\x32\x3b\x51\x77\x73\xc3\x66\xc3\x15\x8a\xd3\x54\x43\x79\x61\x90\xf4\xc2\x5d\xc0\xb2\xcc\xbd\x10\xa9\x41\x06\xe0\x2f\xc7\x2a\xd9\x58\x39\x21\xe1\x42\x10\x59\x70\x06\x10\xe1\x2f\x97\xf5\x5a\xfe\x23\x48\x0c\x1a\xd8\x4b\xf9\x0a\x36\x17\x80\x6d\xe8\x7a\xe3\xf6\x10\x0b\x02\xbf\xb5\x69\xa2\xef\xf0\xc2\xf4\x14\xc9\x3d\x67\x17\xed\x1f\xbc\x33\x86\x48\x5e\xa8\x5d\x83\xd2\x1a\x7b\xac\x88\xc8\xab\x15\x62\x90\x5a\x7d\x8f\xb9\x4d\xa4\x99\x3f\xcd\x8b\x8c\x26\x54\x59\xca\x43\xaf\xd1\x4b\x20\x3d\xaa\x4e\x24\x1c\x9b\x39\x2f\x5e\x2d\xd0\x99\x13\x85\x7d\xcf\xf0\xa4\x18\xaf\x46\xb6\x43\xe8\x89\x4a\x1e\x00\x5a\x8d\xef\x7d\x67\x88\x03\x36\x27\x47\x58\x42\x42\x6f\xed\xe3\xdb\x50\x8d\x24\x19\x49\x94\xe6\xc3\x44\xe4\x33\x84\xa5\xe4\x09\xd5\x92\x44\xb5\xff\x41\x90\x68\x8f\xd4\x0c\x9a\xfd\x0b\x8a\x5f\x94\x7e\xf6\x09\x77\xe8\xfd\xce\x12\xb5\xa2\xa1\x4f\x5a\x7b\xa9\x4d\x86\x31\x08\x11\xe9\x33\xae\xbf\x3f\x91\x28\xc3\x4b\x92\x75\xee\xcd\xee\x33\x40\xf7\xde\xe9\x7a\xa7\x69\x45\x52\xfb\x97\x08\xc0\xf6\xf2\xd1\xf2\x09\xa6\x4c\x5a\x31\x7c\x86\x30\xba\x27\x3b\x23\xb1\x6b\xa5\xa0\xd0\xac\x0b\x2e\x61\xac\xa2\xa0\x0a\x62\x2e\x17\xcd\x03\xee\xc9\x0e\x00\x59\x11\x3f\xe2\xfb\xf8\x9d\x37\xcf\x3d\xe9\x15\x36\xfa\x9e\xce\x25\x0e\x7b\x05\x73\x04\x4c\x00\x27\x1d\x83\x3f\x04\x9a\x5a\x91\x51\x02\xa2\x76\xe4\x37\xbd\x92\x6f\xe8\x71\x5b\x70\xd0\x3a\x3f\x55\xfa\x85\xd9\xd8\x13\x69\x36\x48\x9f\x95\x0d\x2d\xa2\xd7\xa9\x38\x50\x17\x1c\x15\xa7\xb0\x7d\xd6\x1a\x72\x35\x3d\x09\x9c\xff\x8a\xf9\xa5\x92\xfd\xe7\x9a\xab\x2b\x36\x43\x97\x8f\x54\xea\x0b\xff\x82\x13\x79\xcd\x15\xfc\x73\x81\xbe\x53\x86\x06\xdf\x0f\xb0\x8a\xc6\x14\xc7\x22\xd6\xac\xe3\x20\xb4\x9e\x31\x84\x85\xc0\x3b\x8d\x8e\xa6\x1a\x28\x17\x5a\xc2\x1e\x66\x89\xf5\x53\x1d\x30\x2a\xb5\x62\xc6\x85\x43\x0b\x28\xf3\x00\xd3\x0c\x15\x0d\x31\x2f\x25\xe8\x7b\x8c\xb3\x39\xdc\x97\x6e\x4e\xad\xb1\x0c\xd6\xe3\xa7\x29\x5a\xfb\xd3\x9d\x9e\x1b\x36\x1a\xa2\x7f\x6a\xdf\x29\x3d\xdc\xfb\xd6\x20\xf1\x07\xb2\x9e\xcc\x06\x6f\x41\x08\xa3\x6c\x9d\x55\x62\xd5\x0c\x3d\x6c\x68\xb2\x01\xb9\x3d\x1a\xe8\x92\x18\x8b\x46\x21\x88\xbe\xf7\xb0\xd4\xac\x51\xff\xb2\x26\x42\x8b\xc3\xd4\x21\x81\xc6\x4f\x54\x90\x22\xc3\x09\x49\x51\x0a\x42\xa7\xb1\x27\x60\x45\xd6\x34\x41\x39\x11\x6b\x82\x0a\x7d\xb7\xc5\x52\x7f\xf4\x85\x62\x9e\xd1\x87\xc5\x7d\x12\x4b\x8b\x4e\xa4\x8e\x99\xd2\x5c\x73\xa6\xa8\xf7\x1c\x99\x44\xbc\xdc\x6b\x38\x08\xbf\x1c\xb3\x36\x10\x38\xac\xfd\xf0\x0b\xcb\x1a\xa0\x17\x4c\xb2\xc6\x24\x6b\x78\x9f\x49\xd6\x70\xcf\x24\x6b\x4c\xb2\xc6\x24\x6b\x4c\xb2\xc6\x3f\x91\xac\x11\x09\xd4\xd8\x53\x46\x98\x75\x7e\x30\x76\xae\x7d\x3b\x0e\x08\x36\xce\x79\xd5\x32\xd9\x0c\xac\x48\x8b\x09\xb7\xf6\x2e\xbb\x03\x13\x11\x65\x00\x44\x60\xb6\x26\xe8\xcd\xfc\xcd\xeb\xd7\x61\xca\x5a\x71\x91\x63\xf5\x56\x53\xf9\xef\xbe\x8d\xc0\x89\x3d\x0d\xde\x37\x87\xe9\x61\xde\xb0\x88\x05\x5e\x32\xb8\xf5\x5b\x6b\x87\x77\x68\x68\xb3\x7d\x96\xe7\x27\xf8\x27\x2c\x97\xab\x4c\xd4\x2d\xe3\x77\xc7\x95\xe0\x5d\x9c\xb5\x3a\x0b\xcd\xdc\x15\xca\x89\x42\x58\xb5\x4c\x9b\x34\x27\x95\x07\xc9\xb8\x41\x8c\xa3\xd1\x0b\xd1\xf9\x46\x52\xc4\x99\xb5\x5c\x6b\xda\x59\x44\xce\xd8\xef\xed\x68\x3a\x45\x50\x42\xb0\x24\x5a\x86\x58\x92\x6a\xd6\x3c\xd7\xb3\xa4\x4c\x39\x06\xa8\xa7\x4c\x1c\x56\xbd\x80\x5f\x92\xc5\x7a\x81\xd2\x12\xc0\x61\x66\x3d\xa8\xaf\xcc\xaa\xe5\x4e\x2a\x92\x83\x8f\x85\x0b\xf8\x1f\xbd\x7c\x25\x76\x48\xf9\x2d\xba\x64\x4b\x98\x2a\x71\x96\xed\x10\xd9\xd2\x44\x55\xf8\x03\x27\x2f\x55\xc6\x1f\xe6\x3b\x2d\x31\x02\xeb\xfe\x69\x0c\xf2\xe9\x3d\xf1\xcd\x90\xe2\xc2\xab\xa9\x28\x0d\x0f\xdc\x3f\xe1\x43\xaa\x5f\x03\xca\xf9\xf8\xc9\x6f\xf9\x47\x71\x17\xc9\xbe\x4e\x52\x66\x99\xc6\xb7\x71\x04\x74\xa7\xe7\x8c\xed\x83\x3c\xcb\x99\xe2\x8d\x37\xab\x45\x71\xc6\x7f\x64\x3c\x19\x67\xd7\x17\x1a\x23\x43\x4b\x46\xe8\x8e\x17\x3c\xe3\xeb\x5d\x13\xf7\x70\xfa\xc1\xc1\x60\x21\x63\x24\xcb\xa5\x95\x6c\x87\x05\xb7\xeb\xbd\xad\x9c\x6c\xe6\x93\x1e\xdb\xf7\x4c\x7a\x6c\xe7\x99\xf4\xd8\xc8\x29\x4e\x7a\x2c\x3c\x93\x1e\x3b\xe9\xb1\x83\xcf\xa4\xc7\xf6\xbc\x3c\xd9\xcc\x27\x59\x23\xf0\x4c\xb2\x46\xe7\x99\x64\x8d\x49\xd6\x98\x64\x8d\x49\xd6\x08\x3e\x93\xac\xd1\xf3\xf2\xd1\x6c\xe6\xc3\xe0\x86\xd0\x33\xef\x1a\xda\x82\x16\x60\xef\x94\x82\x7f\x2e\x78\x7a\x40\x48\x7d\xc1\xd3\x40\x44\xbd\x31\x6a\x26\x7c\x9e\xf1\x04\xab\x7e\x7e\x00\xe6\x54\x0d\xc6\x5a\xf2\x25\xce\x8d\xad\x76\x86\x7e\xe6\x8c\x98\x48\x67\x7d\xcc\xc0\xb2\xca\xd5\x86\x08\xfd\xfa\x4b\xf9\xaa\x37\x52\x75\x8a\xd2\xef\x7d\xa6\x28\xfd\x29\x4a\xdf\x3e\xcd\x28\xfd\x0d\x96\x86\x2e\xcd\x45\xe8\x0f\xda\x6f\x70\x07\xcd\x80\xfe\x23\x38\xdf\x2f\x14\xb3\xaf\x89\xd0\x12\x0b\xa4\x19\xd6\x1b\x6f\xd6\x95\x5a\x77\x24\x49\x6f\xda\xab\x09\x70\x6f\xa3\xc3\xc1\xa4\x71\x9a\x92\x14\x15\x44\xcc\x0d\xe9\x71\xb4\xa2\x2c\xed\x59\x8b\x5b\xbf\x17\x6c\x64\x1c\x7d\x7b\x92\x23\x5c\x17\x4d\xef\x4a\x8b\x41\xef\x47\xd5\x0f\xdc\x85\xd5\xfe\x3d\x67\x54\x3d\x68\x5e\xee\x72\x1b\xaf\xb2\x83\xde\xf6\xf7\x92\x88\x1d\xe2\x5b\x22\x6a\xcd\xa4\xca\xc1\x8c\x51\x42\xe0\xee\xa1\x12\x25\x58\x1a\x46\x3d\x2c\x6a\x8d\xd3\x4e\xc7\xfb\x41\x3a\x8b\xdd\x07\x61\xb4\x7c\x67\xb3\x00\x44\x44\x4a\x6f\xbd\xa6\x8d\x1e\xe7\x14\x16\xb1\x22\xbc\x71\x5d\x45\xbd\x3c\x4a\x38\xed\xdd\x6d\x8f\xc9\x23\x5e\x2d\x68\xb8\xf1\x06\xcc\x1e\xf1\x30\xf7\xcc\x23\x4f\x34\x7d\xa0\x03\xcc\x1f\x68\x9c\x09\x04\xed\xa3\x57\xcf\xd2\xde\xd3\x5d\x6b\xc8\x08\xa0\x0d\xfa\x1a\x6f\x11\x41\x87\xe9\x23\xe3\x2d\x23\x68\x7f\xf9\xd5\xf6\x89\x8e\x99\x64\xd4\xe2\x9b\x26\x15\xbf\xa9\x64\x14\xc8\x8e\x59\xa5\x6d\x2e\x01\xda\x6a\x59\x4c\x9e\x1b\xd9\xe3\xac\x25\x68\x1f\xd5\xd6\x56\x40\x41\x75\xde\xb3\x9d\x8c\x42\x4c\xdb\xce\xe2\xb5\x9f\x8c\x82\xe9\x33\x66\xb4\x6d\x28\xa3\x41\x76\xed\x2d\x1d\x3b\xca\x71\xa6\x69\xa7\x58\x1b\x22\x46\x81\x35\xc5\x1b\x8e\x69\x8c\x40\xe3\x0d\x12\xe8\x50\xba\x1c\x6b\x98\x40\x23\x8d\x13\x68\x84\x81\x02\x8d\x35\x52\xa0\xb1\x86\x0a\x34\x7a\xbd\x20\x42\xbc\x87\x10\x88\xb8\xe5\x6a\xf5\x42\x9f\x59\x9c\xdd\x8c\xbe\x8d\x46\xef\x60\x57\xda\x31\x53\x35\x82\x4e\x8e\x0b\xcd\x25\xfe\x97\xbe\x9a\x81\xf0\xff\x77\xec\x3d\x8a\xa9\x90\x5a\x14\xb6\xc6\xbf\x06\x04\x67\x73\x68\x0c\x16\x09\x54\xcf\x86\x4a\xa4\x69\x67\x8b\x33\x2d\x80\x98\xb0\x2d\xab\xaa\xe9\x99\xee\xcb\x6b\xb1\xe7\xfb\x61\xa3\xd5\x73\x7d\xf9\x1a\x35\x8f\x4a\xf4\xe2\x9e\xec\x5e\xcc\x3a\x7c\xe4\xc5\x15\x7b\x11\x0b\x15\x5b\x55\xa5\xc5\x33\x2a\xc9\x87\xb3\x6c\x87\x5e\xc0\xdf\x5e\xc4\x1e\xec\x3e\x71\x71\x8c\x20\x78\x80\x51\x2e\xea\x65\xe6\x2a\xeb\x8c\x75\x00\xd6\x1f\x56\xf6\x15\xa7\x18\xd7\x7f\x8a\xb1\x36\x3a\x09\xea\xb6\x2b\x07\xa1\x97\x55\xda\xf8\x5a\x63\x5e\xbd\xf2\xab\xd2\x8d\x25\xb5\x22\xd1\x40\xe4\xcf\x09\x66\x12\xbd\x70\xd6\xb3\x13\x59\xcf\xf1\xc5\xf1\x3c\x8e\xa3\xce\x70\x3c\x2f\x52\x36\x80\xed\xaf\x31\xe2\xea\x9e\x8e\x6f\xad\x85\xb6\x62\xd0\x92\xd4\xe6\xc5\x14\xbd\x74\x9a\xae\x5f\xf7\xae\x1f\x2e\x20\x8a\xb2\xf5\x39\x53\x74\x5e\xc1\xa8\xf5\x5f\xad\x11\xc6\xb2\x57\x17\xd6\xdc\xa6\x00\x67\xdc\xac\xec\x76\x35\x45\xc5\x9c\xe0\x87\x0d\x11\xad\x95\x52\x69\x2b\x31\x81\x07\x42\x94\x8c\xe9\x71\x39\xb3\x66\xbd\x28\x90\x9a\xcd\x98\x82\x42\xd6\x4c\x62\xc4\x7e\x58\x35\xc8\xfe\xf5\x2e\x45\x86\x3a\x22\x67\xc0\x84\x2a\x4f\x36\x66\x92\x33\x7b\x88\xf4\x2f\xce\x12\x07\x78\x21\x69\x2c\x66\x69\xb5\xc6\x05\xba\x84\x43\xd0\x9c\x1c\x95\xb0\x93\x38\xcb\xf8\x43\x0c\xf7\x89\xa6\xea\x38\xd9\x60\xde\x9c\xcc\x31\x5c\x06\xa3\xc3\xec\x1f\x8e\x1c\x66\xbf\x67\x7a\xfa\x27\x89\xb2\x8f\x34\xea\x4d\xa1\xf6\x53\xa8\x7d\x23\xd4\x1e\x3e\x32\x9c\x6f\x38\xe6\xde\x4f\x33\x10\x8b\x1f\x1b\x73\x8f\x7e\xd8\x10\x38\x51\x01\x03\x9b\xde\xa2\xbc\xcc\x14\x2d\x6a\x87\xb5\x34\x53\xcb\x8c\xfa\x68\x02\x95\xe4\x9e\x75\x36\x94\x11\x80\x93\xcd\xfe\x31\x81\x71\xc0\xa1\x2d\x81\x23\x5b\x37\x0b\xce\x32\x1b\x5b\xaf\xf5\x4a\xff\x1e\x11\xeb\xab\xa2\xc7\x31\xe1\x5f\x54\x85\x0c\xad\xd1\x04\x9c\x13\x2f\xf5\x65\x99\x69\x72\xd0\x57\x96\xe3\x6a\x21\x9f\x6b\xe7\xfe\x35\x56\x99\x2d\x71\x0e\x92\x35\xdd\x12\x56\x5f\xc2\x2f\xe5\xab\x57\x43\x61\x4d\x2a\x52\xf4\xe8\x0a\x16\x01\xa0\x7d\x22\xc7\x2c\xf2\xba\x0f\x80\xad\x04\x81\x88\x6b\xfe\x4f\x8d\xdb\xeb\x3f\x03\x30\x6b\xe7\x90\xf7\x82\x07\xf4\x54\x57\x7c\xb5\x81\x01\xa0\x74\x78\x35\x71\x76\xd0\x11\x6e\x84\x03\x5c\x08\x88\xfa\xd9\x89\x79\xc6\xb8\x0f\x7e\xb1\xf4\x89\x08\x97\xc1\x98\x30\xb7\x61\x77\x41\xac\xfe\x77\x68\xc8\x63\xd0\x01\x30\xc5\x3c\x06\x9f\x78\x63\xff\xbf\x5e\xe8\x63\xc0\xb8\xff\x95\xc6\x40\x1e\x6c\xd4\xff\x25\x43\x1f\x43\x86\xfc\x91\xde\x2e\x34\x64\xc4\x7f\x62\x00\xe0\x50\x10\x64\x34\x4c\x8f\xf1\xbe\xdf\x20\x1f\x0d\xb5\xcf\x70\xdf\x6b\x8c\x8f\x86\x38\x45\x10\x0e\xbe\xf7\xa5\x23\x08\x47\x1a\xe4\x0f\x35\xc6\x8f\xda\x9d\xb1\x46\x78\x6b\x5e\x8f\x98\x46\xa4\x01\xbe\x6b\x5a\x8f\x59\xe2\xa0\xf1\x7d\xdf\xac\x1e\x67\x74\x0a\x19\xde\x7b\x4d\xea\x11\x60\xfb\x8d\xee\x4f\x12\xa7\xa2\xa9\x33\xf2\xc5\x58\x13\xfa\x78\xf3\x79\x44\x2c\xc1\x08\xd3\xb9\x33\x8c\x0f\x40\x3c\x86\xd9\x3c\x8a\x23\x46\x9f\xb4\x38\x0e\x11\x6d\x26\x7f\x0e\x13\xf9\x48\xf3\x78\x8c\x5a\x8e\x7a\x55\xf3\x90\x69\xdc\x68\xc2\x03\x20\xe3\xcd\xe2\x4d\x6d\x78\x68\xf9\xb1\x26\xf1\xa6\x3e\x3c\xe4\x99\x8a\x32\x87\x77\x8d\xdd\xf1\xde\x94\x51\xa6\xf0\x28\x6a\x8d\xb1\xbc\xc6\x98\xbf\x9f\x6c\x54\x1d\x0c\x5e\x67\x8a\x1e\x1a\xc0\xde\xa4\x6b\x4f\x14\x7b\xef\x9c\xf1\x96\xd3\x14\x15\xa5\xb2\xa1\xbc\xa3\x23\xd9\x7b\xa1\xfe\xaa\xa2\xdb\x5b\xa8\x0f\x86\xb8\x87\x4d\xda\xb3\x03\x42\xdc\xbd\x10\xed\xb1\x3c\x20\xc4\xdd\x0f\xd2\x86\xbe\x1f\x14\xe2\xee\x85\x0a\xa1\xef\x87\x85\xb8\x0f\x9e\xf8\x7d\x12\xf2\xef\x95\x8b\x73\xf7\x82\x1c\x8e\x7f\x0f\xc4\xb9\xfb\x2d\xe4\xc1\xf8\xf7\x40\x9c\xbb\x1f\x9d\xd1\xf1\xef\x9d\x38\xf7\x00\xc9\x4f\xf1\xef\x7b\xcf\x14\xff\xde\x78\xa6\xf8\xf7\xc8\xc5\x4e\xf1\xef\x53\xfc\xfb\xd0\x33\xc5\xbf\x4f\xf1\xef\x53\xfc\xfb\x14\xff\x3e\xc5\xbf\x4f\xf1\xef\x3d\xcf\x14\xff\x3e\xc5\xbf\x4f\xf1\xef\x8d\x67\x8a\x7f\x1f\x58\xca\x14\xff\x3e\xc5\xbf\x4f\xf1\xef\x53\xfc\xfb\x14\xff\xde\xf3\xca\x17\x89\x7f\x6f\x19\xa1\xbd\x41\xf0\x01\x73\x6c\x5d\x3f\x65\x64\x10\xbc\x17\xe6\x92\x0c\x07\xc1\x7b\xa7\xed\x85\xea\xa9\xf1\x13\x15\x09\xef\x37\xbd\x36\x23\xe4\x47\x45\xc2\x07\x8c\xe6\x3d\x55\xe9\x9f\x58\x7d\x1e\x35\x22\xe4\x0f\x8d\x84\xf7\x93\x00\x9f\x22\xe1\xa7\x48\xf8\x29\x12\x7e\x8a\x84\x9f\x22\xe1\xcd\x33\x45\xc2\x4f\x91\xf0\x53\x24\xfc\x14\x09\x3f\x45\xc2\x77\x9e\x29\x12\xbe\x77\xba\x53\x24\xfc\x14\x09\x3f\x45\xc2\xd7\xcf\x14\x09\xdf\x7e\xa6\x48\xf8\x29\x12\x3e\xf0\x4c\x91\xf0\xcf\x13\x09\xef\xfd\x13\xce\x88\x50\x17\x82\x17\xfd\x57\x6c\x5b\xb9\x6c\xbf\xab\xd9\xf4\x8a\xae\x4b\x1b\xb7\x6a\xe8\x00\x28\xd3\x6e\x9f\x39\x5d\x9d\x89\x2e\x09\x4a\x05\x2f\x0a\x02\x01\xf1\x77\x1b\xcc\xb8\xfc\x04\x31\xe4\x30\x19\x13\xb6\xf2\x93\x69\xc8\xf7\x53\xed\xeb\xd5\x9b\x56\x08\xbe\xa5\x29\xe9\xa9\x67\xfe\x93\x02\x38\x3f\x0a\x0d\xe8\x47\x2d\x13\xd2\x04\xff\x64\x4c\xb4\xed\x01\xcd\x20\x68\xb9\xd3\xe7\x00\x97\x59\x47\x6d\xf0\xf0\xb1\x00\x2d\xf8\xb6\x05\x86\xca\x31\xc3\x6b\x22\xe4\x39\x60\x2b\x88\x60\x63\xdb\xab\xf0\x0a\x3a\x17\x44\x7d\x27\x9c\x31\x92\x98\xb8\x68\xde\x02\xbb\x40\xe8\x23\xcb\xba\xd4\x80\xb7\x98\x66\x78\x99\x55\xc1\xe5\x1a\x3b\x68\xfb\x7a\xf1\xe6\xf5\xe2\x35\xdc\xcb\x10\x7b\xac\xbf\xff\x80\x0b\xe9\x8c\x7e\x3f\xb5\xa6\xbc\x30\x33\xf9\xa9\x0b\x5d\x74\x12\x1f\x42\x6a\xb9\x47\x05\xef\x04\x29\x6b\xfe\x51\x9d\xf7\x44\x10\x08\x1e\x30\x27\x1f\xcc\xc3\x7a\xb2\x56\x53\xc1\x9a\x45\x79\xc2\xc5\xec\xb7\xf7\x64\xd7\x77\xba\x83\x67\x5a\x93\xef\xe0\x54\x4f\xae\x71\x5e\x99\x0a\x6d\x0b\x5f\xb5\x40\x1f\x38\xd8\x89\x57\xfc\x2d\xda\x28\x55\xc8\xb7\xa7\xa7\xf7\xe5\x92\x08\x46\x14\x91\x0b\xca\x4f\x53\x9e\xc8\xd3\x84\xb3\x84\x14\x4a\x9e\xf2\x2d\x11\x5b\x4a\x1e\x4e\x1f\xb8\xb8\xa7\x6c\x3d\xd7\x1b\x35\xb7\x1d\x41\x4f\xe1\x1c\x9d\x7e\x03\xff\xd3\xbb\xc8\xbb\x8f\x17\x1f\xdf\xa2\xb3\x34\xb5\xad\x0f\x4a\x49\x56\x65\xe6\x7a\x4b\x21\x5c\xd0\xcf\x44\x68\xc1\x6e\x86\xee\x29\x4b\x67\xa8\xa4\xe9\x7f\x9d\x8c\xc5\x07\x2f\x8c\x38\x3d\x88\x93\x5b\xb8\x9b\x76\xfa\x36\x82\xe9\x68\xd4\xdc\x9a\x7d\xd0\x17\x98\x92\xb0\xb9\x4e\xcf\xb4\x37\x90\x77\x36\x4b\xce\x33\x82\xf7\x0d\x8a\x3e\x46\xdb\xa7\xce\x84\x19\x9e\x23\xf0\xef\x45\x67\x65\xed\x9d\xb6\x27\xf2\xfb\x4f\xef\xa5\xa1\x45\x96\x3a\x06\xa2\xb8\x61\x88\xf5\x41\x7c\xc7\x85\x65\x67\x9d\x85\x75\x0f\xde\xcc\x7c\xfd\xa1\xc5\x1d\x1a\x02\x49\x29\x81\x5d\x49\x45\x70\xba\x00\xcb\x47\x0f\x61\x36\xbc\x3f\x8e\xd3\x51\xe3\x49\x43\x74\xd5\x3b\x00\x6d\xb8\xc3\x16\x70\xf4\xbb\x40\x7b\x59\x41\x29\xb2\x9f\xe0\xdc\xef\xd3\xd0\xf1\xd8\xa5\x15\xfb\x89\x08\x5f\x43\x27\xe7\xd5\x7b\xe6\x16\x97\x88\xb2\xff\xb6\xec\xb1\xd6\x00\x1b\xe0\x4c\x5e\x4f\x4a\x57\xbb\x7e\x1a\xb7\x6a\xcb\x9a\x30\xfd\x5f\x24\x6d\x7c\x6a\xad\x0d\x09\x66\xd5\xa6\x00\x07\xce\xf8\x83\xcb\x31\xe9\xd0\x29\x42\xb8\x54\x1b\xc2\x14\x4d\x0c\x0b\x2f\x04\x7f\xdc\x19\x83\x58\xf3\xba\x03\x57\x00\x64\x4b\x25\x1b\x70\x20\x6b\xb4\x2f\xc9\x06\x6f\x69\x8f\xc0\x0e\xf2\x53\x70\xb2\x0b\xd4\xc0\x4c\x6a\x33\xd9\x52\x04\x9e\x12\xb3\xfc\xee\x44\xc3\x10\x6d\xae\xcc\x0e\xc9\x8d\x4b\x4f\x31\xc9\x6b\xfa\xff\x69\x5a\x06\xb0\x76\x99\x5d\x4a\xd2\xdf\xa4\x9c\x11\xb4\xa5\xd8\x1b\x2e\x09\x9c\x3f\x29\x85\x66\xa2\x8d\x91\xfb\x39\x1f\x16\xe4\xad\xbb\xeb\xe7\x70\xd7\xff\x04\xf3\xf8\x09\x32\xf2\xe6\xe6\xbe\xca\x71\x31\x17\x24\xe3\x38\x25\xe2\xa7\x05\xfa\xb8\x25\x42\x50\xd8\xaa\x7a\x5f\x3b\x90\xb5\x3e\xcd\x14\x15\x24\xdb\x21\x5e\x2a\x49\x53\xbb\xde\x84\x17\xc0\xec\x1f\x9c\xe9\x37\xc7\xb4\xc2\x32\x9c\x3a\x59\x16\x05\x17\x5d\x99\x4d\x4f\x4c\x8b\x19\x5c\x0f\x2d\xf9\x0c\xed\x78\x89\x70\xa2\xd9\xbf\x33\x24\x53\xe9\x36\xbc\x34\x9e\xd2\xa5\x20\xf8\x1e\x61\x05\xb2\xaf\xa2\x79\x57\x08\xd7\xd7\x04\x2f\x95\x96\x87\x68\x42\x62\x8f\xe3\x9e\x97\xc0\xda\x19\x40\x75\xb4\x44\x5a\xa3\x1e\xe6\xa6\xe7\xfa\x80\x4d\xfc\x9e\x28\x19\x0c\xdb\xeb\xe2\x01\x97\x56\xf7\xa2\x0d\x9b\xe9\xb1\x58\x7b\x54\xc5\xf6\x51\x3f\x13\xeb\xd2\xe8\xfa\x96\x2b\x11\xa6\xc4\x0e\x3c\xda\x86\x70\x52\x9e\xdc\x6b\x3a\xcd\xf1\x9a\x9c\x78\x23\xd2\xcf\x3f\x5c\xe8\x0d\x36\x3c\xd5\xe6\x90\xed\x89\x94\x0b\xf4\x19\x0b\x0a\x12\x53\xd5\x95\x5f\xa2\xdf\xbe\xfc\x7c\xf6\xe9\xc7\xeb\xb3\x0f\x97\x3e\x65\x50\xd3\x38\x79\x2c\x30\x4b\x49\x8a\x4a\x59\x47\x95\x58\x6c\x9e\x9c\x68\xc2\xda\x52\xc1\x59\x0e\x62\xc2\xd5\x0a\x84\x17\x33\x96\x07\x68\x82\x99\x29\xae\x07\x0e\xb6\x6c\x4b\xd2\x59\x53\xd8\x48\x88\x53\x09\x29\x2b\x4a\xe5\xcc\xc9\xf6\x0a\xf0\xc0\x2c\x99\xe1\x32\xa6\x93\x78\x73\x65\x48\xee\x98\xc2\x8f\x8e\xc9\x11\x99\xe0\xc2\x85\xca\x60\x94\xf2\xd2\x3f\xd1\xdf\xfe\x76\x86\x28\x79\x8b\x7e\xdb\x00\xb7\x40\x97\x16\x42\x03\x91\x26\x56\x82\x6c\x89\x80\x21\x2c\xc2\x7c\x96\x7f\x41\xd6\x58\xa4\x19\x91\xd2\x9c\xbc\x5a\xa6\x70\x88\x43\xa4\x32\x32\x33\xae\x16\xe8\xdc\x61\xcc\xb7\x7a\x08\x5c\x48\x63\xa5\x34\x85\xe5\xbd\x3c\x35\xd7\xca\x3c\xc5\x0a\xcf\x1b\x47\xe5\xd4\x88\x2f\xf3\x84\xe7\x39\x66\xe9\x1c\x5b\x22\x9d\x57\x9b\x7e\xfa\x8d\x55\x4f\xe7\xb8\x7a\x8b\xb2\x39\x9e\xcb\x0d\xc9\xb2\x3e\x29\x6c\xc0\x7c\x32\xa8\x88\x86\x35\x43\x3b\x87\x98\x13\x77\x59\x1d\x30\x03\x6d\xa1\x45\x0f\x1b\x1a\x62\x89\x42\x2b\x51\x08\x56\x12\x6a\x4a\xbf\x77\x32\xd1\xe5\xf5\xdd\xa7\xbf\xdd\x7c\xbc\xba\xbe\x1b\x3c\x8a\x1e\x88\x03\x07\x34\xe6\x28\x7a\x20\xfb\x0f\xe8\xf0\x51\xf4\x80\x0c\x1c\xd0\xe1\xa3\xe8\x67\x0b\xde\x03\x1a\x7d\x14\x3d\xb0\x3d\x07\x34\xfe\x28\x7a\xe0\x76\x0e\xe8\xaf\xfc\x28\x12\xb6\x8d\x38\x86\xef\x6d\x00\x42\x83\x30\x2b\x7c\x5b\x4d\x44\x39\x12\xab\xe5\x3f\xdf\xed\xd7\x41\xfd\xf8\x55\xb7\x66\x77\xc9\xb6\x9f\x71\xdb\x53\xcc\x7a\xa7\x8a\xec\x0b\x5e\x9b\x17\xb0\x92\xf3\xa1\x05\xc4\xb8\xfc\x7d\x9a\x7b\xef\x02\x9a\x0a\x7c\xdf\xbc\x17\xb5\x9d\x21\x68\x1f\x3c\xff\xf1\xea\xe2\xf2\xfa\xee\xea\xdd\xd5\xe5\xa7\x90\x25\x31\xca\x8e\x08\x36\xd7\xe8\x25\x9c\x8c\xe1\x86\xc1\x45\xd4\x9c\xb2\x10\x44\x4b\xa2\xb5\x85\xb8\x9f\xfc\x0c\xdd\x05\x61\xd6\xc2\xa4\x89\x12\xd9\x21\x49\xc4\x96\x26\xfd\xe8\x36\x26\xbf\x30\xaa\xe3\x19\x72\x8b\xf5\x06\x61\x8e\x65\xcb\x96\x01\x07\x61\x3e\x0b\x73\x36\xcf\xe1\x2c\x3a\x3c\xe3\xb6\x24\x75\x61\xac\xa2\xc0\x65\x5e\xbc\xe8\xe8\x17\xcd\x27\x9e\xac\xdf\x09\x1e\x4c\xd4\x6f\xdb\x92\x4c\x41\x8a\x15\x17\xde\x03\x7a\x62\xa3\x91\xc2\xe6\xfb\x06\xe3\xb3\xe2\x86\x89\xf2\xb3\xf2\x86\x09\x27\x08\x40\x88\x0d\x35\x32\x6a\xe7\x07\x5c\xfc\x95\xec\x3e\x91\xd5\x90\x0f\xac\xbd\x58\x30\x6f\xda\x58\x1b\x50\xf2\xd1\xb9\x03\x37\xe4\xd6\x1c\x13\x0a\x15\x19\x06\xd5\x6b\x93\xad\xac\xb0\x31\x4e\xec\x51\xbe\xf4\x21\xae\xdd\x3b\xad\xaf\xc2\xfe\xba\xff\x8c\xb5\xc7\x46\x01\xf5\xd9\x6c\xf7\x9f\x51\x38\x0f\xd9\x74\xf7\x9f\x41\x1b\x6f\x45\xab\xd6\xcc\x1b\xb5\xac\x38\x53\x70\xff\x22\xfb\x4d\xc3\xfb\x4f\x6c\x34\x4c\x4c\x24\x4c\x74\xe8\x00\xec\xf5\xd8\xf3\x7f\x52\x33\x00\x63\xc8\xb5\x74\x5d\xf0\xf4\xad\xb3\x2c\x49\x94\x13\x85\xb5\xec\xbb\xd0\x04\x39\x4c\x3b\xad\xd7\xc1\x51\x3c\xab\x7f\x33\x9e\xb5\xc6\x0f\xc0\x25\x8d\x09\x6f\x18\xb4\x2c\x48\xb2\x60\x3c\x25\xfa\x10\xce\xcc\x3f\xed\xdd\x7e\x96\x24\xbc\x64\xca\xfe\x41\x61\x55\xca\xc5\x86\x4b\x75\x75\x13\x01\xd6\xbc\x5e\xf0\xf4\xea\x66\xd6\xfa\x97\x0c\x5e\x41\x68\x24\x1b\xac\xcf\xe1\x68\xf2\xb7\xdf\x35\x2b\x2a\xe5\x18\xfe\xf3\x9d\xde\xb8\x1b\x1c\x28\xf6\xd3\x7c\xa8\x44\x0f\x82\x2a\x45\x18\x48\x2a\x90\x42\xc0\x57\x33\xe7\x8e\x34\x17\xef\xf6\x4d\x54\xbe\xe9\xa8\x83\xbf\x72\xd3\x1c\xbd\x74\xfd\x91\x5b\xb7\xa1\xd2\xda\x31\x17\x21\x0d\xba\xa7\x0e\x60\x38\xbb\xb9\x42\x5b\x83\xcf\x23\x2f\x33\xfe\xe4\xaf\x22\x77\x2d\xfa\xfc\xbb\x60\xf8\x77\x4f\xe4\x03\x55\x49\x2e\x8b\xf1\x4a\x98\x7e\x0b\x01\x51\x83\xf8\xaa\x82\xf2\x51\x46\x73\x6a\x03\x65\x6d\x79\x2f\x89\x5e\x9a\x1f\x17\x49\x51\xce\xec\x0b\x8b\x9c\xe4\x5c\xec\x86\x4f\xa9\x7d\x9d\x14\x1b\x92\x13\x81\xb3\xb9\x54\x5c\xe0\x35\x99\x55\xe0\x0d\xd8\xea\x5f\x06\xf0\xf0\xa9\x6c\x4c\xb0\x0b\xdd\xe8\x32\xd6\x45\x90\xed\x1c\x57\x24\xe9\x51\x39\x43\x85\xe5\xeb\x83\x64\x92\xf3\x96\xe7\xe2\x6d\x45\x87\x20\xc6\x6e\x79\x56\xe6\x71\x19\xad\xf5\xfd\x6c\xea\xbd\xb1\xad\x16\x7a\xe5\xd1\xa5\x80\x94\x6e\xa9\x8c\x8b\x15\xef\x11\x02\xa8\x0d\xdf\xe7\xa5\x2a\x4a\x65\xd3\x1a\x87\x3a\xc3\x37\x1f\xf2\x58\x70\x09\xaa\x4f\x95\x40\xd2\xe2\x7f\x6f\x86\x93\xb5\x47\x2e\xd8\x8d\x34\x7e\x6b\x5d\xd9\xb0\xb7\xf5\xc9\xac\xd8\xdf\x91\xf7\x25\x9e\x7b\xb9\xa9\x1c\x8b\x79\x99\xa0\x89\xe3\x28\x30\x36\x00\xc3\xea\xe1\x10\x44\x18\xa5\x09\x80\xa4\xf2\x95\xe8\x3c\x11\x71\x28\x51\x84\x5e\xc7\xaa\x0c\xc4\xa5\xec\x3f\x93\x1e\xf5\x6b\xd2\xa3\x3a\xb1\x32\x51\xeb\xfa\x97\x53\xa2\x22\x5e\x1b\x9a\xd5\x1c\x0e\x43\xd0\x78\x1f\x80\x3f\x68\xbc\xf7\x5b\xb2\x7a\x0d\xf8\x4e\x12\x53\x1c\x15\xbc\x28\x33\xac\x3c\x26\xd0\xb0\x1b\xa9\x11\xe3\x61\x19\x54\x6d\xa4\xad\x5d\x72\xe6\x6e\xca\x07\x4c\xd7\x2d\xa3\x35\x3a\xcb\x32\x44\x99\x61\x50\x00\xd6\x59\x43\x05\x31\x42\x16\xc2\xc6\xbc\xbf\xf5\xdb\xf1\x1f\x6c\x4e\x76\x33\x70\x44\x6a\x25\x4e\x28\x08\xd1\x85\x9c\x6d\x73\x3f\x58\x63\x23\x65\x55\xe6\xb6\x07\x66\x25\x16\x54\xf9\x03\x9d\x32\x0e\x26\xea\x54\x2a\xb7\x70\x98\xb9\xc2\xf7\x3e\x90\x85\x20\x09\x49\x09\x4b\x08\x64\xa2\x95\xa4\xc6\xe1\x72\xa7\xd7\x78\xc9\xb6\x95\xdd\xb6\x34\x3e\x26\x73\x19\x68\xc8\x3e\x8a\xc2\xf7\xa4\x05\xf9\x39\xbc\x2d\x9a\xe8\x6e\x5d\x99\xde\xca\xe9\x02\xf7\x53\xa5\x29\xb8\x64\x3b\xef\xe9\xaa\x4c\x35\x3e\x5a\x8b\xb9\x5a\x2b\x53\xe7\x80\x98\xd0\xb9\x53\x6b\x43\x51\xfb\x2e\x3d\x82\xf9\x35\xe6\xf2\xfb\xba\x2f\xbe\xa3\x05\x73\x36\x9f\xe8\xcb\x2c\xf6\x22\x1b\x61\x0c\x1c\x77\x31\xc5\x5e\x4a\x51\x97\x48\x21\xc8\x8a\x3e\x46\xd3\xe6\x19\xab\x15\x2e\x9a\x12\xa6\xb4\x72\x03\x41\x79\x85\x20\x05\x61\x69\x55\x16\x62\xe8\x92\xb3\xac\xba\xb6\xde\x37\x82\x95\x8f\xea\x28\x34\x72\xe4\xd8\x03\x78\xdb\x27\xc9\x4e\xa7\xef\x5f\xe7\xf4\xd9\x0d\xfe\x62\x47\xef\x89\xb2\x15\x04\x0a\xc5\x44\x28\x5d\x34\x02\x8b\x80\xfa\x46\xd3\x4e\x1d\x06\x7a\x0a\x50\x7c\x24\x72\x57\x87\x57\x53\x59\xb3\x89\x2a\x00\xd8\x44\x72\xa3\x8c\x6c\x49\x66\x6f\x46\x64\x02\xa6\x73\xbf\xb0\xa4\xb8\xb3\x74\x68\x69\x9f\x9b\xe0\xd4\x96\xe8\x04\x53\xd2\xec\x44\x93\x76\xc6\xb1\x09\xc8\x15\x3c\xcb\xfa\x02\x57\xcd\x93\xd1\x7b\x82\x2e\x48\x91\xf1\x9d\xcd\x8d\x64\x29\xba\x55\x58\x69\x52\xbe\x25\xca\x67\x45\x1f\x20\x53\x98\xcb\x4d\x99\x65\x37\x3c\xa3\x89\x47\x9b\x6e\x6f\xcf\x15\xec\x4b\x51\x66\x19\x2a\xe0\xa3\x05\xfa\xc8\xe0\xbc\x9f\x65\x0f\x78\x27\x67\xe8\x9a\x6c\x89\x98\xa1\xab\xd5\x35\x57\x37\x46\x98\xf1\xf1\xc4\xa6\x33\xda\x7c\x8e\xe8\x0a\xbd\xcd\x4c\x97\x04\x85\xdb\x01\xed\x33\x8d\xd1\x26\x58\x0f\x54\x38\xe6\x0f\x54\xf6\x4a\x6b\x4f\x26\xa6\x6f\x00\x92\x66\x49\xe6\xdf\x07\x21\x3e\xa3\x2b\x92\xec\x92\x2c\xe6\x44\x9c\x25\xe0\xbb\xa9\x8b\x53\xd4\x34\xe8\xba\x15\xdb\xbc\x02\x10\x56\xbd\x85\x5a\x4c\x89\x24\x53\x43\xaa\x26\xc7\x6a\x26\x46\x05\x90\xd1\x12\xee\xf0\x05\x52\x70\xa9\x6e\xb5\x96\x10\x59\xfb\xe8\xe4\xc6\x7d\x80\x20\x26\x3f\xcb\x48\x8a\x68\x9e\x93\x54\x6b\x05\xd9\x0e\xe1\x95\x82\xea\x34\xd5\xec\x03\x1c\x4d\x43\x80\x76\x1b\x69\x55\xec\x60\x83\x59\x9a\x11\x81\x56\x98\x66\x56\xf3\x68\x69\x34\x8a\x88\x9c\xb2\x81\x7a\x45\xc6\x96\x0d\xca\x8f\x56\x9e\x92\x84\x0b\xdb\x7f\x19\x54\x7b\xfb\xa7\xfa\x6c\x00\xff\x1e\xe4\x1a\xa8\x4e\xb8\xac\xa7\xb4\xcc\x78\x72\x2f\x51\xc9\x14\xcd\xcc\x02\x38\xbf\x87\xa6\x1a\x19\xd0\x6a\x83\x94\x03\x60\x47\x12\x79\xf5\x9f\xf3\x8a\x32\xe6\x7a\x5c\x79\xfa\x4d\xfd\x27\xf8\xc1\x7f\x45\xc6\xc9\x16\xe4\x91\x24\x23\xb2\x7a\x35\x97\xd1\xc8\x87\xa4\x71\xce\x2a\x11\x63\xc5\x35\xb3\x86\x18\xfc\xfe\x84\xc4\xf6\xb3\x24\xcd\x0c\x99\xcb\x47\x92\x34\x92\xb5\xa1\x64\x1b\x1c\x37\x08\x48\xc7\xf7\x03\x11\x28\xf1\xd6\xca\x60\x88\xae\x77\xcd\xe7\xe6\x2b\x57\xa8\xc6\x02\x41\x19\x65\x70\x8a\x6d\xd8\x6e\x84\x5d\x88\xb2\x2a\xe3\xa1\xda\x45\x73\x02\xac\x7c\x85\x52\x2a\x20\x1b\x79\x87\x56\x71\xf5\x20\x1a\xf3\x81\x84\x5d\xce\x15\x7a\x79\x72\x7a\xf2\xaa\x63\xd4\x38\xd1\xb7\x6c\x46\x0c\xaf\x8a\xb1\x8d\xde\x35\x60\xeb\x0b\x80\xe6\x45\xb6\x83\xd5\x9e\xa4\x33\x44\x95\x8b\xf0\x11\x25\xb3\x2b\x8b\x00\x6a\x63\x9a\x67\x48\x72\xa4\x04\xae\xf2\x88\xe0\x57\x48\xc5\x12\xa5\xe5\xb4\x2f\x4f\xfe\x71\x12\x63\x79\x24\x2a\x79\x85\x1e\x38\x3b\x51\x80\xc6\x05\xba\xe3\x5a\xba\xac\x87\xda\xf1\x12\x31\x62\x92\x8a\xc8\x63\x91\xd1\x84\xaa\x08\x0f\x1f\x02\xe6\x87\x78\xa9\x4c\x5e\x04\x56\x2e\x1e\xfb\xf2\x91\x2a\xeb\x3e\xd7\xf4\xff\x1a\x28\xc3\xb0\xb9\x18\x14\x48\x94\xd1\x2d\x39\xdd\x10\x9c\xa9\x8d\xa9\xcc\xc4\x38\x9b\xff\x4c\x04\x87\xa8\x6d\x66\xff\x72\xc4\xfa\x55\xcf\x52\x4a\x37\xd2\xdc\xa8\x59\xdf\x77\x64\x4c\x45\xd1\xbf\xdc\xdd\xdd\x7c\x47\xd4\x1e\x4b\xd0\x70\x9c\x03\x13\x54\x47\x22\x56\x5c\x0c\x90\x72\x3c\x6f\xd8\x70\x39\x30\xc7\xee\x3c\xb9\x54\x26\x4d\xcb\x5c\xe6\x4c\x6b\x7c\x8a\xb7\xbc\x6c\x91\x87\xb8\xe0\x29\xba\xba\x59\xa0\xbf\xf1\x52\xcf\x79\x89\x97\xd9\xae\x4a\x0d\x92\x44\xa1\x17\x7a\xb0\x17\xfa\x54\x6b\x3c\xfc\x85\xe0\xd4\x2f\xa7\x36\x1f\x97\xdd\x18\xb9\xeb\x51\x24\xd2\x98\xc1\x58\x56\x5a\x4a\xc5\x73\xb4\x31\x1f\xef\xc5\x58\xdb\xbd\x8d\xe1\x4d\x9a\x42\x5c\x5e\xa2\x20\x05\x1c\x3d\x07\xf5\xb9\xca\xbe\xe9\x31\xcd\xaa\xab\xbc\x3f\xa9\xc5\xa0\xe6\x92\xa2\x1c\x0a\xa6\x7a\xa8\xcd\x3d\x35\x4b\xd1\x5b\x1e\xe5\xbb\x19\x5b\x98\x2d\xd6\x67\x85\xfa\xac\x19\x66\x4d\x56\x39\x0b\x18\xfc\xf7\x9f\xc3\x6a\x7f\x1d\x67\x9a\x31\x45\x35\x0e\x9c\xe7\xb8\xea\x4f\x91\xf8\x9a\x47\xcf\xf8\x99\x6a\x3f\x15\x51\xb1\x4a\xdd\x48\x25\xad\xa0\x27\x09\xc4\x43\x9b\xe3\x0b\x84\x2c\x89\xd8\xfa\x73\x0c\xf6\xe7\x17\x85\xfa\x82\x87\x74\x17\xf7\x60\xb6\xfb\x38\xe8\x53\x87\x2a\x21\x51\x35\x9f\xf7\xdf\x3f\xa4\x6c\x95\x31\xc1\x09\xc4\xca\x7c\x49\x44\x1d\x73\x28\x54\x8d\xbc\x88\x7d\xe7\x1d\xef\xd4\xb5\x01\xe8\x8c\x50\xed\xfa\xd8\x31\x94\xc4\xd1\x1f\xfe\xed\xdf\x7e\xf7\x6f\x0b\x33\xc5\xca\x97\xc5\xd0\xd5\xd9\xf5\xd9\x8f\xb7\x9f\xcf\x21\x78\x7e\x78\x17\x1f\xe7\xb5\x3e\x33\xa7\x4c\xcd\xb9\x98\x1b\x4c\xbd\x45\x4a\x0c\x52\x35\x44\xf7\x45\x9c\xfb\xb6\x55\x0e\x3e\xd2\x6b\xd0\x42\x5e\xb7\x70\x87\x51\xd1\xe2\xae\x91\xa6\xe5\x43\x93\xef\x17\xa8\xde\xde\x9b\xd4\xdc\x1d\x71\xd8\xa9\x9b\x14\xb7\x3c\xb9\x1f\x25\x67\x9d\xdc\x9d\xdf\x98\x8f\x1a\xa2\x16\x66\x4e\xf9\xa2\x6c\xcb\xb3\xed\x30\xd9\x63\x74\x77\x7e\x03\x0b\x59\xc0\x7f\x81\x5e\x0a\xaa\xc1\x4e\x43\x76\x81\x64\xd6\x04\xac\xd5\x88\x21\x25\xdc\x40\x15\x04\x67\x54\x2a\x9a\x00\xd4\xda\x44\xa2\xe1\x87\x2d\xc3\xcf\x2a\xf5\x9d\x7c\x74\xc6\xe4\x61\x01\x30\xee\x30\x36\x04\xc0\xe1\x00\x8a\x5f\x05\xe7\xb4\x1c\xd3\xc4\xf9\x4d\x9c\x73\xef\xf9\x65\x79\x4b\xc4\x4b\x85\x20\xb7\x8a\x17\xd1\x16\x46\xf3\xba\xc7\xbe\xb8\x24\x2b\x2e\x48\xbc\x81\xb1\x36\x18\x56\xc5\xf4\x19\xc4\x3e\x3b\x5d\x91\x37\x4d\x7f\xc1\x18\x0b\xfd\xc8\x32\xd9\x38\x1d\x9d\x11\x29\x4f\xc1\x94\x58\x16\x46\x46\x07\xb3\x65\x29\xc8\x4c\xaf\x99\xe4\xb0\xa2\x59\x4c\x9c\xa0\x5e\x0c\x61\xe6\x75\x68\x45\x7d\xd7\xb0\x85\x5a\x4b\x8a\x43\xc6\x9e\x09\x32\x04\x55\x60\xb9\x21\x90\x57\x46\x1e\x69\x5d\x0e\x1b\x4b\x5b\xd4\xca\x21\x07\xf8\xb9\x44\x05\x96\xa6\xba\x4a\xe8\x26\xa9\x27\x66\xc0\xdd\xf0\xf4\xe4\x44\xb6\x40\xad\x05\x4e\x88\xd6\xc0\x29\x4f\x11\x24\x24\xa4\xfc\x21\xe4\xda\x5a\x92\x35\x65\xd2\xed\xad\x1e\xc2\x11\x81\xe6\xe6\xa6\x64\x9e\xcb\x7f\x5f\xa0\x4f\x55\xb2\xdd\xb0\xa5\x96\x97\x2a\xe1\x35\x93\xb0\x33\xdf\x37\x2c\x43\xd8\x4a\xdd\x16\x21\xb4\x7c\x47\x4e\x2e\xe6\x47\x0d\xa3\xc0\x5a\x98\x03\x50\x1b\x04\x38\xd6\xc2\x1c\x42\x81\x68\x7c\xe5\xdd\x1f\xa8\xdf\x8b\x93\x4d\xdb\xef\x32\x19\xab\x27\x63\x75\xe8\x99\x8c\xd5\x93\xb1\x7a\x32\x56\xf7\x3e\x93\xb1\x7a\x32\x56\x4f\xc6\xea\xe1\x6f\x27\x63\xf5\x64\xac\x9e\x8c\xd5\x3d\xcf\xd7\x68\x72\x99\x8c\xd5\xe1\xcf\x27\x63\xf5\x64\xac\x0e\x40\x9d\x8c\xd5\xbd\xef\xff\x1a\x38\xe7\x64\xac\x0e\x7d\xfc\x95\x19\xab\x07\x5e\x70\x56\xdf\x1b\x2d\xe3\xc6\x44\x62\xdf\x80\x8d\x8d\x26\xd6\x3c\xcc\x57\xad\xa8\x5e\x03\xac\x51\x33\xda\x33\xf1\x3a\x1f\xd0\xc5\xb4\x5a\x23\x70\x6d\x74\xee\x8d\x09\x06\x7b\x9e\x07\x66\x7c\x74\xb5\x0b\x81\x97\xa7\x05\x37\xff\xaf\xb6\xe4\x35\x4c\x78\x46\xee\xef\x3f\xf4\xc3\x4c\x2c\x6c\xbb\x3b\xc8\x6e\xd7\xb6\xcc\x05\x88\xe7\x09\x36\xbb\x38\xee\x1c\x65\xab\x3b\xc0\x4e\x17\x67\xab\x8a\xb5\xd1\xed\x5b\xe0\x06\xc0\x46\xdb\xe7\x9a\xd6\xb7\x01\x98\x71\xb6\x39\x9f\xe5\x6d\x48\x44\xf3\xd8\xe5\x06\xad\x6e\x03\x70\xfb\x6d\x72\x41\x8b\xdb\xd0\x4c\x7b\xed\x71\x41\x6b\xdb\x30\x62\x23\x6d\x71\xbf\x7c\x0b\xa9\x08\xce\x6d\xdd\x6a\x77\x1b\x41\xe4\x86\x67\x81\x93\xd4\x3a\x45\x1f\x28\xa3\x79\x99\x6b\xc2\x94\xd0\x57\x7b\x5b\x79\xe8\x64\x45\xf1\x86\x87\x06\xad\x5b\xd0\x9c\x0a\x48\x0f\xaa\xc9\x60\x9a\xe9\xdd\x80\x44\x87\x0d\xde\x02\xc7\x29\x93\x84\x10\xa8\x61\x7e\x11\x65\x30\xfb\xdd\xa2\x9a\x5d\x55\x10\xf1\x8d\x7f\x67\xe2\x9a\xd6\xc7\x48\x35\x83\x26\xcc\xe7\x30\x5f\xc6\xb1\xc9\x61\x01\x76\xb4\xc9\x32\xa2\x18\xce\xb3\x98\x2b\xa3\x4c\x95\x91\xa7\x28\xda\x44\x39\xde\x3c\x09\xfb\x3b\xa4\xbc\x1c\x62\x9a\x8c\xe2\x22\xa3\x4d\x92\x31\x36\xe8\x83\xcc\x91\x63\x4c\x91\x07\xd5\x79\x39\xd4\x04\x39\x4a\xef\x88\x36\x3d\x1e\xc7\xec\xf8\x2c\x35\x95\x22\xf0\x12\x67\x66\x1c\xd9\x6d\x72\xc8\xbc\x38\x6c\x5a\x3c\xa6\x59\x31\x12\xb5\xc3\x4a\x71\x84\x42\x3c\x46\x19\x1e\xa1\x08\x8f\x36\x1f\x5a\x24\x0d\x6c\x6b\xac\x02\xbc\xa7\xde\x0e\x40\x3d\x4c\xf9\x7d\x82\xe2\x1b\x63\x2e\x7c\x16\x53\xe1\x38\x33\xe1\xd1\x9a\x2f\x06\xd5\xf7\x88\xa3\x4a\x19\x55\x14\x67\x17\x24\xc3\xbb\x5b\x92\x70\x96\x06\x38\xf5\x5e\xa9\x83\x8a\xe6\xa4\xf9\xd0\x4a\x6e\xed\x28\x9b\x0d\xb6\xd5\x72\x82\x7e\x6f\x1b\xa0\xe4\x34\x77\x7b\xb9\x40\x6d\x44\x33\xc3\x43\xb2\x97\x8f\xa0\x5f\xa3\xa3\x8a\x88\x26\x30\x68\x1c\x9a\xff\xc2\x1f\x10\x5f\x29\xc2\xd0\x4b\xca\x1c\xa6\x5f\x35\x84\xc3\x5a\xd6\x0e\x91\x9c\x25\x4f\xfd\xdd\x9b\xd7\x0e\xcc\x97\x12\x95\x41\xa8\x97\xf2\x18\x5a\x87\x05\xf5\x14\xb5\xc3\x82\x58\x95\x59\x5b\xf5\x30\xea\x48\xac\xde\xf1\xa6\x2e\x89\xf2\x06\xe6\x52\xd1\xb2\xd6\x26\x6d\x30\x63\x17\xe1\x41\x88\xbf\xc0\x56\x44\xb8\x04\x0e\x72\x07\x18\x83\xff\xc0\x15\x3b\xca\x15\xd0\x34\xf6\x07\xe0\x8e\x71\x03\x3c\x8b\xf6\x74\x44\xd3\xff\x18\xb3\xff\xbf\x9c\x64\x13\x61\xde\xff\x15\x49\x36\xbf\x84\x2c\xa0\x68\x4e\x78\xa9\x8e\x24\x06\x98\x3e\xc9\x0d\x8e\x4c\xc3\xf5\x8a\x78\xb9\xd7\xa0\xe3\x8d\x05\xd8\x7b\x4b\x1d\x2f\xa2\xf6\x2b\x93\x12\x06\xf6\xc9\xaf\x24\x7b\x9b\x00\xd5\xb2\x58\x5d\xa3\x1c\x4b\x84\xd1\xc5\xf5\xed\x8f\xef\xcf\xfe\x7c\xf9\x7e\x81\x2e\x71\xe2\x2b\x15\xde\xa8\x12\xc2\x4c\x43\x44\x43\xfb\x1b\xbc\x25\x08\xa3\x92\xd1\xbf\x97\xb6\x6b\xe6\xcb\x0a\xe2\x2b\xe7\x35\xf1\x00\x1d\xaa\xaf\x32\xc0\x33\xa0\x71\xc0\x88\x4a\x95\xa6\xd1\x80\x31\x23\x73\x2d\xe6\x0b\x9e\xef\xbb\xfd\x2e\xf5\x9f\xfc\x2c\x0a\x1b\xde\x03\x0d\x47\xd7\x74\x6b\x0d\x76\xb6\x04\x4d\xa3\x33\xab\x26\x49\x4d\x09\xfa\x36\xc4\x4b\x30\x53\x7b\x39\x14\x23\x4a\x53\x5f\xa5\x71\x70\x26\x9b\xf9\x17\x5a\x23\x91\x33\xb4\x2c\xc1\x54\x5f\x08\x9a\x63\x41\xb3\x5d\x73\x08\x9c\xf9\xf8\xcd\x35\x77\x37\xf4\xce\x5c\xc7\xf5\xf4\x2f\x3e\x5e\xde\xa2\xeb\x8f\x77\xd0\x13\x49\xdf\xac\x60\x45\x87\xbf\x03\x62\x96\xc4\x8f\x06\x5b\xdb\x7a\x81\xce\xd8\xce\x7c\x62\xce\x39\x95\x48\x5f\xcd\xc4\x75\xdc\xd7\xc8\x71\xa5\xa0\x5e\xbc\x5e\xc0\xff\xf9\xca\x5e\xe3\x34\x15\x9a\x9b\x57\x4e\x88\xbd\xfc\x01\xcd\x65\x81\xdf\xd3\x65\xd6\xd8\x3b\x8b\xbd\x5f\xac\x33\x58\xe5\x4c\xbc\xd1\xcb\x6e\x36\x08\xab\x36\x12\x10\x62\xea\x95\x42\x13\x52\x2f\x1f\x18\xec\x6b\x16\x59\xaf\xb2\x9e\x50\x74\xbd\xbc\x9a\x5f\xbb\xcb\xd4\x1e\x0a\xde\x28\x69\x8d\xae\x6e\xdc\xb6\x84\x2f\x34\x28\x23\x96\xb7\x1b\x97\x1b\xc0\xc6\x24\x31\x43\xaf\xd1\x9f\xd0\x23\xfa\x13\x5c\xad\x7f\x08\x01\x8b\xe3\xa0\x71\x62\xad\x91\xda\xae\x6e\xa2\xb1\xf2\x83\x3e\x02\xfa\x1b\xbd\x72\xc5\xd1\x92\xb2\xd4\x74\x68\x7a\x54\x44\xe8\x83\x6d\xb1\xf5\xe4\x0a\x87\x7a\x90\xa3\x6e\x18\x58\x27\xd0\xd5\xaa\x51\x2b\x2c\x2c\x29\x8e\xdc\x32\x0d\x5a\x4b\xb2\xd7\x86\xc8\xc3\xe6\xe9\x56\xc5\xb2\x7a\xa4\x1c\xab\x64\xd3\x3e\x41\xfa\x0a\x97\x2a\xd4\xb6\xb8\x85\x11\x0e\x1a\x82\x71\x07\x6e\x68\x90\x2a\x8f\x4b\x48\xa3\x9a\xef\xb5\x76\x61\x0f\xd3\x7b\x82\xe2\x80\x10\x9e\xba\x9b\xb5\x91\x0e\x55\xf0\xd4\x5c\xd5\x30\xa9\xb4\xc1\x6e\xdc\xad\x1c\x04\xda\xbd\xb1\x6d\x88\x4a\xa5\x3a\x03\x7d\xe9\x93\x60\xbb\x71\x42\x05\x4b\x31\x90\xb1\xa0\x4f\x4b\xd5\x03\x2f\xb8\x31\x51\xe7\xa3\x10\x5c\xf1\x84\x07\x6b\x46\xb6\x4d\xc2\xf6\x03\x58\x86\x51\x2b\x9d\x26\xfe\xfd\xc5\xcd\x4c\x6b\x84\x50\x3c\xef\xf6\x7c\xc8\x2a\xd7\x6a\x0f\x77\x77\x7e\x13\x6c\x53\x13\xb1\x98\xe1\x72\xde\x2d\x16\xee\x13\xcb\x9f\x56\x7b\x52\x10\x9c\xd2\xa3\xc5\xd6\xb8\x56\x87\x15\xd4\x31\x41\x36\x39\xdf\x92\xd4\x5c\xe0\x75\xcb\xc4\x14\x1a\xf2\xca\x40\xe4\xcd\xb0\x0c\xf9\x05\x2c\x83\x53\xe4\xcd\x14\x79\x33\x45\xde\x4c\x91\x37\x81\x77\xa6\xc8\x9b\x29\xf2\x66\x8a\xbc\xe9\x45\xcb\x14\x79\x33\x45\xde\x4c\x91\x37\x8d\x97\xa6\xc8\x1b\x3b\xa9\x7f\x1a\xff\xd4\x14\x79\xd3\x7e\xa6\xc8\x9b\xce\x28\x53\xe4\xcd\xd7\xe1\x53\x9b\x22\x6f\xdc\x33\x45\xde\x4c\x91\x37\x53\xe4\xcd\x14\x79\xb3\xf7\x4c\x91\x37\x53\xe4\xcd\x14\x79\x13\xde\xa7\xaa\x9b\x77\x8c\x0b\xe5\x9c\xe7\x45\xa9\x08\xfa\x54\xb5\xab\xaf\x7a\xa6\x2f\x77\xc6\x2f\xd8\x38\x1c\xcf\xe5\xe6\x30\x6d\xbb\x4a\x01\xa1\x22\xa7\xa6\x16\xe2\x3c\x31\x53\x9b\x57\xeb\x99\x57\x33\x39\x3d\xd4\xd5\x61\x7a\xe7\xfb\xe9\xa1\x8e\x8f\xb9\x89\x62\xfc\x51\x8c\xab\x8d\xf1\xf7\x30\x85\x86\xa1\xc5\x34\x8b\x7a\x04\xf2\xc5\x39\x2f\x4d\x09\x48\xbb\xfa\xc0\xd8\x15\x5e\x8c\x99\xe8\xcb\xa1\x1d\xc5\xf7\x0c\x26\xf2\x0b\x63\xff\x93\x9d\xc4\x3e\xfe\x2d\xfb\x38\x0c\xff\xee\xc8\x40\x04\x42\x35\x02\x95\x88\xe7\x54\x69\x39\x45\x0b\x7b\x8d\x68\xa1\x90\x57\x83\xaa\x96\x0d\xd5\x52\x0b\xf8\x1c\xb1\x32\x55\x50\x2b\x37\x47\xb3\xe7\x9a\xeb\xa6\x16\x42\x17\x54\xbe\xad\xa4\x25\xd8\xf5\xb9\x6b\xbe\x0b\x8c\xf3\xab\xa6\xa0\x81\x17\xb4\xbc\x2f\xa8\xda\x9d\x73\xa6\xc8\xa3\x47\x82\x69\x13\xc3\xad\xfd\xc4\x76\x15\x94\x95\x28\x65\x9d\x98\xa2\x64\x10\xd5\x10\x71\x95\xc4\x20\xcb\x74\x1b\x3b\x75\x13\x05\xac\x90\x47\x75\xea\x01\x19\xb7\x15\x0a\xcb\xfb\x7a\x1f\xc8\x5c\x5f\x4e\x35\xba\x3b\x63\x1d\xca\x38\x81\xc5\xdc\x08\xba\xa5\x19\x59\x93\x4b\x99\xe0\x0c\xf6\x3c\x56\x04\x38\xf3\x7c\xef\xba\x2a\xca\xaa\x8b\xa6\xaf\x63\xb6\x9d\x27\x08\x75\x09\x66\x68\x8d\x29\x43\xb9\xc6\x51\xe1\xc0\x42\xf7\x3d\x06\x1d\xde\x0a\x2c\xb4\x42\x60\x3f\x08\x49\x5c\x10\x18\xb6\xe4\x3c\xb3\x1e\xd9\x6c\x57\xcf\xc9\xba\xfa\x19\xff\x91\x91\x87\x1f\xf5\x38\x12\xad\x32\xbc\x0e\xf5\xa2\x46\xb6\x22\x2c\x51\x9d\x92\x2d\xd5\x74\x90\x0f\x1d\x21\xc6\x20\x41\xfc\x43\xd8\x74\x60\xec\x6d\xf7\xfd\x16\xbd\x79\x05\x54\x8b\x25\xaa\xa0\x87\x8c\x2a\xdf\xbe\x02\xeb\xcb\xf9\xd9\xcd\x8f\xb7\x7f\xbb\xfd\xf1\xec\xe2\xc3\xd5\xf5\xd0\x11\x0d\xf7\x29\x4d\x70\x81\x97\x34\xa3\x61\xde\xdd\xb1\x82\x37\x3f\x03\x46\x95\xa6\xa7\xa9\xe0\x85\x59\xa7\x28\x19\xc4\x6b\xd6\x31\x58\x11\x86\x0c\xe7\x83\xaa\xc2\x3b\x4d\x6b\xee\xf6\x50\x6b\x81\x99\x72\xc2\xce\x50\x7d\x6e\x83\x66\x51\x32\x2d\xa8\x3e\xd5\xe3\x86\xd3\x31\x41\x09\x67\x69\x4a\xd2\xd6\xd4\x8f\xec\x03\x3a\x77\xa0\x77\x75\xc4\x28\xba\xf9\x78\x7b\xf5\x3f\xe3\x47\x45\x96\x46\xa2\xdc\x03\x47\xf2\x60\x23\xa4\xc9\x64\x04\x26\x3f\xd9\xe8\x9e\x09\x97\x9e\x77\x06\x2a\xf9\x3b\xae\x12\x79\xb8\x3f\x95\xac\x1d\x99\x5f\x43\x40\x39\x4f\xc9\x02\xdd\x18\xa6\x08\xdd\x76\x83\xbc\xbf\xfa\xae\x66\x03\x60\xfe\xd5\x1f\x33\x45\x71\x96\xed\x90\x96\xc4\xb6\x38\x23\xc6\x85\x2c\xb8\x57\x5b\x41\x75\x49\x2d\x13\x97\xda\xe4\x1a\x2b\x9c\xc9\xc0\x01\x8f\xe1\x83\x9a\xd5\x7f\xd0\xc2\x64\x24\x9e\xaa\xf7\x51\x4a\x18\x57\x56\x2e\xd5\x23\x41\x40\xad\xe0\x09\x32\xb2\xa9\x71\x43\x04\x56\x55\x87\x13\x55\xcc\x12\x58\xac\x63\x83\x54\xba\xb5\xde\x54\x63\x82\x26\x1e\x80\x59\x4a\x22\xf7\x6e\x1b\xcb\x06\x6b\x69\x55\x8f\x2b\x08\x4e\x21\x36\xac\xc0\x6a\x03\x76\xcd\x00\xd0\x1c\xcb\x7b\x92\x9a\x57\x17\xe6\x1e\xb6\x92\xb4\xb4\x1d\x00\xec\xf4\xee\x34\x16\x56\x04\xab\x52\x10\xb8\x7f\xc3\x42\xee\x92\x20\xc2\xf0\x32\x0b\x45\x9e\x45\x05\x45\xe2\xf4\x23\xcb\x76\x9f\x38\x57\xef\xaa\x90\xaa\xc8\xed\xfc\xa1\xea\x09\xde\xd4\xa0\xe1\xb2\x05\x23\x65\x3a\x07\x34\x41\x20\x57\x5c\x25\xf3\x8b\x7a\xfb\x8e\x40\x9e\xa2\x64\x67\xf2\x3b\xc1\xcb\xd8\xa6\x1c\x9a\x82\xbe\xbb\xba\x80\x53\x55\x9a\x73\x43\x98\x12\x3b\x08\x8a\xec\x64\xf0\x0c\xcb\x70\x0b\xf4\xbd\xa6\xa9\x3d\x2a\xd2\x12\x57\xc9\x24\x51\x0b\xf4\x01\xef\x10\xce\x24\xb7\xc2\x54\x48\x32\x62\xe8\x06\x7c\x26\x4d\xf9\x7f\x81\x20\xc6\xd9\xc4\x5d\x2c\xb9\xda\xa0\xbd\x17\x06\x88\xb3\x0b\xd1\x84\xef\x19\x03\x53\x9d\xa0\x44\xd9\x3e\xe0\x10\x71\xe2\x7b\x22\x51\x21\x48\x42\x52\xc2\x92\xc0\x1e\x36\x6c\x45\x7f\xf8\xfd\x93\xcc\xf7\xb0\xd3\xd7\x9c\x69\x32\x8e\xdc\xeb\x2b\x96\xd2\x04\x1b\x1e\x64\xbb\x59\xd7\x24\x0c\x56\x4d\x2b\x63\x62\x88\x81\x1b\xe0\xb2\xa5\x24\xc2\x74\x77\x16\x25\x31\x48\xfc\x6b\xb9\x24\x19\x51\x26\xe2\x16\xe2\xfa\xb1\x32\xad\x04\x4c\x43\x79\xac\x1c\x61\x84\x4f\x3a\x61\xb2\x84\x76\x21\x5a\x35\x56\x28\xe5\xa4\x8e\x57\xc4\x12\x7d\x7f\x75\x81\x5e\xa3\x97\x7a\x7e\xaf\xc0\xc7\xb2\xc2\x34\x24\xb6\x2b\x6e\xbc\x30\xfb\x72\xf5\xca\x01\x87\x65\x00\x7d\x22\x2e\xcc\x31\x9c\x21\x16\xf2\xf9\x40\xb7\x18\xbb\x42\xad\xee\xb8\x18\x63\xeb\x99\x03\xa3\x4d\x9b\xd0\x03\xe4\x1c\x1a\x27\x4c\xe8\x3e\x72\x0e\x40\x1c\x26\xf4\x11\xe4\x1c\xcd\x92\xbe\x97\x44\x8c\xe0\x48\xdf\x1f\x95\x23\x35\x45\x00\x4d\xb5\xed\xd5\x1b\xd2\xcc\x89\xc2\x29\x56\x18\xd1\xd0\x76\x94\xac\xd1\x11\xe4\xd7\xb0\xc1\xc7\xe3\x57\x92\xbc\xa7\xac\x7c\x34\x2e\xb2\x31\x2a\xe4\xed\x25\x7c\x88\x12\x37\x79\x40\x38\x2e\x8a\x8c\x9a\x00\xe1\x76\x1e\x65\x00\x33\xe6\x90\x37\xd3\x63\xfa\x04\x1f\x38\xca\x38\xcb\xb8\x66\x95\xfa\x56\xc7\x2c\xe5\x79\x00\xec\xfe\x04\xb5\xc0\x44\x70\xb2\x69\x5a\xd8\x7b\x88\x65\xd4\x25\xf5\x4f\x7e\xed\xc5\xa9\xce\x19\xd9\x92\x60\xda\xcd\x7e\x76\xad\x7e\x5f\x0b\x4e\x6e\x07\x00\x00\xca\xf0\x92\x64\xe6\xf2\x30\x54\x12\xe9\x6c\x8d\xa2\xa1\x68\xd5\x4c\xf0\x6c\x4c\x30\xd2\x27\x9e\x81\x7f\x0b\x57\x8b\xd1\x00\xbe\x92\xb5\xc0\x6b\xf1\x6b\x01\xb9\xbe\xb5\x16\xd0\x77\xbe\x8e\xb5\x94\xc1\x9b\xa8\xb3\x16\x7d\x71\xb5\xd7\x02\x37\xc8\xd7\xb0\x96\x08\xb5\xfe\x81\xb2\x94\x3f\xc8\xf1\x4c\xf7\x07\xf3\xa1\xe3\x0c\x89\x66\x3d\x8a\xb2\xb5\x6c\x32\x5e\x1c\x34\x96\x36\xf5\xd4\x3e\xce\xeb\x8c\xf3\x55\x3e\x75\x97\x47\x05\xa0\x3b\x81\xab\x94\xd6\x3f\x73\xc0\x45\x1a\xa2\xf8\x28\xde\x78\x74\x0e\xb8\xce\x25\x3e\x17\x1a\x96\xa2\x38\xbb\x2d\x46\xb5\x3d\xfb\xee\xc3\xed\x59\xfb\x63\x4d\xb8\x0f\x90\x72\xaf\xd7\xa3\xff\x8e\x70\x9a\x53\x29\xc3\x26\x69\xc0\x2f\x59\x42\x3b\xba\x97\xce\x47\xb1\xa6\x6a\x53\x2e\x17\x09\xcf\x1b\xee\x8a\xb9\xa4\x6b\x79\x6a\xa9\x6c\xae\x67\xff\x6a\x00\x2e\x65\x19\x65\x0d\xa3\x03\x24\xb0\x5b\xa1\x0e\x26\x98\x54\x2b\x00\xd4\x9b\x4c\xd3\x01\xa0\xc6\xca\xdb\x83\x00\x93\x5d\x4a\x49\x96\x5a\x43\x84\x09\xc7\xd6\xe7\x39\x2b\x36\x78\x0e\x17\xc6\x00\x70\x9b\x33\x06\x7a\xfd\x86\x33\x6e\x7d\xe8\x26\xe6\xd8\xaa\x52\xc6\x2e\x01\x93\xb0\x27\x47\xcf\x65\x00\x70\xd3\xf2\x71\x14\xd6\xd6\xa5\x9e\xeb\xc1\xc0\xfa\x01\x0a\x02\x04\xda\x8c\xb9\x46\x34\xce\xc0\xca\x7a\x37\xd2\x08\xdf\xbf\x86\x7d\xa8\x34\x9e\x91\xe8\x07\xcd\xc7\x7e\xa6\xb9\x8d\x63\xc2\xbd\x9a\xd0\xc0\xa2\x3a\xb5\x57\x7a\xb5\x21\xfd\x4a\x5b\x23\x1a\x3c\xbe\x5d\x7d\x69\x48\x2b\x1a\x00\xd9\x27\xec\x3e\x49\xd6\xed\x07\x7a\x04\x79\x17\xf5\xc9\xbc\x7b\xf4\xbc\x24\xca\x92\x33\x10\x6c\x8e\x77\x68\x39\x74\x5c\x52\x2a\xc1\xac\x09\x4e\xe9\x26\xf1\x7e\x6a\x12\xd2\xb1\xe9\xf4\xc9\x8e\x79\x13\xd8\x1a\x9d\xd5\x7d\xdb\x78\x1f\xd1\xae\x29\xea\x86\xa7\x26\x64\xbc\x0a\xca\xf5\xf6\x3f\xb4\xa1\xeb\xf4\x67\x77\xf7\xd7\x92\x05\xe3\x26\x66\xa2\x19\x47\xee\x1a\xcc\x9a\xa6\xa9\x1e\x98\xd6\xa2\x6b\x9b\xaf\xb6\x66\x61\xac\x5c\x1b\x2a\x9b\xc9\xe1\xb3\x6a\xd2\x01\xa7\x71\xb3\xb5\xc3\x0c\xfd\x77\x29\x15\xc2\x95\xfb\xb9\xd5\x73\xa2\x8a\x39\x06\x72\x4a\xbc\xd6\x14\x97\x8b\xa5\xb8\x9e\xcc\x96\xa6\x04\xa5\x74\xb5\x22\xce\x2d\xbe\x24\xa8\xc0\x02\xe7\x44\x81\x1b\xc5\xa0\x16\xba\xf0\x32\x3f\x31\xf0\x15\xc2\xae\xd7\x6d\x15\x01\x37\x33\x3e\x5a\xaa\x50\x4e\xd7\x1b\x23\xeb\x20\x8c\x32\xce\xd6\x10\xd1\xa7\xa7\x90\x71\xec\x3b\x89\xc0\x1c\xb8\x40\x0f\x58\xe4\x08\xa3\x04\x27\x1b\xb0\x12\x62\x86\xd2\x52\x40\x82\xa7\x22\x38\xdd\xcd\xa5\xd2\x7a\xb6\x96\x8e\xc0\x94\x66\x30\xe0\xf5\x42\x77\x3a\x61\x00\xbe\xa8\x89\x44\xd6\x77\x49\x75\x4c\xac\xaf\xc0\x09\x07\x4d\xf2\xf3\x40\x6f\x1d\xb0\x29\xa5\x7f\xef\x99\x52\xfa\xa7\x94\xfe\x29\xa5\xdf\xbd\x39\xa5\xf4\x77\x9e\x29\xa5\x7f\x4a\xe9\x9f\x52\xfa\xa7\x94\x7e\x78\xa6\x94\xfe\xf1\x73\x9b\x52\xfa\xa7\x94\xfe\x29\xa5\xbf\xf1\x4c\x29\xfd\x9d\x51\xa6\x94\xfe\xaf\x23\x59\x6f\x4a\xe9\x77\xcf\x94\xd2\x3f\xa5\xf4\x4f\x29\xfd\x53\x4a\xff\xde\x33\xa5\xf4\x4f\x29\xfd\x53\x4a\xff\x90\x0b\x2d\xa5\x9e\x54\xcb\x98\xac\x03\x6b\xc0\x6f\xc4\x2a\x2e\xcb\xd5\x4a\x6b\xa8\xdc\x7b\x59\xeb\x11\x3b\x96\xe8\x2a\xf7\xad\x72\x74\x59\x6b\xb2\x24\x6a\x06\x69\x0d\x26\x4c\x67\x1c\x50\x1b\x48\x09\x69\x8d\x82\x48\x48\x03\x60\xe8\xf2\xe3\xbb\x45\x23\xe9\xc1\x6b\xca\xf4\xa6\x42\x0c\xc5\x1c\xc3\x6c\x3e\xb2\x24\xc6\x29\x59\x23\xb6\x2f\x12\xd4\xe2\x37\xc9\xb8\x34\x31\x05\x00\xda\xe7\x9a\xda\x60\xc6\x88\x93\x3a\xa8\x02\x59\x79\x49\x08\x43\xbc\x20\xcc\xf8\xa1\x5c\x5b\x06\x84\x95\xc2\xc9\x66\xa1\xc7\x67\x41\xa8\x2e\x3b\xb4\x1a\x5d\xb3\x5e\x82\x73\x83\x5c\x41\x72\x4c\xcd\x00\x08\x27\x82\x4b\x89\xf2\x32\x53\xb4\xa8\x86\xf0\xed\x18\x81\x18\x20\x13\x99\x55\x21\x0c\x1c\x0b\xc4\x98\xe2\x21\xa6\xdf\x6e\xac\x74\x4b\xe0\x6c\x30\xf0\x1a\x64\xa3\x19\x24\xb4\xe7\x85\xda\x19\x97\xab\x71\x3c\x51\x21\x15\x4a\x32\x0a\xd7\x3f\xcc\xce\xe4\x84\xc2\x28\xb3\x80\x53\x5f\x41\xae\x28\xac\x55\xda\xc5\xb2\x14\x6e\x8d\x42\x49\xe3\x68\xac\x87\xb1\x03\xa4\x54\xda\x3b\x5a\xfa\x3c\x13\xd8\xf5\x0e\x31\x9b\xed\xd6\x0a\xdb\x9d\xc2\x10\x6e\x4c\xfb\x53\x63\x90\x01\x2c\x40\xca\x93\x55\x94\xea\x43\x05\x29\xc6\x2e\xcf\x67\xd6\xea\x33\x52\x54\xc9\x72\x6a\x83\xfd\x95\x16\xdc\x41\xb4\xb3\x05\x22\x60\x64\xab\x69\x96\x24\x44\x8b\xd0\xb8\x73\xc2\xcc\x70\x07\x1d\x25\x45\x44\x4e\x19\xb8\x65\x3f\x10\x29\xf1\x9a\xdc\x78\x0d\x3c\x3e\xb1\x09\x6c\x3c\x35\xaa\x81\x10\x32\x90\xa1\xea\x5f\x6a\x97\xd8\x89\x8f\x21\x34\xa6\x82\x72\x33\x97\x2a\x06\xf0\x41\x50\xa5\x75\x2a\x2a\x4d\x2e\x1d\xd8\x35\xf7\x03\x2e\xfd\xa0\x9b\x4e\xb8\x0f\x0e\x74\x0d\x52\xf3\x77\x96\x1a\xc7\xd5\x92\xa0\xa5\xa0\x64\x85\x56\x94\xe1\xcc\x7a\xa0\x7c\xf4\x05\x39\x22\xd8\x08\xd4\x52\x6a\xd1\x94\x33\xe7\x58\x71\x6b\x58\xa0\x1f\xec\x22\x94\x28\x59\x82\x07\x73\x96\x19\x4f\x09\xa2\x2b\xb4\x06\x6f\x97\x30\x0e\xf5\xdf\xbf\xfe\xf7\x3f\xa0\xe5\x4e\xdf\x88\x60\xa8\x54\x5c\xe1\xac\x42\x53\x46\xd8\x5a\xef\x01\x30\x08\xdf\x59\xc8\xb2\x66\xfa\xa5\xc3\x2c\xd4\x55\x31\x4b\x7f\xf3\xed\xfd\xb2\x7d\xa5\x9f\xa6\x64\x7b\xda\xd8\x97\x79\xc6\xbd\x71\x29\xdd\x66\x38\xfd\x97\xef\x80\x78\xd9\x43\x90\x50\x7c\x21\x82\x24\x5d\xf2\x13\xda\xf0\x07\x93\x83\xd9\x43\x51\xb5\x4b\xbc\xe0\x45\x99\xf9\xbb\xf6\x20\xf4\x4e\x53\x31\xe0\xa9\xb4\xb7\x43\x2b\x9c\xb1\xf7\xe4\x80\xa2\x6f\x01\xfb\x79\x5d\xf3\x86\x37\x2e\x4e\x37\x3d\x6e\xe3\xa1\xac\x92\x5b\xe5\x3e\x95\x82\x2c\xd0\x3b\x9c\x65\x4b\x9c\xdc\xdf\xf1\xf7\x7c\x2d\x3f\xb2\x4b\x21\xbc\x62\x40\x6b\xde\x19\xd6\x7c\x79\x53\xb2\xfb\x76\xab\x85\x8c\xaf\xb5\x1c\x57\x94\xca\x45\xac\x34\x56\xe5\x01\xec\x66\x0a\x67\xbc\xba\x04\xb0\xed\x65\x53\xc3\x26\x8f\x40\x57\x10\xf0\x84\x19\x22\x7a\xae\x3e\x4c\x6b\x8a\x6e\xce\x45\x36\xc9\xf2\xdb\xd7\xbf\xff\xa3\x21\x7d\xad\x5d\xfc\xf1\x35\x38\xff\xe5\xcc\x30\x17\xcd\x19\xfd\x1c\x5a\xe6\x38\xcb\xb4\x22\xd1\x24\x6a\xbd\xad\x8b\xd8\xde\x4d\x43\xd4\xaa\x62\x08\x33\x5a\xb8\xbb\xbb\xfb\x5b\x40\xb2\xa3\x4a\x92\x6c\x35\x33\xb1\x77\x55\xbe\xed\x09\x5c\x14\x27\x96\x77\xe9\x5b\xbd\x7b\x35\x1c\x26\x66\x6d\x79\x56\xe6\xe4\x82\x40\xd3\x95\x88\x65\xb6\xde\x77\x11\x1b\x99\xed\x8f\xb6\xcc\x78\x72\x8f\x52\xfb\x47\x98\xac\x67\x99\xe0\xb5\xb2\x21\x3d\x0d\x5d\xb0\x8a\x02\x82\x00\x3c\x17\xc9\xf3\xd4\x8e\x5b\xcd\x39\xb7\xfc\x6d\x39\x2e\x0a\x68\x34\xb6\x82\x04\xa1\x07\xb3\x80\x80\x8e\x05\x10\x6c\x27\x1d\x7c\x9c\xee\x5b\x06\xa8\xff\x42\xee\x59\x4f\xfd\x89\xdb\x80\x02\xfe\xdb\xc4\x8b\x8c\x48\xad\x43\x75\xd8\x5e\xb5\x36\x73\x63\x68\xcc\xc0\xc9\x7c\x72\x1f\x9e\x51\x7d\x8f\xc0\xac\xd0\xe8\xf4\xd4\x8c\x57\xc6\xa8\x20\x42\x42\x73\x38\xf5\x19\x76\xf4\x3c\xc3\x34\x94\xd1\x85\x50\xdd\xf0\xe8\x69\xcb\x18\xee\xc0\x53\xef\x89\xf7\x95\x80\xb7\xef\x89\xbd\x79\x0c\x81\x43\x32\x7e\xcc\x19\xbe\xe1\xa9\xfd\x04\x0e\xa9\x29\x5c\xd0\x23\x6a\xc9\x88\xdc\xf7\xa3\xb7\xc7\xfb\x5c\xaf\xa5\x7d\x56\xf5\x2f\xd5\x61\x35\x6f\xd9\xa3\xe8\xdd\xdb\x23\x1d\x51\x18\x7a\xd4\x09\x85\xb3\xd9\xe8\xb8\x55\xdf\x07\x2d\x11\xda\x6c\x42\x90\x82\x6b\x51\xc6\xca\xc4\x0b\x64\x6c\xda\x1a\xeb\x16\x2c\x3a\x79\x7b\xf2\xe4\x73\x6a\x16\x29\x78\x81\xd7\x03\xa5\xa3\xf6\xd6\xba\xff\x21\x4a\x89\x11\x30\x88\x04\x21\x0d\xfe\x0e\x6e\xa3\xe0\x42\x0b\x0b\xc1\x75\x76\x72\x3e\x3e\x6b\xa6\x75\xe8\xb3\x22\x88\x09\x0e\x7e\x08\x7a\xb1\x11\xc2\x82\x97\x2c\xb5\xfa\x79\x65\x08\xf9\xb0\x37\xe1\x6b\xce\x40\xc8\x31\x39\x48\x81\xb0\x55\xf3\xb4\x62\xc4\x35\x87\x79\xb3\x78\xf3\xfa\x97\x65\x93\x77\x7b\x0d\xf1\x34\x46\xae\x2b\x36\x69\xce\xc6\x93\x67\xe4\x0a\x6c\x44\xcf\xea\x83\x55\xda\xea\xfa\x19\xd4\x55\x15\x80\x9f\xb4\x32\x46\xa2\x4a\xe1\x21\xf4\x12\x44\x1a\x2d\x0b\x36\xb2\x12\x5e\x8d\x2a\x03\x13\x97\xd6\xae\xf5\xbb\xe5\x93\xce\xb6\x39\xc4\x86\x68\xfb\x74\xe1\x30\x35\xd9\xaf\x7b\x8e\x79\xab\x8b\xdc\x0b\xf4\xd2\xbc\x79\x22\x21\x16\xf5\xd5\x93\xb7\xd7\x2e\xfb\xf2\xb1\x08\xe6\x51\xb6\x96\x7e\xf9\x58\x60\xd0\xa1\x8b\x21\x1c\x0c\x08\x1d\xed\x5b\xc6\x8f\x83\x3f\x93\x0d\xde\x12\x88\x93\xa5\x19\x16\xde\x4c\x02\x0b\x97\xa3\x5b\xb3\x2a\x68\x76\x4b\xd8\x96\x0a\xce\xc0\x4f\xb5\xc5\x82\x42\x4e\x11\xb4\x22\x24\x4c\xcb\xa7\xbf\x7d\xf9\xf9\xec\x13\xf8\x07\xc2\xd9\x6e\x26\xf7\xc0\xae\xbc\x94\x10\x83\xb0\xb7\x82\xc6\x50\xf5\xc6\x0d\xcd\xb5\x67\x53\xdd\xfc\xf5\xae\x00\xaf\x73\xeb\xd1\x73\xc8\x4b\x55\x62\x7f\x36\x85\x79\xc8\x63\x92\x95\x92\x6e\x9f\x7a\xfe\x87\x25\x9e\xea\x56\xfc\x02\x02\x8f\x0d\xe9\xbe\xa0\x1e\xda\xed\x6f\xb8\x7b\x22\xbb\xb1\xe0\x60\xd6\x63\x5c\x0d\x77\x3d\xed\x35\x2e\x9f\xc8\xaa\x36\x4e\x33\x95\xd5\x2a\xae\x36\xe5\xc2\xab\x05\x55\x75\x21\xd3\xae\xd9\x1d\xf2\xb3\x8e\xa3\xc2\xfa\xf7\xd2\xb3\x47\x81\xdd\xf1\xed\x0b\x61\x2b\x2e\x12\x92\xea\x6b\x48\x16\x38\x21\xef\xf1\xb2\x5b\x05\xa0\xcd\x4d\x7a\x3f\x71\x90\x24\xd4\x9b\x05\xa7\x35\x73\x2f\x98\x7c\xed\xce\x74\xf9\x0a\x71\x41\xd7\x94\xd5\x35\x1b\x70\x46\x84\x49\x18\xce\x89\x12\x34\xa9\xea\xb3\x42\x9a\x5c\x62\x62\xcc\x8d\x95\xad\x1f\xa6\x71\x6b\x35\x7d\x1f\x4b\x52\xa9\x23\x66\x32\x56\xd1\x32\x68\xaa\x06\x80\xae\xd7\xd5\x08\xbd\xd8\xeb\xd9\x26\xa2\xc7\x03\x69\xe4\x8a\x29\x22\xb6\x38\x8c\x3a\xf7\x92\x96\x41\x1e\x08\x61\xad\xf0\x8b\x1a\x56\x27\x6e\xd5\x3f\xbe\x6d\x4f\x7c\x23\xc8\x8a\x3e\x06\xc7\xbe\x6b\x76\x33\xfe\xfe\xd3\x7b\x40\xc2\xdd\x06\x33\x2e\xd1\xa7\x32\x83\x32\x72\x52\x61\x60\xb1\x55\xdf\xed\x2d\xa6\x99\xe6\xbf\x1d\x3c\x97\x2c\x6d\x2a\xfe\x8c\x24\x44\x4a\x2c\x76\x9a\x41\xae\x09\x23\x02\x2b\x7d\x2a\x84\x3e\xae\x7a\x34\xd9\xf3\x6e\x07\x28\x5d\xed\x4d\xc8\xb9\xc1\x44\xd5\x38\x14\x12\x3a\x40\x5c\xba\xb8\xbe\x35\x4d\x6c\x63\x71\xb5\x16\x45\x72\x0b\x71\x8d\x77\x99\x3c\x87\x23\x1c\x44\xd8\xc9\x77\x9f\x6e\xce\xed\x07\xef\x6f\xcd\x07\xf5\xd1\x37\x0a\xfc\xfa\xd3\xcd\xb9\x0d\x96\x0c\xdd\xa2\x76\x55\xff\xa3\x24\x82\x12\x61\x3d\x09\x82\x24\x5c\xe8\xbb\x49\x94\x19\x01\x3f\xca\x02\x5d\x73\x45\xde\xa2\xf3\x52\x08\xc2\x14\x64\x0e\x65\xfd\xe6\xe8\xf3\xb3\x77\x34\x23\x33\x74\x4e\x84\x32\xff\xa5\x0f\xcd\x5f\xc9\x0e\x0c\xa3\x20\xeb\x9a\x90\xaf\x2a\x06\x64\x81\x3e\xe0\xa2\x4a\x3b\x3d\x39\x99\xcf\x35\x42\xe6\x66\xf2\x73\x95\xc9\xf9\xff\x75\xd2\xb5\x0a\x9f\xbf\xbf\x42\x58\xac\x65\xc7\x60\x1c\x52\xc0\x12\xdc\xc7\xde\xdb\xa1\x82\xaa\x4c\x2a\x45\xc8\x5d\xcd\xe7\x67\x28\x21\x42\x35\x03\x08\xc1\xee\x89\xc5\x9a\xa8\xde\x60\xee\x21\x35\xd0\x6c\xd7\x07\xec\xad\xc7\xb6\x7f\xe3\x98\xb7\x9b\x13\x03\x07\x57\xfc\x8c\x62\x66\xa5\x9f\x7b\x12\x2f\xa1\xeb\xa3\x7b\x4f\x76\x26\x3e\x3e\x23\x49\x30\x80\xf2\xf8\x6a\xcb\xc9\x75\x23\x6a\xc4\x0a\x62\x6a\x74\x04\x21\xdf\x12\xb1\xa5\xe4\xe1\xd4\xde\xe5\x73\x2d\x87\xce\x0d\x17\x96\xa7\xc0\x9e\x4f\xbf\x81\xff\x09\x0a\x4a\x26\x92\xe9\x2c\x4d\xad\x2e\x59\x4a\xb2\x2a\x33\x4b\xf1\x0b\x84\x0b\xfa\x99\x08\x49\x39\x9b\xa1\x7b\xca\xd2\x19\x2a\x69\xfa\x5f\xa1\x70\x9f\x28\x7c\x71\xe7\x50\x8b\xc5\xd9\x2d\x88\x25\xbb\xaa\xfe\x32\x90\x77\x45\x5e\x5c\x40\x39\x65\xbd\xa7\x83\x6d\xbb\x97\x50\xc6\x8f\xb2\x60\xcc\x67\x54\x25\xb0\x41\xd1\xf0\x9e\xf8\x84\xd4\x41\xb9\x4f\x92\x44\xf8\x03\xdf\xda\xa8\x81\x57\xbf\xd2\x23\x66\xa9\xdc\x2c\xa7\x3e\x70\xc0\xdc\xad\x09\x67\x68\xb7\x5c\x4f\x7d\x0b\xe3\x9e\x04\x93\xd9\xa6\xe3\xfa\xb5\x1e\x57\x4b\xa7\xff\x6a\x67\x35\xf8\xe7\x04\x6b\xf9\x61\xf0\xf6\x76\xde\xd4\xe6\xa5\x6d\x35\xa1\x1b\xc1\x73\x8d\xc3\xb2\xe9\x4d\xf3\x44\xfb\x46\x9e\xf7\xe0\x96\xeb\xb1\x23\xa4\x0d\xd1\x23\x6e\xd8\x58\x15\x98\x3d\x78\x4c\x27\x81\x63\x12\x38\x3a\xcf\x3f\x31\x07\x9b\x04\x8e\x49\xe0\xe8\x3c\xd3\x71\xfd\x5a\x8f\xeb\xaf\x52\xe0\xb0\xf6\x8b\x51\x22\x47\xe7\xe2\x0e\xc8\x1e\xbd\x73\x7e\xaa\xd0\x41\xc1\x6a\x27\xc8\xed\x3d\x2d\x3e\x13\x41\x57\xbd\xe7\xbe\x35\xff\x0b\x53\x65\xca\x0e\x09\x73\xa7\x2b\x13\x12\x57\x17\xb2\xf6\x4f\xc4\xb7\x7b\xf7\xc6\xe2\x73\x08\xfa\x34\x81\x7d\x11\xec\xdd\x93\xdd\xad\x97\x7b\x0f\x70\xee\xbe\xf9\x1f\x41\x6c\x0b\x70\xee\x43\xb9\x76\xa8\xf0\x58\x3c\xc7\x1e\xe4\x3e\x21\x4e\xfd\x75\x72\xe9\xa3\x72\xe8\x41\xfc\x0c\x71\xe6\x03\xb9\xf2\x30\xe7\x1d\xe2\xba\x21\x8e\xeb\xe3\xb6\x41\x56\x6a\x2c\xb9\xbe\xa2\x87\xfb\x65\x75\x21\x7c\x73\x0b\xbc\xab\x8a\xd9\x80\x90\xad\xa7\x9d\x6e\xef\x0c\xc1\x2f\x36\xe0\xa0\x00\x23\xf9\x9e\x2b\x0d\x7d\xff\xe9\x7d\xb4\x89\x1f\xbe\xb8\x29\xb3\xcc\x6c\x5a\xe7\xb0\xb7\x9b\x3f\xb1\x8a\x38\xaa\x48\xc8\x86\x9b\x19\x0e\x35\x40\x71\x0c\x52\x6a\xf4\x54\x7e\xa4\x0e\x5e\x1a\xf2\x64\x51\x66\x99\xe1\x56\xb0\x24\x98\x96\x4d\x1d\x10\x64\x4d\xf5\xcc\x89\x44\x92\x98\x2a\x35\xfd\x47\xae\x94\x44\xcc\xd7\x25\x4d\xc9\xa9\xf9\xfe\x1b\xe3\xea\xdc\xe9\x53\x07\xbf\xe8\x51\xec\x14\xe7\x9c\xcd\xf1\xbc\x1b\x2f\xe7\x89\xdf\x6a\xd7\xf1\xe6\x09\xce\x3e\xc2\x8e\x7d\x72\xcb\x77\xbb\x20\x11\x61\xbc\x5c\x6f\x80\x43\x88\x1c\xbb\x82\x63\x59\x6f\xeb\x90\x1d\x2f\x91\x8d\x97\x6d\x30\x99\x84\xa4\xce\xd9\x66\x43\x1d\xbb\xc8\xec\x52\x59\x98\x63\xfb\xb9\xde\xd7\xc8\xf3\x8e\xc8\xf1\x82\xfc\xee\x00\xff\x2f\x65\x54\x55\x8e\xf6\xf0\x79\x39\xb9\x6a\xbd\xeb\x6a\xee\x58\x77\x6f\x1b\x50\x23\xdd\xb6\x87\xf8\x56\x50\x87\xc0\x14\x1b\xe4\x92\x40\xe3\xc1\x46\x65\x45\xb2\x58\x2f\xd0\x8a\xa8\x64\x53\x9d\x40\x7d\xa8\x28\xd3\xeb\xea\x0b\x7e\xaf\x62\x20\x0d\x0b\x31\xce\xc3\x56\x13\x4d\x73\xf6\x2a\xf7\xa7\xed\xa0\xb9\x40\x67\x6c\x67\xa2\xdf\xbb\x5b\x67\xcb\x24\x42\xd9\x57\xa8\x64\xa7\xc1\xf0\x15\x34\xfb\x6c\xae\xd5\x38\x4b\x33\x82\x4d\x51\x6e\x97\x79\x84\x78\xb7\xef\x84\x2d\x59\xf9\xd4\xe2\x0b\x7a\xf8\xba\x1b\xa5\xec\x76\xba\xfc\x5e\xf6\xec\x08\x74\x4b\x65\x3b\xe0\x51\x09\x96\x2e\x16\x0f\xb2\xbb\xac\x1c\x02\x38\x87\x4f\xbb\xe8\x20\x4c\x51\x41\xb2\x1d\xe2\xa5\xaa\x0f\x71\xc2\x4d\x27\xad\x07\x17\x8f\x9c\x63\xda\x4e\x63\xb1\xfe\xc7\xde\xfc\xb2\xe5\x0e\xa5\x1c\x2a\x93\xf1\x19\x30\x0f\x93\x54\xe6\xa2\x9b\xc1\x2b\xbf\xc1\x5b\xca\x4b\x61\x4a\xb9\x0a\x82\xef\x11\x56\xb0\x8e\xde\x3e\x36\xfa\x64\xf2\x12\xa2\x2c\x69\x42\x3a\x4e\xcb\x18\x76\x78\x56\x65\x09\x16\x45\xa6\x05\x74\xda\xcc\xbb\x33\x73\xd3\x73\x75\xd5\xb7\x5c\x3b\xd3\xde\x78\x56\xac\x4f\xc0\x58\xe6\x86\xc5\x3a\xaa\xcb\xf4\x99\x58\x97\x39\xa4\xbc\x58\xf2\xaf\xcb\x13\xdb\xde\x64\x3c\xb9\x77\xf7\xa8\x3f\x01\xeb\xfc\xc3\x85\x0b\xa3\x34\x99\x26\x75\x02\xaa\xad\x71\x9a\x2e\xd0\xe7\x83\x02\xb1\x06\x43\xb0\xf6\x63\xb0\xae\x56\x20\x1b\x9b\xb1\x3c\x40\xeb\x2a\xa4\x82\x48\x9e\x6d\x5d\x45\xfb\x6a\x66\xee\xbe\xa6\xac\x28\x95\xe5\x95\x2e\xa4\xc1\x03\xb3\x64\xc9\x06\xb3\xb5\x8b\x2d\x69\xac\x0c\xc9\x1d\x53\xf8\xd1\xf1\x28\x22\x13\x5c\x54\xa9\x33\x28\xe5\xa5\x7f\xa2\xbf\xfd\xed\x0c\x51\xf2\x16\xfd\xb6\x01\x6e\x81\x2e\x2d\x84\x06\x22\x1b\x89\x84\xcb\x1a\x61\xbe\x80\x26\x41\xd6\x58\xa4\x19\xe4\xec\xaf\x5a\xa2\x6a\x15\x2d\x47\x1e\xa9\x54\x90\x92\xc3\xb8\x6a\x04\x23\xf9\x56\x3f\xae\xc1\xb8\x69\x8e\x6b\xd8\xf1\x3c\xc5\x0a\xcf\x1b\x47\xe5\xd4\x48\xc5\x73\x5b\x4b\x73\x8e\x2d\x91\x36\xda\xe7\x7e\x63\x1b\x8f\xce\x71\xf5\x16\xd5\xe2\x0b\xd4\x9e\xec\xbf\xf6\x82\x71\xe8\x83\x3a\x40\x38\x28\x2d\x58\xf8\xb4\x7d\xe2\x2e\xeb\x4e\x48\x00\x0d\x02\x36\xea\x02\xc7\x55\x86\x89\xad\xa2\x79\xe7\xcd\x23\xdc\x3b\x99\xe8\xf2\xfa\xee\xd3\xdf\x6e\x3e\x5e\x5d\xdf\x0d\x1e\x45\x0f\xc4\x81\x03\x1a\x73\x14\x3d\x90\xfd\x07\x74\xf8\x28\x7a\x40\x06\x0e\xe8\xf0\x51\xf4\xb3\x05\xef\x01\x8d\x3e\x8a\x1e\xd8\x9e\x03\x1a\x7f\x14\x3d\x70\x3b\x07\xf4\x57\x7e\x14\x09\xdb\x46\x1c\xc3\xf7\x56\x59\xeb\x0b\x14\xde\x2f\x22\x39\x98\x48\x72\xf4\x44\x98\x4b\xb6\xfd\x8c\x45\xdd\xa2\x16\x32\x90\x7b\x63\x9a\xed\x0b\x5e\x43\x09\xb0\x92\xf3\x63\x64\xc2\x8c\x32\xe7\x37\x75\xa6\xbe\x79\xd7\xc5\x99\x42\x4d\xc5\x11\x3a\xff\xf1\xea\xe2\xf2\xfa\xee\xea\xdd\xd5\xe5\xa7\x27\x3b\x24\x06\xcb\x46\xb6\x19\xf5\x18\x6e\x18\x5c\x44\xcd\x29\x0b\x41\xb4\x24\x2a\x9d\xd9\xc7\x43\x7e\x74\xb8\x8c\x4e\x3b\x2d\x46\xcb\xb2\x52\x2b\x98\x49\x3f\xba\x4d\x95\x88\x30\xaa\xe3\x19\x72\x8b\xf5\x06\x61\x8e\x65\xcb\x96\x01\x07\x61\x3e\x0b\x73\x36\xcf\xe1\x2c\x3a\x3c\xe3\xb6\x24\xd5\x4e\xee\x08\x96\x91\x8a\x27\xeb\x77\x82\x07\x1a\xe0\xee\x9b\x28\x41\x75\xad\xac\x74\x7d\x14\x73\x22\x0d\xdc\x70\xf9\xa4\x06\xe3\xb3\xe2\x46\x55\x12\x48\xff\x0e\xa9\xe3\x21\x08\xb1\xe5\x68\xab\x88\x88\xbf\x92\xdd\x27\x32\x50\x0d\xab\x63\xff\xcf\x48\xa2\x39\xa8\x33\xba\xe3\xda\xa7\x3d\x54\x44\x72\x4c\xb9\xdc\x01\xc7\x6d\xef\xdc\x46\xc5\x48\xb8\x67\x54\xa9\xdc\x83\x8a\xf8\x7e\x25\x26\xaf\xf6\x33\xd6\x00\x16\x05\x74\xc8\x71\xeb\x9e\x51\x38\x8f\x71\xe4\xba\x67\x74\xfc\x45\xd4\xb2\xe2\x3d\x0c\xdd\x45\x0e\xe5\xcc\x99\x27\xbe\xd0\xb1\xdf\xe7\xdb\x1e\x37\xa2\x82\x31\xec\xf5\xd8\xf3\x7f\x52\x33\x00\x93\xbe\x59\x95\xae\x4b\xdf\x3a\xcb\x92\xac\x9a\x21\x2d\x34\x41\x0e\xd3\x4e\xeb\x75\xb0\x3e\xcf\xea\xdf\x20\xab\x44\x36\x7e\x00\x2e\x69\xb2\x32\x86\x41\xcb\x82\x24\x0b\xc6\x53\xa2\x0f\xe1\xcc\xfc\xd3\xde\xed\x67\x49\xc2\x4b\xa6\xec\x1f\xa0\xb0\xc8\x62\xc3\xa5\xba\xba\x89\x00\x6b\x5e\x2f\x78\x7a\x75\x33\x6b\xfd\xab\x1b\x97\xbf\xff\x8c\x61\x83\xf5\x39\x1c\x4d\xfe\xf6\xbb\xca\x31\x9a\x6c\x48\x8e\xe1\x3f\xdf\xe9\x8d\x0b\xe4\x9b\xb5\x1f\x2a\xeb\xe2\x3f\x0c\x2a\x9e\xe8\x7b\xbb\x5d\x2e\xff\xc5\xf6\xcd\x8b\xa3\x33\xdb\x95\x9b\xe6\xe8\xa5\x83\x6b\xdd\xb5\x77\x01\x2a\xad\xfd\xc1\x11\xd2\xa0\x7b\xea\xae\x58\x67\x37\x57\x68\x6b\xf0\x79\xe4\x65\xc6\x9f\xfc\x55\xe4\xae\x45\x9f\x7f\x2d\x8f\x6a\xc9\xe5\xdd\x13\xf9\x80\x83\xd3\xa9\x97\xf1\x16\x92\x65\x06\xf1\xe5\xbe\xb7\x65\x6c\xa4\xad\x34\x06\xad\x06\x24\x7a\x69\x7e\x5c\x24\x45\x39\xb3\x2f\x2c\x72\x92\x73\xb1\x1b\x3e\xa5\xf6\x75\x52\x6c\x48\x4e\x04\xce\xe6\x52\x71\x81\xd7\x90\x46\x6d\xc0\x1b\xb0\xd5\xbf\x0c\xe0\xe1\x53\xd9\x98\x60\x17\xba\xd1\x65\x92\x2a\x63\xa8\xce\xf7\x39\x26\x67\xa8\xb0\x3c\xdc\x53\xcf\x3c\xed\xed\xab\x9d\x25\x20\xd3\x54\x74\x08\x62\xac\x2d\x69\x11\x77\xe9\x57\x1e\x5b\x48\x19\x64\x5b\x2d\xf4\x06\x2a\x49\xd6\xcf\x28\x66\x90\xd2\x2d\x95\x7c\xa0\x51\x6d\xcf\x42\x6f\x5b\x1d\x48\x6c\xc5\x24\xe3\x38\x8d\x6b\xdd\x68\x1e\xf2\x58\x40\xc5\xbb\x8a\x56\xf7\xf8\xdf\x9b\x17\xc7\x5e\xb0\x1b\x69\xfc\xd6\x7e\x72\x2c\xa5\x3e\x99\x15\xfb\x3b\xf2\xbe\xc4\x73\x2f\x37\x95\x63\x31\x2f\xe3\x1f\x3b\x8e\x02\x63\x7d\x6d\x75\x89\x9b\x81\x4a\x03\xc8\x6a\x02\xfd\x41\x07\xed\xe7\x97\xd2\x79\x9e\x1a\xb4\xea\x9e\xd1\xc1\xab\xee\x99\xf4\xa8\x5f\x93\x1e\xd5\x09\xc1\x8a\x5a\xd7\xbf\x9c\x12\x15\xf1\xda\x70\x18\xef\xf3\x15\x77\x20\x6c\xeb\xb7\x64\xf5\x1a\xf0\x9d\x24\xd6\xa8\xcb\xd8\x6f\x02\x0d\xbb\x91\x5a\x85\xe8\x80\x41\xd5\x46\xda\xda\x25\x67\xee\xa6\x7c\xc0\x74\xdd\x32\x5a\xa3\x33\xe8\xc5\x67\x18\x14\x80\x75\xd6\x50\x41\x6c\x61\x7d\x53\x60\x94\x6c\xfd\x76\x7c\x68\xe3\xb9\x57\x23\xc2\xb6\xf1\xa0\x6c\x6d\x8b\x1c\x99\xfb\xc1\x1a\x1b\x29\xab\xea\x08\x7b\x60\x56\x62\x81\xaa\x9a\xea\x62\x29\x79\x02\xbd\x3d\xea\x3e\xb6\x50\x5a\xd2\x2e\x1c\x66\xae\xf0\xbd\x0f\x64\xb3\xa7\xee\x67\x0d\xb1\xc6\xe1\x72\x07\x75\x6d\xd9\xb6\xb2\xdb\x96\xc6\xc7\x64\x2e\x83\x40\x03\x56\x68\x5a\xda\x84\xfc\x1c\xde\x16\x4d\x74\xd6\x2a\xda\x70\xba\xc0\xfd\x54\x69\x0a\x18\x7c\x42\x3d\x21\x39\xee\xa9\x4c\x35\x3e\x5a\x8b\xb9\x5a\x2b\x53\xe7\x80\x98\xd0\xb9\x53\x6b\x43\x51\xfb\x2e\x3d\x82\xf9\x35\xe6\xf2\xfb\xba\x2f\xbe\xa3\x67\x74\xa0\x31\x97\x59\xec\x45\x36\xc2\x18\x38\xee\x62\x8a\xbd\x94\xa2\x2e\x91\xa2\xb7\x4e\x88\x77\x1d\xcd\x10\x59\x0a\xed\xe4\x57\x14\xd2\x39\x35\xa0\x82\x30\x13\xae\x87\x93\xcd\xe0\x25\x67\x59\x75\x6d\xbd\xaf\x9d\x88\xc7\x75\x14\x1a\x39\x72\xec\x01\xbc\xed\x93\x64\xa7\xd3\xf7\xaf\x73\xfa\xec\x06\x7f\xb1\xa3\xf7\x44\xd9\xaa\x37\x7a\xbe\x67\xe9\x27\x17\x8d\xc0\x22\x53\x1e\x67\x2c\xed\x34\x02\x4b\x4d\xdc\xb9\x67\x45\xed\xc6\xfb\x15\x9b\x50\xdc\x04\x06\xa3\x0d\x5d\x6b\xe4\x9b\x66\xfc\xe6\x66\x44\x39\x66\x78\x0d\x1d\x88\x7c\x68\xe2\x55\x5d\x2e\x2e\x90\x26\x63\x41\xd3\x4e\x79\x2d\x10\x91\x5c\x50\x2c\xfc\x51\xf0\x2c\xf3\x37\x3c\xcd\xe8\x3d\x41\x17\xa4\xc8\xf8\x2e\xb7\x11\x19\x29\xba\x55\x58\x69\x52\xbe\x25\xca\x67\x45\x1f\x20\xd3\x2a\xdb\x20\xba\x0a\xfa\xc9\x15\xec\x4b\x51\x66\x19\x2a\xe0\xa3\x05\x74\x0a\xe7\x2b\x74\x06\xd5\xaa\x66\xe8\x9a\x6c\x89\x98\xa1\xab\xd5\x35\x57\x37\x46\x98\xf1\xf1\xc4\xa6\x33\xda\x7c\x8e\xe8\x0a\xbd\xd5\x62\xb4\x54\x48\x99\x6e\x07\x8d\xe6\xfc\x5c\xb4\xc0\x7a\xa0\x56\x85\x1e\x9f\x10\x96\xe4\x27\xa6\x6f\x00\x52\x95\xc2\xe0\x31\xdd\x0d\x20\xbe\xea\x29\x13\x81\xf2\x33\xdb\x45\x5b\xd5\x11\xca\x8e\x06\x91\x29\x91\xeb\x0a\x18\x82\xb0\xea\xad\x4a\x2b\x88\x2c\x38\x93\xa4\x5d\xd7\xb4\xee\x8e\x05\x2a\x80\x8c\x96\x70\x87\x2f\x90\x82\x4b\x05\x5d\xf3\x63\x9b\x07\xdd\xb8\x0f\xa0\x8d\x06\xce\x32\x92\x22\x9a\xe7\x24\xd5\x5a\x41\xb6\xb3\xad\x51\x70\x54\x85\x69\x0d\xc1\x15\x5b\xbb\x32\x97\xd1\x06\xb3\x34\x23\x02\x2a\xde\x5b\xcd\xa3\xa5\xd1\xb8\xea\xf4\x41\xae\x6a\x6c\xd9\xb6\x35\x07\xc2\x49\xc2\x45\x6a\x9b\x43\x6a\xd5\xde\xc5\xce\x57\x67\x03\xf8\xf7\x20\xd7\x40\xa6\x98\x5c\x7b\x4a\x50\x13\x5c\x36\xba\x86\x6c\x38\xbf\x47\x09\xcf\x8b\x0c\x68\xf5\x78\x5d\x8f\x1a\x44\x5e\xf7\x38\xaa\x28\x63\x0e\x3d\xd9\x4e\x1b\xed\x8f\xe0\x87\xa7\x76\x52\x23\x8f\x24\x09\xdf\x8a\x2d\xea\xd0\x5c\x46\x23\x1f\x0a\x8a\x71\x56\x89\x18\x2b\xae\x99\x35\xc4\xe0\xc3\x29\x18\xb8\x11\x97\xa4\x66\x28\x0b\x74\xf9\x48\x92\xbd\xae\xdb\xb6\x77\x9d\xe2\x70\x9c\xc2\xa6\xbc\x78\x6b\x65\x30\x44\xd7\xbb\xe6\x73\xf3\x95\x2b\xb6\x6e\x81\x40\x8b\x02\xd3\x06\x1f\xc2\x76\x23\xec\x42\x8d\xb4\xa5\x6a\x17\xcd\x09\xe8\xd4\xa5\x0c\xb4\x08\x68\x3e\xcd\xf9\x40\xbb\x1a\xce\x15\x7a\x79\x72\x7a\xf2\xaa\x63\xd4\x88\x2a\xe7\xdd\x7c\xee\x1a\xb0\x29\xd4\x60\x2d\xb2\x1d\xac\xf6\x24\x9d\x21\xaa\x5c\x84\x8f\x28\x99\x5d\x59\x04\x50\x1b\xd3\x3c\x43\x92\x23\x25\x70\x4a\xed\x75\x0f\xbf\x42\xe5\x40\x51\x5a\x4e\xfb\xf2\xe4\x1f\x27\x31\x96\x47\xa2\x92\x57\xe8\x81\xb3\x13\x05\x68\x5c\xa0\x3b\x93\x40\x57\x0d\xb5\xe3\x25\x62\xc4\xe6\x04\x3d\x16\x19\x4d\xa8\x8a\xf0\xf0\x21\x60\x7e\x88\x97\xa6\x95\x92\xe6\xfb\x36\x1e\xfb\xf2\x91\x2a\xd7\xd4\x83\xaf\xd0\x6b\xd3\xdf\x89\x0c\xf0\xac\x0a\x05\x12\xfa\x50\x9e\x6e\x08\xce\xd4\xc6\xb4\xd5\x60\x9c\xcd\x7f\x26\x82\x43\xd4\x36\xb3\x7f\x19\xde\xa4\xa8\xce\xe3\x68\xac\xcd\x35\xae\x49\x74\xb4\xb9\x71\xb0\x09\x3f\x7a\xa6\x46\xfc\x68\x14\x6f\x18\x6e\x29\xd9\x9d\x67\x44\x53\xfe\xc8\x43\xfc\x2c\x8d\xf9\x51\x6c\x73\x7e\x34\x8e\x44\xa2\x9b\xf4\xa3\x83\x1a\xf5\x47\xac\x0a\x9a\x8b\x1f\xd4\xac\x1f\x8d\x39\x36\xa3\x9b\xf6\x47\x39\x14\x4c\x17\x97\xf1\x8d\xfb\xd1\x48\xcf\x1c\x1a\xe1\xb3\x42\xc7\x6a\xe2\x8f\xc6\x72\x1b\x34\xa6\x99\xff\xf0\x34\x63\x1b\xfa\x1f\x30\xcf\x58\x57\x0d\x8a\x6d\xee\x8f\xa2\x1b\xfc\xa3\x31\x5e\x66\x34\x82\x87\xc7\x34\xfb\x47\x47\x6e\xf8\x8f\xc6\xa1\x7e\xb8\x3d\x2e\x8a\x6b\x91\x8b\x46\xb6\xc9\x45\xe3\x5a\xe5\xa2\xfe\x04\x08\x81\x58\xd5\x8d\x55\x75\xda\xe5\x46\xec\x3b\xef\x78\xa7\x82\x2d\x73\x63\x28\xa9\xd5\x54\xf7\xc0\xb6\xb9\xe8\x29\xad\x73\xcd\x03\xd1\x7d\x11\xe7\xbe\x6d\x95\x83\x8f\x9a\x55\x12\xec\xcd\x6b\xf5\x3f\x57\x84\x22\xe6\x1a\x69\x5a\x3e\x34\xf9\x1e\x91\x6e\xe3\x98\xc5\x40\x83\x60\x34\xc2\xa9\x3b\xdc\x34\x1c\x1d\xda\x38\x7c\x00\x2b\xd0\x56\x7c\x7c\xf3\xf0\x41\xa8\x55\x6b\xf1\x51\x0d\xc4\xd1\x73\x4b\x7d\x47\x6c\x26\x8e\x46\x36\x14\x47\xbf\x16\xce\x19\xd1\x68\xfc\x57\xcc\x39\x7f\x59\xde\x12\xf1\x52\x21\xc8\xad\xe2\xde\x5a\xa5\x1d\x0b\xa3\x79\xdd\x63\x5f\x5c\x92\x15\x17\x24\xde\xc0\x58\x1b\x0c\x51\x5a\xc2\x49\xc4\x0c\x62\x9f\x9d\xae\xc8\x9b\xa6\xbf\x60\x8c\x05\x6a\xf4\x7b\xd5\x3a\x3a\x23\x52\x9e\x82\x29\xb1\x2c\x6c\xcb\x74\xdb\xa8\x73\xa6\xd7\x4c\x72\x58\xd1\x2c\x26\x4e\xd0\xb6\x15\x85\xd7\x89\x4a\x4c\x88\x89\xb3\x85\x5a\x4b\x8a\x43\x46\x7c\x07\xbf\x44\x60\xb9\x31\x4d\x33\xc9\x23\x55\xb6\x71\xac\x20\x58\x72\xd3\x0d\xa3\xd9\x1e\x95\x4a\x54\x60\x69\x8a\xa3\x84\x6e\x92\x7a\x62\x06\xdc\x0d\x4f\x4f\x4e\x64\x0b\xd4\x5a\xe0\x84\x68\x0d\x9c\xf2\x14\x41\x42\x42\xca\x1f\x42\xae\xad\x25\x59\x53\x26\xdd\xde\x9a\x32\x71\x86\x08\x34\x37\x27\x60\x61\x72\xf9\xef\x0b\xf4\xa9\x4a\xb6\x1b\xb6\xd4\xf2\x52\x25\xbc\x66\x12\x76\xe6\xfb\x86\x65\x08\x5b\x81\xad\x1f\xea\xa1\x53\x91\x53\xb3\xc1\xd1\x00\x0a\xac\x85\x39\x00\xb5\x41\x80\x63\x2d\xcc\x21\x14\x88\xc6\x57\xde\xfd\x81\x36\xd6\x38\xd9\xb4\xfd\x2e\x93\xb1\x7a\x32\x56\x87\x9e\xc9\x58\x3d\x19\xab\x27\x63\x75\xef\x33\x19\xab\x27\x63\xf5\x64\xac\x1e\xfe\x76\x32\x56\x4f\xc6\xea\xc9\x58\xdd\xf3\x7c\x8d\x26\x97\xc9\x58\x1d\xfe\x7c\x32\x56\x4f\xc6\xea\x00\xd4\xc9\x58\xdd\xfb\xfe\xaf\x81\x73\x4e\xc6\xea\xd0\xc7\x5f\x99\xb1\x7a\xe0\x05\x67\xf5\xbd\xd1\x32\x6e\x4c\x24\xf6\x0d\xd8\xd8\x68\x62\xcd\xc3\x7c\xd5\x8a\xea\x35\xc0\x16\x75\xf5\x3d\xcf\xc4\xeb\x7c\x40\x17\xd3\x6a\x8d\xc0\xb5\xd1\xb9\x37\x26\x18\xec\x79\x1e\x98\x07\xd7\x85\x2e\x78\x5a\x5b\xf2\x1a\x26\x3c\x23\xf7\xf7\x1f\xfa\x61\x26\x16\xb6\xdd\x1d\x64\xb7\x6b\x5b\xe6\x02\xc4\xf3\x04\x9b\x5d\x1c\x77\x8e\xb2\xd5\x1d\x60\xa7\x8b\xb3\x55\xc5\xda\xe8\xf6\x2d\x70\x03\x60\xa3\xed\x73\x4d\xeb\xdb\x00\xcc\x38\xdb\x9c\xcf\xf2\x36\x24\xa2\x79\xec\x72\x83\x56\xb7\x01\xb8\xfd\x36\xb9\xa0\xc5\x6d\x68\xa6\xbd\xf6\xb8\xa0\xb5\x6d\x18\xb1\x91\xb6\xb8\x28\x83\x42\xf4\x75\x18\xa3\xbb\x45\x70\x6e\xeb\x56\xbb\xdb\x08\x22\x37\x3c\x0b\x9c\xa4\xd6\x29\xfa\x40\x19\xcd\xcb\xbc\xd5\xff\xdc\x82\x92\x15\xc5\x1b\x1e\x1a\xb4\x6e\x2d\x81\xb6\x35\xe9\x41\x35\x19\x4c\x33\xbd\x1b\x90\xe8\xb0\xc1\x5b\xe0\x38\x65\x92\x10\x02\x35\xcc\x2f\xa2\x0c\x66\xbf\x5b\x54\xb3\xab\x0a\x22\xbe\xf1\xef\x8c\xa9\xee\x02\x12\xcb\xef\xbe\x1d\xc0\x64\x58\xaa\x19\x34\x61\x3e\x87\xf9\x32\x8e\x4d\x0e\x0b\xb0\xa3\x4d\x96\x11\xc5\x70\x9e\xc5\x5c\x19\x65\xaa\x8c\x3c\x45\xd1\x26\xca\xf1\xe6\x49\xd8\xdf\x21\xe5\xe5\x10\xd3\x64\x14\x17\x19\x6d\x92\x8c\xb1\x41\x1f\x64\x8e\x1c\x63\x8a\x3c\xa8\xce\xcb\xa1\x26\xc8\x51\x7a\x47\xb4\xe9\xf1\x38\x66\xc7\x67\xa9\xa9\x14\x81\x97\x38\x33\x63\xb4\x89\x31\xce\xbc\x38\x6c\x5a\x3c\xa6\x59\x31\x12\xb5\xc3\x4a\x71\x84\x42\x3c\x46\x19\x1e\xa1\x08\x8f\x36\x1f\x5a\x24\x0d\x6c\x6b\xac\x02\xbc\xa7\xde\x0e\x40\x3d\x4c\xf9\x7d\x82\xe2\x1b\x63\x2e\x7c\x16\x53\xe1\x38\x33\x61\xd4\x6e\x0f\x1f\xee\x01\xf5\x3d\xe2\xa8\x42\x2b\x27\x9c\x5d\x90\x0c\xef\x6e\x49\xc2\x59\x1a\xe0\xd4\x7b\xa5\x0e\x2a\x9a\x93\xe6\x43\x2b\xb9\xb5\xa3\x6c\x36\xd8\x56\xcb\x09\xfa\xbd\x6d\x80\x92\xd3\xdc\xed\xe5\x02\xb5\x11\xcd\x0c\x0f\xc9\x5e\x3e\x82\x7e\x8d\x8e\x2a\x22\x9a\xc0\xa0\x71\x68\xfe\x0b\x7f\x40\x7c\xa5\x08\x43\x2f\x29\x73\x98\x7e\xd5\x10\x0e\x6b\x59\x3b\x44\x72\x96\x3c\xf5\x77\x6f\x5e\x3b\x30\x5f\x4a\x54\x06\xa1\x5e\xca\x63\x68\x1d\x16\xd4\x53\xd4\x0e\x0b\x62\x55\x66\x6d\xd5\xc3\xa8\x23\xb1\x7a\xc7\x9b\xba\x24\xca\x1b\x98\x4b\x45\xcb\x5a\x9b\xb4\xc1\x8c\x5d\x84\x07\x21\xfe\x02\x5b\x11\xe1\x12\x38\xc8\x1d\x60\x0c\xfe\x03\x57\xec\x28\x57\x40\xd3\xd8\x1f\x80\x3b\xc6\x0d\xf0\x2c\xda\xd3\x11\x4d\xff\x63\xcc\xfe\xff\x72\x92\x4d\x84\x79\xff\x57\x24\xd9\xfc\x12\xb2\x80\xa2\x39\xe1\xa5\x3a\x92\x18\xf0\xb0\xa1\xc9\xa6\xc9\x91\x69\xb8\x5e\x11\x2f\xf7\x1a\x74\xbc\xb1\x00\x7b\x6f\xa9\xe3\x45\xd4\x7e\x65\x52\xc2\xc0\x3e\x45\x76\x4e\x6d\x96\xa1\xaa\x65\xb1\xba\x46\x39\x96\x08\xa3\x8b\xeb\xdb\x1f\xdf\x9f\xfd\xf9\xf2\xfd\x02\x5d\xe2\xc4\x57\x2a\xbc\x51\x25\x84\x99\x86\x88\x86\xf6\x37\x78\x4b\x10\x46\x25\xa3\x7f\x2f\x4d\xad\x22\xf4\xb2\x82\xf8\xca\x79\x4d\x3c\x40\x87\xea\xab\x0c\xf0\x0c\x68\x1c\x30\xa2\x52\xa5\x69\x34\x60\xcc\xc8\x5c\x8b\xf9\x82\xe7\xfb\x6e\xbf\x4b\xfd\x27\x3f\x8b\xc2\x86\xf7\x6c\x88\x20\x68\x4d\xb7\xd6\x60\x67\x4b\xd0\xe0\xb4\x0a\x52\x6d\x76\xda\xc5\x4b\x30\x53\x7b\x39\x14\x23\x4a\x53\x5f\xa5\x71\x70\x26\x9b\xf9\x17\x5a\x23\x91\x33\xb4\x2c\xc1\x54\x5f\x08\x9a\x63\x41\xb3\x5d\x73\x08\x9c\xf9\xf8\xcd\x35\x77\x37\xf4\xce\x5c\xc7\xf5\xf4\x2f\x3e\x5e\xde\xa2\xeb\x8f\x77\xd0\x13\x49\xdf\xac\x60\x45\x87\xbf\x03\x62\x96\xc4\x8f\x06\x5b\xdb\xda\xb4\x5e\x85\x4f\xcc\x39\xa7\x12\x9a\x30\x13\xe8\xf2\x6e\xb5\x72\x57\x0a\xea\xc5\xeb\x05\xfc\x9f\xaf\xec\x35\x4e\x53\xa1\xb9\x79\xe5\x84\xd8\xcb\x1f\xd0\x5c\x16\xf8\x3d\x5d\x66\x8d\xbd\xb3\xd8\xfb\xc5\x3a\x83\x55\xce\xc4\x1b\xbd\xec\x66\x83\xb0\x6a\x23\x01\x21\xa6\x5e\x29\x34\x21\xf5\xf2\x81\xc1\xbe\x66\x91\xf5\x2a\xeb\x09\x45\xd7\xcb\xab\xf9\xb5\xbb\x4c\xed\xa1\xe0\x8d\x92\xd6\xe8\xea\xc6\x6d\x4b\xf8\x42\x83\x32\x62\xd5\x5d\x68\x8b\x41\x03\x60\x63\x92\x98\xa1\xd7\xe8\x4f\xe8\x11\xfd\x09\xae\xd6\x3f\x84\x80\xc5\x71\xd0\x38\xb1\xd6\x48\x6d\x57\x37\xd1\x58\xf9\x41\x1f\x01\xfd\x8d\x5e\xb9\xe2\x68\x49\x59\x6a\x3a\x34\xb9\xa6\xc3\x16\x5b\x4f\xae\x70\xa8\x07\x39\xea\x86\x81\x75\x02\x5d\xad\x1a\xb5\xc2\xc2\x92\xe2\xc8\x2d\xd3\xa0\xb5\x24\x7b\x6d\x88\x3c\x6c\x9e\x6e\x55\x2c\xab\x47\xca\xb1\x4a\x36\xed\x13\xa4\xaf\x70\xa9\x6a\x22\x0e\x0b\xc3\x29\x07\x0d\xc1\xb8\x03\x37\x34\x48\x95\xc7\x25\xa4\x51\xcd\xf7\x5a\xbb\xb0\x87\xe9\x3d\x41\x71\x40\x08\x4f\xdd\xcd\xda\x48\x87\x2a\x78\x6a\xae\x6a\x98\x54\xda\x60\x37\xee\x56\x0e\x02\xed\xde\xd8\x36\x44\xa5\x52\x9d\x81\xbe\xf4\x49\xb0\xdd\x38\xa1\x82\xa5\x18\xc8\x58\xd0\xa7\xa5\xea\x81\x17\xdc\x98\xa8\xf3\x51\x08\xae\x78\xc2\x83\x35\x23\xdb\x26\x61\xfb\x81\x69\xdd\x6f\x28\xcb\xe2\xfc\xfb\x8b\x9b\x99\xd6\x08\xa1\x78\xde\xed\xf9\x90\x55\xae\xd5\x1e\xee\xee\xfc\x26\xd8\xa6\x26\x62\x31\xc3\xe5\xbc\x5b\x2c\xdc\x27\x96\x3f\xad\xf6\xa4\x20\x38\xa5\x47\x8b\xad\x71\xad\x0e\x2b\xa8\x63\x82\x6c\x72\xbe\x25\xa9\xb9\xc0\xeb\x96\x89\x29\x34\xe4\x95\x81\xc8\x9b\x61\x19\xf2\x0b\x58\x06\xa7\xc8\x9b\x29\xf2\x66\x8a\xbc\x99\x22\x6f\x02\xef\x4c\x91\x37\x53\xe4\xcd\x14\x79\xd3\x8b\x96\x29\xf2\x66\x8a\xbc\x99\x22\x6f\x1a\x2f\x4d\x91\x37\x76\x52\xff\x34\xfe\xa9\x29\xf2\xa6\xfd\x4c\x91\x37\x9d\x51\xa6\xc8\x9b\xaf\xc3\xa7\x36\x45\xde\xb8\x67\x8a\xbc\x99\x22\x6f\xa6\xc8\x9b\x29\xf2\x66\xef\x99\x22\x6f\xa6\xc8\x9b\x29\xf2\x26\xbc\x4f\x55\x37\xef\x18\x17\xca\x39\xcf\x8b\x52\x11\xf4\xa9\x6a\x57\x5f\xf5\x4c\x5f\xee\x8c\x5f\xb0\x71\x38\x9e\xcb\xcd\x61\xda\x76\x95\x02\x42\x45\x4e\x4d\x2d\xc4\x79\x62\xa6\x36\xaf\xd6\x33\xaf\x66\x72\x7a\xa8\xab\xc3\xf4\xce\xf7\xd3\x43\x1d\x1f\x73\x13\xc5\xf8\xa3\x18\x57\x1b\xe3\xef\x61\x0a\x0d\x43\x8b\x69\x16\xf5\x08\xe4\x8b\x73\x5e\x9a\x12\x90\x76\xf5\x81\xb1\x2b\xbc\x18\x33\xd1\x97\x43\x3b\x8a\xef\x19\x4c\xe4\x17\xc6\xfe\x27\x3b\x89\x7d\xfc\x5b\xf6\x71\x18\xfe\xdd\x91\x81\x08\x84\x6a\x04\x2a\x11\xcf\xa9\xd2\x72\x8a\x16\xf6\x1a\xd1\x42\x21\xaf\x06\x55\x2d\x1b\xaa\xa5\x16\xf0\x39\x62\x65\xaa\xa0\x56\x6e\x8e\x66\xcf\x35\xd7\x4d\x2d\x84\x2e\xa8\x7c\x5b\x49\x4b\xb0\xeb\x73\xd7\x7c\x17\x18\xe7\x57\x4d\x41\x03\x2f\x68\x79\x5f\x50\xb5\x3b\xe7\x4c\x91\x47\x8f\x04\xd3\x26\x86\x5b\xfb\x89\xed\x2a\x28\x2b\x51\xca\x3a\x31\x45\xc9\x20\xaa\x21\xe2\x2a\x89\x41\x96\xe9\x36\x76\xea\x26\x0a\x58\x21\x8f\xea\xd4\x03\x32\x6e\x2b\x14\x96\xf7\xf5\x3e\x90\xb9\xbe\x9c\x6a\x74\x77\xc6\x3a\x94\x71\x02\x8b\xb9\x11\x74\x4b\x33\xb2\x26\x97\x32\xc1\x19\xec\x79\xac\x08\x70\xe6\xf9\xde\x75\x55\x94\x55\x17\x4d\x5f\xc7\x6c\x3b\x4f\x10\xea\x12\xcc\xd0\x1a\x53\x86\x72\x8d\xa3\xc2\x81\x85\xee\x7b\x0c\x3a\xbc\x15\x58\x68\x85\xc0\x7e\x10\x92\xb8\x20\x30\x6c\xc9\x79\x66\x3d\xb2\xd9\xae\x9e\x93\x75\xf5\x33\xfe\x23\x23\x0f\x3f\xea\x71\x24\x5a\x65\x78\x1d\xea\x45\x8d\x6c\x45\x58\xa2\x3a\x25\x5b\xaa\xe9\x20\x1f\x3a\x42\x8c\x41\x82\xf8\x87\xb0\xe9\xc0\xd8\xdb\xee\xfb\x2d\x7a\xf3\x0a\xa8\x16\x4b\x54\x41\x0f\x19\x55\xbe\x7d\x05\xd6\x97\xf3\xb3\x9b\x1f\x6f\xff\x76\xfb\xe3\xd9\xc5\x87\xab\xeb\xa1\x23\x1a\xee\x53\x9a\xe0\x02\x2f\x69\x46\xc3\xbc\xbb\x63\x05\x6f\x7e\x06\x8c\x2a\x4d\x4f\x53\xc1\x0b\xb3\x4e\x51\x32\x88\xd7\xac\x63\xb0\x22\x0c\x19\xce\x07\x55\x85\x77\x9a\xd6\xdc\xed\xa1\xd6\x02\x33\xe5\x84\x9d\xa1\xfa\xdc\x06\xcd\xa2\x64\x5a\x50\x7d\xaa\xc7\x0d\xa7\x63\x82\x12\xce\xd2\x94\xa4\xad\xa9\x1f\xd9\x07\x74\xee\x40\xef\xea\x88\x51\x74\xf3\xf1\xf6\xea\x7f\xc6\x8f\x8a\x2c\x8d\x44\xb9\x07\x8e\xe4\xc1\x46\x48\x93\xc9\x08\x4c\x7e\xb2\xd1\x3d\x13\x2e\x3d\xef\x0c\x54\xf2\x77\x5c\x25\xf2\x70\x7f\x2a\x59\x3b\x32\xbf\x86\x80\x72\x9e\x92\x05\xba\x31\x4c\x11\xba\xed\x06\x79\x7f\xf5\x5d\xcd\x06\xc0\xfc\xab\x3f\x66\x8a\xe2\x2c\xdb\x21\x2d\x89\x6d\x71\x46\x8c\x0b\x59\x70\xaf\xb6\x82\xea\x92\x5a\x26\x2e\xb5\xc9\x35\x56\x38\x93\x81\x03\x1e\xc3\x07\x35\xab\xff\xa0\x85\xc9\x48\x3c\x55\xef\xa3\x94\x30\xae\xac\x5c\xaa\x47\x82\x80\x5a\xc1\x13\x64\x64\x53\xe3\x86\x08\xac\xaa\x0e\x27\xaa\x98\x25\xb0\x58\xc7\x06\xa9\x74\x6b\xbd\xa9\xc6\x04\x4d\x3c\x00\xb3\x94\x44\xee\xdd\x36\x96\x0d\xd6\xd2\xaa\x1e\x57\x10\x9c\x42\x6c\x58\x81\xd5\x06\xec\x9a\x01\xa0\x39\x96\xf7\x24\x35\xaf\x2e\xcc\x3d\x6c\x25\x69\x69\x3b\x00\xd8\xe9\xdd\x69\x2c\xac\x08\x56\xa5\x20\x70\xff\x86\x85\xdc\x25\x41\x84\xe1\x65\x16\x8a\x3c\x8b\x0a\x8a\xc4\xe9\x47\x96\xed\x3e\x71\xae\xde\x55\x21\x55\x91\xdb\xf9\x43\xd5\x13\xbc\xa9\x41\xc3\x65\x0b\x46\xca\x74\x0e\x68\x82\x40\xae\xb8\x4a\xe6\x17\xf5\xf6\x1d\x81\x3c\x45\xc9\xce\xe4\x77\x82\x97\xb1\x4d\x39\x34\x05\x7d\x77\x75\x01\xa7\xaa\x34\xe7\x86\x30\x25\x76\x10\x14\xd9\xc9\xe0\x19\x96\xe1\x16\xe8\x7b\x4d\x53\x7b\x54\xa4\x25\xae\x92\x49\xa2\x16\xe8\x03\xde\x21\x9c\x49\x6e\x85\xa9\x90\x64\xc4\xd0\x0d\xf8\x4c\x9a\xf2\xff\x02\x41\x8c\xb3\x89\xbb\x58\x72\xb5\x41\x7b\x2f\x0c\x10\x67\x17\xa2\x09\xdf\x33\x06\xa6\x3a\x41\x89\xb2\x7d\xc0\x21\xe2\xc4\xf7\x44\xa2\x42\x90\x84\xa4\x84\x25\x81\x3d\x6c\xd8\x8a\xfe\xf0\xfb\x27\x99\xef\x61\xa7\xaf\x39\xd3\x64\x1c\xb9\xd7\x57\x2c\xa5\x09\x36\x3c\xc8\x76\xb3\xae\x49\x18\xac\x9a\x56\xc6\xc4\x10\x03\x37\xc0\x65\x4b\x49\x84\xe9\xee\x2c\x4a\x62\x90\xf8\xd7\x72\x49\x32\xa2\x4c\xc4\x2d\xc4\xf5\x63\x65\x5a\x09\x98\x86\xf2\x58\x39\xc2\x08\x9f\x74\xc2\x64\x09\xed\x42\xb4\x6a\xac\x50\xca\x49\x1d\xaf\x88\x25\xfa\xfe\xea\x02\xbd\x46\x2f\xf5\xfc\x5e\x81\x8f\x65\x85\x69\x48\x6c\x57\xdc\x78\x61\xf6\xe5\xea\x95\x03\x0e\xcb\x00\xfa\x44\x5c\x98\x63\x38\x43\x2c\xe4\xf3\x81\x6e\x31\x76\x85\x5a\xdd\x71\x31\xc6\xd6\x33\x07\x46\x9b\x36\xa1\x07\xc8\x39\x34\x4e\x98\xd0\x7d\xe4\x1c\x80\x38\x4c\xe8\x23\xc8\x39\x9a\x25\x7d\x2f\x89\x18\xc1\x91\xbe\x3f\x2a\x47\x6a\x8a\x00\x9a\x6a\xdb\xab\x37\xa4\x99\x13\x85\x53\xac\x30\xa2\xa1\xed\x28\x59\xa3\x23\xc8\xaf\x61\x83\x8f\xc7\xaf\x24\x79\x4f\x59\xf9\x68\x5c\x64\x63\x54\xc8\xdb\x4b\xf8\x10\x25\x6e\xf2\x80\x70\x5c\x14\x19\x35\x01\xc2\xed\x3c\xca\x00\x66\xcc\x21\x6f\xa6\xc7\xf4\x09\x3e\x70\x94\x71\x96\x71\xcd\x2a\xf5\xad\x8e\x59\xca\xf3\x00\xd8\xfd\x09\x6a\x81\x89\xe0\x64\xd3\xb4\xb0\xf7\x10\xcb\xa8\x4b\xea\x9f\xfc\xda\x8b\x53\x9d\x33\xb2\x25\xc1\xb4\x9b\xfd\xec\x5a\xfd\xbe\x16\x9c\xdc\x0e\x00\x00\x94\xe1\x25\xc9\xcc\xe5\x61\xa8\x24\xd2\xd9\x1a\x45\x43\xd1\xaa\x99\xe0\xd9\x98\x60\xa4\x4f\x3c\x03\xff\x16\xae\x16\xa3\x01\x7c\x25\x6b\x81\xd7\xe2\xd7\x02\x72\x7d\x6b\x2d\xa0\xef\x7c\x1d\x6b\x29\x83\x37\x51\x67\x2d\xfa\xe2\x6a\xaf\x05\x6e\x90\xaf\x61\x2d\x11\x6a\xfd\x03\x65\x29\x7f\x90\xe3\x99\xee\x0f\xe6\x43\xc7\x19\x12\xcd\x7a\x14\x65\x6b\xd9\x64\xbc\x38\x68\x2c\x6d\xea\xa9\x7d\x9c\xd7\x19\xe7\xab\x7c\xea\x2e\x8f\x0a\x40\x77\x02\x57\x29\xad\x7f\xe6\x80\x8b\x34\x44\xf1\x51\xbc\xf1\xe8\x1c\x70\x9d\x4b\x7c\x2e\x34\x2c\x45\x71\x76\x5b\x8c\x6a\x7b\xf6\xdd\x87\xdb\xb3\xf6\xc7\x9a\x70\x1f\x20\xe5\x5e\xaf\x47\xff\x1d\xe1\x34\xa7\x52\x86\x4d\xd2\x80\x5f\xb2\x84\x76\x74\x2f\x9d\x8f\x62\x4d\xd5\xa6\x5c\x2e\x12\x9e\x37\xdc\x15\x73\x49\xd7\xf2\xd4\x52\xd9\x5c\xcf\xfe\xd5\x00\x5c\xca\x32\xca\x1a\x46\x07\x48\x60\xb7\x42\x1d\x4c\x30\xa9\x56\x00\xa8\x37\x99\xa6\x03\x40\x8d\x95\xb7\x07\x01\x26\xbb\x94\x92\x2c\xb5\x86\x08\x13\x8e\xad\xcf\x73\x56\x6c\xf0\x1c\x2e\x8c\x01\xe0\x36\x67\x0c\xf4\xfa\x0d\x67\xdc\xfa\xd0\x4d\xcc\xb1\x55\xa5\x8c\x5d\x02\x26\x61\x4f\x8e\x9e\xcb\x00\xe0\xa6\xe5\xe3\x28\xac\xad\x4b\x3d\xd7\x83\x81\xf5\x03\x14\x04\x08\xb4\x19\x73\x8d\x68\x9c\x81\x95\xf5\x6e\xa4\x11\xbe\x7f\x0d\xfb\x50\x69\x3c\x23\xd1\x0f\x9a\x8f\xfd\x4c\x73\x1b\xc7\x84\x7b\x35\xa1\x81\x45\x75\x6a\xaf\xf4\x6a\x43\xfa\x95\xb6\x46\x34\x78\x7c\xbb\xfa\xd2\x90\x56\x34\x00\xb2\x4f\xd8\x7d\x92\xac\xdb\x0f\xf4\x08\xf2\x2e\xea\x93\x79\xf7\xe8\x79\x49\x94\x25\x67\x20\xd8\x1c\xef\xd0\x72\xe8\xb8\xa4\x54\x82\x59\x13\x9c\xd2\x4d\xe2\xfd\xd4\x24\xa4\x63\xd3\xe9\x93\x1d\xf3\x26\xb0\x35\x3a\xab\xfb\xb6\xf1\x3e\xa2\x5d\x53\xd4\x0d\x4f\x4d\xc8\x78\x15\x94\xeb\xed\x7f\x68\x43\xd7\xe9\xcf\xee\xee\xaf\x25\x0b\xc6\x4d\xcc\x44\x33\x8e\xdc\x35\x98\x35\x4d\x53\x3d\x30\xad\x45\xd7\x36\x5f\x6d\xcd\xc2\x58\xb9\x36\x54\x36\x93\xc3\x67\xd5\xa4\x03\x4e\xe3\x66\x6b\x87\x19\xfa\xef\x52\x2a\x84\x2b\xf7\x73\xab\xe7\x44\x15\x73\x0c\xe4\x94\x78\xad\x29\x2e\x17\x4b\x71\x3d\x99\x2d\x4d\x09\x4a\xe9\x6a\x45\x9c\x5b\x7c\x49\x50\x81\x05\xce\x89\x02\x37\x8a\x41\x2d\x74\xe1\x65\x7e\x62\xe0\x2b\x84\x5d\xaf\xdb\x2a\x02\x6e\x66\x7c\xb4\x54\xa1\x9c\xae\x37\x46\xd6\x41\x18\x65\x9c\xad\x21\xa2\x4f\x4f\x21\xe3\xd8\x77\x12\x81\x39\x70\x81\x1e\xb0\xc8\x11\x46\x09\x4e\x36\x60\x25\xc4\x0c\xa5\xa5\x80\x04\x4f\x45\x70\xba\x9b\x4b\xa5\xf5\x6c\x2d\x1d\x81\x29\xcd\x60\xc0\xeb\x85\xee\x74\xc2\x00\x7c\x51\x13\x89\xac\xef\x92\xea\x98\x58\x5f\x81\x13\x0e\x9a\xe4\xe7\x81\xde\x3a\x60\x53\x4a\xff\xde\x33\xa5\xf4\x4f\x29\xfd\x53\x4a\xbf\x7b\x73\x4a\xe9\xef\x3c\x53\x4a\xff\x94\xd2\x3f\xa5\xf4\x4f\x29\xfd\xf0\x4c\x29\xfd\xe3\xe7\x36\xa5\xf4\x4f\x29\xfd\x53\x4a\x7f\xe3\x99\x52\xfa\x3b\xa3\x4c\x29\xfd\x5f\x47\xb2\xde\x94\xd2\xef\x9e\x29\xa5\x7f\x4a\xe9\x9f\x52\xfa\xa7\x94\xfe\xbd\x67\x4a\xe9\x9f\x52\xfa\xa7\x94\xfe\x21\x17\x5a\x4a\x3d\xa9\x96\x31\x59\x07\xd6\x80\xdf\x88\x55\x5c\x96\xab\x95\xd6\x50\xb9\xf7\xb2\xd6\x23\x76\x2c\xd1\x55\xee\x5b\xe5\xe8\xb2\xd6\x64\x49\xd4\x0c\xd2\x1a\x4c\x98\xce\x38\xa0\x36\x90\x12\xd2\x1a\x05\x91\x90\x06\xc0\xd0\xe5\xc7\x77\x8b\x46\xd2\x83\xd7\x94\xe9\x4d\x85\x18\x8a\x39\x86\xd9\x7c\x64\x49\x8c\x53\xb2\x46\x6c\x5f\x24\xa8\xc5\x6f\x92\x71\x69\x62\x0a\x00\xb4\xcf\x35\xb5\xc1\x8c\x11\x27\x75\x50\x05\xb2\xf2\x92\x10\x86\x78\x41\x98\xf1\x43\xb9\xb6\x0c\x08\x2b\x85\x93\xcd\x42\x8f\xcf\x82\x50\x5d\x76\x68\x35\xba\x66\xbd\x04\xe7\x06\xb9\x82\xe4\x98\x9a\x01\x10\x4e\x04\x97\x12\xe5\x65\xa6\x68\x51\x0d\xe1\xdb\x31\x02\x31\x40\x26\x32\xab\x42\x18\x38\x16\x88\x31\xc5\x43\x4c\xbf\xdd\x58\xe9\x96\xc0\xd9\x60\xe0\x35\xc8\x46\x33\x48\x68\xcf\x0b\xb5\x33\x2e\x57\xe3\x78\xa2\x42\x2a\x94\x64\x14\xae\x7f\x98\x9d\xc9\x09\x85\x51\x66\x01\xa7\xbe\x82\x5c\x51\x58\xab\xb4\x8b\x65\x29\xdc\x1a\x85\x92\xc6\xd1\x58\x0f\x63\x07\x48\xa9\xb4\x77\xb4\xf4\x79\x26\xb0\xeb\x1d\x62\x36\xdb\xad\x15\xb6\x3b\x85\x21\xdc\x98\xf6\xa7\xc6\x20\x03\x58\x80\x94\x27\xab\x28\xd5\x87\x0a\x52\x8c\x5d\x9e\xcf\xac\xd5\x67\xa4\xa8\x92\xe5\xd4\x06\xfb\x2b\x2d\xb8\x83\x68\x67\x0b\x44\xc0\xc8\x56\xd3\x2c\x49\x88\x16\xa1\x71\xe7\x84\x99\xe1\x0e\x3a\x4a\x8a\x88\x9c\x32\x70\xcb\x7e\x20\x52\xe2\x35\xb9\xf1\x1a\x78\x7c\x62\x13\xd8\x78\x6a\x54\x03\x21\x64\x20\x43\xd5\xbf\xd4\x2e\xb1\x13\x1f\x43\x68\x4c\x05\xe5\x66\x2e\x55\x0c\xe0\x83\xa0\x4a\xeb\x54\x54\x9a\x5c\x3a\xb0\x6b\xee\x07\x5c\xfa\x41\x37\x9d\x70\x1f\x1c\xe8\x1a\xa4\xe6\xef\x2c\x35\x8e\xab\x25\x41\x4b\x41\xc9\x0a\xad\x28\xc3\x99\xf5\x40\xf9\xe8\x0b\x72\x44\xb0\x11\xa8\xa5\xd4\xa2\x29\x67\xce\xb1\xe2\xd6\xb0\x40\x3f\xd8\x45\x28\x51\xb2\x04\x0f\xe6\x2c\x33\x9e\x12\x44\x57\x68\x0d\xde\x2e\x61\x1c\xea\xbf\x7f\xfd\xef\x7f\x40\xcb\x9d\xbe\x11\xc1\x50\xa9\xb8\xc2\x59\x85\xa6\x8c\xb0\xb5\xde\x03\x60\x10\xbe\xb3\x90\x65\xcd\xf4\x4b\x87\x59\xa8\xab\x62\x96\xfe\xe6\xdb\xfb\x65\xfb\x4a\x3f\x4d\xc9\xf6\xb4\xb1\x2f\xf3\x8c\x7b\xe3\x52\xba\xcd\x70\xfa\x2f\xdf\x01\xf1\xb2\x87\x20\xa1\xf8\x42\x04\x49\xba\xe4\x27\xb4\xe1\x0f\x26\x07\xb3\x87\xa2\x6a\x97\x78\xc1\x8b\x32\xf3\x77\xed\x41\xe8\x9d\xa6\x62\xc0\x53\x69\x6f\x87\x56\x38\x63\xef\xc9\x01\x45\xdf\x02\xf6\xf3\xba\xe6\x0d\x6f\x5c\x9c\x6e\x7a\xdc\xc6\x43\x59\x25\xb7\xca\x7d\x2a\x05\x59\xa0\x77\x38\xcb\x96\x38\xb9\xbf\xe3\xef\xf9\x5a\x7e\x64\x97\x42\x78\xc5\x80\xd6\xbc\x33\xac\xf9\xf2\xa6\x64\xf7\xed\x56\x0b\x19\x5f\x6b\x39\xae\x28\x95\x8b\x58\x69\xac\xca\x03\xd8\xcd\x14\xce\x78\x75\x09\x60\xdb\xcb\xa6\x86\x4d\x1e\x81\xae\x20\xe0\x09\x33\x44\xf4\x5c\x7d\x98\xd6\x14\xdd\x9c\x8b\x6c\x92\xe5\xb7\xaf\x7f\xff\x47\x43\xfa\x5a\xbb\xf8\xe3\x6b\x70\xfe\xcb\x99\x61\x2e\x9a\x33\xfa\x39\xb4\xcc\x71\x96\x69\x45\xa2\x49\xd4\x7a\x5b\x17\xb1\xbd\x9b\x86\xa8\x55\xc5\x10\x66\xb4\x70\x77\x77\xf7\xb7\x80\x64\x47\x95\x24\xd9\x6a\x66\x62\xef\xaa\x7c\xdb\x13\xb8\x28\x4e\x2c\xef\xd2\xb7\x7a\xf7\x6a\x38\x4c\xcc\xda\xf2\xac\xcc\xc9\x05\x81\xa6\x2b\x11\xcb\x6c\xbd\xef\x22\x36\x32\xdb\x1f\x6d\x99\xf1\xe4\x1e\xa5\xf6\x8f\x30\x59\xcf\x32\xc1\x6b\x65\x43\x7a\x1a\xba\x60\x15\x05\x04\x01\x78\x2e\x92\xe7\xa9\x1d\xb7\x9a\x73\x6e\xf9\xdb\x72\x5c\x14\xd0\x68\x6c\x05\x09\x42\x0f\x66\x01\x01\x1d\x0b\x20\xd8\x4e\x3a\xf8\x38\xdd\xb7\x0c\x50\xff\x85\xdc\xb3\x9e\xfa\x13\xb7\x01\x05\xfc\xb7\x89\x17\x19\x91\x5a\x87\xea\xb0\xbd\x6a\x6d\xe6\xc6\xd0\x98\x81\x93\xf9\xe4\x3e\x3c\xa3\xfa\x1e\x81\x59\xa1\xd1\xe9\xa9\x19\xaf\x8c\x51\x41\x84\x84\xe6\x70\xea\x33\xec\xe8\x79\x86\x69\x28\xa3\x0b\xa1\xba\xe1\xd1\xd3\x96\x31\xdc\x81\xa7\xde\x13\xef\x2b\x01\x6f\xdf\x13\x7b\xf3\x18\x02\x87\x64\xfc\x98\x33\x7c\xc3\x53\xfb\x09\x1c\x52\x53\xb8\xa0\x47\xd4\x92\x11\xb9\xef\x47\x6f\x8f\xf7\xb9\x5e\x4b\xfb\xac\xea\x5f\xaa\xc3\x6a\xde\xb2\x47\xd1\xbb\xb7\x47\x3a\xa2\x30\xf4\xa8\x13\x0a\x67\xb3\xd1\x71\xab\xbe\x0f\x5a\x22\xb4\xd9\x84\x20\x05\xd7\xa2\x8c\x95\x89\x17\xc8\xd8\xb4\x35\xd6\x2d\x58\x74\xf2\xf6\xe4\xc9\xe7\xd4\x2c\x52\xf0\x02\xaf\x07\x4a\x47\xed\xad\x75\xff\x43\x94\x12\x23\x60\x10\x09\x42\x1a\xfc\x1d\xdc\x46\xc1\x85\x16\x16\x82\xeb\xec\xe4\x7c\x7c\xd6\x4c\xeb\xd0\x67\x45\x10\x13\x1c\xfc\x10\xf4\x62\x23\x84\x05\x2f\x59\x6a\xf5\xf3\xca\x10\xf2\x61\x6f\xc2\xd7\x9c\x81\x90\x63\x72\x90\x02\x61\xab\xe6\x69\xc5\x88\x6b\x0e\xf3\x66\xf1\xe6\xf5\x2f\xcb\x26\xef\xf6\x1a\xe2\x69\x8c\x5c\x57\x6c\xd2\x9c\x8d\x27\xcf\xc8\x15\xd8\x88\x9e\xd5\x07\xab\xb4\xd5\xf5\x33\xa8\xab\x2a\x00\x3f\x69\x65\x8c\x44\x95\xc2\x43\xe8\x25\x88\x34\x5a\x16\x6c\x64\x25\xbc\x1a\x55\x06\x26\x2e\xad\x5d\xeb\x77\xcb\x27\x9d\x6d\x73\x88\x0d\xd1\xf6\xe9\xc2\x61\x6a\xb2\x5f\xf7\x1c\xf3\x56\x17\xb9\x17\xe8\xa5\x79\xf3\x44\x42\x2c\xea\xab\x27\x6f\xaf\x5d\xf6\xe5\x63\x11\xcc\xa3\x6c\x2d\xfd\xf2\xb1\xc0\xa0\x43\x17\x43\x38\x18\x10\x3a\xda\xb7\x8c\x1f\x07\x7f\x26\x1b\xbc\x25\x10\x27\x4b\x33\x2c\xbc\x99\x04\x16\x2e\x47\xb7\x66\x55\xd0\xec\x96\xb0\x2d\x15\x9c\x81\x9f\x6a\x8b\x05\x85\x9c\x22\x68\x45\x48\x98\x96\x4f\x7f\xfb\xf2\xf3\xd9\x27\xf0\x0f\x84\xb3\xdd\x4c\xee\x81\x5d\x79\x29\x21\x06\x61\x6f\x05\x8d\xa1\xea\x8d\x1b\x9a\x6b\xcf\xa6\xba\xf9\xeb\x5d\x01\x5e\xe7\xd6\xa3\xe7\x90\x97\xaa\xc4\xfe\x6c\x0a\xf3\x90\xc7\x24\x2b\x25\xdd\x3e\xf5\xfc\x0f\x4b\x3c\xd5\xad\xf8\x05\x04\x1e\x1b\xd2\x7d\x41\x3d\xb4\xdb\xdf\x70\xf7\x44\x76\x63\xc1\xc1\xac\xc7\xb8\x1a\xee\x7a\xda\x6b\x5c\x3e\x91\x55\x6d\x9c\x66\x2a\xab\x55\x5c\x6d\xca\x85\x57\x0b\xaa\xea\x42\xa6\x5d\xb3\x3b\xe4\x67\x1d\x47\x85\xf5\xef\xa5\x67\x8f\x02\xbb\xe3\xdb\x17\xc8\xa4\xee\xc8\x50\x71\x25\x63\x03\x93\x6f\x17\x0a\x80\x31\x6a\xac\x99\x54\x3a\xd7\x58\xd7\xe4\x72\x17\x98\x9a\x00\xd0\xbb\x0d\x66\x5c\x7e\x2a\xb3\x3e\xd9\xcf\xee\xb9\x4d\xbd\x49\x2b\xe7\x2f\x12\xa4\xc8\x68\x82\x2d\xb0\x9f\x14\x00\xf9\x51\x68\x28\x3f\xda\xbf\xfd\xd4\x9f\x29\xb4\x24\x7a\xb5\xae\x27\xba\xf9\x5e\x9f\xe0\x25\x81\x12\x78\x85\xd9\x63\x9c\x11\xa1\x3a\xe1\xa4\x5e\x7c\x9b\x5e\xd8\xef\x79\x82\x3b\x05\x15\x3a\x0d\xca\xed\x7b\x28\x87\xd4\x36\x8d\x1a\x83\x02\x04\xb3\xb7\xa0\x10\x67\x28\xe3\xbc\x58\xe2\xe4\xbe\x4b\xe8\x92\x77\x8b\xf5\x40\x07\x63\xbc\xc6\x94\xc9\x3a\xc1\xeb\xaa\x13\x4a\xe5\xbf\x6b\x33\xbe\x7e\x67\xfc\x70\xc1\x15\xf0\xb5\x75\xd7\x41\xa0\x46\x63\xf7\xac\xd1\xa3\x71\x56\xa0\xe8\x6b\xef\xf8\x3d\x34\x94\xf1\xf5\xfb\xbe\x82\x14\x9d\xd1\x4d\xb6\xdf\x71\x07\x67\x3c\x25\xb7\x24\x03\x56\xf3\xbc\x67\xe3\x02\x0a\x05\x5b\xb6\x73\xcd\x53\x57\xa4\x8d\xa7\x26\x62\x4b\x26\x1b\x92\x96\x19\x78\x7f\xa2\xc9\xcf\xfc\x74\xab\xb8\xc0\x6b\x72\x0e\x38\x08\xa2\xf1\x63\xf7\xfd\x1a\x75\xd2\x82\x43\xd2\xfc\x5d\x1f\x07\x83\xe9\xfd\xf9\x84\x74\xb2\x7b\xd2\x2b\x90\x76\x82\x7c\xef\xc9\xce\x59\x42\x24\x49\x04\xb1\x01\xee\x7a\x2b\x40\x4c\x71\x6a\x54\xdd\xbb\xba\x97\xaf\xda\x6f\xef\x49\x6f\x22\x49\x90\xeb\xfa\x24\xfa\x3d\x4f\x7d\x23\x90\xc2\xca\x26\x6a\x74\x50\x1d\xdf\x12\xb1\xa5\xe4\xe1\xd4\x5e\x6f\x73\x4d\xa4\x73\x83\x6e\x79\xaa\x27\x22\x4f\xbf\x81\xff\xe9\x5d\xa4\x09\xea\x39\x4b\x53\xab\x56\x95\x92\xac\xca\xcc\x28\x3a\x72\x81\x70\x41\x3f\x13\x21\x29\x67\x33\x74\x4f\x59\x3a\x43\x25\x4d\xff\xab\xcf\xf0\x1f\xc4\x07\x77\xbe\xa4\x21\x9c\xdc\xc2\x4d\xbc\xab\x4a\x0e\x43\xda\x9f\xd9\x07\x2e\xa0\x7c\xb0\xde\x5c\x17\xeb\x61\x2b\x64\x7b\x67\xd3\x2f\xfe\xfb\xae\xc4\xb9\x86\x1d\x7b\x3c\x0a\xac\xef\xfa\xe0\x89\x00\xcd\x13\xb7\x38\x4a\x4a\x8a\x8c\xef\x40\x2a\xa5\xd2\xc2\x80\x84\x57\x6c\xf3\xb4\xc8\xa3\xde\xd5\xce\x82\x34\x67\x4a\x49\x46\xfa\x0b\x95\xb9\xa8\xeb\x92\xa5\x44\x64\x3b\x30\x94\x98\xfd\x8f\xe7\xd4\x05\x4f\x3f\xd8\x7c\xf0\xe0\xa2\x6e\xea\xf7\x9c\xc0\x22\xdd\xe5\xac\xaf\xbc\x33\x2d\xb2\x60\xb3\x98\x35\x51\xb2\xa1\xdb\x77\xf9\x9b\x31\x3a\xa9\xe6\x55\x55\xf0\x74\x14\x4f\xc0\xf5\x78\x7d\xc4\x15\x5f\xb7\x7e\x40\x2e\xde\xab\x99\xdd\x58\xa5\x49\x5c\x2d\x6d\xb6\x1d\xdc\x13\x9a\x46\x4d\x6c\x4c\x8e\x0b\xe0\x79\x9e\x60\x5b\xe3\x3c\xa9\xea\xd5\x9b\x1b\xd8\x24\x9c\x83\x1b\x7f\xb9\xab\x65\x1c\xc5\x79\x66\x9d\xed\x9a\x43\xf8\x7c\xed\x82\x28\x41\xc9\x96\x20\x2c\x96\x54\x09\x2c\x76\x55\xa2\x3f\x78\x16\x77\x70\x25\xe8\xdb\xfd\xef\x25\x11\x3b\x50\x8c\x20\x22\x12\x34\xb0\x5e\x90\x9a\xd6\x04\x81\x70\xfe\xd4\x64\x14\xe7\x3c\xa5\xab\x16\xa1\xed\xb3\xad\x7e\xae\x55\x4a\x22\xe6\xeb\x92\xa6\xe4\xb4\xb1\x71\x7e\x76\xe2\x51\x12\xfa\x05\xce\x67\xdc\xef\x0f\xb8\x80\x80\x2a\x78\x5b\x6f\xaf\x21\x76\xd8\x63\xd9\x6a\x77\x6f\x33\xbb\x7b\x87\xe4\x62\x8d\x19\xfd\xd9\xe0\x3b\xc1\x8a\xac\xb9\xd0\xff\x7c\x29\x13\x5e\xd8\x5d\x80\x5b\xea\x55\x03\xad\x78\x67\x0c\x3d\x9e\x2b\xca\xc8\x17\xe0\xb0\xb4\x32\x6a\xb3\x76\x7b\x06\x19\xe4\x00\xd7\xb6\xd6\x1f\x8a\xd3\x8a\xda\x3b\x83\xff\x91\xdb\xe6\x67\xa5\x5c\xa8\xbe\x32\x1b\x7b\x7c\x47\xd8\xd0\x4d\xc0\x70\x15\x5c\x0c\x32\x0e\x4b\xd1\x5a\xdf\x83\x50\x89\xdc\x2e\xd5\x63\xcd\x6b\xa6\xcc\x3d\x90\x65\xac\x30\x57\x08\xca\xa1\xc2\x44\x86\xa5\x1c\x9e\xac\x7d\x1b\x25\xfa\x75\x84\xa5\xa4\x6b\x56\x57\xba\xd3\x82\x59\xec\xc0\x70\x48\x23\xc4\x2f\x2b\x03\xb6\xba\x3e\xf4\x66\x4f\x00\xaf\x05\xa8\x90\xbb\x87\x99\xa6\x8a\x3e\x25\xc9\x05\x91\xd9\x4b\xd6\xe4\x53\xff\x0f\xfd\xe1\x65\xd5\x70\xdf\xd8\x43\xdd\x85\x44\xd7\x50\xd2\x45\x13\x6d\xd1\xc5\xbc\x5d\xfc\x4f\x30\xf6\xc2\x4c\xf4\x27\x74\xfe\xfe\x0a\x61\xb1\x2e\x8d\xf9\xe4\x23\xcb\x76\x08\x6f\x31\xcd\x80\x2f\xd9\x62\x1a\x30\xe5\xed\xeb\xc5\x9b\x37\x8b\xd7\x3d\x17\x40\x8a\x36\x74\xbd\xe9\xaa\x7a\x93\x28\x39\x89\x92\xff\x0c\xa2\xe4\xdf\x5b\x67\x2a\x78\xca\xf7\x8e\x9f\x99\xb4\x74\xca\xbe\x06\x44\x89\x40\xa4\x3e\x9f\x7e\xa3\xac\xe2\x96\x0b\xe4\x5a\x60\x48\xa4\x39\xb5\xee\x94\xce\xe7\xe6\x8f\x10\xef\x06\x74\x55\xcb\x68\xfb\x24\xec\xf1\xef\x05\x76\xd1\x67\x48\xb2\x37\x58\x18\x07\xd7\x8d\xd4\xba\x86\xe0\x58\x31\x33\xbd\x04\x23\x67\xef\x4f\x34\x14\x12\xec\x0f\x04\xf6\x36\xed\xda\xeb\x5d\xe0\x5a\x0e\xb9\x4d\x31\x47\xd1\x0a\x76\x96\x50\x72\x08\x2e\xd2\x6c\xd9\x44\x91\x76\x90\xa6\xaf\x86\x45\xd7\x44\xc5\x78\xd5\xa3\xe9\xd4\x34\xca\xaa\x98\x6e\xb7\x00\x77\x88\xef\xf9\xbb\x6c\x3d\x93\xe4\x34\xae\xa7\x56\x8d\xec\xde\x91\xbf\x68\x37\xad\xa0\x44\x1a\xea\xa0\xf5\x4c\x98\x1d\xdb\x2f\x6b\x00\xb7\xa3\x3b\x65\x35\xfb\x61\xf5\xaf\xe6\x80\x1e\x59\xc1\x4e\x58\xbd\xa3\x7c\xc1\xee\x58\x87\x08\xbb\x82\x28\xc2\xfa\x7c\xec\x6d\xd1\x03\x0a\xef\x3b\x31\xae\x69\x41\x90\x1b\x0c\x51\xe3\xe0\xfb\x07\x2d\x7c\xc5\xeb\xf8\xb7\xce\x24\xa9\x44\x27\xdf\xfe\x7e\x73\x32\x33\xa5\xcc\xda\x6e\x63\x41\xd6\x65\x86\x85\xde\x13\x61\xa2\xc9\xd1\x4f\xff\xef\xeb\xf9\xbf\xff\xff\xff\xf7\xcb\x5c\xfe\x43\xfe\x23\xff\xc7\xe6\x1f\xe9\x3f\x1e\xfe\xb1\x7b\xf5\x53\x07\xf0\xcb\x9c\x66\x19\x75\x19\x26\xee\x7f\x73\xca\x4a\x05\xbe\xff\x52\x48\x94\x42\x37\x24\x42\xee\x25\xda\x11\x2c\x64\xc7\x71\xe9\xa5\x77\xc1\x4b\x45\x6e\x04\x59\xd1\xc7\x30\x9e\xf4\x2a\xf4\xbb\x5a\x41\x5d\xd1\xc7\x16\xaa\x04\x59\x53\x09\x35\xb4\x20\x1d\x7d\x83\x59\x0a\xfa\xd0\xaa\x2f\x4e\x11\xdc\xea\xb6\x02\x84\xbd\x57\xbe\xbf\xb2\x16\x60\xab\xf9\x72\x86\x30\x92\xe5\x72\x5e\xe0\x11\x66\x60\x7d\x3b\x69\xe9\x4c\x16\x38\xf1\xda\x83\x3b\x39\xe4\xf0\xb6\xac\xc6\xd7\x5f\xd9\x23\xa8\xd7\x26\x4d\x6c\xfc\x96\x58\x1f\x56\xb3\x30\x6b\x57\x60\xd2\x32\x35\x08\xb0\x5a\x46\x64\x0e\x38\xc2\x4d\x47\x81\xc1\x98\x35\xd2\x42\xc4\x74\x15\x15\x31\xe2\x76\x01\xd2\xba\xac\xa8\xa9\x97\xcb\xb5\xe3\x47\xf6\x3e\x30\xf1\x7f\x2e\xa4\xd0\x38\x52\x9c\x8e\xdb\xba\x43\xfb\x3d\x61\x77\x9b\xbd\x9b\x16\x0b\x82\xce\xae\x2f\xfa\x3d\x67\x81\xb8\xa4\x76\x83\xa7\xc0\x44\xcc\x84\xab\xbf\x18\x4b\x80\x35\x8b\xf5\x42\xb6\x0c\x4b\xce\x10\xd6\x32\xa2\x39\x97\x98\xd9\xe2\x69\x0e\x84\x20\x19\x76\x8d\x66\xb4\x94\x5a\x1b\x1b\xfa\x17\x3e\x1c\xc9\xe4\x51\x78\x7a\x96\xab\xc7\x73\xb1\x9d\xb0\x6e\xfd\x43\x15\x2b\x58\x2d\x75\xb8\x66\x72\x28\x80\x30\xc2\x0b\xed\x30\x12\x39\xed\x0a\x81\x55\x5f\x27\x69\x50\x7c\x22\x0d\x3a\x35\x7d\x6d\x68\x01\x37\x4c\x60\xd6\xb6\x15\x99\xc5\x36\xfa\xac\x75\xba\x0a\xb8\xa1\xa8\x2b\x36\x43\xd7\x5c\xe9\xff\xb9\x7c\xa4\xfa\x9a\x0c\x17\xfc\xba\xe0\x44\x5e\x73\x05\xef\x3e\x09\x25\x66\x52\x91\x08\xb1\xc6\x29\x5b\x57\x4f\xcb\xda\x0d\x13\x96\x5b\xde\xd5\xca\x16\x72\x36\xeb\x0b\x2c\x82\x4a\x74\xc5\xb4\xe6\x64\x57\x5e\x95\xe2\x94\x16\xb8\xd3\xa4\x18\x67\x73\x88\x19\x77\xd0\x03\x40\xab\x4d\xa3\xd2\xa1\x92\x8b\x16\xbe\x3c\x03\x05\x60\x2e\x09\xb2\xc3\x1b\x9e\x0e\xdf\x40\x36\x4f\x91\xe1\x84\xa4\xae\x76\x21\xd6\xb8\xc0\x8a\xac\x69\x82\x72\x22\xd6\xa1\x79\x16\x9a\x4f\xf9\xb7\x6e\xb0\x08\xd0\x88\x6a\x9e\xfe\xfa\x2c\xe1\xb0\x8c\x3e\x95\xd3\xfd\x25\xb8\xbd\x03\xe1\x18\xa1\x59\x01\xfb\x7e\xff\x0b\x1b\x63\x1b\x83\x1a\xee\x9b\x1b\xe3\xec\xff\xd2\xec\x14\x08\xe5\x7f\x9b\x48\x80\x05\x3a\xf3\xa9\x59\xfa\x69\xbe\x6f\x23\x30\x9a\xa0\x35\x54\x2d\xaf\xb6\xba\x96\x61\x86\x88\x11\x4c\xfb\x0d\xbc\xab\xce\x8d\x36\x43\x0f\x1b\x2e\x0d\x17\xaf\xa2\x07\x5f\xdc\x93\xdd\x8b\x59\xeb\xe4\xf9\xf2\x28\x5f\x5c\xb1\x17\xb3\x2a\xf4\xb1\x75\x0e\x2a\xf7\x0b\xdc\xf0\x2f\xe0\x6f\x2f\x16\x9d\x4b\xb0\x5f\x93\x0a\x5d\x8c\x07\xc9\xb5\x65\x16\x27\xdd\x74\x6e\xd3\xda\xa0\x66\x1c\xd8\x37\x82\xe7\x44\x6d\x48\x29\x8d\xa8\xe3\xa2\x94\x3b\x13\x05\x85\x24\xd3\x64\xa5\x4f\x33\xe4\xfa\x25\x5c\xa4\x94\x75\x52\x98\x26\x99\x65\x92\x59\x26\x99\x65\x92\x59\x26\x99\xa5\x81\x9b\x49\x66\x99\x64\x96\x5f\xb7\xcc\x32\xd0\x97\xbe\xed\x4d\xda\xeb\x5f\xb0\xe1\x59\x2a\x11\x14\x27\x81\xd8\x41\x07\x0b\x61\xa5\x04\x5d\x82\x15\xac\x8f\xc3\x26\x3c\xcf\x9b\x35\x18\xaa\xae\x3c\xf6\xe8\xa7\x9e\x0e\xd9\x3d\x2d\x16\x46\x08\x39\x2b\x7f\x43\xd1\xd6\x2a\x5f\x9c\x19\xab\x2c\xce\xa0\xee\x93\xb5\xc1\x66\x68\xad\xbf\x6e\xf5\x4a\xb2\xcd\x83\x1a\x19\xe7\xbd\x7b\x06\xb9\x92\x05\x4f\x17\xe8\x96\xe7\x55\xae\x80\xde\x11\x6b\x6d\x83\x45\xba\xa6\x93\x8a\x43\x0d\x8e\xb5\x89\xee\xe5\x0f\x1a\xec\x86\x16\x3e\xba\x85\xf9\x38\x90\x60\x29\xd3\x9f\x54\xb9\xa5\x05\x4f\xdf\xa2\xff\x8f\xa1\x37\x86\xbe\xf8\x03\x84\x07\x7c\x77\x75\xe1\x2f\xf7\xbf\x34\x23\xbf\xbb\x05\x74\xa1\x6f\xcd\x97\x92\xa8\x35\x4d\xd1\xd2\x94\xe8\xd6\x97\xed\x4b\x46\x1e\x4c\x82\x1c\x4a\x6c\xcd\x6a\x4f\x2a\x5a\x23\x43\xc2\x79\x6c\xaa\x49\xda\x61\x5e\xa1\xdf\x99\x71\x0a\x22\x6c\x67\x1f\x3d\x96\x3f\x6d\xea\xe3\xa7\x13\x9b\x77\x2d\x1e\xe6\xe2\x61\x3e\x9f\xcf\xf5\x3a\x5d\x03\xcc\x9e\x46\x9e\x8c\x2b\x1b\xb3\xe3\xbd\xdc\x2a\x6c\xc3\xc1\xad\xa7\x02\xa1\x25\x98\xed\xec\x2a\x16\x2f\x7a\xbe\x1e\x6a\x31\x18\xae\xb2\x13\x6e\x78\xfb\x84\x56\xb7\x55\xc3\x94\xde\x05\x8f\x6b\x72\xdb\xd3\x66\xc4\xdf\x17\xf2\xc0\x8e\x90\x81\x72\xaf\xa3\x5a\x58\xd9\xe8\x98\x5a\xac\xef\x4f\x81\x3c\xc2\xae\x05\x9a\xd7\x3e\x4b\xdb\xda\xe3\x37\xac\x3d\xb0\x55\x6d\xd5\x90\xd6\x7b\xe8\x47\x34\xa9\xdd\x6f\x45\xdb\x0b\x33\xae\x3d\xad\xaf\xe7\xa4\x8f\x39\x1f\x46\xa2\x03\xbd\x86\x0e\xec\xb2\x16\x4e\xd9\x0b\xf6\xa0\x7d\x42\xf7\xd9\x30\x93\x18\xd9\x77\xb6\xd3\x47\xa9\x5f\x90\x89\xdb\x33\xdf\xfe\xf4\xc3\x8c\xdf\xb3\xd8\x8e\x49\x5f\x84\xad\x0c\xf7\x98\x1d\xdf\x5d\xb6\x2d\xa7\xf4\x6f\xf4\x53\x1a\xcb\xba\x19\xf4\x02\x1e\xd9\x52\xf6\x5f\xed\x92\x19\xb2\xf2\x04\x1b\xc6\x1e\xd6\x2a\x76\xa8\x1b\xc2\x60\x5d\x80\x41\xcd\x37\xd4\x18\xf6\xb0\x96\xb0\xcf\x3f\xe7\x50\x03\xd8\xc3\x5a\xbf\x3e\xff\x9c\x43\x8d\x5e\x0f\x6b\xf1\xfa\xdc\x73\x0e\x1a\x26\x9a\x2a\x15\xc8\xbb\xc3\xfc\xed\xac\x32\x2c\x83\x0a\x26\xf7\x9b\x66\x9b\x8a\x7c\xf6\x0a\xb3\x9d\x83\x7a\x67\xde\x66\x3d\x33\x50\xcc\xac\xa9\xa3\xd3\xd8\xf6\x44\x9f\x73\x9a\x63\xb1\xd3\xc2\xb6\x9f\x03\xb5\x18\x26\xe3\x6e\x8a\x4e\x52\x31\x29\x91\x60\x81\xd8\x85\x11\x1b\xb0\x45\x0d\x77\x2f\x1f\x2a\xe1\x19\x32\x06\xc9\x9d\x4c\x54\xbf\x21\xa8\xad\xfd\x9b\xf7\x40\xeb\x6f\x18\xfb\xab\x60\x8a\xd4\x41\xaa\xa2\xd3\xbd\x72\x21\x28\xc3\x90\x9a\x07\x1a\x5c\xc9\xea\x02\xcb\x0e\xc6\xcb\xfd\xe2\x48\xee\xfe\xe9\xcf\x55\x37\x89\xc6\x4e\x2a\xcd\x70\xc9\xfa\xed\x7e\xb1\xbe\x03\xb3\xd8\x2a\x8e\x11\xa3\x7b\x22\x18\xa4\xd7\xda\xa6\x74\x55\x58\x4a\xbf\xdc\x30\x6c\xd8\x0f\x17\xbc\xe8\x69\xa8\x00\x15\x80\x0c\xd8\x9d\xed\xf0\xf2\x64\x9b\x74\xe4\x04\x3e\x83\xf0\x74\xdc\x19\x0c\x59\x45\xbd\xc9\xf3\xa1\x8e\x20\x4f\xb0\x89\x0e\xf7\x98\x3e\xb8\xbb\xf4\x41\x82\x97\xeb\x2b\xdd\xad\xb6\x75\x22\xa3\x44\xd7\x67\x6b\x2d\x1d\x27\x4e\x47\xa9\x3b\x43\xc7\x24\xbe\x91\xf4\x73\xb4\x90\x3e\x7e\xf3\xe8\xc3\xda\x46\xa3\x65\xa0\x9f\xda\x33\x34\x8c\x7e\x86\x16\xc5\x31\x4d\x5f\x07\x59\xc6\xb8\xc6\xd0\x87\xb5\x84\x46\xc1\x65\x8c\x6e\x06\xdd\xc4\xa5\x17\xea\x38\x1c\x1f\x07\x97\x51\xcd\x9d\x0f\x6f\xeb\x8c\x78\xbf\xb8\x84\x3a\x96\xa1\xc8\x86\xce\x95\xa9\xc1\x0b\x76\x44\x2b\xe7\x08\x4f\x42\xfd\x1c\xc6\x39\x83\x12\xf6\x21\xdc\x33\x5c\x98\x2b\xdc\xb8\x39\xb2\x35\xf3\x73\x9e\xde\xc3\x7c\x53\x90\xc5\x78\x96\x24\xbc\x64\xc3\xe9\x91\xb7\x9d\xd7\xfb\xce\x77\xfb\xad\xbe\x34\xd5\xd2\x84\xe0\x3b\xa2\xb6\x89\x45\x26\x3a\xf8\xa6\x27\x35\xdb\xbb\x72\x5b\xe8\x21\x3c\x69\x5b\x0c\xc2\xb1\x13\x69\x33\xb6\x36\xfc\xa1\x2a\x14\x61\xe2\xdd\xdd\x55\x3e\xc2\xe5\x05\xfe\x74\x4f\x91\xa0\x76\x22\xc5\xa5\x7d\xd3\xd4\x4e\xbb\xb5\x99\xd8\xbc\xca\xe6\xb5\xd2\x78\x1d\x97\xd4\x4b\x05\xb7\x0a\x2b\xb2\x2a\xb3\x5b\xa2\xe4\x7e\x47\x6b\xd7\xa7\x0f\x9c\xf9\x6d\x7f\x0a\xd4\xb1\xbc\x23\x79\x91\x61\xe5\xa9\xdb\x34\x32\xb5\xc1\x62\xee\xd4\x56\x79\x3c\xfd\x06\x30\x91\x52\xd1\x97\xc2\x30\x24\x84\xe4\x24\xa5\x65\x1e\xc5\x23\x4f\x7e\x00\xd3\xfe\xae\x20\x26\x66\xc3\xec\x9f\x01\x50\xd5\xf7\xc2\xc9\xbd\x49\x2c\xad\x8b\x30\x79\x4f\xde\x5d\xc3\xfd\x49\x25\x7a\xf1\xc2\x15\x56\x22\x98\x39\x83\xac\x21\x71\x9e\x92\x93\x46\x35\x26\x33\xa6\x1f\xf0\x87\xba\x55\x88\x29\x6e\x6c\x03\x4c\x5e\x5a\x00\xaf\x10\x17\xe8\x03\xc9\xa1\x44\xd4\xd3\xb0\x1f\x44\x3e\x8a\xb9\xac\x24\xfd\x99\x40\x1a\x4d\xdc\x26\xdc\x41\xdd\xf0\x3a\xf9\x27\x83\xba\x40\x6e\x37\x9c\xe2\x61\x8d\x77\x01\xa6\xea\x0e\x85\x73\xfb\x19\x47\x28\xfd\xd9\x16\x14\x37\x57\xbd\xe4\x46\xda\x4f\xe0\xae\xd6\x30\x73\xc0\x5a\xe0\x9e\x82\x9d\x01\x60\x2e\x09\xac\x74\x75\xb1\xcd\xb7\x8e\x62\xaa\x09\x3c\x78\xeb\x12\xa0\xda\x63\x9b\xb7\x3a\x92\x2c\x89\x7a\x20\xc4\xb0\xb0\x5b\x87\xbf\xc6\x9d\xa3\x85\xe1\xa0\x04\x08\x51\x63\x65\x0e\xc1\x11\x66\x56\x36\xeb\x4e\x9f\xdd\x76\x9d\xf5\xda\xc3\x7d\x17\xb8\xf5\x1a\x74\xcc\x68\xd6\x26\x64\xe7\x11\xab\x10\x5b\x32\x9b\xf0\x64\xa8\x2f\x20\x51\x47\x57\x5b\x38\x12\x39\x06\x75\xcc\x1e\x86\x16\x61\xdf\xba\xf9\x7c\x5e\x5d\x00\x5e\x8e\xdb\xe6\xae\x07\xf0\xb1\x3a\xf9\x38\xee\x18\x9d\xdd\x5c\xd9\xf7\x5b\xf9\x9c\x5b\xf3\x1b\x49\x4d\x5f\x43\x6c\x2e\xd6\xc0\x31\xaa\x02\xfb\x4c\x26\x17\xb0\x7e\x8b\xbf\x05\x5c\xc7\x9a\x84\x5c\x93\x12\xce\xb6\x44\x28\x08\x63\x5d\x33\xfa\x73\xa0\x41\x9f\x19\xbd\x12\x17\x21\xf0\x12\xca\xf8\x9a\x52\x21\x70\x0a\x66\x95\x10\x24\x08\xa4\xf5\x94\x2c\x02\xb2\x0b\xb2\xeb\x61\x7b\x6b\xaa\x16\xf7\x7f\x04\xf2\x4a\x78\x9e\x97\x8c\xaa\xdd\x29\x14\x9a\xa0\xcb\x52\x71\x21\x4f\x53\x2d\x7b\x9d\x4a\xba\x9e\x63\x91\x6c\xa8\x22\x50\x0f\xe5\x14\x17\x74\x0e\x8b\x83\xc4\x37\xb9\xc8\xd3\x6f\xaa\x14\xbb\x83\xf9\xe2\x3d\xf5\xf7\x99\x6f\xef\xe5\x5f\xa9\xd1\x43\x70\x2b\x90\xb0\xde\x1a\x57\xd4\xf1\xd3\xe5\xed\x5d\x95\x24\x19\x90\xe0\x69\x55\xcd\xaa\x0e\xdb\xac\x37\x53\x23\x9c\xb2\x95\xab\x06\x5f\xd5\xb3\x75\x49\xd9\x61\xd5\xc0\x74\x3e\x91\xe5\x12\xb8\x8d\xcb\x2a\x45\x8a\xf7\x55\x03\x44\x57\x0c\x9d\xe3\x9c\x64\xe7\x38\x54\x0c\xf5\x99\xb7\x12\x82\x79\xe6\x7a\x3b\x0e\xdf\xcc\xdc\x53\x7a\xa8\x7f\x43\x6f\x15\x66\x29\x16\xa9\xdd\x06\x7d\xf5\xd7\x25\x6e\x9e\x79\xb5\x6e\xa0\xf0\x52\x03\xc5\x2d\x65\xac\x21\xe7\x04\x6c\x37\x4d\xee\x93\x12\x09\x97\x77\xb2\xc1\x02\x27\x8a\x08\xe8\xbd\x67\x2e\x25\xff\x81\x36\xc1\x47\x96\x94\x5c\x13\xa3\x82\xa7\x08\x97\x6a\xc3\xc5\xc1\x12\x4e\x5d\x91\x7d\xee\x6e\x97\xfa\x27\xf3\x4b\xa2\xef\x02\x2f\x55\xc4\x94\xdf\x36\x7d\xe5\x3e\xf0\x34\xdc\x12\x70\x8f\x79\xd7\x1f\xd5\x01\x87\x4d\x04\xda\x6e\x75\xb9\x7e\x23\x00\xb5\x15\xbd\x65\x99\xf4\x06\x6f\xc7\x67\x1b\x07\x50\x66\xa6\x32\x87\xa9\xcc\xdf\x84\x5a\x0a\x46\x74\x1a\x8f\xec\xec\x17\xd3\x08\x5a\xd3\xb8\x51\x85\xc6\x55\xa6\x36\xca\x78\xd5\xbc\x42\x23\xd0\xea\x55\x0c\x17\x72\xc3\xd5\x45\x05\x38\xb8\x14\xb0\x23\x55\xca\xf7\x1a\x62\x7a\x40\x40\x30\x86\x21\xd3\xdc\x29\x29\x85\x20\x4c\x65\xbb\xbd\x31\x82\x90\xad\x5e\x0c\x16\xbe\xda\xf7\x02\xd6\x13\xc3\xfa\xab\x08\x73\xa8\xbf\x00\xf7\x7d\xb8\x91\x42\x82\x99\x83\xb4\x37\x91\x26\x58\x48\x98\x07\xc3\xb4\x09\x19\x0c\x2f\x1f\x31\xf2\xe0\x48\x4f\x2f\x15\x00\x39\xb3\xb6\x20\xa6\xa6\x98\xbb\xff\xdd\x7b\x03\xfd\xbf\x5d\x0e\x70\xa3\x4f\x5c\x6b\x91\x75\xe8\x53\xff\x6a\x82\xd0\x5b\x2b\x6d\x46\x3c\xda\x4b\xcb\xc5\x49\x3a\xf1\xda\x36\xbd\x09\xc2\xac\xd7\x6b\x77\xc9\xb4\x62\x22\x5b\xa8\x6e\x73\x65\x04\xfc\x55\xa9\x49\x64\x86\x1e\x88\xd6\xaf\xd9\x50\xeb\x7c\xb7\xb4\x5c\x1f\xe1\xc6\xa4\x5d\x50\xaa\x9d\xde\x92\x6c\xf0\x96\x72\xd7\xc2\x3b\x08\xb2\x89\x42\x7d\xfd\x9b\x18\xd6\x50\x11\xe6\xd8\x36\xfc\xb8\xa0\xde\xc0\xc8\xe6\xd3\x96\xa9\x6f\xae\x4c\xf8\xaa\xa5\x74\x13\xbc\xeb\x2a\x66\x0d\x0a\x38\xee\x59\x12\x2d\x18\x55\x35\xb3\x8d\x1f\xa5\x09\xbb\x5d\x39\x79\x10\x4b\xa8\x15\x61\x02\x42\xd9\x5e\xdf\xcf\x44\x6f\xc9\xd9\xcd\x95\x99\xf1\x02\xbd\x0b\x26\x77\x58\x0c\xb1\x9d\x2d\x37\xa4\x36\x54\xa4\xf3\x02\x83\x83\x4e\xef\xe5\xac\x35\xdb\xaa\xbe\xc5\x00\xc8\xe8\xee\xa8\x21\x01\xd4\x3d\xad\x7d\x71\x72\x28\xd4\x3c\xb4\x66\x92\xaa\x40\xcc\x3e\xb6\x8f\x35\xcb\xa1\xde\x02\x9d\x59\xf6\xd9\x0e\x9f\x79\x96\xc3\xbd\x54\x21\x55\x84\x06\x13\x96\x82\x25\xc7\x51\x8c\x64\x86\x42\xc5\x7e\x9a\xcf\x7e\x1d\x16\x57\xf9\xa7\x91\xc5\xd5\xb4\x49\x84\xeb\xae\x54\xd3\x7b\x76\x51\x63\x50\xe7\x42\x23\x38\x93\xbf\x90\x50\xf3\x89\xcf\xa6\x69\xa1\x22\x96\xb8\x0f\x2b\x36\x34\x38\x7e\xa7\x60\xce\x97\x2d\x3c\xd4\x45\xcd\x00\x11\xa3\x81\x82\x44\xcd\xe7\x17\xde\xa1\xa8\xa2\x45\x83\xc3\xf7\x15\x35\x1a\x2c\x60\x34\x08\x35\x54\xe0\xa8\xb7\x98\xd1\x20\xc4\xa3\x17\x3b\x6a\x3e\x5f\xb0\xf0\x51\xf3\x89\xa4\xc8\xa8\xd7\xa4\x27\x81\xbc\xf9\xf4\xa6\x39\x9b\x62\x75\x7c\x4b\x44\xb3\xb9\x55\xc2\xa1\x2b\x5a\xa8\x99\xb2\x79\x96\x94\xf5\xa5\x8d\x37\x9f\x58\xbe\x18\x93\x4e\xee\x5d\xce\x98\xd4\xf2\x41\xfa\x68\xa5\x9e\x8f\x4c\x33\x6f\x3e\x11\x7a\x67\x67\x21\xf1\xe9\xe7\x83\x70\x51\x3b\x41\x3d\x26\x15\x3d\x02\xe6\xd8\x64\xf5\xe6\x13\x4b\x0a\xe6\x09\x26\xb1\x37\x9f\x03\x12\xda\xa3\xe0\xa2\x46\xec\xeb\xf0\xe2\xd0\x38\xee\x8e\xa2\x92\xde\x9b\xcf\x41\x09\xf0\x91\x0b\xd5\xfc\x34\x32\x19\x3e\x12\x62\x27\x65\x3e\x32\x31\xbe\x35\xab\x71\xe8\x1c\x4a\x98\x6f\x3e\xa3\x93\xe7\x23\x97\xbd\x97\x62\x3f\x98\x48\x1f\x09\xd6\x9b\x6e\xdf\x93\x54\x1f\x09\x32\x2e\xf5\xbe\x4e\xb0\x8f\x04\x7b\xbc\x34\xfc\xe6\x33\x90\x92\xdf\x7c\x22\xb9\xae\x79\x46\x52\x58\x9c\x05\xd0\x3d\x31\xda\x99\x79\xfc\xe9\xfc\xed\xb7\x22\x2a\x37\x34\xa7\x19\x21\xed\xc6\xaf\x68\x20\xfd\xbf\xf9\xfc\xb2\xa2\x71\x7c\x89\x80\xc1\x29\xb8\x12\x02\xa3\xcb\x05\x0c\x2f\xae\x59\x4e\x20\xaa\x74\xc0\x20\x48\x6f\x69\x81\x40\x19\x81\x08\x0d\x2e\xaa\xcc\x40\xbc\x10\x74\x54\x29\xd7\xf6\xc8\xf1\x95\x92\x6f\x3e\xfe\x2a\xdf\xb7\x0d\x28\x75\x5c\x87\xcb\x1c\xc8\x30\x0d\x04\xc0\xa0\xc3\xa3\x8a\x7a\xec\x0a\x50\xe4\x3e\xec\xbb\x88\x3a\x14\xae\x93\x6d\x1a\x8f\x91\xfa\x93\xca\x51\xf6\xd0\x8c\x42\xb2\x06\x95\x86\xf9\x2f\xac\x07\x34\xb1\x57\x47\xfe\xbf\xab\x3a\xe1\x42\x69\xcc\xdc\xc4\xb7\x3f\xd8\xc6\xa2\x61\x67\x03\x4b\xb2\x32\x35\xd1\x5f\x00\x16\x14\xc1\x71\xcd\xae\x47\xa3\x70\x14\x51\x7d\xae\x3e\x71\x02\xa7\xd5\x86\x6a\x33\xdf\x50\xd2\x94\x7e\x6e\xf6\xfa\x33\x43\xa8\x97\xf1\xac\x53\x39\x4c\x8f\x11\xab\x1b\xf6\xac\x42\xa7\xfd\x68\x17\xb2\x2a\x3b\x16\x3b\xeb\x4f\x82\x63\x21\x72\xa3\x22\x1b\xa8\xde\xa9\xef\x35\xa7\x76\x14\x67\x49\xe8\x93\x6b\x87\xfa\x6b\xf2\xb2\xe2\x44\x95\x38\x3b\xc8\xc9\x5a\x13\x0d\x81\xc0\xa0\x0d\xee\x0f\x45\xf9\x17\x73\xb6\x26\xb8\xc0\x09\x55\x41\x45\x71\xbc\x34\x12\x39\xc1\xbd\x32\xf6\xad\x03\x61\xb7\xb2\x36\xb2\xd9\xcb\xa7\xee\x34\x15\x9c\xc1\x36\xb2\x1b\xf1\xc0\x85\x99\x70\x66\xd6\x1e\x4f\x9d\xe7\xf6\x24\x9f\xbb\x4f\xf5\xcc\x7d\xc7\x34\xb8\x06\xc8\x4f\xaa\xfa\x6a\x75\x41\x40\xdc\xb9\x61\x97\x92\xfe\x4c\x40\x58\xf1\xa7\xd5\x20\x4b\xef\xf5\xbc\x1a\x75\xfc\x35\x9f\x3d\xf9\x04\x60\x6e\x15\x16\x8a\xa4\xc1\xd6\xde\x11\x34\xda\xee\x4a\xd3\xd7\x42\xbf\x9e\x88\x39\xc3\x99\x44\x29\x81\xff\x1d\x92\x8e\x97\xbc\x54\xc0\x73\xe1\x8e\x2c\xb6\xc9\x90\x8f\x34\x52\x84\xce\xb0\x54\x37\x82\x2f\xc9\x1d\x1d\x76\x5d\x75\xba\x84\x4a\x85\x4c\xa6\x3e\x78\xb6\x97\x66\x3f\x6a\x0a\x1a\x16\x9e\x5d\xc2\x69\x8a\x15\x99\x7b\xcb\x86\x34\x9f\x11\x12\xbf\x5e\xdb\x9d\xc0\x4c\xc2\x64\x9e\xb4\xc0\xd6\xb2\x90\xaa\x80\x46\x58\x8e\x91\x89\x4a\xe3\x8c\xd8\x3b\xd3\xc8\xf5\x60\x97\xfe\xc2\x08\xca\x89\x94\x3d\x69\x03\xdd\xa7\x85\x95\xbf\x94\x39\x66\x73\x41\x70\x0a\x81\xc8\x16\x08\xa2\xa6\xea\x0c\xf4\xfc\x8d\xa2\x69\x54\xd1\x75\x06\x78\xae\x90\x3a\x8c\x95\x11\x6b\x14\x04\xcb\x70\x8f\xfd\x9e\x25\x7e\xcf\xe8\xdf\x4d\xc9\x1b\x2a\x1b\xdd\xb2\xb1\xfe\x6f\xa1\x66\x28\xc7\xc9\x86\xb2\x18\x43\x04\x70\x33\x09\x21\x74\x1a\x59\xd6\x3e\x04\xb6\xc5\x35\xdd\x56\x8d\x4b\xf4\x1c\x07\x0d\xe7\xe6\xa9\xc8\xf0\x44\x76\x10\xa7\xf9\x27\x55\x36\x82\x43\xa2\x17\x2d\xf6\xd6\x57\x4b\x6a\xff\x31\x2d\xf1\x6c\xa4\x34\x89\xe3\xc5\x51\x06\x60\xe0\xd6\x47\xdd\xd8\xb0\x00\x7a\x10\xc8\x50\xd5\x86\xfa\x19\xc1\xe6\x6d\x75\x87\x98\x83\x60\x2a\x12\xd9\x68\x59\xbe\x1a\x00\xbc\xd0\x90\x8f\xb7\xf4\x38\xab\xd3\x1c\x0d\x88\xe7\xe6\x25\x35\x34\xb5\x51\xea\x7d\x58\x96\x2b\x36\x58\xc6\x6b\x5f\x37\xfa\x6d\x9f\x1a\x02\xa0\xbc\x98\x7f\x5e\x75\xea\x90\x9c\x35\xc5\x33\x22\xfa\x7b\x71\xb6\xab\x81\xad\xf6\xe2\x86\x50\xc1\xd3\x13\xd9\xfc\x3e\xb2\xc7\x54\x27\x49\xb3\xe0\xa9\x61\x91\x77\x15\x2c\x50\xb3\x95\xc2\xc9\xc6\x06\xcc\x99\xbf\x40\xac\x57\xdf\x36\x6a\x45\x46\xb9\x4e\x9c\x2a\xd9\x58\x8e\xa8\x04\x2d\x32\x82\xfe\x54\x99\xd4\x66\x64\xb5\x22\x89\xfa\x4f\x54\x4a\xa7\xb2\xc0\xfb\xfd\x28\xaf\x0c\x5b\x7f\x72\xff\xf5\x9f\xdd\x0d\x0c\x0b\x49\x66\xbc\x88\x02\x0e\x97\xf0\xa2\xbb\xfe\xdc\xfc\x61\x59\x06\x06\xd4\xd4\x06\x5b\xb4\x49\xb3\xf1\x90\x88\xe1\xba\xa6\x5f\x0c\xce\xb2\x16\x08\xb9\x30\xfd\x6d\x1b\x1b\x69\x83\x24\xac\xa5\xce\x03\x13\x0b\x82\xae\xf9\xad\xed\x48\x3d\x43\x37\x60\x65\xa8\x7f\x01\x7b\xdf\x35\xbf\x7c\x24\x49\xe9\x4b\x88\x1b\xa0\x6e\xaf\xc7\xad\x1d\x8d\x55\x7b\xd8\xcc\xba\x5a\x1e\xb6\x9a\x14\x07\x8a\x46\x2b\x6e\x71\xe8\xc1\xd6\x3d\xd9\xd5\x25\x8b\xad\x57\x0f\x3c\x11\xb3\x21\x33\xb8\xf3\x5b\x18\x77\xc8\x7f\x58\x43\x0a\xcf\x97\x94\x99\x89\x55\x79\x70\xf5\x98\xce\x48\xea\x8d\x94\xd2\x2f\xc1\x94\x0e\x41\x6c\xd8\xd1\xd7\xee\x06\x3e\xa2\xb2\x75\x65\xdd\xf5\x71\xb4\x3e\x17\x5e\xc3\x23\x77\xf9\xf7\x12\x67\xed\x1c\x6a\xfb\x53\xd0\x93\xd4\x29\x94\xfb\x40\xb3\x34\xc1\xc2\x24\xc7\xd9\x14\x1a\xd7\x15\xdf\x44\xcc\x27\x10\x5e\x6a\xd8\x47\x00\xc1\xb0\xf3\xd2\x9a\x86\xb0\x50\x34\x81\x36\x4b\xb6\xe3\xab\xc7\x07\x35\x94\x79\x55\x11\xe4\xad\xe9\xb5\x14\xb1\x09\x77\xfb\xdf\xec\x5f\x34\x05\x11\x94\xa7\xa0\xd4\x5b\x95\xc2\x4b\xe5\xd5\x71\x78\x69\x73\xd7\x2c\x75\xf2\x95\xe3\x29\xd5\xa1\x6d\x45\xb8\xf8\x93\xa3\xaa\xb4\x6d\xdb\x36\xf4\x55\x83\x33\x57\xa7\x72\x81\xfe\xbc\x73\x41\x38\x10\x90\x63\xe2\x4e\x3d\x20\xa1\xf8\x69\x3b\x49\xd4\x40\x6c\x1c\xf3\x15\x17\x64\x4b\x04\x7a\x99\x72\x88\x60\x25\x5b\x9a\xa8\x4e\x67\x2a\xf7\xfc\x3f\x44\x70\x20\x32\x46\xd6\x58\xd1\x6d\xe5\x87\x70\x6a\xbb\x72\x61\xcd\x12\xbd\x46\x2f\x01\x18\xa2\x79\x4e\x52\x8a\x15\xc9\x76\xbe\x72\x18\xd6\xd2\x6c\xac\xca\xfd\x83\x3f\xbd\xf2\x51\xa0\xcc\x4d\x4f\x89\x9b\x16\x33\x34\x42\xdf\x1e\x27\xac\xae\x43\x6f\x1c\x81\xd7\x9b\xdb\x2a\x44\x58\x69\x2f\x8e\x11\x3a\x72\xf1\x40\xfd\x6f\x4d\x6b\xb8\x6a\x57\x66\xce\xc8\x01\xa7\x68\x50\xa6\xe9\x4a\x76\x4a\xe0\x84\xb2\x75\x44\x03\xde\xbb\xe6\x9b\x55\x1f\x5e\x8d\x2d\xf3\x07\x44\x5d\x23\xb7\x86\xf5\xbf\x6b\x28\x22\x8f\xfa\x50\xda\xb2\xcb\xd6\x2d\x00\x84\x5f\x07\x96\x43\xca\x29\xdb\xa1\xb2\x48\x78\x6e\x2c\x4f\x19\xd1\x92\x22\xa4\xa2\x2e\x05\xc1\xf7\x7d\xab\x7f\xc0\x1d\xce\x33\x75\xc8\x9d\x3a\xe4\xfe\x33\x74\xc8\xb5\xf6\xfb\xe0\xf9\xfb\x6c\xe3\xfe\x6c\x0f\xbf\x76\x23\x6c\x7d\x15\x57\xf6\xf3\x2a\x44\x90\xb3\xde\x2b\x8f\x97\xaa\x28\x55\x33\xe5\xd8\xac\xdd\x1a\x34\xdc\x40\x75\x2e\x43\x55\xf0\xae\x28\x08\x4b\x7b\x50\xa4\xb8\xdd\xf0\x2a\x38\x11\x64\x0a\x41\xd0\x9a\x30\xb8\xa0\x4c\x6a\x0b\x12\x44\x96\x19\x38\xd6\xad\x7b\x17\x72\x00\x5d\x33\xf8\x03\x74\xa2\xcf\x2e\xfb\xaf\x21\x85\x99\xba\x4a\xce\x64\x62\xd3\xd7\x9d\xc2\xb3\x43\xcb\x3e\x36\x6c\x3c\x27\x36\x7b\xb0\x59\xce\xcf\xc5\x15\x14\xbc\xc7\x96\x12\xd6\x67\xf0\x83\xbc\xcc\xb0\x54\x34\xf9\x73\xc6\x93\x7b\xbd\xe2\x98\xdb\xea\xe4\xec\x87\xdb\xce\x77\xad\x15\x32\x74\xf6\xc3\x2d\xba\xa0\xf2\x7e\x28\xdb\xc5\x75\x25\x6d\xea\x87\x18\xdd\x9b\x92\xd2\x27\x27\x12\x6d\x38\x74\xcc\x04\xdb\x9a\x0b\x45\x60\x9a\x49\x73\xe9\x35\xb4\x5a\x91\x16\x6a\x02\x3c\xb1\x7a\x04\x7e\x90\xc4\x2c\x75\xa9\x97\x0a\x59\x5f\xfd\x6e\xab\x61\xfb\xfa\x4a\xde\x05\x8d\x49\x6d\x24\x37\x7c\xde\xce\x99\xde\xf0\xd3\x01\xde\x76\xbc\x44\x0f\x38\x18\x35\xe2\x7a\x37\x2d\xd0\x1d\x2d\xde\xa2\xcb\x46\xa5\x6d\x53\xbd\xb2\x3d\x08\x95\x75\x46\x5e\x00\xaa\x15\x9e\x60\x6f\x8c\xa8\x01\x7d\xff\x8d\x2c\x85\x2e\x1f\x71\x5e\x64\x44\xbe\x45\x2f\xc8\xa3\xfa\xfd\x8b\x19\x7a\xf1\xb8\x92\xfa\x7f\x98\x5a\xc9\x17\x21\xb3\xc9\x55\x5e\xc5\x6b\x43\x0a\xb7\x4d\xb1\x5b\x12\x0b\xaa\x5b\x5e\xa9\xda\xde\x00\xd4\x63\x6d\x7c\x60\x08\x73\xb1\x6c\xf8\x03\x4a\xb9\x71\x7d\x40\x8e\x1c\x22\x42\x70\x53\xa3\x62\x0f\xdd\xe0\x00\x48\x78\x5e\x08\x9e\x53\x39\xe0\xc1\x04\xcb\x06\x1c\x01\xbf\xcb\x34\xc2\xe2\x04\xaa\x90\x0a\x94\x60\xe8\xd4\x32\xd1\xa7\xc8\x7d\xe4\x16\xd1\x47\x81\xe1\x9c\x3f\x4b\x81\x57\x2b\x97\x09\x30\x43\xaa\x5d\x5a\xc6\x91\xa9\xa6\x2c\x0b\x5f\x33\xc9\x10\xa9\xd4\x54\xf6\x8e\x3b\xbe\x8e\x4e\x53\xb2\x3d\x95\x29\x7e\x33\x83\xa9\xb9\x7a\x46\xaa\xb9\x8e\x00\x4c\x2c\xd1\x8b\x37\x2f\x16\xe8\x96\xe6\x34\xc3\x22\xdb\xcd\x9a\x2b\xae\x31\xa1\xf5\x53\x37\x54\xd8\x96\xfb\xe2\xf5\x0b\xf4\x92\x0b\x98\x8d\x56\x5e\x33\x82\xb7\xc4\xa5\x7d\x9a\x5a\x96\x20\x83\xbf\x5a\xf8\x77\x36\xd4\x35\xbd\x7e\x86\x74\x11\x64\x1c\x1f\xe9\x47\x96\xc5\x36\xf5\x3a\x71\xf2\xc9\x0b\x25\x4a\xf2\x42\xef\xd2\x8a\x8b\xc4\xf0\x61\x70\x97\x6e\x08\x44\x58\x7c\x0c\x15\x98\x43\xf5\x52\x29\xb3\xf7\xe1\x07\xbd\xd9\xb0\xed\x06\xb4\x97\x38\x02\x50\xa9\x44\x2f\xa0\x82\xff\x8b\x5f\x90\xcb\xa3\xc1\x32\xf9\xe6\x31\x90\xaf\x2e\x62\x31\x6d\xbc\x4b\xe8\xea\xc2\xf1\xf9\x86\x6f\x25\x6d\xde\xa3\xbe\xf2\xc2\xe6\xd1\xd7\xee\xcb\xb3\x1c\xff\xcc\x19\xba\xfc\xf3\xad\x9d\xc6\xab\x2f\x82\xa0\x27\x94\x5f\x75\xd8\x0b\x68\x98\x5e\xbb\x39\xfe\xb9\x14\x44\x8b\x1e\x31\x4d\xfa\xdc\xbb\xfb\xd2\x8b\xfe\x1d\x5d\x60\x85\x8d\x10\x63\x13\xd7\x7c\x98\xaf\xee\x42\x7d\x2e\x96\x90\x57\x6b\xcb\xbb\xf9\x25\x33\x14\x25\x32\x24\xc0\xf5\xd7\xe1\x90\xbc\x36\x25\xfd\x45\x4f\xe4\xdc\x7c\x07\xb1\x3f\x6f\xd1\x35\x67\x64\x06\x07\x15\xe9\x93\x6a\xff\xf3\x07\x41\x15\x09\xb0\x9d\x88\x0b\x45\x53\x66\x38\xd6\xad\xa3\xad\x36\xb5\x40\x48\xfe\x06\xea\xb6\x57\xcb\x32\xe3\x4b\x17\x9d\xf9\xd4\x79\x7d\xff\xe9\x6a\xc4\xb4\xbe\xff\x74\xf5\xbc\x53\x1a\x25\xfc\xed\xcb\x7e\xb5\x14\x57\x6b\xf2\xb5\x2c\x31\xe0\x86\x6a\xd4\x58\x18\x92\xdb\x16\x4e\x62\x0b\xdd\x68\x2d\x59\x6e\xb4\xc4\xf6\x14\x1c\x86\x13\xbe\xf7\x6a\x0a\xfe\x1f\xf6\xae\xad\xb7\x71\x1c\x59\xbf\xef\xaf\x20\x66\x1e\xd2\x0d\xc4\xc9\xcc\x9e\xc1\xec\xa2\xb1\x58\x20\x9d\x74\xcf\x09\xb6\x2f\xd9\xb8\x7b\xe6\xe1\xe0\x60\xc1\x48\x74\xcc\x8d\x2c\x6a\x44\x29\x69\x9f\x5f\x7f\xc0\x2a\x52\xa4\x64\x89\x17\xdb\x49\xba\x77\xac\x97\x99\x76\xac\x32\xaf\x55\xc5\x62\xd5\xf7\x7d\xa9\x90\xb2\x5d\x87\x0b\xe7\x4b\xaa\x14\x0e\x59\xb5\x45\x03\xf7\x48\x30\xb1\x6a\xa6\x7d\xe6\xbb\x62\x75\x07\xdd\x46\x35\x68\x23\xb9\x60\x78\xad\x93\xbf\x32\x69\xde\x9d\x2c\xf7\x05\x9f\x9f\x61\x44\xbd\x87\xf2\xbf\xfc\x15\x6a\x2d\x82\xd5\x80\xb9\xb3\x0a\x5f\x40\xfe\x34\x2f\xcd\x9f\x7c\x42\xef\x29\x2f\xe8\x0d\x2f\x78\xb3\x56\xd6\xf9\xe5\x49\xaf\x78\x52\xc2\x00\xec\xb4\xdd\x13\xdd\x07\xf7\x3e\x00\x0c\x35\x79\xa1\x24\x9c\x3e\x28\xc5\xf3\xf2\xa4\xf3\x1c\xfc\x68\x70\x1a\x84\x02\x1d\x0f\xd7\xe1\x30\x80\xd7\x43\xaf\x22\xb4\xc4\x7c\x86\x3b\x64\x98\x8c\xc2\xf3\xfc\xf9\xf3\xf5\xe5\xd6\x66\x4b\xed\xfb\x58\xb3\xa5\xbe\x3b\x6a\xb6\xe0\x0f\x1a\x68\x74\x82\xb8\x17\x1f\x8c\xbe\x3c\x92\xe5\xfa\xcf\x5f\x2b\x26\x64\x9a\x60\x00\x5d\x48\x07\x13\xab\xed\xd5\x56\xe2\x0c\xce\x83\x0a\xc4\x00\xc8\x82\x35\x55\x73\xf7\x0f\x4f\xdd\x4f\xc4\xce\x06\xe5\x90\xd0\x11\xd0\xa6\xc4\x0b\xdb\xbb\xb3\x13\x68\x47\x77\xea\x0b\xa6\xd1\xdb\xec\xb7\x8c\x55\xcb\x45\xcc\x1d\xde\x39\xab\x96\x6f\xe7\xfd\x00\x9e\xfa\x8c\xbc\x9d\x77\x7e\xa1\xdd\x47\x9e\xea\x57\x68\xae\xc4\x60\xdf\x91\x24\x05\x5f\xb0\xc9\xe4\xbd\xf0\xfe\x5a\x89\x92\x37\xa2\x8e\xe5\xf5\x85\xba\x7f\x18\x6d\xf2\x5e\xbf\x89\xd5\x0f\x99\x28\x0a\x96\x99\x18\x2d\x74\xcc\x88\xf6\xac\xbf\x91\xe3\x04\xd3\xe7\x71\x03\xf4\x66\xd0\x6f\x71\xa0\x4f\xaf\xdf\x9c\x5d\xbc\x7f\x73\xb2\xca\xbf\x5f\x8a\x87\x59\x23\x66\xad\x64\x33\xde\x4c\xdb\xa3\xa7\xa1\xc7\x85\x92\xc0\x65\xec\x20\x7e\x34\x81\x7d\xf2\x59\x62\xc4\x18\x42\x33\x6a\x15\xb0\x9c\xd4\x42\x34\xc7\xa4\xa6\x3a\x94\x3f\xa9\x36\x88\x3e\x32\x2c\xda\xa2\xc0\x11\x6f\x6a\xc6\x8e\xdd\x78\x88\xa7\xe8\x7f\xff\x76\xda\xe9\x56\xac\x1a\xf6\x05\xdb\x58\xcd\x92\xd5\xb0\x1f\x66\x95\x3c\xf2\x52\x8b\xd7\xf5\xd3\x06\xda\x37\xaa\xf3\xee\x5d\x73\xc7\xab\x16\x9d\x1a\xe3\x3b\xb6\x26\x81\x4c\xbc\x85\xa8\x01\xf9\xbe\xbf\x3e\x58\x93\x41\x77\x01\x62\xf6\x44\xdb\x92\x27\xd8\x95\x31\xb6\x04\x1a\x73\xcd\x16\xdb\x0e\xd4\x35\x5b\x60\xc1\x58\xbf\xfa\x09\xe0\x12\x59\xd9\x40\x46\xb1\x37\x8c\xa7\x87\x63\x74\xe4\x74\xd5\xf3\x13\x0c\x55\x5c\xc2\x7d\x18\x1e\xea\xeb\xbb\x45\xb5\xcf\xde\xee\x53\xed\x93\xa0\xd6\xbd\xe9\xa2\x3e\xea\x32\xaf\x5e\xaf\xcd\x26\xad\x69\x2e\x24\x32\x41\xa8\xb1\x38\x8e\x8b\x49\xd2\x7c\xc5\xcb\xaf\x62\x2b\x86\x1c\x2c\xaf\x9d\x0f\xb9\x4f\xbc\xcc\xa7\xc6\xb7\x3f\xb6\xe7\xf0\xcd\xbe\xff\x84\x6f\x5b\xd4\x44\x7d\xf7\x47\xcd\xf9\x63\xf2\x9c\x2b\x4a\x73\x37\xd8\xbf\x19\x8c\xda\xd0\xab\xb5\xfc\xbd\x98\xe1\x6f\xcf\xaa\xdc\x8e\xf8\xf3\x5c\xe8\x3d\x55\x50\x67\x70\x19\xf7\x0c\xa1\x9d\x28\x7f\x31\x71\x76\xc8\xc1\x15\xda\xeb\x28\xc6\x78\x3f\x5b\xd9\x74\xc0\xdc\x96\x06\x19\x06\x73\x5b\x10\xbc\x5b\x9f\x7a\xfd\xee\x4f\xc7\x79\xa7\x99\xfd\x10\x55\xaa\xd4\x39\xd4\x1f\x2b\x56\xce\x1b\x9a\xdd\x79\xe2\xd8\x07\x3b\xfc\xac\x76\x38\xf5\x26\xcc\xa4\xc5\xe4\xdd\x7c\x73\x60\xbd\xd2\xd7\xb8\x36\x6b\x06\x17\xf9\x57\xa8\x75\x1e\xf3\x76\x0b\xb3\xaa\xde\xd3\x09\x40\xda\x7e\xe4\xc2\x7c\x77\x60\x7c\xbb\x8f\x21\xf6\xa4\x93\x41\x2b\x51\xb5\xc5\x74\x56\x35\xe4\xbe\x63\xc3\xb7\x34\x96\xda\x79\x4a\xb9\xca\xb2\x4a\x64\x25\x72\x46\x6e\x78\x47\x03\xae\x1c\x01\x83\x67\x0c\x36\xd3\xb3\x0a\x6e\xba\xfc\xe5\x93\x7e\x22\xa4\xc3\x53\xf2\x03\xf8\x1e\x3f\xfc\xe5\x2f\x7f\xb1\x69\xec\x3e\x0b\x2c\xc8\x0f\x3f\xff\xf4\xd3\x09\xb9\xd0\x24\x3a\x9c\x75\x5c\x89\xdd\xf1\x8e\xd6\x0c\xf2\x9b\x29\x64\x67\xfb\x89\xf4\xf4\x00\x6b\x9b\xa0\xf3\x53\x91\x56\x14\xd1\x79\xd5\xa4\x15\x3c\x6b\x90\x43\x0b\x37\xb9\x26\x69\xf4\x0a\xa5\xe6\xf7\xbb\xfc\x13\x18\xcb\x63\x52\xf0\x3b\x46\x16\x12\xd0\x79\x2d\xc6\x0b\xa6\xbf\x79\x24\x66\xb4\x84\xa4\x73\x68\x80\x9d\x15\xc9\x9a\x27\x49\x60\x08\x04\x85\x86\x45\x4e\x3d\x5e\x4b\x20\xe0\xbd\x63\xeb\x19\x4e\x7d\x45\x79\x97\x3b\x77\x41\x9b\x69\xfc\x7e\x93\x28\xdf\x57\xf6\x19\xcb\x9d\x0d\x66\x12\x10\xab\x5a\xfc\x1b\x27\x9b\x97\xde\x94\x18\x17\x34\x5c\x6a\xc7\x4f\x23\xf7\x94\x0e\x12\x88\x41\xc6\xd3\x74\x8d\xfe\x5c\x13\x5b\xc6\x31\x52\xe0\x55\x70\xe0\x1e\xb8\x63\x6b\xb9\xd9\x5a\xaf\xbb\xa1\x4f\xdf\x36\xdb\x52\xad\x6e\x89\x6b\xa6\x2d\x37\xe4\x22\xda\xb8\xcf\xa2\xa3\x2a\x82\x46\x52\x53\x91\xe3\xe4\x72\x42\xf5\x80\x46\xb7\xd6\xdf\xd5\xf3\xe4\x11\xda\x4d\x45\x2f\x63\x47\xb2\xa6\xd5\x93\x03\x89\x58\xaa\xbd\x4c\x4a\x5d\xc6\xb0\xa2\xf5\x9d\xb7\xef\x26\x8f\xf7\x84\x5c\xa9\x2e\x77\x89\xb8\x58\x3f\x73\xcf\x3a\x7e\x17\xd5\x54\xed\xcd\x04\xda\x79\x74\x72\x72\x84\xea\x41\xd4\x44\x36\xb4\xd6\x3b\x5a\x7d\x3e\x6d\xca\x82\xb1\xd0\xde\xc2\x7f\x4f\x2b\x87\x6b\x05\xaa\xaa\x04\x14\xc2\x34\x4b\x4b\xe8\x1a\x46\x86\x88\x05\x0c\x88\xc0\x57\x1c\xcd\x59\x6f\x84\x59\x80\x7b\x43\x04\x5f\x05\xa0\x8b\x36\xda\x12\x30\x31\x48\x20\xc3\x0b\x16\x46\x2b\x5c\x45\x58\x96\xcb\xc5\x00\xb2\x3d\x28\xd5\x59\xcb\x8e\xfd\x1c\xb0\xeb\xf6\x8c\x45\x50\xa4\xdf\x98\x8c\x9a\x8c\x70\xe7\x83\x26\x65\xd3\x70\x04\x85\x46\x18\x16\x7c\xe2\xcc\x0b\x3e\x31\x46\x06\x1f\xff\xbd\x00\x3e\x1b\xeb\xba\xd3\x0c\xb8\xc5\x17\xd6\xea\x42\x95\x60\x15\x85\xd1\x8f\x9b\x03\xa9\x43\x35\x77\x03\x2d\x09\xbd\x91\xa2\x68\x1b\x14\x6d\xff\xa8\xd5\x4e\xd4\x4a\x82\x46\x19\xec\x38\xd0\x38\x9d\x18\x47\x15\x81\xb2\x8f\x43\x32\xf4\x6b\x2d\xfd\xc3\x7b\x85\xa0\xf7\xc2\x1b\xce\xa0\x87\xc1\x2b\xa3\x40\x95\x79\xf8\xca\x28\x81\x3d\xfd\x2b\x3a\x27\xee\xf9\x8c\x18\x31\xaf\xbe\x3a\x98\x91\xb1\x1a\xab\x86\xb1\x2e\x96\x2d\x88\x41\x43\xec\xf3\xf8\x7d\xb5\x32\x6e\xeb\x7d\x41\x8f\xd0\x41\x4c\xf2\x98\x23\xd8\xfc\x92\xbc\x38\xef\x4a\x35\x0c\xdf\xea\x65\xd9\xb0\x7a\x41\x33\xf6\xd2\x3d\x9a\xf9\xf3\x86\x4c\xa5\xc4\x92\x96\x79\x61\xea\x40\x08\xfb\xa2\x19\xe7\xd4\x2f\xe5\x35\x87\xc2\xca\x33\x97\xba\x67\xa2\xb2\x32\xe2\xc0\x06\xd2\x62\xf3\x37\xf0\xa7\x47\x28\x6f\x9d\x86\x41\x17\xb0\xfd\x7e\x3f\xb6\x3b\x6b\x9e\xa8\x05\x00\xf6\x03\x54\xd3\x5a\xb4\xb5\x0e\xb0\x1b\x36\x95\x4c\xd4\xea\x08\x16\xe2\x9e\xa0\x92\xd4\xec\x56\xf9\xaa\x35\x62\x01\x22\xcc\x60\xab\x3e\xd8\x29\x27\x6d\x4f\x79\x7d\x4e\xee\x9d\x0e\xc3\xfa\xe2\xb4\x26\x40\xbb\xd0\x4e\xb2\xb8\xe7\xb9\x71\xf4\x91\x50\xf5\xde\x54\x94\x56\x54\xca\x8e\xa7\xc8\x3b\x40\x52\x64\x1c\x0e\xd4\xce\x8c\xa1\x33\x0e\xee\x46\xce\x1a\x56\xaf\x78\xc9\x7a\xb9\xfb\x71\x01\x6b\x64\x29\xf5\x60\xff\x46\x0c\x74\x29\x72\x76\xd5\xde\x14\x5c\x2e\xe7\x89\xd1\xc8\x0f\x23\xaf\x62\xf6\xc3\xc6\x1d\x23\x46\x28\x7d\x67\x82\x61\xec\x92\x48\x06\x50\x3b\xf7\xcc\x45\x2d\x04\xef\x96\xca\x8e\x20\xf2\x7c\x3e\x9e\x15\xa6\x5b\xab\xf7\x87\x80\x8a\x90\x82\xe9\x7a\x69\x35\x11\x4e\xdb\x7f\xb5\x64\x54\xea\xd3\xcf\x65\xe5\x7e\xee\x3d\xb4\x17\x85\x1c\xf2\xc4\x1b\xe5\x8c\x9e\x9a\xe1\xea\xc6\xd5\xc3\xd5\xc2\x0a\x8f\x05\x1f\x70\x3e\x38\x25\xa8\xfd\x61\x92\x48\xf6\xd4\x2c\x69\x49\x84\x17\x23\x09\x5f\x07\x28\x0b\x23\xaa\x9b\x23\xc4\x1d\xc0\x05\x3d\xbd\x94\x0e\xe1\xde\x67\x0d\xf7\x26\x5e\xb8\xcc\xf5\x59\x08\x37\xa3\xc6\xea\x1c\xd4\x8e\x1a\x55\x1f\x3e\xb2\x06\xee\x6c\x76\xba\x02\xc1\x5f\x3f\x6b\x90\xb3\xd2\x0b\xe6\x99\x08\x14\x19\x35\xf4\x23\x45\xa5\xb6\x2d\xe0\x3a\x30\xa9\xf5\xc8\x4c\x1f\x30\x33\x67\x2f\x04\x83\x84\xdd\xce\x72\x34\x96\x96\x67\x8d\x30\xd8\x5f\xfc\xf0\xc8\x27\x32\x17\x59\xdb\xf1\xa9\xc0\xfc\xd9\xeb\xca\x10\x0e\x7e\x70\x8d\x05\x73\x74\xa1\x7d\xdb\xf8\x74\xb9\x78\x28\x1f\x68\x9d\x9f\x5d\x4d\x94\x0e\xf4\x5d\x1e\xfb\x6d\xd7\x8b\x33\x42\x80\x47\x0d\xb1\xec\x74\x2a\xad\xcf\xb1\x1b\x44\xe1\x0f\xf1\xf6\xfe\x10\x1d\xe2\xed\xdf\x40\xbc\x5d\x7d\xb7\x4f\x98\xd3\xdb\x0b\x3a\x8e\xe5\x0d\x28\xa5\x05\x3a\x9d\x1d\x88\x1a\x71\x98\x13\xef\x38\x64\x7e\xe3\x27\xf4\xea\xb6\xb3\xe6\x38\x78\x7a\xfb\x06\xe1\xf4\x63\x03\xa6\x20\xc7\xeb\xbd\x8e\xf4\xd5\x49\xe0\x9d\x03\xb6\x07\xde\x1a\x38\x17\x13\x95\x88\x60\x88\x00\xf3\x0a\x3c\xd6\x88\x00\x75\x8c\xec\x36\xf2\x18\xcf\x6c\x00\xb4\xa3\x1c\x90\x8a\x66\x0c\x76\x54\xa7\xb8\x83\x61\xb8\x14\x56\x9e\x30\x1b\xfc\xe4\x40\x18\x56\x78\x03\x79\x82\x34\xf0\xea\x7f\xdf\xaa\xd1\xb8\xf2\x47\x80\xec\xc3\x25\x51\x6e\x41\xc3\xb0\xb0\x99\xd5\x2b\x49\xc4\xe2\xb8\x57\x33\xf3\xdd\xfd\x8f\xde\x72\x75\xf3\x24\xd1\x7f\x2c\x4c\x33\x93\xbb\x7e\xd5\x0b\x2a\xaa\xa9\xb7\x48\x2f\xc1\x9b\x07\xfb\xd8\xbb\x16\xd8\x96\x38\x9e\x7b\xee\x66\x2c\x67\xc9\xcc\x0e\x47\x54\x1c\x31\x82\x8a\xe4\x70\x09\x70\xb8\x04\xf0\x7f\xf7\x11\x2f\x01\x1c\x35\x0d\xbb\x95\x4b\xa2\x07\xc0\xbd\x18\x08\x04\xab\xf0\x19\xdc\x1e\x58\x06\x67\xed\x56\x99\xab\x01\x73\x2f\x10\x81\x14\xec\xdc\x51\x92\xa3\xa3\x93\x93\xa3\x23\x73\x9b\xa0\x17\x6e\xdb\x2c\x66\x7f\x25\xac\xcc\x44\x8e\x8b\x2a\xdc\xcc\x05\xaf\x65\x03\x86\xdb\x9e\x8f\xdd\xbe\xae\x4c\x5b\xed\x15\x43\xf8\x5e\x01\xda\x16\x47\x7c\x18\x05\x65\x8b\xb5\xf3\x6f\xb7\x32\xbc\xd6\xdc\x76\x35\xf8\xba\xa3\x1d\x06\xcf\x2b\xb0\xab\xc1\x6e\x59\x14\x7f\x24\x6f\x85\xed\x61\x78\x42\xc9\x0b\xfc\xf0\x24\xab\xda\x63\xfd\x85\x93\x15\x5b\x89\x7a\x1d\x56\x11\x46\x88\x7a\xb9\x27\x55\x4b\x78\x09\xb6\xdc\xb2\xb5\x3f\x8e\x55\xef\xc6\x23\xc4\x7f\x62\x9e\x41\xa6\x70\x17\x27\x87\xe8\x8c\xe5\xd4\x59\x74\x00\x1f\x32\x8e\x36\xce\xc4\xb6\xe0\x4d\x56\xde\x93\x7b\x5a\x7b\x49\x77\xcd\x93\x64\xc8\x73\x7e\xcf\x65\x1c\xeb\xde\x44\xcc\x03\xa0\xfa\x10\xec\x0a\xf5\x57\x0c\xd9\xb9\x79\x34\x06\x92\x5d\x55\x03\xdf\xe5\xc7\x28\x70\xef\x94\x0e\x9b\x5f\x4a\x9f\x5a\xab\x15\xbb\x3d\xd4\xb9\x2e\x7b\x9e\x97\x78\xcf\x23\x92\x88\x3d\xd2\xf1\x88\xbb\xc0\x7c\x8a\x0b\xca\x80\x10\x08\xf1\x5e\xf0\xa8\xe4\xfd\x37\xfa\xbb\xfd\x0c\xc2\x86\xad\x2a\x51\xd3\x7a\x4d\x72\x7d\x1e\x5f\x9b\x28\x06\xad\xa7\x81\x87\xa1\xf0\xd1\xa9\x7c\xdc\x19\x95\x04\x7a\x92\xf3\x7a\xdb\xfc\xfd\x15\xcb\x79\xbb\x8a\x8d\x8e\xfc\xe6\xf2\x5a\x19\x50\x00\x14\xd1\x21\x6a\xd2\xec\xce\x87\xb8\x0a\x42\xcd\x90\x21\x1b\x9a\x53\x9a\xf4\xdd\x77\x03\xe8\x54\xf0\x40\xe1\x3e\x4d\xe4\xec\xc8\x1f\x71\xd3\x62\xb0\x3d\x4e\xe0\xa5\xd4\x21\x7d\x9d\x0d\xf4\x42\x7f\xf1\x25\x11\x35\x79\x0f\xb6\x21\x31\x83\x76\x7f\x13\x44\x22\xeb\xc9\xf8\xff\x31\x60\x7e\x8e\x46\xad\x12\x0d\x2d\x2c\xdb\x38\x29\x44\x46\x8b\x6e\xc6\x7a\x56\x25\x30\x57\xdd\xf2\x37\xb7\x91\x6a\xc6\x54\x7b\xd0\x3e\x43\xb0\xa3\x90\x78\xbb\xc5\x33\x60\x73\x50\x52\xd1\xe6\x7a\xe4\x9a\x59\xfa\xe4\xb0\xa3\xb7\xc0\x98\x01\xa8\xd2\xea\x6d\xb3\xb2\xba\x26\x3c\xa8\x15\xe6\x0b\xbb\xe1\x52\x31\x44\xde\xfd\x03\x08\x00\x4b\x9a\x71\x74\x0e\x80\x81\x6a\x7a\xe3\xbe\xcb\x16\x9c\x3b\xdd\x32\xed\xbc\x88\x05\xdc\xd2\x74\x46\x5f\x76\x50\x86\xbe\x15\x35\x58\xf3\x25\x2f\xfa\x8b\xde\x20\xd3\x75\x03\xdc\x96\xfa\x2e\x3f\x61\x9d\x8e\x2f\xd3\x56\xb2\x7a\x76\xdb\xf2\x7c\xaf\x0b\x34\xa0\x6d\x17\x59\x84\x9e\x7d\x7b\xde\x57\xb0\x6f\xf9\x4d\xcd\xc8\xf9\x92\x96\x25\x2b\x1c\x93\x39\x00\x4b\x9c\x0a\x28\xbb\x10\x8a\x01\x04\xc5\x3d\x20\x3d\x7c\x1b\x55\x50\xcf\x09\x6d\xf3\x8d\xc0\x03\x16\x6d\x34\x30\xa0\x8d\x98\xbc\x3d\x27\x0d\xad\x6f\x59\xa3\x5e\x27\x65\xbb\xba\x61\x9e\xdd\xf4\x7c\x50\x76\xcf\x5f\xd8\xb5\x5b\x05\x16\x0e\xf2\x6f\xbf\x7d\x88\x46\x7c\x18\x9b\xa3\x07\x51\x17\xf9\x03\xcf\x31\x45\x47\x92\x17\x4a\xe0\xcb\xe7\x07\x61\x78\x78\xe0\x53\x80\xfa\x81\x8e\xe9\xc0\x18\x74\x8c\x40\xcf\x74\xb9\x10\x57\x16\xe9\x05\x08\x9e\xc2\x80\x57\xcf\x1b\x0e\xc1\x28\xf8\x9e\xf2\x89\x5c\x7e\x07\x75\x18\xeb\x86\x1d\x54\xa7\x5a\xe3\x3a\xc8\xe7\x91\x09\x28\xf8\x37\xad\x0e\xd1\x88\x66\x49\x24\x5f\xb5\x45\x43\x4b\x26\x5a\x59\xac\x3d\x4b\xe1\x69\x06\x3c\x64\xb3\x0a\xf6\x05\x97\x6e\x8c\xed\xea\xbe\xdc\xb7\x61\x00\xac\xcc\x33\x33\x41\x3d\x23\x36\x75\xdb\x24\x31\x97\x49\x02\x8b\xda\x69\x57\x17\x8c\xfc\x2e\x90\xed\xc6\x32\x72\x43\x95\xdd\xaa\x8a\xf6\x96\x4f\x44\xad\x9f\x2c\xb7\xcd\xe6\xed\x28\x4f\x3d\xc2\xa1\x0c\xa5\x30\xfc\x81\x81\xe4\x3e\x8d\x66\x95\x91\x9c\x55\xac\xcc\x01\x2a\xdc\xae\x34\xdf\xde\x83\xce\xef\x34\xc2\x3a\x0a\xfe\x9c\x09\x1e\x8e\x8e\x7b\xf3\xa5\xa9\xa9\x52\x4b\x2b\xa5\x80\x4c\x84\x9e\x2f\x08\x2d\x7d\x8a\x64\xff\xa9\x3a\xdf\xbc\x09\x7d\x34\x60\x92\xc7\x4a\x1a\x44\x1d\x17\x5c\xec\x26\xb5\x6f\x32\x85\xcf\xfc\xbe\x5b\x67\xe5\x45\xe1\x8e\x4f\xe5\x73\x13\xf6\xbc\x16\x51\x7d\x4b\x8e\xa4\x19\x61\x1f\xbb\x9e\x1c\xca\xb8\xbf\xca\xbc\xbe\xc7\xcb\xb9\x5a\x14\x22\xbb\x8b\x42\x12\x79\x8b\xdf\x1c\x9c\x94\xf5\x87\x43\x28\x11\x75\x06\x9e\xe8\xee\xf8\xc9\x58\xef\x21\xc7\xdc\x40\x4a\x81\x16\xaf\x16\x7f\x2d\xa6\x56\xb8\xd4\x60\x8b\x9a\x86\xb8\x2d\x27\x31\x0d\x22\x3c\x13\xda\x50\x99\x04\x2a\x38\x44\xd4\x95\xac\xc1\x7c\x40\x00\x28\x5b\xb1\x86\x02\x9c\xe8\xec\xef\xa1\x6b\x47\xdd\x67\x23\x43\xb9\x33\xa6\xff\x96\x31\x28\x13\xa5\xe4\x39\xd3\xd2\x73\x35\x17\x80\x85\xba\x8b\xc1\xd5\xbf\xf8\xf9\x73\x34\x4a\x80\xfa\xea\xa0\xcf\x96\xd4\xa7\x45\x2c\x6d\x7b\x0e\xf0\xf5\x79\xe1\x2c\x22\x2d\xe9\xd1\x62\x41\xb7\x19\xb3\x44\x92\x91\x10\xd5\x47\xbf\x9c\xbf\xe9\xbf\xd4\xdf\x00\xbf\x9c\xbf\xf9\x8f\x20\xda\xb8\xcd\x98\x85\x3c\xcf\xb9\xbc\x3b\xb0\x6c\xfc\x01\x58\x36\x36\x66\xfd\x5b\x8f\xa1\x1d\x28\x36\xbe\x62\x8a\x8d\x27\xd2\x51\x64\xaf\x81\xce\x2a\x4f\xf0\x05\x0c\x8f\x84\x1b\xa4\xb8\xba\x70\xc9\x23\x94\xc1\x38\x01\xf8\x52\xbf\x3e\xeb\x81\xee\x18\x40\x7c\x78\xf7\xe9\x06\xf1\x11\xf0\xbd\x7a\x38\xd2\xa1\xf3\xa7\x67\x84\x36\x50\xbb\x36\x8e\xc4\x4f\x3f\x50\xbb\x00\x9b\xe3\x2a\xdb\xca\xa9\xe1\xcd\x35\xab\x26\x2c\xc3\xc0\x95\xc1\xaf\x0e\xe2\x84\x9a\x9c\x5e\x72\xc8\x23\x40\xaa\xd7\x8e\xb3\x75\x72\xda\x31\x4a\x78\x42\x2e\xde\x5c\x5d\xbf\x39\x3f\xfb\xf4\xe6\xe2\x15\x31\xf2\xb9\xeb\x98\x9e\x90\x4f\xc2\x86\x15\x27\x4f\x05\x96\x4f\x0d\xf2\x21\x6d\xbb\x8e\xb5\xda\xa4\xa5\xbd\x8b\x05\x50\x14\x5a\x92\xcb\x92\x37\x5d\xd6\x92\xcf\xf1\xca\x0a\x51\x76\xc4\xfe\x95\xd0\x11\xcd\x5b\xde\x1c\xa3\x9b\xa5\x51\xd7\x97\xac\xff\x1b\x93\x22\x19\xb9\xc2\x5c\x8a\xae\xd9\x13\x27\xe7\x88\x03\x87\xc9\x47\x88\x65\xcb\xc0\x9b\x04\x9b\xf9\x01\x56\xc4\xa6\x24\x9a\x1c\x43\x83\x6f\xe2\xd9\x44\x16\xf9\x04\x62\x0e\x47\x27\x47\xc6\x35\x2a\x3a\xdc\x1a\x93\xf8\xda\xfd\x9c\xda\xb3\x3e\xa7\x09\xb7\x72\x7f\x55\x9d\x10\xf2\xd1\x50\x9c\x1e\x2b\xef\x66\x00\x8e\xe3\x29\xb4\x31\x2d\xb5\x37\xdd\x23\xf2\x8d\xdd\x96\xed\x8d\xdb\x50\x7f\xaa\x0f\x48\xb9\x67\x65\xc0\x0c\x47\x29\x41\xd3\x90\xc8\x39\xbc\xb6\x2d\xff\x7c\xfd\x6e\xb7\x9f\xc6\x7d\x15\xf9\xc3\xe7\x62\xb5\xe2\x0d\x59\x52\xb9\xec\xca\xfa\x6c\x36\x42\xb7\xab\xb7\x6f\x51\x48\xcf\xd9\xa1\xda\x4a\xd7\x61\xc1\x78\x14\x6e\xfc\xd1\x2f\xe6\xcb\x83\x03\x5b\xf7\xf1\x06\x7a\xbc\x4f\x83\xf4\xd0\xe3\x43\x49\x54\x53\x50\xb3\x5d\xfb\x77\xc7\x3e\x65\x65\x8e\xc8\x8e\xd1\x84\x2c\xe6\x85\x0f\x0e\xbe\x95\x91\x82\x0e\x0b\x74\x34\x67\x0d\xe5\x85\xcf\xe1\xb3\x23\xd8\x88\x4a\x14\xe2\x36\x0d\xcf\x79\x64\x10\xbe\xc7\xcc\xea\x19\x9d\xa9\xd1\xdd\xcd\xff\x8f\x47\x93\x37\x09\xe2\x6a\x20\x6c\x9f\x3a\x4f\x18\xf2\xb2\x53\x0e\x5e\xcf\xd2\xe1\xbd\x3a\x60\xc3\x51\xf0\xbb\xa8\x37\x16\x7a\x1f\x2c\x89\xad\x1f\xae\x58\xbd\xe2\x52\xa9\x92\x51\xcf\xcc\x23\xf6\x09\xd7\xd1\x2e\xee\x5a\xb7\xfb\xa6\xdc\xb9\xa9\x34\xd3\x80\x82\x53\x5a\x68\xba\x34\x69\x93\x68\x0c\x96\x70\x4f\xbd\x55\x35\x9b\xb1\x2f\x5c\x42\xac\x02\x6a\x17\x44\x6d\xad\xf7\xd4\x8d\x9b\xc3\xa0\x61\x42\x50\x26\x60\x85\xef\x16\xeb\x61\xc6\x92\xf5\x7c\x26\x84\x9a\x70\x20\x32\xfc\x16\xc5\x1a\x01\x45\xa1\x1a\x19\x03\x04\xf4\x16\x1a\x2d\x6a\x1d\x6e\xaf\x6a\x7e\xcf\x0b\x36\x4d\xb3\xd4\x2c\x79\x79\xeb\x90\x07\x03\xd5\x31\xd3\x65\x58\x6c\xa3\x0f\x6a\xff\xca\xc6\xc9\x90\x9b\x10\x0b\xbb\xe0\xc3\xc7\x4f\xa4\x64\x4a\xd8\x92\xcb\x9d\x0f\x0f\xaa\x19\x9e\x5c\xe3\xd9\x6c\x06\xf1\x94\x17\xff\x56\x7e\x69\x5e\xbc\x24\xbf\x31\xfd\xeb\xca\x3d\x57\x3b\x3e\x6b\xc8\xc3\x52\xc0\x89\xba\x95\xba\x5f\xa1\x79\x5c\x21\xad\x23\x2d\x73\xf3\xee\xa9\x7a\x5f\xb9\x85\x68\xec\x7a\x52\xa0\xea\x5f\x12\x7b\x73\xb8\xb5\x0f\x9b\xac\x75\x4d\xe8\xb8\x73\xd6\x9c\x15\xd8\x41\x59\x04\x72\xb5\xa1\xd2\x55\xae\x57\x05\x2f\xef\x80\x20\x5e\x2b\x33\xb5\x26\x74\x0a\x63\x79\x67\x56\x6b\xcd\x68\x81\x3a\x3d\x4d\xf9\x6c\x33\xe7\x3b\xe9\xf3\x26\x21\x78\xfa\x69\x5d\x61\xd6\x43\xa7\x0a\x74\x22\x88\xab\x72\xbf\xfb\x2e\x0d\xd1\xfa\x89\x7b\x1c\x3c\x18\x6f\xa9\x49\xb9\x8c\x43\x88\x3a\xba\x9c\x9f\xcf\x2f\x07\x44\x5e\xf8\x59\x2f\xac\x6f\xf4\xe1\x44\x4f\xb7\x0b\xeb\xfb\x61\x81\xa6\xc2\xfa\x53\x06\x11\xba\xbc\xbb\x67\x99\x2d\x69\x75\xd6\x36\xcb\x0b\x2e\x33\x71\xcf\xa2\x0f\x35\x06\x36\x4c\x87\xd6\x09\x37\x83\x88\x52\xc8\xf9\x7f\x9f\x5d\xc5\x72\x88\xc4\xa4\x13\x98\x76\xce\x99\x4c\x38\x01\x8d\xb7\x52\xcb\xd8\x7b\x1b\x0f\x97\x21\xdf\xd0\x65\x08\xec\x9f\x6f\xfd\x02\x84\x97\xbc\xe1\xb4\x11\x81\x1a\xc0\x7e\x54\xa0\x95\x8d\x58\xe9\xad\x70\x69\x04\xc0\xc5\x36\x18\xe3\x9e\x4c\xbf\x45\x76\x70\x84\x39\x9c\xae\x32\xc9\x3b\xb4\xbd\x41\x1a\xe6\x31\x29\xd9\x03\xfe\xaa\xd7\x3a\x99\xb7\xff\xa6\x93\x68\xd5\x5a\xa5\xc5\xdf\x5f\xfd\xcd\xb9\x46\xf9\x7b\x57\x8e\xad\x8b\x74\x3d\x12\x2d\x74\x1d\xf0\x18\xec\x16\xf0\x20\x84\xff\x1e\xab\x7b\x74\xe8\x0e\xc7\xf9\x9f\x2d\x2d\x70\xa4\x3e\xec\x1a\x7f\xea\x8f\x72\x64\x63\xcc\x6c\x9b\xd1\xfd\xd0\x45\x00\x5a\xc9\xc0\x0a\xe2\x37\x9a\x9a\x96\x52\x0d\x79\x2c\xf0\xd3\x91\xbe\xf4\x3a\x22\x2f\x9a\xac\x0a\xa2\x3e\xed\x29\x25\x1e\x1b\xab\x47\xf8\x5d\x97\x0a\x3f\xfd\xeb\x7b\xbc\x21\x82\xf5\x18\x1b\x88\xe9\x35\xf4\x0a\x5e\x25\xef\xb8\x6c\x30\x03\x13\x65\x01\x51\x16\x24\x46\xfb\x6e\xf2\x4a\x72\x79\x05\xb0\x9c\xd5\xbf\x68\x9e\xd7\xaf\xd0\x9e\x19\x30\x92\x1a\x4e\x6f\xa2\x23\xc3\x8b\x60\x4f\x7a\xd1\xac\x2b\x9e\xc1\x51\xed\xd3\xf9\x15\xc8\x90\xe4\xaf\x3f\x23\x7a\xc2\x7f\xfd\xf9\xe7\x1f\x3c\x93\xf9\x54\x99\xea\x89\xf1\x8e\x27\xbc\x6f\xda\xc9\x51\x48\xcd\x8d\x04\x47\x65\x6e\x79\xd6\xf4\x5e\xc5\x55\xa5\xa6\xab\xd3\xd9\xb1\xee\xcc\x21\xbf\xef\x59\x71\xfb\x70\xea\x50\x1f\x6c\xaf\x49\x50\x89\x5c\x0d\x94\x08\xf1\x52\x61\x6e\xa3\x44\x1c\x55\xe1\x73\x98\x52\x95\xc8\xce\xa7\x45\xfe\xfb\x78\x4f\x67\xca\x92\x4c\xfc\xc5\x1d\xf9\x6d\x4e\x9a\xd3\x5b\xa2\xbf\x15\x50\x7f\xa8\x33\xa1\x73\x63\x07\x15\x00\x17\x1f\xe6\xff\x7a\x77\xf6\xfa\xcd\x3b\xcd\xe9\x00\x29\x04\x08\xaf\xe6\xb9\x81\xdc\x26\xeb\x2b\x7e\x27\x8d\xaf\xfa\xc0\x04\x95\x71\x37\x33\x1f\x06\x7c\xbe\x25\xf9\x30\x49\xe6\x9b\x58\xd3\xbe\x6b\x0c\xa7\x5c\x4c\xf4\xfc\x11\x82\x60\x26\xc2\xca\xbe\xf4\xab\x3a\xd4\x60\x48\x56\x03\xf2\xe3\xa3\x85\x6e\x26\x3b\x4a\x9e\xe1\xde\x41\xf5\x18\x47\x01\x8f\x7e\x9e\x1e\x6f\x77\xe3\xf0\xac\xe3\x18\xb2\xfc\x75\x7c\x29\xd4\xd1\x1c\xbe\x6d\x6e\xad\xd4\x2e\xc1\x54\xa3\x5a\xa9\x71\xa5\xc0\x99\x94\x61\x10\x93\xe1\x0a\x7b\xb6\x75\xb4\x75\xf4\x6f\xa6\xdb\xbf\x8d\xc2\xb6\x59\x3d\xa8\x92\xcf\x0b\xca\x27\x50\x28\x06\xbb\x76\xec\x45\xfc\xdf\x39\x06\x09\x7b\x57\x31\x5d\x9d\xca\x94\x12\x17\x84\x92\x51\x99\x5d\x3e\x03\xd5\xc7\x5b\xc0\x03\x8c\x08\x7d\xa4\xcc\xa0\x1d\x86\x99\x99\x4c\xfb\x11\x7e\x92\xa9\xc6\x6c\xad\x10\xe1\xed\x94\xe4\xb9\x73\xf3\xc2\xb0\xd6\x6f\x62\x98\xfc\xfe\xfa\xe6\x00\x1a\xc2\xf0\x4a\x98\x9a\xc6\x1e\xd4\xfd\xde\x75\xc4\x8e\x23\x4c\x1e\x45\x13\xff\x96\x58\xf3\x15\x3e\xf5\xef\x7e\xfe\x09\xa9\x81\x6e\x25\x6d\xb5\xdd\x97\xa2\x11\x65\x72\xe2\xff\xd5\xc8\x6b\xfd\xfd\x8d\xdf\x38\xc7\xd2\x94\x62\x3a\x3c\xd0\x89\xc0\x3c\xce\x31\xba\xdd\x49\x62\xdd\x2d\xb7\xde\x7f\x6a\x91\xea\xde\x20\x21\x62\x52\x49\xf2\xe8\x72\x98\xcb\x0b\xed\xcc\x99\x92\x17\xa9\x17\x07\xb1\xab\xc3\x59\x07\x9e\xfe\x7a\x73\xf0\x77\x37\xa7\xf9\x76\xac\x97\x6a\x42\x1f\x44\x1d\x5f\x94\x7e\xd5\x7b\x61\x90\xa1\xa0\xff\x36\xac\x19\x9b\x72\xf1\xbf\x96\x5d\x32\x87\xeb\x56\xa7\x2b\x63\xb7\x29\x66\xef\x78\xa6\x78\x6c\x53\x45\x6d\x1d\x8f\xcc\x91\x4d\x85\x5b\x27\xbc\x65\x7c\x16\x6f\x7f\x9b\x29\xd1\x48\xc5\x16\x38\x87\x00\x94\x52\x0b\x9c\x77\xf2\xe4\x13\x99\x76\x7f\xd5\x5f\xd7\x07\x7e\x35\x3f\x56\x7d\xd0\x6e\x0b\x85\x52\xb1\x9e\x95\x0e\xb7\x63\xb0\x8c\xd0\x09\x88\x4f\xbe\x10\x35\xc0\x56\x71\x2c\x5f\xb6\x90\x9c\xba\x44\xf9\x58\x93\x4f\xac\x68\x35\x09\x36\xa9\x54\x82\x0b\x6d\xbe\xe5\xf6\x4f\x47\xe8\x7f\x1f\x82\xe5\x77\xc1\xf7\xa3\x54\x80\x07\x96\x7f\x14\x6a\xdf\x23\x74\x0a\x84\x3f\x00\xb5\xef\x91\x98\x0a\x51\xec\x40\x10\x7b\xa4\x46\x83\x13\x5b\xf0\xe1\x27\xb8\xc4\xd1\xcb\x30\x72\x21\x18\x80\x7d\x93\x2c\x8a\xdb\xc0\xcb\x4e\x90\x06\xad\x7f\xd5\x49\xc4\x91\xd6\xd8\x02\x96\xdf\x96\x16\xa2\xbc\x0d\xa3\xf9\x0a\x37\xd9\x81\xe5\x5d\x2e\xc1\xba\xf2\x06\xcb\x63\x51\x67\x03\x74\xd8\x13\x9d\x73\x21\x17\x2c\x43\x87\xe5\xc5\x86\x7a\x69\x6f\xb9\x5d\xd7\xca\x20\x1a\x79\x1a\x82\x6e\x70\x92\x46\xfb\x13\xc1\x74\x1c\x21\x92\xb8\x6c\xc8\x61\xce\xe3\x28\x89\xe3\xbc\xc8\x6e\x56\xc9\x80\xfd\x38\x4a\xaa\x9f\x21\x19\xa5\x8f\xf0\x20\x47\xc9\x6e\x42\x5c\xc9\x23\x8c\xc8\x51\x82\x63\x58\x93\x3b\x6e\xe4\x28\x89\x49\xfc\xc9\xd1\x9d\x4f\x62\x52\x8e\x5b\x56\x0e\xdb\x72\x90\x53\x39\x4a\xe2\x04\xef\xf2\x14\xbb\x72\x94\xcc\x18\x2e\x53\x92\xb2\x45\x93\x59\x99\xa3\x64\x92\x28\xee\x66\xfb\xa4\x68\x1f\x7c\x22\xf8\x9c\xed\xb3\x23\xb3\xb3\x7d\x92\x80\xa8\xf1\x89\x21\x7a\x98\x68\xa9\x9f\xf2\x21\x5a\x26\x71\xc8\x21\xfc\xe4\x0f\x09\x22\x27\x68\x22\x26\x68\x20\x12\x04\x7b\x08\x23\x5c\x42\x88\x24\x89\xfb\xa1\x8e\xb0\x4f\x34\x89\x44\x82\xcc\x34\xf2\xa4\xe1\x93\x42\x2c\x61\x9f\x78\x8a\x09\xfb\xc4\x90\x4d\xd8\x27\x9e\x7b\x3a\x65\x39\x77\x2c\xd5\x01\x16\xea\x04\x99\xa3\x7c\xd5\x96\xb6\xab\xc7\x47\x9d\x20\xd6\xcb\x5c\x9d\x28\x2d\x59\xf9\xc4\x82\xcc\xe3\x13\xe2\xad\x76\xbf\x19\x28\x3a\xb0\x4f\x34\x1f\x8e\xfb\x75\x5f\x66\x93\x7d\xc2\x49\x36\xf8\x7c\xcd\xa9\x36\xf8\xa4\x26\xdc\x44\x09\x0d\x27\xe5\xe0\x93\xb4\xaa\xc2\x5c\xd9\xf6\x49\x66\xcd\x8e\xea\x56\xc7\xac\x1d\xc3\x9f\x3d\xec\xa5\x3f\x32\xd5\xff\x6e\xc4\x9a\x0d\x32\x31\x3a\x5f\x0d\x9f\xec\x1c\x69\x70\xb6\x0b\xf6\xca\x3a\x30\xcf\x7f\xb6\xdb\x64\xd5\xdb\xa0\xbd\x8b\x9a\xde\x48\x4b\xb0\xad\x7b\x1b\xe2\xe2\x8b\xd4\xc5\x03\x34\x44\x3f\x2b\x5f\xac\x5d\x8d\xe0\xee\x73\xbe\x9d\xec\x30\xc7\xf2\xf9\xd9\x27\x9e\xd9\x2f\xc9\x15\x45\x0e\xc0\x00\xc7\x5f\x82\xc4\x5d\xd8\x00\xed\x93\x3e\xa0\x24\x99\x21\xd0\x3e\x71\x5c\x81\x49\x22\x89\x65\x16\x0c\xb2\x06\x26\x0a\x4e\xe0\x18\x74\x5e\x4a\x3f\x2a\x91\x54\xde\x41\xfb\xc4\x32\x10\x26\xf6\xdc\x24\x48\x6c\xcb\x45\x68\x9f\xad\x86\x23\xcd\x81\x23\x49\x4c\x85\xc3\xa6\x45\xfb\x68\xe4\x70\xa8\x3d\x1c\x6a\x23\x9f\x3f\xc0\xa1\x36\xc4\xa5\x98\x78\x06\xed\x81\xa2\x4d\xb1\x2a\x26\xc8\xdc\xe4\x5f\x9c\xe4\x57\x4c\x39\xd6\x4e\x32\x31\xf6\x99\x16\x13\x1d\x83\x20\x27\x63\x24\xe7\xa2\x23\x35\x5d\xed\xa6\xf2\x30\xda\x27\x9d\x91\x31\x65\x2b\x29\x7f\x29\x9e\x9b\x31\x41\x72\x9f\xc5\x31\xcc\xd2\x98\xe2\x1f\x6d\xc9\xe7\x68\x9f\xed\xfc\xb2\x64\x8e\x47\xfb\xc4\xb1\x3d\x26\xfa\x11\x2e\x37\xe4\xf6\xbc\x8f\xf6\xd9\xd2\xb9\x4a\xe0\x82\x74\x5e\x8a\x64\x85\x4c\x1c\x12\xbd\x17\xfc\xfc\x90\x89\x32\xe3\xd8\x24\xed\xb3\xe5\x30\xa6\x30\x4c\xda\x67\xbf\x5c\x93\x3b\x76\x62\x1b\xcf\x32\x92\x89\x72\xd8\xb2\x04\xc7\x32\x35\x60\xf9\xfc\x61\xc8\x68\xc1\x98\xb8\xb3\x87\x30\x91\xe6\x3b\xd0\xb7\xff\x5f\x4f\x04\xe8\x09\x6f\xf7\x75\x45\x67\x00\x63\xd1\x3e\x29\x57\xfb\xf1\xd1\x87\xc3\xd5\xfe\xe3\x5c\xed\xcf\x35\x57\xc7\xe1\x5e\x7f\xb4\x37\x87\x7b\x7d\xfb\x1c\xee\xf5\x0f\x21\x90\x43\x08\x64\xf3\x39\xdc\xeb\xf7\xba\x75\xb8\xd7\x3f\xdc\xeb\x1f\xee\xf5\x7d\xcf\x5e\xef\xf5\xb5\x7b\x8e\x97\xfa\xd1\x8b\xef\x2b\xb9\xd3\xd7\x2c\x59\x67\x59\x26\xda\xb2\xf9\x24\xee\x58\xf0\x6a\x2f\xea\xd0\xb6\x21\x35\xd8\xc1\xc7\x3b\xe1\xd1\x36\xe7\xea\x24\x95\x3c\xdb\x67\xfa\x45\x73\xc8\x51\x16\xa6\xcc\x59\xde\x49\x8c\x0d\xf9\xaa\x97\x1b\x35\x0a\x27\xe4\x8c\xd4\x2c\xe3\x15\x67\x48\x83\x4f\xf1\x73\x5c\x0e\x86\xde\x23\xd2\xd1\x97\xac\x58\x68\x62\x84\xd2\x21\xd6\x72\xce\x26\x5a\xf5\x9b\xe6\x46\xc9\xd5\x4a\x05\x9a\x85\xee\x80\x30\x28\xfd\x86\x71\xac\x66\xff\xd6\x1e\x47\x5c\xef\xb1\xe7\x9f\x9c\x96\xb8\x41\x2f\x1c\xda\x18\x5e\xb0\x8d\x46\xd2\x8a\x6b\xc4\x82\x7d\x6b\x08\xf6\xa5\xe2\x35\x2c\xeb\x39\xcb\x44\xe9\xe3\x41\xb6\x4f\x6f\xf1\xbc\x19\x4a\x30\xab\x48\xc7\x97\x23\x8f\xb1\x79\x5b\x77\xbc\xc7\xf7\xb4\xe0\x39\x6f\xd6\xdd\xd5\xb9\xa6\xb8\xa3\xb8\xcf\xf4\x40\x47\x89\x3d\x93\x76\x96\x09\xad\xaa\x5a\xd0\x6c\xc9\xa4\xd3\x6f\xf4\x81\x75\x65\x65\x94\x4c\x53\xf7\x82\xe4\x91\xe0\x00\x83\x5c\xe5\x27\x15\x6b\x52\x8b\xc6\xa4\x8d\xe8\x86\xc7\x1d\x3f\x7b\x9d\xc3\x63\x0f\x36\x0a\x7f\x02\x5d\x92\xa6\x5e\x43\xfe\x49\x5c\x08\xd5\x69\x0a\x8e\x00\x5f\xb8\xff\x90\x44\x14\xb9\x01\x37\xfa\xeb\x0f\x71\x47\x3f\x56\x67\x7a\x4f\xc3\xf1\x86\xaf\x20\xc2\x59\x28\x1f\x51\x99\x86\xfe\x0f\xc4\x2d\x72\xdb\x88\x3f\xff\x44\x96\xa2\xad\xe5\x89\x5b\x03\xf9\x23\x7c\x86\xe7\xf3\xd8\x5b\x32\xe5\x58\x36\xa4\x60\x54\x36\xe4\xc7\x1f\xc8\x8a\x97\xad\x72\x0d\x22\xde\x75\x5c\xf3\x9f\x7f\x8a\xde\x6e\xb1\x4e\x79\xac\x3b\xbe\x99\xf8\xa0\x77\x55\x85\xa0\xe7\xda\x2b\xd7\x5a\x25\x54\x75\xeb\xfc\x3e\x10\x1e\x0c\xee\x21\xb5\x29\x72\x67\xae\x6c\xc4\x9e\x75\x4d\xac\x77\x1b\xe5\xad\x46\xda\xfd\xa8\xaf\x85\x9c\xd8\x50\x09\xa9\xbe\xe0\x18\xfd\x6b\xa0\x01\xbf\xb7\xe2\x66\xdd\xc4\xd4\x94\xff\x13\xbf\xd9\x2f\x26\x37\x1f\x8e\x83\x47\x4d\x74\xb8\xc7\xe5\x61\xb1\xa3\x46\xbf\x1d\xf6\x3e\x6e\xd5\x69\x3a\xb2\x6e\x10\x4e\xde\xe6\x34\x68\xc2\xb4\x59\xc6\x90\x73\xf8\xc2\xb2\xc5\x95\x02\xe5\x06\xa6\x6c\x9f\x35\xd7\x5e\x84\x26\x33\xce\xa6\x7e\xd0\xa7\x7c\xf7\xcf\x0b\x11\xe3\x0f\xd7\xec\x96\xcb\x26\x81\x82\x07\xbf\xde\x5f\x4e\x92\x97\xb7\x48\x99\xb0\x6a\x8b\x86\x57\x45\xd7\x73\x4f\x7f\x3b\x51\xda\xd6\xb9\x21\x63\xea\xc4\x26\x29\x82\x16\x20\xc4\x5e\xe0\xda\xe0\x45\xf7\xfb\xac\x6c\x10\xa9\xbf\x56\xc6\xb4\xa2\x35\xed\x06\x16\x48\xc9\xe5\x4b\x1d\x97\xa6\x99\x37\xfd\x4d\x63\xdf\x28\xcb\x55\xd3\xa2\x1b\x2e\xf7\x02\x77\x97\xc5\xd6\xb0\x92\x96\x9e\x5b\xa0\x7e\x58\x05\xbe\x4c\xc4\x83\xc9\x24\xd5\x4c\x4c\x83\x55\x16\x2c\x79\x7e\x4d\xb3\x3b\x56\xe6\x40\xa7\x87\x43\x92\xaf\x4b\xba\xd2\x18\xa6\x1d\xe9\x18\xcb\x07\x92\x27\x2b\xcb\xd5\x83\x51\x46\x2c\x99\x36\x40\x0c\x01\x26\xf0\x88\xf1\x69\x65\x34\xc8\xd7\x67\xa9\x7c\x01\xbf\x8e\x90\x78\xa7\x5a\xf3\xfb\x8c\x69\xb7\xc9\xd3\x25\xf5\xe3\xbb\x34\xfe\xde\x83\xfb\xb1\xd1\x7c\x8d\xf9\xc1\x9d\x95\x0f\xc1\xcb\xee\x9a\x0b\x10\xff\x68\xa1\xd4\x82\xef\xfc\x63\x0a\xeb\x07\x8b\xe2\x66\xbd\x2b\x61\x57\x98\xa3\x0a\xb7\xc6\xc4\x9f\x3d\x78\x0c\x01\x5b\x57\xdf\xc4\xe0\x24\x1c\x5d\xbf\xbe\xe8\x6b\xa5\x6b\x9a\x0b\x49\x5e\x17\x22\xbb\x23\x17\x0c\xce\x01\xae\xbd\x9b\x18\x89\x21\x84\xe2\x8e\xdc\x55\xf5\x4d\xbe\x3b\xb7\xc0\x01\x0f\xff\x1b\xc2\xc3\xaf\x6f\x7c\x03\xf0\x6d\xa0\xe1\xaf\xe8\x6d\x3c\x9d\x8a\x3a\xb1\xc3\x56\x83\xd7\x0c\x4c\xeb\x96\x5b\xe4\xfb\xa5\x78\x98\x35\x62\xd6\x4a\x36\xe3\x9e\xc4\x97\x88\x5e\xdc\xb1\xb5\xfa\x6b\x6c\x3f\xfe\x81\x5f\xef\x1d\x97\x1a\x01\x17\x0f\xf0\xb9\xb2\xf8\xd7\xaf\x2f\x94\x99\x89\x41\x77\xe3\x92\x9c\xb2\x26\x3b\xcd\x58\xb5\x3c\xd5\x4d\xf9\x2a\x86\x65\x25\x4a\xde\x88\x3a\x9a\x01\xef\x8c\x64\xa2\x28\x34\xaa\x86\x58\x90\x73\x56\x2d\x3b\x21\x8f\xdf\xa3\xa7\x42\x48\xaf\x84\x88\x45\x90\x76\x96\xbc\x7a\x4b\xaf\x78\x67\xe2\xeb\x9b\x54\x05\xf3\xd4\x8b\xe0\x1b\x23\x20\x7e\x84\xe1\xd9\x2f\xb0\xfc\xd1\xdc\xbc\x00\xc7\x50\xe7\xee\xa9\x8f\x23\xaf\x05\x7b\x46\xc8\x55\x33\xe4\x72\x81\xee\x78\xce\x72\x22\xee\x59\x5d\xf3\x9c\x49\xd2\x69\x13\xf7\xe4\xcb\x8b\x3d\x11\x04\x6e\x35\xa6\x07\x18\xfc\x67\x85\xc1\x4f\x38\x26\x39\xca\x4b\xbd\xb5\xa9\xbc\x68\xbe\xe2\x65\x22\xac\xeb\xd3\xaa\xaf\x20\x9c\xbd\xf2\x43\x26\xfe\x66\x0c\xd7\x36\x07\x11\x99\xd1\x82\x5d\x7e\x8c\x38\x8c\xcc\xf1\x9b\xfd\xf3\x88\xf9\xd0\x41\x36\xdd\x0a\xcb\xf1\x1f\xdd\x62\x27\xa5\xc8\xa7\x62\xd3\x7f\x5c\xb4\x53\x67\x2d\x23\x98\xe3\x2e\x86\xf2\x96\x36\xec\x81\x46\xb3\x8c\x9b\xae\xf4\x31\xc5\xbb\xa9\x3f\xbb\xba\x24\xbf\xa0\xc4\xdd\x40\x56\x6b\xd1\xa0\x47\x76\x21\x56\x94\x47\x33\x29\x39\xe0\xd0\x6e\xb3\xae\x3a\x71\x04\xe5\x29\x2b\x14\x38\x67\x20\xee\x58\xab\xce\x59\xfa\x04\x74\x40\xba\xdc\xb3\x53\x61\x7d\x0a\x27\x08\x64\x52\x7d\x2d\x89\x8d\x9e\xc5\x40\x20\xcb\x5e\x54\x13\xc9\x4a\xc9\xe1\x16\xc8\x49\x4e\xd0\xfc\xa1\x48\x3e\x8b\x99\xba\xe8\x78\xf8\x76\xde\x3b\x71\xcb\x4b\xb3\x6f\x85\xbe\xd2\x5c\x50\x9f\x2f\x72\xf0\x14\x9e\xd5\x53\x90\xb2\x78\x53\xd2\x9b\xc2\x77\x9d\xd6\x57\xfc\x05\xbd\x55\x8b\x8e\xc1\x5b\xa7\x39\x97\xea\xbf\x64\x3e\x7f\x07\x81\xf4\xb6\x34\x9e\x6d\x20\xb5\x59\xab\xbd\xae\x9a\x07\xb7\xed\x6e\xfb\x09\xf5\x4e\x02\x12\xe9\x65\x99\xab\xe6\x32\xd9\xcb\x4f\xd2\x72\x10\x64\xb5\x4b\x31\x87\x4c\x0e\xff\x7d\xcd\xa7\x25\xcf\xee\xae\x9c\x78\xb9\xa8\xd5\x67\xa5\xf3\x51\xcf\x1c\x0d\xff\xb6\x8b\xc2\xd4\x8d\xbe\x8a\x3f\xb6\x7e\x72\x34\xfe\x5c\x77\x59\xbd\x4e\xa8\x94\x22\xe3\xf6\x82\x24\x00\x98\x6a\x8d\x45\x0e\xc6\x62\xb7\x6e\x80\xa5\xdf\xd2\x7e\x99\x89\x33\xc4\xd8\xd2\xb1\x4a\xfe\x43\xa8\x1e\x87\x9d\x9a\x8e\x0b\x25\x81\xa9\xe1\x53\x8f\x9b\xc1\xf8\x7e\x18\xd1\xef\xe2\xf6\x3a\x02\x18\x56\xea\xc6\x1b\xd3\x74\x38\x9b\x93\xd8\x71\x34\xe8\x8b\xe6\x47\x8c\xfd\x6b\x2f\x69\xe2\xaf\x9d\xdd\x9b\xfa\xfb\xb4\xcf\x18\xf2\xc8\x3d\x45\x54\x63\xe7\xf3\xc1\xb5\x25\x7e\xa6\x83\xfd\x90\xb8\x55\x89\xaa\x2d\xe8\xe4\xbd\xe5\x06\xf1\xc5\x0e\x14\x30\xf8\xeb\xdb\x5e\x09\xa4\xa3\x30\xfb\x8b\x0c\xfa\x80\xcc\xfe\x08\xbe\x81\x6a\x8e\x03\x64\x0e\x43\x8c\x34\x82\xfc\xf0\xf3\x4f\x3f\x4d\x81\x37\x4f\x42\x34\x7b\x3d\x54\x1f\x78\xb3\x0f\xa2\xd9\x2b\xd4\x0b\xde\x3c\x55\x22\xe0\xbb\xac\x9b\x06\x6f\x9e\x76\x07\xf6\x87\xde\x1c\x88\xad\xa6\xd6\xf3\xb9\xb5\x7a\xbe\x08\x57\xb8\x8a\x6f\xbc\xbe\xcd\x23\xd3\x53\xbb\xe7\xaf\xcb\xf3\xc9\x1c\xa9\xd8\x8b\xac\xc6\x0b\x9c\x9d\x6c\xa2\xc3\xbe\x6a\xf0\x92\x2a\xef\xdc\xaa\xba\x40\x4b\xfd\xf5\x76\x13\xb5\x74\x1e\x99\xe3\x55\x76\xe1\x0a\x3a\x8f\xc8\x5e\x6d\x5d\xa0\xd2\x22\x0d\x4d\x3c\x5c\x23\x17\x55\xfd\x16\x9b\x89\x1d\x51\xe9\xb6\x63\x7d\x5b\x74\xd2\x5d\x4c\x2d\x5b\x8a\x71\xb1\x75\x69\x01\xa1\xc4\x5f\xb7\x36\x55\x8d\x16\x94\x3a\x5e\xad\xe6\xab\x41\x0b\x8a\xf4\x9b\x91\xed\x2a\xcf\xa2\xeb\xcd\x1c\x93\x11\x14\x1a\x5d\x65\x96\x52\x5b\x16\x9f\xbc\x1a\x93\xb8\x1a\x5f\x3d\xe6\xd4\x84\x05\x3b\xee\xaf\x19\x1b\xaf\x04\x8b\x5a\x49\x9b\x95\x62\xfe\xfa\xaf\xa0\xd0\x98\xfa\xb0\xc8\xcd\x1b\x93\x2d\x1b\xaa\x00\x0b\x66\xd2\xee\x25\x3d\x36\xa6\xca\x28\xbd\xb6\xa8\xb3\x2e\x5e\x2d\xef\x2f\x29\x8a\x0f\xe6\xa5\xf0\xf4\xb9\x31\x2a\x7d\xf4\x30\x0e\x2e\x26\x18\x59\xd0\x42\xaf\x07\xd1\x4e\x5c\x92\xee\xeb\xf0\x41\x62\x16\x5b\xe8\x60\x86\xbf\x27\x62\x88\x6d\x75\x2c\xe2\xe3\x7c\x70\x5d\xd2\x7d\x7c\xb8\x25\xf9\xc6\x39\xe1\x0e\xc1\xfd\xcd\x4e\xda\xe0\xbe\xec\x41\x28\x99\xa0\x04\xfa\x4e\x0b\x51\x13\x71\xa3\xc1\x63\x03\xbe\xba\xdd\x30\x67\x57\x97\xea\x3c\x0f\x15\x63\xb4\x90\x27\x64\xa4\x7e\x5f\xbb\x41\xa1\xf3\x8f\x3d\xe1\xd0\xa6\x61\xab\xaa\xf1\x2d\x85\x43\x6c\xff\x59\x63\xfb\xc9\x01\xc9\x5f\xbb\x17\x3a\x6a\xe4\x76\x45\xcb\x99\xda\x6d\x10\xe5\x77\x82\xad\x9e\x1e\x0c\x35\xf5\x09\x31\xd9\xcc\x30\xa0\x10\xba\x81\x42\x86\x1e\x47\x3b\xf1\xc5\x08\x2c\x7b\xef\x7e\x22\xb4\x20\x2b\x79\x54\xd0\x18\x0f\xf6\x67\x26\x86\x39\xb5\x5e\x15\x04\x5d\xed\x46\xc8\x6c\x45\xc7\xd6\xf7\x4e\xec\xcd\x92\x85\xb2\xf7\xaf\xa0\xfa\xc6\xbe\xdf\x3f\xc3\xe0\x21\x86\x16\x85\x78\xc0\xf6\x5a\x3b\x18\x18\x6e\xe8\x19\x96\x08\x42\x2d\x0a\x57\x07\x7d\x1d\x4d\x76\xbb\x00\x3a\xa9\x51\xa7\x24\xaf\xe3\x0f\x47\x83\x5a\x5f\x2d\xce\x59\xe3\x2e\x36\x75\x8c\x2e\x31\x21\x5d\xfd\xbf\xc9\x6c\x0a\x74\xdc\x5c\x1c\xdd\xb0\x25\xbd\xe7\xa2\xad\x51\x6e\x23\xc8\x77\xfa\x4f\x60\xb4\xd6\xa2\xed\x82\x85\x6d\x20\x61\xb6\x1b\x45\x39\x32\x53\x1f\xec\x1f\xe1\x30\x97\x0b\x13\x47\x99\xb1\x2f\xdc\x5b\x4e\xb8\x31\x66\x66\x92\x0c\x6a\xe7\xa3\x39\x5e\xf7\xb2\x52\x56\x31\x9a\x72\xf4\x57\xf7\xfb\x7d\x07\xec\x7e\x0e\x7f\xfa\xd6\x08\x47\x0f\x2e\xd8\xd8\xd3\x5d\x17\x16\x3c\x5b\x47\x93\x6d\xda\x6b\x42\xf5\x1a\x79\x4d\x25\xcb\xc9\x7b\x5a\xd2\x5b\x3c\xfb\xbe\x98\x5f\xbd\x7e\xff\x52\x4d\x61\x20\xbc\x71\x79\x31\x76\xcb\x68\xe4\xa3\xf8\x0f\xbb\xd5\xa7\x0c\xfa\x98\x60\x06\xf7\xd6\xcb\x1d\x2b\x6c\x8c\xc1\xf2\xa3\x9d\x6f\x16\xf8\x0e\x49\x94\x07\x1b\xf7\x7e\x95\x3f\x22\x39\xb2\x6d\x72\xba\xba\x9a\x96\x3d\x1b\x87\xdd\xf3\x48\x1b\x8f\x36\x8c\xbe\x20\x1b\xda\xb4\x3d\x6d\xd3\x77\x38\xdf\xab\x3d\x5e\x33\xac\x56\xbf\x01\xfc\x84\x5c\xbf\x64\x0c\xff\xa7\x25\x2d\x85\xbc\x6e\x0b\x56\x93\xac\x68\x65\xc3\x6a\x3c\x97\x40\xc5\x66\x7f\x0d\x7c\x10\xea\xa0\x9f\x15\x6d\x0e\x21\x79\x56\x1a\x80\x03\xa8\x2a\xa8\xc5\xaa\x8f\xd4\x70\x8c\xbe\x52\xf7\x07\xe7\xa7\x7a\x62\x3f\x82\x12\x12\x35\x78\xfb\x88\x75\x31\xea\x15\xdf\xf2\x66\xd9\xde\x9c\x64\x62\xe5\x38\xc8\xa7\x3a\x77\xa3\x59\x9f\xde\x14\xe2\xe6\x74\x45\x55\x17\x94\xbb\xdc\xd4\xfc\xa6\x6d\x44\x2d\x4f\x73\x76\xcf\x8a\x53\xc9\x6f\x67\xb4\xce\x96\xbc\x61\x59\xd3\xd6\xec\x94\x56\x7c\x96\x89\xf2\x5e\x2d\x37\x51\xca\x93\x55\xfe\xbd\x52\x51\x33\x5a\xe6\x33\x1c\x24\xd7\xdb\x9d\xd2\xee\xf4\x9e\xf2\x42\xf9\x98\xd7\x4c\x29\x41\xba\xa1\xfc\xfb\x21\x41\xd1\xd0\x82\x94\xed\xea\x86\xd5\x70\x7b\x6e\xde\x26\x95\xc8\x25\x1e\x0f\xb1\x26\xb3\xab\xdd\x5f\xf1\x52\xcd\xc7\x5a\x63\x4b\x6c\x82\x14\x37\xb4\xbe\x65\x2e\xd7\xab\x3b\xa7\x39\xab\x0a\xb1\x5e\x8d\xdc\xba\xf8\x82\xa4\xd3\x41\xd1\x8a\x2a\xf7\xcc\xdb\xc7\x6b\x6b\x7b\x4d\x80\x4b\x39\x49\x14\x09\x52\x4d\x91\x76\x5b\xe6\xac\x2e\x00\xca\x61\x05\x1a\x6a\xd3\x1e\xeb\x43\x0d\x38\x41\x37\x4c\x7d\xb3\x62\xb5\x6a\xb6\xf2\x0f\xe1\x00\x9c\x2b\xd3\xcc\x3a\xd1\xdd\x1d\x56\xf7\xb5\xd1\x7e\x8d\x9d\x7f\xeb\x6d\x66\xaf\x14\xe5\xac\x61\xf5\x8a\x97\x60\x0d\x60\x0a\x7d\xb3\xb1\xd1\x43\x3b\x3b\xe4\x45\xb3\x64\xbc\xd6\x54\x21\x64\x45\x9b\x4c\x07\x5e\x01\x38\x57\xd4\x2f\xf7\x33\x7f\x6d\xb9\xdb\x82\x75\xde\xdf\xa9\xbf\x7b\xea\x4d\x95\xab\x91\xdf\xaa\x27\xfb\x9c\x3c\x30\x5c\x4b\x7a\x8f\xf1\x99\x9c\x49\x65\x0c\x0c\x9d\x06\x9c\x8a\xf6\xd1\xdf\x31\x2b\x33\xdb\x54\x40\xbd\xbf\xe2\x7e\xed\x7d\x54\x8f\x7d\x6f\x64\x5d\xf4\xff\xde\x1f\x69\xbf\x65\x1a\x36\x74\x06\x43\xf0\xa7\xd1\xef\xeb\x41\x7a\x45\xee\x7f\xb4\xff\x82\x99\x9c\x69\x64\x72\xf8\x03\xe2\x57\xb1\xfc\x15\x69\xea\x16\xed\xa9\xf6\x92\xf4\x27\xd6\x16\xd2\x2c\x63\x55\xc3\x72\x38\xf6\x60\x13\xee\x78\x99\xbf\x22\xdf\x21\x86\x76\x55\xb4\x35\x2d\xf4\x3f\x95\x4e\xe5\xa0\x3d\x5e\x91\xff\xf9\xdf\x3f\xa1\x54\x96\xff\x6a\xda\xa1\x3e\xfc\xff\x00\x00\x00\xff\xff\xa7\x5a\xa2\x04\x4f\x3b\x04\x00") - -func examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYamlBytes() ([]byte, error) { - return bindataRead( - _examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml", - ) -} - -func examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYaml() (*asset, error) { - bytes, err := examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYamlBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml", size: 277327, mode: os.FileMode(420), modTime: time.Unix(1, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml": examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml": examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml": examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml": examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml": examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYaml, - "example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml": examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYaml, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "example": &bintree{nil, map[string]*bintree{ - "prometheus-operator-crd": &bintree{nil, map[string]*bintree{ - "monitoring.coreos.com_alertmanagers.yaml": &bintree{examplePrometheusOperatorCrdMonitoringCoreosCom_alertmanagersYaml, map[string]*bintree{}}, - "monitoring.coreos.com_podmonitors.yaml": &bintree{examplePrometheusOperatorCrdMonitoringCoreosCom_podmonitorsYaml, map[string]*bintree{}}, - "monitoring.coreos.com_prometheuses.yaml": &bintree{examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusesYaml, map[string]*bintree{}}, - "monitoring.coreos.com_prometheusrules.yaml": &bintree{examplePrometheusOperatorCrdMonitoringCoreosCom_prometheusrulesYaml, map[string]*bintree{}}, - "monitoring.coreos.com_servicemonitors.yaml": &bintree{examplePrometheusOperatorCrdMonitoringCoreosCom_servicemonitorsYaml, map[string]*bintree{}}, - "monitoring.coreos.com_thanosrulers.yaml": &bintree{examplePrometheusOperatorCrdMonitoringCoreosCom_thanosrulersYaml, map[string]*bintree{}}, - }}, - }}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/crd_kinds.go b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/crd_kinds.go deleted file mode 100644 index 03a8c86da..000000000 --- a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/crd_kinds.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2018 The prometheus-operator Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v1 - -import ( - "fmt" - "strings" -) - -type CrdKind struct { - Kind string - Plural string - SpecName string -} - -type CrdKinds struct { - KindsString string - Prometheus CrdKind - Alertmanager CrdKind - ServiceMonitor CrdKind - PodMonitor CrdKind - PrometheusRule CrdKind - ThanosRuler CrdKind -} - -var DefaultCrdKinds = CrdKinds{ - KindsString: "", - Prometheus: CrdKind{Plural: PrometheusName, Kind: PrometheusesKind, SpecName: "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1.Prometheus"}, - ServiceMonitor: CrdKind{Plural: ServiceMonitorName, Kind: ServiceMonitorsKind, SpecName: "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1.ServiceMonitor"}, - PodMonitor: CrdKind{Plural: PodMonitorName, Kind: PodMonitorsKind, SpecName: "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1.PodMonitor"}, - Alertmanager: CrdKind{Plural: AlertmanagerName, Kind: AlertmanagersKind, SpecName: "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1.Alertmanager"}, - PrometheusRule: CrdKind{Plural: PrometheusRuleName, Kind: PrometheusRuleKind, SpecName: "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1.PrometheusRule"}, - ThanosRuler: CrdKind{Plural: ThanosRulerName, Kind: ThanosRulerKind, SpecName: "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1.ThanosRuler"}, -} - -// Implement the flag.Value interface -func (crdkinds *CrdKinds) String() string { - return crdkinds.KindsString -} - -// Set Implement the flag.Set interface -func (crdkinds *CrdKinds) Set(value string) error { - *crdkinds = DefaultCrdKinds - if value == "" { - value = fmt.Sprintf("%s=%s:%s,%s=%s:%s,%s=%s:%s,%s=%s:%s,%s=%s:%s,%s=%s:%s", - PrometheusKindKey, PrometheusesKind, PrometheusName, - AlertManagerKindKey, AlertmanagersKind, AlertmanagerName, - ServiceMonitorKindKey, ServiceMonitorsKind, ServiceMonitorName, - PodMonitorKindKey, PodMonitorsKind, PodMonitorName, - PrometheusRuleKindKey, PrometheusRuleKind, PrometheusRuleName, - ThanosRulerKindKey, ThanosRulerKind, ThanosRulerName, - ) - } - splited := strings.Split(value, ",") - for _, pair := range splited { - sp := strings.Split(pair, "=") - kind := strings.Split(sp[1], ":") - crdKind := CrdKind{Plural: kind[1], Kind: kind[0]} - switch kindKey := sp[0]; kindKey { - case PrometheusKindKey: - (*crdkinds).Prometheus = crdKind - case ServiceMonitorKindKey: - (*crdkinds).ServiceMonitor = crdKind - case PodMonitorKindKey: - (*crdkinds).PodMonitor = crdKind - case AlertManagerKindKey: - (*crdkinds).Alertmanager = crdKind - case PrometheusRuleKindKey: - (*crdkinds).PrometheusRule = crdKind - case ThanosRulerKindKey: - (*crdkinds).ThanosRuler = crdKind - default: - fmt.Printf("Warning: unknown kind: %s... ignoring", kindKey) - } - - } - (*crdkinds).KindsString = value - return nil -} diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go index 017846932..baf7d3be6 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go @@ -170,6 +170,10 @@ type ThanosRulerSpec struct { // Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. // Maps to the '--grpc-server-tls-*' CLI args. GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"` + // The external Query URL the Thanos Ruler will set in the 'Source' field + // of all alerts. + // Maps to the '--alert.query-url' CLI arg. + AlertQueryURL string `json:"alertQueryUrl,omitempty"` } // ThanosRulerStatus is the most recent observed status of the ThanosRuler. Read-only. Not diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/types.go b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/types.go index 5f0222645..f25a7dc6e 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/types.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/types.go @@ -193,7 +193,7 @@ type PrometheusSpec struct { // VolumeMounts specified will be appended to other VolumeMounts in the prometheus container, // that are generated as a result of StorageSpec objects. VolumeMounts []v1.VolumeMount `json:"volumeMounts,omitempty"` - // A selector to select which PrometheusRules to mount for loading alerting + // A selector to select which PrometheusRules to mount for loading alerting/recording // rules from. Until (excluding) Prometheus Operator v0.24.0 Prometheus // Operator will migrate any legacy rule ConfigMaps to PrometheusRule custom // resources selected by RuleSelector. Make sure it does not match any config @@ -321,6 +321,13 @@ type PrometheusSpec struct { // and metric that is user created. The label value will always be the namespace of the object that is // being created. EnforcedNamespaceLabel string `json:"enforcedNamespaceLabel,omitempty"` + // QueryLogFile specifies the file to which PromQL queries are logged. + // Note that this location must be writable, and can be persisted using an attached volume. + // Alternatively, the location can be set to a stdout location such as `/dev/stdout` to log + // querie information to the default Prometheus log stream. + // This is only available in versions of Prometheus >= 2.16.0. + // For more details, see the Prometheus docs (https://prometheus.io/docs/guides/query-log/) + QueryLogFile string `json:"queryLogFile,omitempty"` } // ArbitraryFSAccessThroughSMsConfig enables users to configure, whether @@ -368,6 +375,9 @@ type AlertingSpec struct { // If neither `emptyDir` nor `volumeClaimTemplate` is specified, then by default an [EmptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) will be used. // +k8s:openapi-gen=true type StorageSpec struct { + // Deprecated: subPath usage will be disabled by default in a future release, this option will become unnecessary. + // DisableMountSubPath allows to remove any subPath usage in volume mounts. + DisableMountSubPath bool `json:"disableMountSubPath,omitempty"` // EmptyDirVolumeSource to be used by the Prometheus StatefulSets. If specified, used in place of any volumeClaimTemplate. More // info: https://kubernetes.io/docs/concepts/storage/volumes/#emptydir EmptyDir *v1.EmptyDirVolumeSource `json:"emptyDir,omitempty"` @@ -422,16 +432,24 @@ type ThanosSpec struct { // Note: Currently only the CAFile, CertFile, and KeyFile fields are supported. // Maps to the '--grpc-server-tls-*' CLI args. GRPCServerTLSConfig *TLSConfig `json:"grpcServerTlsConfig,omitempty"` + // LogLevel for Thanos sidecar to be configured with. + LogLevel string `json:"logLevel,omitempty"` + // LogFormat for Thanos sidecar to be configured with. + LogFormat string `json:"logFormat,omitempty"` } // RemoteWriteSpec defines the remote_write configuration for prometheus. // +k8s:openapi-gen=true type RemoteWriteSpec struct { - //The URL of the endpoint to send samples to. + // The URL of the endpoint to send samples to. URL string `json:"url"` - //Timeout for requests to the remote write endpoint. + // The name of the remote write queue, must be unique if specified. The + // name is used in metrics and logging in order to differentiate queues. + // Only valid in Prometheus versions 2.15.0 and newer. + Name string `json:"name,omitempty"` + // Timeout for requests to the remote write endpoint. RemoteTimeout string `json:"remoteTimeout,omitempty"` - //The list of remote write relabel configurations. + // The list of remote write relabel configurations. WriteRelabelConfigs []RelabelConfig `json:"writeRelabelConfigs,omitempty"` //BasicAuth for the URL. BasicAuth *BasicAuth `json:"basicAuth,omitempty"` @@ -441,7 +459,7 @@ type RemoteWriteSpec struct { BearerTokenFile string `json:"bearerTokenFile,omitempty"` // TLS Config to use for remote write. TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` - //Optional ProxyURL + // Optional ProxyURL ProxyURL string `json:"proxyUrl,omitempty"` // QueueConfig allows tuning of the remote write queue parameters. QueueConfig *QueueConfig `json:"queueConfig,omitempty"` @@ -472,17 +490,21 @@ type QueueConfig struct { // RemoteReadSpec defines the remote_read configuration for prometheus. // +k8s:openapi-gen=true type RemoteReadSpec struct { - //The URL of the endpoint to send samples to. + // The URL of the endpoint to send samples to. URL string `json:"url"` - //An optional list of equality matchers which have to be present + // The name of the remote read queue, must be unique if specified. The name + // is used in metrics and logging in order to differentiate read + // configurations. Only valid in Prometheus versions 2.15.0 and newer. + Name string `json:"name,omitempty"` + // An optional list of equality matchers which have to be present // in a selector to query the remote read endpoint. RequiredMatchers map[string]string `json:"requiredMatchers,omitempty"` - //Timeout for requests to the remote read endpoint. + // Timeout for requests to the remote read endpoint. RemoteTimeout string `json:"remoteTimeout,omitempty"` - //Whether reads should be made for queries for time ranges that + // Whether reads should be made for queries for time ranges that // the local storage should have complete data for. ReadRecent bool `json:"readRecent,omitempty"` - //BasicAuth for the URL. + // BasicAuth for the URL. BasicAuth *BasicAuth `json:"basicAuth,omitempty"` // bearer token for remote read. BearerToken string `json:"bearerToken,omitempty"` @@ -490,7 +512,7 @@ type RemoteReadSpec struct { BearerTokenFile string `json:"bearerTokenFile,omitempty"` // TLS Config to use for remote read. TLSConfig *TLSConfig `json:"tlsConfig,omitempty"` - //Optional ProxyURL + // Optional ProxyURL ProxyURL string `json:"proxyUrl,omitempty"` } diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go index 5d67ca7bf..65ad1226f 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go @@ -294,42 +294,6 @@ func (in *BasicAuth) DeepCopy() *BasicAuth { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CrdKind) DeepCopyInto(out *CrdKind) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdKind. -func (in *CrdKind) DeepCopy() *CrdKind { - if in == nil { - return nil - } - out := new(CrdKind) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CrdKinds) DeepCopyInto(out *CrdKinds) { - *out = *in - out.Prometheus = in.Prometheus - out.Alertmanager = in.Alertmanager - out.ServiceMonitor = in.ServiceMonitor - out.PodMonitor = in.PodMonitor - out.PrometheusRule = in.PrometheusRule - out.ThanosRuler = in.ThanosRuler -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrdKinds. -func (in *CrdKinds) DeepCopy() *CrdKinds { - if in == nil { - return nil - } - out := new(CrdKinds) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = *in diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/alertmanager.go b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/alertmanager.go index 2b2474a48..5b7559900 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/alertmanager.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/alertmanager.go @@ -17,6 +17,7 @@ package v1 import ( + "context" "time" v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -35,15 +36,15 @@ type AlertmanagersGetter interface { // AlertmanagerInterface has methods to work with Alertmanager resources. type AlertmanagerInterface interface { - Create(*v1.Alertmanager) (*v1.Alertmanager, error) - Update(*v1.Alertmanager) (*v1.Alertmanager, error) - UpdateStatus(*v1.Alertmanager) (*v1.Alertmanager, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Alertmanager, error) - List(opts metav1.ListOptions) (*v1.AlertmanagerList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Alertmanager, err error) + Create(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.CreateOptions) (*v1.Alertmanager, error) + Update(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (*v1.Alertmanager, error) + UpdateStatus(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (*v1.Alertmanager, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Alertmanager, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AlertmanagerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Alertmanager, err error) AlertmanagerExpansion } @@ -62,20 +63,20 @@ func newAlertmanagers(c *MonitoringV1Client, namespace string) *alertmanagers { } // Get takes name of the alertmanager, and returns the corresponding alertmanager object, and an error if there is any. -func (c *alertmanagers) Get(name string, options metav1.GetOptions) (result *v1.Alertmanager, err error) { +func (c *alertmanagers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Alertmanager, err error) { result = &v1.Alertmanager{} err = c.client.Get(). Namespace(c.ns). Resource("alertmanagers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Alertmanagers that match those selectors. -func (c *alertmanagers) List(opts metav1.ListOptions) (result *v1.AlertmanagerList, err error) { +func (c *alertmanagers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AlertmanagerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -86,13 +87,13 @@ func (c *alertmanagers) List(opts metav1.ListOptions) (result *v1.AlertmanagerLi Resource("alertmanagers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested alertmanagers. -func (c *alertmanagers) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *alertmanagers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -103,87 +104,90 @@ func (c *alertmanagers) Watch(opts metav1.ListOptions) (watch.Interface, error) Resource("alertmanagers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a alertmanager and creates it. Returns the server's representation of the alertmanager, and an error, if there is any. -func (c *alertmanagers) Create(alertmanager *v1.Alertmanager) (result *v1.Alertmanager, err error) { +func (c *alertmanagers) Create(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.CreateOptions) (result *v1.Alertmanager, err error) { result = &v1.Alertmanager{} err = c.client.Post(). Namespace(c.ns). Resource("alertmanagers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(alertmanager). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a alertmanager and updates it. Returns the server's representation of the alertmanager, and an error, if there is any. -func (c *alertmanagers) Update(alertmanager *v1.Alertmanager) (result *v1.Alertmanager, err error) { +func (c *alertmanagers) Update(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (result *v1.Alertmanager, err error) { result = &v1.Alertmanager{} err = c.client.Put(). Namespace(c.ns). Resource("alertmanagers"). Name(alertmanager.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(alertmanager). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *alertmanagers) UpdateStatus(alertmanager *v1.Alertmanager) (result *v1.Alertmanager, err error) { +func (c *alertmanagers) UpdateStatus(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (result *v1.Alertmanager, err error) { result = &v1.Alertmanager{} err = c.client.Put(). Namespace(c.ns). Resource("alertmanagers"). Name(alertmanager.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(alertmanager). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the alertmanager and deletes it. Returns an error if one occurs. -func (c *alertmanagers) Delete(name string, options *metav1.DeleteOptions) error { +func (c *alertmanagers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("alertmanagers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *alertmanagers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *alertmanagers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("alertmanagers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched alertmanager. -func (c *alertmanagers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Alertmanager, err error) { +func (c *alertmanagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Alertmanager, err error) { result = &v1.Alertmanager{} err = c.client.Patch(pt). Namespace(c.ns). Resource("alertmanagers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go index 8d2b14096..f460caddb 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/podmonitor.go @@ -17,6 +17,7 @@ package v1 import ( + "context" "time" v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -35,14 +36,14 @@ type PodMonitorsGetter interface { // PodMonitorInterface has methods to work with PodMonitor resources. type PodMonitorInterface interface { - Create(*v1.PodMonitor) (*v1.PodMonitor, error) - Update(*v1.PodMonitor) (*v1.PodMonitor, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PodMonitor, error) - List(opts metav1.ListOptions) (*v1.PodMonitorList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodMonitor, err error) + Create(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.CreateOptions) (*v1.PodMonitor, error) + Update(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.UpdateOptions) (*v1.PodMonitor, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodMonitor, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PodMonitorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodMonitor, err error) PodMonitorExpansion } @@ -61,20 +62,20 @@ func newPodMonitors(c *MonitoringV1Client, namespace string) *podMonitors { } // Get takes name of the podMonitor, and returns the corresponding podMonitor object, and an error if there is any. -func (c *podMonitors) Get(name string, options metav1.GetOptions) (result *v1.PodMonitor, err error) { +func (c *podMonitors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodMonitor, err error) { result = &v1.PodMonitor{} err = c.client.Get(). Namespace(c.ns). Resource("podmonitors"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PodMonitors that match those selectors. -func (c *podMonitors) List(opts metav1.ListOptions) (result *v1.PodMonitorList, err error) { +func (c *podMonitors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodMonitorList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -85,13 +86,13 @@ func (c *podMonitors) List(opts metav1.ListOptions) (result *v1.PodMonitorList, Resource("podmonitors"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested podMonitors. -func (c *podMonitors) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *podMonitors) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -102,71 +103,74 @@ func (c *podMonitors) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("podmonitors"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a podMonitor and creates it. Returns the server's representation of the podMonitor, and an error, if there is any. -func (c *podMonitors) Create(podMonitor *v1.PodMonitor) (result *v1.PodMonitor, err error) { +func (c *podMonitors) Create(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.CreateOptions) (result *v1.PodMonitor, err error) { result = &v1.PodMonitor{} err = c.client.Post(). Namespace(c.ns). Resource("podmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podMonitor). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a podMonitor and updates it. Returns the server's representation of the podMonitor, and an error, if there is any. -func (c *podMonitors) Update(podMonitor *v1.PodMonitor) (result *v1.PodMonitor, err error) { +func (c *podMonitors) Update(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.UpdateOptions) (result *v1.PodMonitor, err error) { result = &v1.PodMonitor{} err = c.client.Put(). Namespace(c.ns). Resource("podmonitors"). Name(podMonitor.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(podMonitor). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the podMonitor and deletes it. Returns an error if one occurs. -func (c *podMonitors) Delete(name string, options *metav1.DeleteOptions) error { +func (c *podMonitors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("podmonitors"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podMonitors) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *podMonitors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("podmonitors"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched podMonitor. -func (c *podMonitors) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodMonitor, err error) { +func (c *podMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodMonitor, err error) { result = &v1.PodMonitor{} err = c.client.Patch(pt). Namespace(c.ns). Resource("podmonitors"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheus.go b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheus.go index d06f34807..5ec0b1817 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheus.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheus.go @@ -17,6 +17,7 @@ package v1 import ( + "context" "time" v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -35,15 +36,15 @@ type PrometheusesGetter interface { // PrometheusInterface has methods to work with Prometheus resources. type PrometheusInterface interface { - Create(*v1.Prometheus) (*v1.Prometheus, error) - Update(*v1.Prometheus) (*v1.Prometheus, error) - UpdateStatus(*v1.Prometheus) (*v1.Prometheus, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Prometheus, error) - List(opts metav1.ListOptions) (*v1.PrometheusList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Prometheus, err error) + Create(ctx context.Context, prometheus *v1.Prometheus, opts metav1.CreateOptions) (*v1.Prometheus, error) + Update(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (*v1.Prometheus, error) + UpdateStatus(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (*v1.Prometheus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Prometheus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PrometheusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Prometheus, err error) PrometheusExpansion } @@ -62,20 +63,20 @@ func newPrometheuses(c *MonitoringV1Client, namespace string) *prometheuses { } // Get takes name of the prometheus, and returns the corresponding prometheus object, and an error if there is any. -func (c *prometheuses) Get(name string, options metav1.GetOptions) (result *v1.Prometheus, err error) { +func (c *prometheuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Prometheus, err error) { result = &v1.Prometheus{} err = c.client.Get(). Namespace(c.ns). Resource("prometheuses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Prometheuses that match those selectors. -func (c *prometheuses) List(opts metav1.ListOptions) (result *v1.PrometheusList, err error) { +func (c *prometheuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PrometheusList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -86,13 +87,13 @@ func (c *prometheuses) List(opts metav1.ListOptions) (result *v1.PrometheusList, Resource("prometheuses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested prometheuses. -func (c *prometheuses) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *prometheuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -103,87 +104,90 @@ func (c *prometheuses) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("prometheuses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a prometheus and creates it. Returns the server's representation of the prometheus, and an error, if there is any. -func (c *prometheuses) Create(prometheus *v1.Prometheus) (result *v1.Prometheus, err error) { +func (c *prometheuses) Create(ctx context.Context, prometheus *v1.Prometheus, opts metav1.CreateOptions) (result *v1.Prometheus, err error) { result = &v1.Prometheus{} err = c.client.Post(). Namespace(c.ns). Resource("prometheuses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(prometheus). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a prometheus and updates it. Returns the server's representation of the prometheus, and an error, if there is any. -func (c *prometheuses) Update(prometheus *v1.Prometheus) (result *v1.Prometheus, err error) { +func (c *prometheuses) Update(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (result *v1.Prometheus, err error) { result = &v1.Prometheus{} err = c.client.Put(). Namespace(c.ns). Resource("prometheuses"). Name(prometheus.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(prometheus). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *prometheuses) UpdateStatus(prometheus *v1.Prometheus) (result *v1.Prometheus, err error) { +func (c *prometheuses) UpdateStatus(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (result *v1.Prometheus, err error) { result = &v1.Prometheus{} err = c.client.Put(). Namespace(c.ns). Resource("prometheuses"). Name(prometheus.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(prometheus). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the prometheus and deletes it. Returns an error if one occurs. -func (c *prometheuses) Delete(name string, options *metav1.DeleteOptions) error { +func (c *prometheuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("prometheuses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *prometheuses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *prometheuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("prometheuses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched prometheus. -func (c *prometheuses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Prometheus, err error) { +func (c *prometheuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Prometheus, err error) { result = &v1.Prometheus{} err = c.client.Patch(pt). Namespace(c.ns). Resource("prometheuses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go index 8bce2905c..21925e4bd 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/prometheusrule.go @@ -17,6 +17,7 @@ package v1 import ( + "context" "time" v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -35,14 +36,14 @@ type PrometheusRulesGetter interface { // PrometheusRuleInterface has methods to work with PrometheusRule resources. type PrometheusRuleInterface interface { - Create(*v1.PrometheusRule) (*v1.PrometheusRule, error) - Update(*v1.PrometheusRule) (*v1.PrometheusRule, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PrometheusRule, error) - List(opts metav1.ListOptions) (*v1.PrometheusRuleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PrometheusRule, err error) + Create(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.CreateOptions) (*v1.PrometheusRule, error) + Update(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.UpdateOptions) (*v1.PrometheusRule, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PrometheusRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PrometheusRuleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PrometheusRule, err error) PrometheusRuleExpansion } @@ -61,20 +62,20 @@ func newPrometheusRules(c *MonitoringV1Client, namespace string) *prometheusRule } // Get takes name of the prometheusRule, and returns the corresponding prometheusRule object, and an error if there is any. -func (c *prometheusRules) Get(name string, options metav1.GetOptions) (result *v1.PrometheusRule, err error) { +func (c *prometheusRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PrometheusRule, err error) { result = &v1.PrometheusRule{} err = c.client.Get(). Namespace(c.ns). Resource("prometheusrules"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PrometheusRules that match those selectors. -func (c *prometheusRules) List(opts metav1.ListOptions) (result *v1.PrometheusRuleList, err error) { +func (c *prometheusRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PrometheusRuleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -85,13 +86,13 @@ func (c *prometheusRules) List(opts metav1.ListOptions) (result *v1.PrometheusRu Resource("prometheusrules"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested prometheusRules. -func (c *prometheusRules) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *prometheusRules) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -102,71 +103,74 @@ func (c *prometheusRules) Watch(opts metav1.ListOptions) (watch.Interface, error Resource("prometheusrules"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a prometheusRule and creates it. Returns the server's representation of the prometheusRule, and an error, if there is any. -func (c *prometheusRules) Create(prometheusRule *v1.PrometheusRule) (result *v1.PrometheusRule, err error) { +func (c *prometheusRules) Create(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.CreateOptions) (result *v1.PrometheusRule, err error) { result = &v1.PrometheusRule{} err = c.client.Post(). Namespace(c.ns). Resource("prometheusrules"). + VersionedParams(&opts, scheme.ParameterCodec). Body(prometheusRule). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a prometheusRule and updates it. Returns the server's representation of the prometheusRule, and an error, if there is any. -func (c *prometheusRules) Update(prometheusRule *v1.PrometheusRule) (result *v1.PrometheusRule, err error) { +func (c *prometheusRules) Update(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.UpdateOptions) (result *v1.PrometheusRule, err error) { result = &v1.PrometheusRule{} err = c.client.Put(). Namespace(c.ns). Resource("prometheusrules"). Name(prometheusRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(prometheusRule). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the prometheusRule and deletes it. Returns an error if one occurs. -func (c *prometheusRules) Delete(name string, options *metav1.DeleteOptions) error { +func (c *prometheusRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("prometheusrules"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *prometheusRules) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *prometheusRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("prometheusrules"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched prometheusRule. -func (c *prometheusRules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PrometheusRule, err error) { +func (c *prometheusRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PrometheusRule, err error) { result = &v1.PrometheusRule{} err = c.client.Patch(pt). Namespace(c.ns). Resource("prometheusrules"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go index d058774e9..9061f3f93 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/servicemonitor.go @@ -17,6 +17,7 @@ package v1 import ( + "context" "time" v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -35,14 +36,14 @@ type ServiceMonitorsGetter interface { // ServiceMonitorInterface has methods to work with ServiceMonitor resources. type ServiceMonitorInterface interface { - Create(*v1.ServiceMonitor) (*v1.ServiceMonitor, error) - Update(*v1.ServiceMonitor) (*v1.ServiceMonitor, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ServiceMonitor, error) - List(opts metav1.ListOptions) (*v1.ServiceMonitorList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceMonitor, err error) + Create(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.CreateOptions) (*v1.ServiceMonitor, error) + Update(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.UpdateOptions) (*v1.ServiceMonitor, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceMonitor, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceMonitorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceMonitor, err error) ServiceMonitorExpansion } @@ -61,20 +62,20 @@ func newServiceMonitors(c *MonitoringV1Client, namespace string) *serviceMonitor } // Get takes name of the serviceMonitor, and returns the corresponding serviceMonitor object, and an error if there is any. -func (c *serviceMonitors) Get(name string, options metav1.GetOptions) (result *v1.ServiceMonitor, err error) { +func (c *serviceMonitors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceMonitor, err error) { result = &v1.ServiceMonitor{} err = c.client.Get(). Namespace(c.ns). Resource("servicemonitors"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ServiceMonitors that match those selectors. -func (c *serviceMonitors) List(opts metav1.ListOptions) (result *v1.ServiceMonitorList, err error) { +func (c *serviceMonitors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceMonitorList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -85,13 +86,13 @@ func (c *serviceMonitors) List(opts metav1.ListOptions) (result *v1.ServiceMonit Resource("servicemonitors"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested serviceMonitors. -func (c *serviceMonitors) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *serviceMonitors) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -102,71 +103,74 @@ func (c *serviceMonitors) Watch(opts metav1.ListOptions) (watch.Interface, error Resource("servicemonitors"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a serviceMonitor and creates it. Returns the server's representation of the serviceMonitor, and an error, if there is any. -func (c *serviceMonitors) Create(serviceMonitor *v1.ServiceMonitor) (result *v1.ServiceMonitor, err error) { +func (c *serviceMonitors) Create(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.CreateOptions) (result *v1.ServiceMonitor, err error) { result = &v1.ServiceMonitor{} err = c.client.Post(). Namespace(c.ns). Resource("servicemonitors"). + VersionedParams(&opts, scheme.ParameterCodec). Body(serviceMonitor). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a serviceMonitor and updates it. Returns the server's representation of the serviceMonitor, and an error, if there is any. -func (c *serviceMonitors) Update(serviceMonitor *v1.ServiceMonitor) (result *v1.ServiceMonitor, err error) { +func (c *serviceMonitors) Update(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.UpdateOptions) (result *v1.ServiceMonitor, err error) { result = &v1.ServiceMonitor{} err = c.client.Put(). Namespace(c.ns). Resource("servicemonitors"). Name(serviceMonitor.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(serviceMonitor). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the serviceMonitor and deletes it. Returns an error if one occurs. -func (c *serviceMonitors) Delete(name string, options *metav1.DeleteOptions) error { +func (c *serviceMonitors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("servicemonitors"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *serviceMonitors) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *serviceMonitors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("servicemonitors"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched serviceMonitor. -func (c *serviceMonitors) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceMonitor, err error) { +func (c *serviceMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceMonitor, err error) { result = &v1.ServiceMonitor{} err = c.client.Patch(pt). Namespace(c.ns). Resource("servicemonitors"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/thanosruler.go b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/thanosruler.go index de5090e98..7fc7b0163 100644 --- a/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/thanosruler.go +++ b/vendor/github.com/coreos/prometheus-operator/pkg/client/versioned/typed/monitoring/v1/thanosruler.go @@ -17,6 +17,7 @@ package v1 import ( + "context" "time" v1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -35,15 +36,15 @@ type ThanosRulersGetter interface { // ThanosRulerInterface has methods to work with ThanosRuler resources. type ThanosRulerInterface interface { - Create(*v1.ThanosRuler) (*v1.ThanosRuler, error) - Update(*v1.ThanosRuler) (*v1.ThanosRuler, error) - UpdateStatus(*v1.ThanosRuler) (*v1.ThanosRuler, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ThanosRuler, error) - List(opts metav1.ListOptions) (*v1.ThanosRulerList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ThanosRuler, err error) + Create(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.CreateOptions) (*v1.ThanosRuler, error) + Update(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (*v1.ThanosRuler, error) + UpdateStatus(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (*v1.ThanosRuler, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ThanosRuler, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ThanosRulerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ThanosRuler, err error) ThanosRulerExpansion } @@ -62,20 +63,20 @@ func newThanosRulers(c *MonitoringV1Client, namespace string) *thanosRulers { } // Get takes name of the thanosRuler, and returns the corresponding thanosRuler object, and an error if there is any. -func (c *thanosRulers) Get(name string, options metav1.GetOptions) (result *v1.ThanosRuler, err error) { +func (c *thanosRulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ThanosRuler, err error) { result = &v1.ThanosRuler{} err = c.client.Get(). Namespace(c.ns). Resource("thanosrulers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ThanosRulers that match those selectors. -func (c *thanosRulers) List(opts metav1.ListOptions) (result *v1.ThanosRulerList, err error) { +func (c *thanosRulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ThanosRulerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -86,13 +87,13 @@ func (c *thanosRulers) List(opts metav1.ListOptions) (result *v1.ThanosRulerList Resource("thanosrulers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested thanosRulers. -func (c *thanosRulers) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *thanosRulers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -103,87 +104,90 @@ func (c *thanosRulers) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("thanosrulers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a thanosRuler and creates it. Returns the server's representation of the thanosRuler, and an error, if there is any. -func (c *thanosRulers) Create(thanosRuler *v1.ThanosRuler) (result *v1.ThanosRuler, err error) { +func (c *thanosRulers) Create(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.CreateOptions) (result *v1.ThanosRuler, err error) { result = &v1.ThanosRuler{} err = c.client.Post(). Namespace(c.ns). Resource("thanosrulers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(thanosRuler). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a thanosRuler and updates it. Returns the server's representation of the thanosRuler, and an error, if there is any. -func (c *thanosRulers) Update(thanosRuler *v1.ThanosRuler) (result *v1.ThanosRuler, err error) { +func (c *thanosRulers) Update(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (result *v1.ThanosRuler, err error) { result = &v1.ThanosRuler{} err = c.client.Put(). Namespace(c.ns). Resource("thanosrulers"). Name(thanosRuler.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(thanosRuler). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *thanosRulers) UpdateStatus(thanosRuler *v1.ThanosRuler) (result *v1.ThanosRuler, err error) { +func (c *thanosRulers) UpdateStatus(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (result *v1.ThanosRuler, err error) { result = &v1.ThanosRuler{} err = c.client.Put(). Namespace(c.ns). Resource("thanosrulers"). Name(thanosRuler.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(thanosRuler). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the thanosRuler and deletes it. Returns an error if one occurs. -func (c *thanosRulers) Delete(name string, options *metav1.DeleteOptions) error { +func (c *thanosRulers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("thanosrulers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *thanosRulers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *thanosRulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("thanosrulers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched thanosRuler. -func (c *thanosRulers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ThanosRuler, err error) { +func (c *thanosRulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ThanosRuler, err error) { result = &v1.ThanosRuler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("thanosrulers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/evanphx/json-patch/.travis.yml b/vendor/github.com/evanphx/json-patch/.travis.yml index 2092c72c4..50e4afd19 100644 --- a/vendor/github.com/evanphx/json-patch/.travis.yml +++ b/vendor/github.com/evanphx/json-patch/.travis.yml @@ -1,8 +1,8 @@ language: go go: - - 1.8 - - 1.7 + - 1.14 + - 1.13 install: - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi @@ -11,6 +11,9 @@ install: script: - go get - go test -cover ./... + - cd ./v5 + - go get + - go test -cover ./... notifications: email: false diff --git a/vendor/github.com/evanphx/json-patch/LICENSE b/vendor/github.com/evanphx/json-patch/LICENSE index 0eb9b72d8..df76d7d77 100644 --- a/vendor/github.com/evanphx/json-patch/LICENSE +++ b/vendor/github.com/evanphx/json-patch/LICENSE @@ -6,7 +6,7 @@ modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice +* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the Evan Phoenix nor the names of its contributors diff --git a/vendor/github.com/evanphx/json-patch/README.md b/vendor/github.com/evanphx/json-patch/README.md index 9c7f87f7c..121b039db 100644 --- a/vendor/github.com/evanphx/json-patch/README.md +++ b/vendor/github.com/evanphx/json-patch/README.md @@ -1,5 +1,5 @@ # JSON-Patch -`jsonpatch` is a library which provides functionallity for both applying +`jsonpatch` is a library which provides functionality for both applying [RFC6902 JSON patches](http://tools.ietf.org/html/rfc6902) against documents, as well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ietf.org/html/rfc7396). @@ -11,10 +11,11 @@ well as for calculating & applying [RFC7396 JSON merge patches](https://tools.ie **Latest and greatest**: ```bash -go get -u github.com/evanphx/json-patch +go get -u github.com/evanphx/json-patch/v5 ``` **Stable Versions**: +* Version 5: `go get -u gopkg.in/evanphx/json-patch.v5` * Version 4: `go get -u gopkg.in/evanphx/json-patch.v4` (previous versions below `v3` are unavailable) @@ -82,7 +83,7 @@ When ran, you get the following output: ```bash $ go run main.go patch document: {"height":null,"name":"Jane"} -updated tina doc: {"age":28,"name":"Jane"} +updated alternative doc: {"age":28,"name":"Jane"} ``` ## Create and apply a JSON Patch @@ -164,7 +165,7 @@ func main() { } if !jsonpatch.Equal(original, different) { - fmt.Println(`"original" is _not_ structurally equal to "similar"`) + fmt.Println(`"original" is _not_ structurally equal to "different"`) } } ``` @@ -173,7 +174,7 @@ When ran, you get the following output: ```bash $ go run main.go "original" is structurally equal to "similar" -"original" is _not_ structurally equal to "similar" +"original" is _not_ structurally equal to "different" ``` ## Combine merge patches diff --git a/vendor/github.com/evanphx/json-patch/merge.go b/vendor/github.com/evanphx/json-patch/merge.go index 6806c4c20..14e8bb5ce 100644 --- a/vendor/github.com/evanphx/json-patch/merge.go +++ b/vendor/github.com/evanphx/json-patch/merge.go @@ -307,13 +307,16 @@ func matchesValue(av, bv interface{}) bool { return true case map[string]interface{}: bt := bv.(map[string]interface{}) - for key := range at { - if !matchesValue(at[key], bt[key]) { - return false - } + if len(bt) != len(at) { + return false } for key := range bt { - if !matchesValue(at[key], bt[key]) { + av, aOK := at[key] + bv, bOK := bt[key] + if aOK != bOK { + return false + } + if !matchesValue(av, bv) { return false } } diff --git a/vendor/github.com/evanphx/json-patch/patch.go b/vendor/github.com/evanphx/json-patch/patch.go index 1b5f95e61..f185a45b2 100644 --- a/vendor/github.com/evanphx/json-patch/patch.go +++ b/vendor/github.com/evanphx/json-patch/patch.go @@ -202,6 +202,10 @@ func (n *lazyNode) equal(o *lazyNode) bool { return false } + if len(n.doc) != len(o.doc) { + return false + } + for k, v := range n.doc { ov, ok := o.doc[k] @@ -209,6 +213,10 @@ func (n *lazyNode) equal(o *lazyNode) bool { return false } + if (v == nil) != (ov == nil) { + return false + } + if v == nil && ov == nil { continue } @@ -429,14 +437,14 @@ func (d *partialArray) add(key string, val *lazyNode) error { return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } - if SupportNegativeIndices { - if idx < -len(ary) { + if idx < 0 { + if !SupportNegativeIndices { return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } - - if idx < 0 { - idx += len(ary) + if idx < -len(ary) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } + idx += len(ary) } copy(ary[0:idx], cur[0:idx]) @@ -473,14 +481,14 @@ func (d *partialArray) remove(key string) error { return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } - if SupportNegativeIndices { - if idx < -len(cur) { + if idx < 0 { + if !SupportNegativeIndices { return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } - - if idx < 0 { - idx += len(cur) + if idx < -len(cur) { + return errors.Wrapf(ErrInvalidIndex, "Unable to access invalid index: %d", idx) } + idx += len(cur) } ary := make([]*lazyNode, len(cur)-1) diff --git a/vendor/github.com/json-iterator/go/README.md b/vendor/github.com/json-iterator/go/README.md index 50d56ffbf..52b111d5f 100644 --- a/vendor/github.com/json-iterator/go/README.md +++ b/vendor/github.com/json-iterator/go/README.md @@ -1,5 +1,5 @@ [![Sourcegraph](https://sourcegraph.com/github.com/json-iterator/go/-/badge.svg)](https://sourcegraph.com/github.com/json-iterator/go?badge) -[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/json-iterator/go) +[![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/json-iterator/go) [![Build Status](https://travis-ci.org/json-iterator/go.svg?branch=master)](https://travis-ci.org/json-iterator/go) [![codecov](https://codecov.io/gh/json-iterator/go/branch/master/graph/badge.svg)](https://codecov.io/gh/json-iterator/go) [![rcard](https://goreportcard.com/badge/github.com/json-iterator/go)](https://goreportcard.com/report/github.com/json-iterator/go) @@ -18,16 +18,16 @@ Source code: https://github.com/json-iterator/go-benchmark/blob/master/src/githu Raw Result (easyjson requires static code generation) -| | ns/op | allocation bytes | allocation times | -| --- | --- | --- | --- | -| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | -| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | -| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | -| std encode | 2213 ns/op | 712 B/op | 5 allocs/op | -| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | -| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | +| | ns/op | allocation bytes | allocation times | +| --------------- | ----------- | ---------------- | ---------------- | +| std decode | 35510 ns/op | 1960 B/op | 99 allocs/op | +| easyjson decode | 8499 ns/op | 160 B/op | 4 allocs/op | +| jsoniter decode | 5623 ns/op | 160 B/op | 3 allocs/op | +| std encode | 2213 ns/op | 712 B/op | 5 allocs/op | +| easyjson encode | 883 ns/op | 576 B/op | 3 allocs/op | +| jsoniter encode | 837 ns/op | 384 B/op | 4 allocs/op | -Always benchmark with your own workload. +Always benchmark with your own workload. The result depends heavily on the data input. # Usage @@ -41,10 +41,10 @@ import "encoding/json" json.Marshal(&data) ``` -with +with ```go -import "github.com/json-iterator/go" +import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary json.Marshal(&data) @@ -60,7 +60,7 @@ json.Unmarshal(input, &data) with ```go -import "github.com/json-iterator/go" +import jsoniter "github.com/json-iterator/go" var json = jsoniter.ConfigCompatibleWithStandardLibrary json.Unmarshal(input, &data) @@ -78,10 +78,10 @@ go get github.com/json-iterator/go Contributors -* [thockin](https://github.com/thockin) -* [mattn](https://github.com/mattn) -* [cch123](https://github.com/cch123) -* [Oleg Shaldybin](https://github.com/olegshaldybin) -* [Jason Toffaletti](https://github.com/toffaletti) +- [thockin](https://github.com/thockin) +- [mattn](https://github.com/mattn) +- [cch123](https://github.com/cch123) +- [Oleg Shaldybin](https://github.com/olegshaldybin) +- [Jason Toffaletti](https://github.com/toffaletti) Report issue or pull request, or email taowen@gmail.com, or [![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.png)](https://gitter.im/json-iterator/Lobby) diff --git a/vendor/github.com/json-iterator/go/any_str.go b/vendor/github.com/json-iterator/go/any_str.go index a4b93c78c..1f12f6612 100644 --- a/vendor/github.com/json-iterator/go/any_str.go +++ b/vendor/github.com/json-iterator/go/any_str.go @@ -64,7 +64,6 @@ func (any *stringAny) ToInt64() int64 { flag := 1 startPos := 0 - endPos := 0 if any.val[0] == '+' || any.val[0] == '-' { startPos = 1 } @@ -73,6 +72,7 @@ func (any *stringAny) ToInt64() int64 { flag = -1 } + endPos := startPos for i := startPos; i < len(any.val); i++ { if any.val[i] >= '0' && any.val[i] <= '9' { endPos = i + 1 @@ -98,7 +98,6 @@ func (any *stringAny) ToUint64() uint64 { } startPos := 0 - endPos := 0 if any.val[0] == '-' { return 0 @@ -107,6 +106,7 @@ func (any *stringAny) ToUint64() uint64 { startPos = 1 } + endPos := startPos for i := startPos; i < len(any.val); i++ { if any.val[i] >= '0' && any.val[i] <= '9' { endPos = i + 1 diff --git a/vendor/github.com/json-iterator/go/config.go b/vendor/github.com/json-iterator/go/config.go index 8c58fcba5..2adcdc3b7 100644 --- a/vendor/github.com/json-iterator/go/config.go +++ b/vendor/github.com/json-iterator/go/config.go @@ -183,11 +183,11 @@ func (cfg *frozenConfig) validateJsonRawMessage(extension EncoderExtension) { encoder := &funcEncoder{func(ptr unsafe.Pointer, stream *Stream) { rawMessage := *(*json.RawMessage)(ptr) iter := cfg.BorrowIterator([]byte(rawMessage)) + defer cfg.ReturnIterator(iter) iter.Read() - if iter.Error != nil { + if iter.Error != nil && iter.Error != io.EOF { stream.WriteRaw("null") } else { - cfg.ReturnIterator(iter) stream.WriteRaw(string(rawMessage)) } }, func(ptr unsafe.Pointer) bool { diff --git a/vendor/github.com/json-iterator/go/iter_object.go b/vendor/github.com/json-iterator/go/iter_object.go index b65137114..58ee89c84 100644 --- a/vendor/github.com/json-iterator/go/iter_object.go +++ b/vendor/github.com/json-iterator/go/iter_object.go @@ -150,7 +150,7 @@ func (iter *Iterator) ReadObjectCB(callback func(*Iterator, string) bool) bool { if c == '}' { return iter.decrementDepth() } - iter.ReportError("ReadObjectCB", `expect " after }, but found `+string([]byte{c})) + iter.ReportError("ReadObjectCB", `expect " after {, but found `+string([]byte{c})) iter.decrementDepth() return false } @@ -206,7 +206,7 @@ func (iter *Iterator) ReadMapCB(callback func(*Iterator, string) bool) bool { if c == '}' { return iter.decrementDepth() } - iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c})) + iter.ReportError("ReadMapCB", `expect " after {, but found `+string([]byte{c})) iter.decrementDepth() return false } diff --git a/vendor/github.com/json-iterator/go/reflect_extension.go b/vendor/github.com/json-iterator/go/reflect_extension.go index 80320cd64..74a97bfe5 100644 --- a/vendor/github.com/json-iterator/go/reflect_extension.go +++ b/vendor/github.com/json-iterator/go/reflect_extension.go @@ -475,7 +475,7 @@ func calcFieldNames(originalFieldName string, tagProvidedFieldName string, whole fieldNames = []string{tagProvidedFieldName} } // private? - isNotExported := unicode.IsLower(rune(originalFieldName[0])) + isNotExported := unicode.IsLower(rune(originalFieldName[0])) || originalFieldName[0] == '_' if isNotExported { fieldNames = []string{} } diff --git a/vendor/github.com/json-iterator/go/reflect_map.go b/vendor/github.com/json-iterator/go/reflect_map.go index 9e2b623fe..582967130 100644 --- a/vendor/github.com/json-iterator/go/reflect_map.go +++ b/vendor/github.com/json-iterator/go/reflect_map.go @@ -49,6 +49,33 @@ func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder { return decoder } } + + ptrType := reflect2.PtrTo(typ) + if ptrType.Implements(unmarshalerType) { + return &referenceDecoder{ + &unmarshalerDecoder{ + valType: ptrType, + }, + } + } + if typ.Implements(unmarshalerType) { + return &unmarshalerDecoder{ + valType: typ, + } + } + if ptrType.Implements(textUnmarshalerType) { + return &referenceDecoder{ + &textUnmarshalerDecoder{ + valType: ptrType, + }, + } + } + if typ.Implements(textUnmarshalerType) { + return &textUnmarshalerDecoder{ + valType: typ, + } + } + switch typ.Kind() { case reflect.String: return decoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String)) @@ -63,31 +90,6 @@ func decoderOfMapKey(ctx *ctx, typ reflect2.Type) ValDecoder { typ = reflect2.DefaultTypeOfKind(typ.Kind()) return &numericMapKeyDecoder{decoderOfType(ctx, typ)} default: - ptrType := reflect2.PtrTo(typ) - if ptrType.Implements(unmarshalerType) { - return &referenceDecoder{ - &unmarshalerDecoder{ - valType: ptrType, - }, - } - } - if typ.Implements(unmarshalerType) { - return &unmarshalerDecoder{ - valType: typ, - } - } - if ptrType.Implements(textUnmarshalerType) { - return &referenceDecoder{ - &textUnmarshalerDecoder{ - valType: ptrType, - }, - } - } - if typ.Implements(textUnmarshalerType) { - return &textUnmarshalerDecoder{ - valType: typ, - } - } return &lazyErrorDecoder{err: fmt.Errorf("unsupported map key type: %v", typ)} } } @@ -103,6 +105,19 @@ func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder { return encoder } } + + if typ == textMarshalerType { + return &directTextMarshalerEncoder{ + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + } + } + if typ.Implements(textMarshalerType) { + return &textMarshalerEncoder{ + valType: typ, + stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), + } + } + switch typ.Kind() { case reflect.String: return encoderOfType(ctx, reflect2.DefaultTypeOfKind(reflect.String)) @@ -117,17 +132,6 @@ func encoderOfMapKey(ctx *ctx, typ reflect2.Type) ValEncoder { typ = reflect2.DefaultTypeOfKind(typ.Kind()) return &numericMapKeyEncoder{encoderOfType(ctx, typ)} default: - if typ == textMarshalerType { - return &directTextMarshalerEncoder{ - stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), - } - } - if typ.Implements(textMarshalerType) { - return &textMarshalerEncoder{ - valType: typ, - stringEncoder: ctx.EncoderOf(reflect2.TypeOf("")), - } - } if typ.Kind() == reflect.Interface { return &dynamicMapKeyEncoder{ctx, typ} } @@ -163,10 +167,6 @@ func (decoder *mapDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) { if c == '}' { return } - if c != '"' { - iter.ReportError("ReadMapCB", `expect " after }, but found `+string([]byte{c})) - return - } iter.unreadByte() key := decoder.keyType.UnsafeNew() decoder.keyDecoder.Decode(key, iter) diff --git a/vendor/github.com/json-iterator/go/reflect_optional.go b/vendor/github.com/json-iterator/go/reflect_optional.go index 43ec71d6d..fa71f4748 100644 --- a/vendor/github.com/json-iterator/go/reflect_optional.go +++ b/vendor/github.com/json-iterator/go/reflect_optional.go @@ -2,7 +2,6 @@ package jsoniter import ( "github.com/modern-go/reflect2" - "reflect" "unsafe" ) @@ -10,9 +9,6 @@ func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder { ptrType := typ.(*reflect2.UnsafePtrType) elemType := ptrType.Elem() decoder := decoderOfType(ctx, elemType) - if ctx.prefix == "" && elemType.Kind() == reflect.Ptr { - return &dereferenceDecoder{elemType, decoder} - } return &OptionalDecoder{elemType, decoder} } diff --git a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go index 5ad5cc561..d7eb0eb5c 100644 --- a/vendor/github.com/json-iterator/go/reflect_struct_decoder.go +++ b/vendor/github.com/json-iterator/go/reflect_struct_decoder.go @@ -507,7 +507,7 @@ func (decoder *generalStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) for c = ','; c == ','; c = iter.nextToken() { decoder.decodeOneField(ptr, iter) } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } if c != '}' { @@ -588,7 +588,7 @@ func (decoder *oneFieldStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -622,7 +622,7 @@ func (decoder *twoFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -660,7 +660,7 @@ func (decoder *threeFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -702,7 +702,7 @@ func (decoder *fourFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -748,7 +748,7 @@ func (decoder *fiveFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -798,7 +798,7 @@ func (decoder *sixFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -852,7 +852,7 @@ func (decoder *sevenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -910,7 +910,7 @@ func (decoder *eightFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterat break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -972,7 +972,7 @@ func (decoder *nineFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterato break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() @@ -1038,7 +1038,7 @@ func (decoder *tenFieldsStructDecoder) Decode(ptr unsafe.Pointer, iter *Iterator break } } - if iter.Error != nil && iter.Error != io.EOF { + if iter.Error != nil && iter.Error != io.EOF && len(decoder.typ.Type1().Name()) != 0 { iter.Error = fmt.Errorf("%v.%s", decoder.typ, iter.Error.Error()) } iter.decrementDepth() diff --git a/vendor/github.com/json-iterator/go/stream.go b/vendor/github.com/json-iterator/go/stream.go index 17662fded..23d8a3ad6 100644 --- a/vendor/github.com/json-iterator/go/stream.go +++ b/vendor/github.com/json-iterator/go/stream.go @@ -103,14 +103,14 @@ func (stream *Stream) Flush() error { if stream.Error != nil { return stream.Error } - n, err := stream.out.Write(stream.buf) + _, err := stream.out.Write(stream.buf) if err != nil { if stream.Error == nil { stream.Error = err } return err } - stream.buf = stream.buf[n:] + stream.buf = stream.buf[:0] return nil } @@ -177,7 +177,6 @@ func (stream *Stream) WriteEmptyObject() { func (stream *Stream) WriteMore() { stream.writeByte(',') stream.writeIndention(0) - stream.Flush() } // WriteArrayStart write [ with possible indention diff --git a/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go b/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go new file mode 100644 index 000000000..188492b21 --- /dev/null +++ b/vendor/github.com/onsi/gomega/gstruct/errors/nested_types.go @@ -0,0 +1,72 @@ +package errors + +import ( + "fmt" + "strings" + + "github.com/onsi/gomega/types" +) + +// A stateful matcher that nests other matchers within it and preserves the error types of the +// nested matcher failures. +type NestingMatcher interface { + types.GomegaMatcher + + // Returns the failures of nested matchers. + Failures() []error +} + +// An error type for labeling errors on deeply nested matchers. +type NestedError struct { + Path string + Err error +} + +func (e *NestedError) Error() string { + // Indent Errors. + indented := strings.Replace(e.Err.Error(), "\n", "\n\t", -1) + return fmt.Sprintf("%s:\n\t%v", e.Path, indented) +} + +// Create a NestedError with the given path. +// If err is a NestedError, prepend the path to it. +// If err is an AggregateError, recursively Nest each error. +func Nest(path string, err error) error { + if ag, ok := err.(AggregateError); ok { + var errs AggregateError + for _, e := range ag { + errs = append(errs, Nest(path, e)) + } + return errs + } + if ne, ok := err.(*NestedError); ok { + return &NestedError{ + Path: path + ne.Path, + Err: ne.Err, + } + } + return &NestedError{ + Path: path, + Err: err, + } +} + +// An error type for treating multiple errors as a single error. +type AggregateError []error + +// Error is part of the error interface. +func (err AggregateError) Error() string { + if len(err) == 0 { + // This should never happen, really. + return "" + } + if len(err) == 1 { + return err[0].Error() + } + result := fmt.Sprintf("[%s", err[0].Error()) + for i := 1; i < len(err); i++ { + result += fmt.Sprintf(", %s", err[i].Error()) + } + result += "]" + return result +} diff --git a/vendor/github.com/operator-framework/api/pkg/lib/version/version.go b/vendor/github.com/operator-framework/api/pkg/lib/version/version.go new file mode 100644 index 000000000..713c5779b --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/lib/version/version.go @@ -0,0 +1,67 @@ +package version + +import ( + "encoding/json" + + "github.com/blang/semver" +) + +// +k8s:openapi-gen=true +// OperatorVersion is a wrapper around semver.Version which supports correct +// marshaling to YAML and JSON. +// +kubebuilder:validation:Type=string +type OperatorVersion struct { + semver.Version `json:"-"` +} + +// DeepCopyInto creates a deep-copy of the Version value. +func (v *OperatorVersion) DeepCopyInto(out *OperatorVersion) { + out.Major = v.Major + out.Minor = v.Minor + out.Patch = v.Patch + + if v.Pre != nil { + pre := make([]semver.PRVersion, len(v.Pre)) + copy(pre, v.Pre) + out.Pre = pre + } + + if v.Build != nil { + build := make([]string, len(v.Build)) + copy(build, v.Build) + out.Build = build + } +} + +// MarshalJSON implements the encoding/json.Marshaler interface. +func (v OperatorVersion) MarshalJSON() ([]byte, error) { + return json.Marshal(v.String()) +} + +// UnmarshalJSON implements the encoding/json.Unmarshaler interface. +func (v *OperatorVersion) UnmarshalJSON(data []byte) (err error) { + var versionString string + + if err = json.Unmarshal(data, &versionString); err != nil { + return + } + + version := semver.Version{} + version, err = semver.ParseTolerant(versionString) + if err != nil { + return err + } + v.Version = version + return +} + +// OpenAPISchemaType is used by the kube-openapi generator when constructing +// the OpenAPI spec of this type. +// +// See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators +func (_ OperatorVersion) OpenAPISchemaType() []string { return []string{"string"} } + +// OpenAPISchemaFormat is used by the kube-openapi generator when constructing +// the OpenAPI spec of this type. +// "semver" is not a standard openapi format but tooling may use the value regardless +func (_ OperatorVersion) OpenAPISchemaFormat() string { return "semver" } diff --git a/vendor/github.com/operator-framework/api/pkg/operators/catalogsource_types.go b/vendor/github.com/operator-framework/api/pkg/operators/catalogsource_types.go new file mode 100644 index 000000000..ff810f550 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/catalogsource_types.go @@ -0,0 +1,142 @@ +package operators + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +// CatalogSourceKind is the PascalCase name of a CatalogSource's kind. +const CatalogSourceKind = "CatalogSource" + +// SourceType indicates the type of backing store for a CatalogSource +type SourceType string + +const ( + // SourceTypeInternal (deprecated) specifies a CatalogSource of type SourceTypeConfigmap + SourceTypeInternal SourceType = "internal" + + // SourceTypeConfigmap specifies a CatalogSource that generates a configmap-server registry + SourceTypeConfigmap SourceType = "configmap" + + // SourceTypeGrpc specifies a CatalogSource that can use an operator registry image to generate a + // registry-server or connect to a pre-existing registry at an address. + SourceTypeGrpc SourceType = "grpc" +) + +type CatalogSourceSpec struct { + // SourceType is the type of source + SourceType SourceType + + // ConfigMap is the name of the ConfigMap to be used to back a configmap-server registry. + // Only used when SourceType = SourceTypeConfigmap or SourceTypeInternal. + // +Optional + ConfigMap string + + // Address is a host that OLM can use to connect to a pre-existing registry. + // Format: : + // Only used when SourceType = SourceTypeGrpc. + // Ignored when the Image field is set. + // +Optional + Address string + + // Image is an operator-registry container image to instantiate a registry-server with. + // Only used when SourceType = SourceTypeGrpc. + // If present, the address field is ignored. + // +Optional + Image string + + // UpdateStrategy defines how updated catalog source images can be discovered + // Consists of an interval that defines polling duration and an embedded strategy type + // +Optional + UpdateStrategy *UpdateStrategy + + // Secrets represent set of secrets that can be used to access the contents of the catalog. + // It is best to keep this list small, since each will need to be tried for every catalog entry. + // +Optional + Secrets []string + + // Metadata + DisplayName string + Description string + Publisher string + Icon Icon +} + +// UpdateStrategy holds all the different types of catalog source update strategies +// Currently only registry polling strategy is implemented +type UpdateStrategy struct { + *RegistryPoll +} + +type RegistryPoll struct { + // Interval is used to determine the time interval between checks of the latest catalog source version. + // The catalog operator polls to see if a new version of the catalog source is available. + // If available, the latest image is pulled and gRPC traffic is directed to the latest catalog source. + Interval *metav1.Duration +} + +type RegistryServiceStatus struct { + Protocol string + ServiceName string + ServiceNamespace string + Port string + CreatedAt metav1.Time +} + +type GRPCConnectionState struct { + Address string + LastObservedState string + LastConnectTime metav1.Time +} + +func (s *RegistryServiceStatus) Address() string { + return fmt.Sprintf("%s.%s.svc:%s", s.ServiceName, s.ServiceNamespace, s.Port) +} + +type CatalogSourceStatus struct { + Message string `json:"message,omitempty"` + Reason ConditionReason `json:"reason,omitempty"` + ConfigMapResource *ConfigMapResourceReference + RegistryServiceStatus *RegistryServiceStatus + GRPCConnectionState *GRPCConnectionState + LatestImageRegistryPoll *metav1.Time +} + +type ConfigMapResourceReference struct { + Name string + Namespace string + UID types.UID + ResourceVersion string + LastUpdateTime metav1.Time +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient + +// CatalogSource is a repository of CSVs, CRDs, and operator packages. +type CatalogSource struct { + metav1.TypeMeta + metav1.ObjectMeta + + Spec CatalogSourceSpec + Status CatalogSourceStatus +} + +func (c *CatalogSource) Address() string { + if c.Spec.Address != "" { + return c.Spec.Address + } + return c.Status.RegistryServiceStatus.Address() +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// CatalogSourceList is a list of CatalogSource resources. +type CatalogSourceList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []CatalogSource +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/clusterserviceversion_types.go b/vendor/github.com/operator-framework/api/pkg/operators/clusterserviceversion_types.go new file mode 100644 index 000000000..fded5c3cb --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/clusterserviceversion_types.go @@ -0,0 +1,516 @@ +package operators + +import ( + "encoding/json" + "fmt" + "sort" + + appsv1 "k8s.io/api/apps/v1" + rbac "k8s.io/api/rbac/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/operator-framework/api/pkg/lib/version" +) + +// ClusterServiceVersionKind is the PascalCase name of a CSV's kind. +const ClusterServiceVersionKind = "ClusterServiceVersion" + +// InstallModeType is a supported type of install mode for CSV installation +type InstallModeType string + +const ( + // InstallModeTypeOwnNamespace indicates that the operator can be a member of an `OperatorGroup` that selects its own namespace. + InstallModeTypeOwnNamespace InstallModeType = "OwnNamespace" + // InstallModeTypeSingleNamespace indicates that the operator can be a member of an `OperatorGroup` that selects one namespace. + InstallModeTypeSingleNamespace InstallModeType = "SingleNamespace" + // InstallModeTypeMultiNamespace indicates that the operator can be a member of an `OperatorGroup` that selects more than one namespace. + InstallModeTypeMultiNamespace InstallModeType = "MultiNamespace" + // InstallModeTypeAllNamespaces indicates that the operator can be a member of an `OperatorGroup` that selects all namespaces (target namespace set is the empty string ""). + InstallModeTypeAllNamespaces InstallModeType = "AllNamespaces" + + InstallStrategyNameDeployment = "deployment" +) + +// InstallMode associates an InstallModeType with a flag representing if the CSV supports it +type InstallMode struct { + Type InstallModeType + Supported bool +} + +// InstallModeSet is a mapping of unique InstallModeTypes to whether they are supported. +type InstallModeSet map[InstallModeType]bool + +// NamedInstallStrategy represents the block of an ClusterServiceVersion resource +// where the install strategy is specified. +type NamedInstallStrategy struct { + StrategyName string + StrategySpec StrategyDetailsDeployment +} + +// StrategyDeploymentPermissions describe the rbac rules and service account needed by the install strategy +type StrategyDeploymentPermissions struct { + ServiceAccountName string + Rules []rbac.PolicyRule +} + +// StrategyDeploymentSpec contains the name and spec for the deployment ALM should create +type StrategyDeploymentSpec struct { + Name string + Spec appsv1.DeploymentSpec +} + +// StrategyDetailsDeployment represents the parsed details of a Deployment +// InstallStrategy. +type StrategyDetailsDeployment struct { + DeploymentSpecs []StrategyDeploymentSpec + Permissions []StrategyDeploymentPermissions + ClusterPermissions []StrategyDeploymentPermissions +} + +func (d *StrategyDetailsDeployment) GetStrategyName() string { + return InstallStrategyNameDeployment +} + +// StatusDescriptor describes a field in a status block of a CRD so that OLM can consume it +type StatusDescriptor struct { + Path string + DisplayName string + Description string + XDescriptors []string + Value json.RawMessage +} + +// SpecDescriptor describes a field in a spec block of a CRD so that OLM can consume it +type SpecDescriptor struct { + Path string + DisplayName string + Description string + XDescriptors []string + Value json.RawMessage +} + +// ActionDescriptor describes a declarative action that can be performed on a custom resource instance +type ActionDescriptor struct { + Path string + DisplayName string + Description string + XDescriptors []string + Value json.RawMessage +} + +// CRDDescription provides details to OLM about the CRDs +type CRDDescription struct { + Name string + Version string + Kind string + DisplayName string + Description string + Resources []APIResourceReference + StatusDescriptors []StatusDescriptor + SpecDescriptors []SpecDescriptor + ActionDescriptor []ActionDescriptor +} + +// APIServiceDescription provides details to OLM about apis provided via aggregation +type APIServiceDescription struct { + Name string + Group string + Version string + Kind string + DeploymentName string + ContainerPort int32 + DisplayName string + Description string + Resources []APIResourceReference + StatusDescriptors []StatusDescriptor + SpecDescriptors []SpecDescriptor + ActionDescriptor []ActionDescriptor +} + +// APIResourceReference is a Kubernetes resource type used by a custom resource +type APIResourceReference struct { + Name string + Kind string + Version string +} + +// GetName returns the name of an APIService as derived from its group and version. +func (d APIServiceDescription) GetName() string { + return fmt.Sprintf("%s.%s", d.Version, d.Group) +} + +// CustomResourceDefinitions declares all of the CRDs managed or required by +// an operator being ran by ClusterServiceVersion. +// +// If the CRD is present in the Owned list, it is implicitly required. +type CustomResourceDefinitions struct { + Owned []CRDDescription + Required []CRDDescription +} + +// APIServiceDefinitions declares all of the extension apis managed or required by +// an operator being ran by ClusterServiceVersion. +type APIServiceDefinitions struct { + Owned []APIServiceDescription + Required []APIServiceDescription +} + +// ClusterServiceVersionSpec declarations tell OLM how to install an operator +// that can manage apps for a given version. +type ClusterServiceVersionSpec struct { + InstallStrategy NamedInstallStrategy + Version version.OperatorVersion + Maturity string + CustomResourceDefinitions CustomResourceDefinitions + APIServiceDefinitions APIServiceDefinitions + NativeAPIs []metav1.GroupVersionKind + MinKubeVersion string + DisplayName string + Description string + Keywords []string + Maintainers []Maintainer + Provider AppLink + Links []AppLink + Icon []Icon + + // InstallModes specify supported installation types + // +optional + InstallModes []InstallMode + + // The name of a CSV this one replaces. Should match the `metadata.Name` field of the old CSV. + // +optional + Replaces string + + // Map of string keys and values that can be used to organize and categorize + // (scope and select) objects. + // +optional + Labels map[string]string + + // Annotations is an unstructured key value map stored with a resource that may be + // set by external tools to store and retrieve arbitrary metadata. + // +optional + Annotations map[string]string + + // Label selector for related resources. + // +optional + Selector *metav1.LabelSelector +} + +type Maintainer struct { + Name string + Email string +} + +type AppLink struct { + Name string + URL string +} + +type Icon struct { + Data string + MediaType string +} + +// ClusterServiceVersionPhase is a label for the condition of a ClusterServiceVersion at the current time. +type ClusterServiceVersionPhase string + +// These are the valid phases of ClusterServiceVersion +const ( + CSVPhaseNone = "" + // CSVPhasePending means the csv has been accepted by the system, but the install strategy has not been attempted. + // This is likely because there are unmet requirements. + CSVPhasePending ClusterServiceVersionPhase = "Pending" + // CSVPhaseInstallReady means that the requirements are met but the install strategy has not been run. + CSVPhaseInstallReady ClusterServiceVersionPhase = "InstallReady" + // CSVPhaseInstalling means that the install strategy has been initiated but not completed. + CSVPhaseInstalling ClusterServiceVersionPhase = "Installing" + // CSVPhaseSucceeded means that the resources in the CSV were created successfully. + CSVPhaseSucceeded ClusterServiceVersionPhase = "Succeeded" + // CSVPhaseFailed means that the install strategy could not be successfully completed. + CSVPhaseFailed ClusterServiceVersionPhase = "Failed" + // CSVPhaseUnknown means that for some reason the state of the csv could not be obtained. + CSVPhaseUnknown ClusterServiceVersionPhase = "Unknown" + // CSVPhaseReplacing means that a newer CSV has been created and the csv's resources will be transitioned to a new owner. + CSVPhaseReplacing ClusterServiceVersionPhase = "Replacing" + // CSVPhaseDeleting means that a CSV has been replaced by a new one and will be checked for safety before being deleted + CSVPhaseDeleting ClusterServiceVersionPhase = "Deleting" + // CSVPhaseAny matches all other phases in CSV queries + CSVPhaseAny ClusterServiceVersionPhase = "" +) + +// ConditionReason is a camelcased reason for the state transition +type ConditionReason string + +const ( + CSVReasonRequirementsUnknown ConditionReason = "RequirementsUnknown" + CSVReasonRequirementsNotMet ConditionReason = "RequirementsNotMet" + CSVReasonRequirementsMet ConditionReason = "AllRequirementsMet" + CSVReasonOwnerConflict ConditionReason = "OwnerConflict" + CSVReasonComponentFailed ConditionReason = "InstallComponentFailed" + CSVReasonInvalidStrategy ConditionReason = "InvalidInstallStrategy" + CSVReasonWaiting ConditionReason = "InstallWaiting" + CSVReasonInstallSuccessful ConditionReason = "InstallSucceeded" + CSVReasonInstallCheckFailed ConditionReason = "InstallCheckFailed" + CSVReasonComponentUnhealthy ConditionReason = "ComponentUnhealthy" + CSVReasonBeingReplaced ConditionReason = "BeingReplaced" + CSVReasonReplaced ConditionReason = "Replaced" + CSVReasonNeedsReinstall ConditionReason = "NeedsReinstall" + CSVReasonNeedsCertRotation ConditionReason = "NeedsCertRotation" + CSVReasonAPIServiceResourceIssue ConditionReason = "APIServiceResourceIssue" + CSVReasonAPIServiceResourcesNeedReinstall ConditionReason = "APIServiceResourcesNeedReinstall" + CSVReasonAPIServiceInstallFailed ConditionReason = "APIServiceInstallFailed" + CSVReasonCopied ConditionReason = "Copied" + CSVReasonInvalidInstallModes ConditionReason = "InvalidInstallModes" + CSVReasonNoTargetNamespaces ConditionReason = "NoTargetNamespaces" + CSVReasonUnsupportedOperatorGroup ConditionReason = "UnsupportedOperatorGroup" + CSVReasonNoOperatorGroup ConditionReason = "NoOperatorGroup" + CSVReasonTooManyOperatorGroups ConditionReason = "TooManyOperatorGroups" + CSVReasonInterOperatorGroupOwnerConflict ConditionReason = "InterOperatorGroupOwnerConflict" + CSVReasonCannotModifyStaticOperatorGroupProvidedAPIs ConditionReason = "CannotModifyStaticOperatorGroupProvidedAPIs" +) + +// Conditions appear in the status as a record of state transitions on the ClusterServiceVersion +type ClusterServiceVersionCondition struct { + // Condition of the ClusterServiceVersion + Phase ClusterServiceVersionPhase + // A human readable message indicating details about why the ClusterServiceVersion is in this condition. + // +optional + Message string + // A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. + // e.g. 'RequirementsNotMet' + // +optional + Reason ConditionReason + // Last time we updated the status + // +optional + LastUpdateTime *metav1.Time + // Last time the status transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time +} + +// OwnsCRD determines whether the current CSV owns a paritcular CRD. +func (csv ClusterServiceVersion) OwnsCRD(name string) bool { + for _, desc := range csv.Spec.CustomResourceDefinitions.Owned { + if desc.Name == name { + return true + } + } + + return false +} + +// OwnsAPIService determines whether the current CSV owns a paritcular APIService. +func (csv ClusterServiceVersion) OwnsAPIService(name string) bool { + for _, desc := range csv.Spec.APIServiceDefinitions.Owned { + apiServiceName := fmt.Sprintf("%s.%s", desc.Version, desc.Group) + if apiServiceName == name { + return true + } + } + + return false +} + +// StatusReason is a camelcased reason for the status of a RequirementStatus or DependentStatus +type StatusReason string + +const ( + RequirementStatusReasonPresent StatusReason = "Present" + RequirementStatusReasonNotPresent StatusReason = "NotPresent" + RequirementStatusReasonPresentNotSatisfied StatusReason = "PresentNotSatisfied" + // The CRD is present but the Established condition is False (not available) + RequirementStatusReasonNotAvailable StatusReason = "PresentNotAvailable" + DependentStatusReasonSatisfied StatusReason = "Satisfied" + DependentStatusReasonNotSatisfied StatusReason = "NotSatisfied" +) + +// DependentStatus is the status for a dependent requirement (to prevent infinite nesting) +type DependentStatus struct { + Group string + Version string + Kind string + Status StatusReason + UUID string + Message string +} + +type RequirementStatus struct { + Group string + Version string + Kind string + Name string + Status StatusReason + Message string + UUID string + Dependents []DependentStatus +} + +// ClusterServiceVersionStatus represents information about the status of a pod. Status may trail the actual +// state of a system. +type ClusterServiceVersionStatus struct { + // Current condition of the ClusterServiceVersion + Phase ClusterServiceVersionPhase + // A human readable message indicating details about why the ClusterServiceVersion is in this condition. + // +optional + Message string + // A brief CamelCase message indicating details about why the ClusterServiceVersion is in this state. + // e.g. 'RequirementsNotMet' + // +optional + Reason ConditionReason + // Last time we updated the status + // +optional + LastUpdateTime *metav1.Time + // Last time the status transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time + // List of conditions, a history of state transitions + Conditions []ClusterServiceVersionCondition + // The status of each requirement for this CSV + RequirementStatus []RequirementStatus + // Last time the owned APIService certs were updated + // +optional + CertsLastUpdated *metav1.Time + // Time the owned APIService certs will rotate next + // +optional + CertsRotateAt *metav1.Time +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient + +// ClusterServiceVersion is a Custom Resource of type `ClusterServiceVersionSpec`. +type ClusterServiceVersion struct { + metav1.TypeMeta + metav1.ObjectMeta + + Spec ClusterServiceVersionSpec + Status ClusterServiceVersionStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// ClusterServiceVersionList represents a list of ClusterServiceVersions. +type ClusterServiceVersionList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []ClusterServiceVersion +} + +// GetAllCRDDescriptions returns a deduplicated set of CRDDescriptions that is +// the union of the owned and required CRDDescriptions. +// +// Descriptions with the same name prefer the value in Owned. +// Descriptions are returned in alphabetical order. +func (csv ClusterServiceVersion) GetAllCRDDescriptions() []CRDDescription { + set := make(map[string]CRDDescription) + for _, required := range csv.Spec.CustomResourceDefinitions.Required { + set[required.Name] = required + } + + for _, owned := range csv.Spec.CustomResourceDefinitions.Owned { + set[owned.Name] = owned + } + + keys := make([]string, 0) + for key := range set { + keys = append(keys, key) + } + sort.StringSlice(keys).Sort() + + descs := make([]CRDDescription, 0) + for _, key := range keys { + descs = append(descs, set[key]) + } + + return descs +} + +// GetAllAPIServiceDescriptions returns a deduplicated set of APIServiceDescriptions that is +// the union of the owned and required APIServiceDescriptions. +// +// Descriptions with the same name prefer the value in Owned. +// Descriptions are returned in alphabetical order. +func (csv ClusterServiceVersion) GetAllAPIServiceDescriptions() []APIServiceDescription { + set := make(map[string]APIServiceDescription) + for _, required := range csv.Spec.APIServiceDefinitions.Required { + name := fmt.Sprintf("%s.%s", required.Version, required.Group) + set[name] = required + } + + for _, owned := range csv.Spec.APIServiceDefinitions.Owned { + name := fmt.Sprintf("%s.%s", owned.Version, owned.Group) + set[name] = owned + } + + keys := make([]string, 0) + for key := range set { + keys = append(keys, key) + } + sort.StringSlice(keys).Sort() + + descs := make([]APIServiceDescription, 0) + for _, key := range keys { + descs = append(descs, set[key]) + } + + return descs +} + +// GetRequiredAPIServiceDescriptions returns a deduplicated set of required APIServiceDescriptions +// with the intersection of required and owned removed +// Equivalent to the set subtraction required - owned +// +// Descriptions are returned in alphabetical order. +func (csv ClusterServiceVersion) GetRequiredAPIServiceDescriptions() []APIServiceDescription { + set := make(map[string]APIServiceDescription) + for _, required := range csv.Spec.APIServiceDefinitions.Required { + name := fmt.Sprintf("%s.%s", required.Version, required.Group) + set[name] = required + } + + // Remove any shared owned from the set + for _, owned := range csv.Spec.APIServiceDefinitions.Owned { + name := fmt.Sprintf("%s.%s", owned.Version, owned.Group) + if _, ok := set[name]; ok { + delete(set, name) + } + } + + keys := make([]string, 0) + for key := range set { + keys = append(keys, key) + } + sort.StringSlice(keys).Sort() + + descs := make([]APIServiceDescription, 0) + for _, key := range keys { + descs = append(descs, set[key]) + } + + return descs +} + +// GetOwnedAPIServiceDescriptions returns a deduplicated set of owned APIServiceDescriptions +// +// Descriptions are returned in alphabetical order. +func (csv ClusterServiceVersion) GetOwnedAPIServiceDescriptions() []APIServiceDescription { + set := make(map[string]APIServiceDescription) + for _, owned := range csv.Spec.APIServiceDefinitions.Owned { + name := owned.GetName() + set[name] = owned + } + + keys := make([]string, 0) + for key := range set { + keys = append(keys, key) + } + sort.StringSlice(keys).Sort() + + descs := make([]APIServiceDescription, 0) + for _, key := range keys { + descs = append(descs, set[key]) + } + + return descs +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/doc.go b/vendor/github.com/operator-framework/api/pkg/operators/doc.go new file mode 100644 index 000000000..ee6b62a7d --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/doc.go @@ -0,0 +1,5 @@ +// +k8s:deepcopy-gen=package +// +groupName=operators.coreos.com +// +kubebuilder:skip +// Package operators contains all resource types of the operators.coreos.com API group. +package operators diff --git a/vendor/github.com/operator-framework/api/pkg/operators/installplan_types.go b/vendor/github.com/operator-framework/api/pkg/operators/installplan_types.go new file mode 100644 index 000000000..fcd7764e8 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/installplan_types.go @@ -0,0 +1,392 @@ +package operators + +import ( + "errors" + "fmt" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// InstallPlanKind is the PascalCase name of an InstallPlan's kind. +const InstallPlanKind = "InstallPlan" + +// Approval is the user approval policy for an InstallPlan. +type Approval string + +const ( + ApprovalAutomatic Approval = "Automatic" + ApprovalManual Approval = "Manual" +) + +// InstallPlanSpec defines a set of Application resources to be installed +type InstallPlanSpec struct { + CatalogSource string + CatalogSourceNamespace string + ClusterServiceVersionNames []string + Approval Approval + Approved bool +} + +// InstallPlanPhase is the current status of a InstallPlan as a whole. +type InstallPlanPhase string + +const ( + InstallPlanPhaseNone InstallPlanPhase = "" + InstallPlanPhasePlanning InstallPlanPhase = "Planning" + InstallPlanPhaseRequiresApproval InstallPlanPhase = "RequiresApproval" + InstallPlanPhaseInstalling InstallPlanPhase = "Installing" + InstallPlanPhaseComplete InstallPlanPhase = "Complete" + InstallPlanPhaseFailed InstallPlanPhase = "Failed" +) + +// InstallPlanConditionType describes the state of an InstallPlan at a certain point as a whole. +type InstallPlanConditionType string + +const ( + InstallPlanResolved InstallPlanConditionType = "Resolved" + InstallPlanInstalled InstallPlanConditionType = "Installed" +) + +// ConditionReason is a camelcased reason for the state transition. +type InstallPlanConditionReason string + +const ( + InstallPlanReasonPlanUnknown InstallPlanConditionReason = "PlanUnknown" + InstallPlanReasonInstallCheckFailed InstallPlanConditionReason = "InstallCheckFailed" + InstallPlanReasonDependencyConflict InstallPlanConditionReason = "DependenciesConflict" + InstallPlanReasonComponentFailed InstallPlanConditionReason = "InstallComponentFailed" +) + +// StepStatus is the current status of a particular resource an in +// InstallPlan +type StepStatus string + +const ( + StepStatusUnknown StepStatus = "Unknown" + StepStatusNotPresent StepStatus = "NotPresent" + StepStatusPresent StepStatus = "Present" + StepStatusCreated StepStatus = "Created" + StepStatusWaitingForAPI StepStatus = "WaitingForApi" + StepStatusUnsupportedResource StepStatus = "UnsupportedResource" +) + +// ErrInvalidInstallPlan is the error returned by functions that operate on +// InstallPlans when the InstallPlan does not contain totally valid data. +var ErrInvalidInstallPlan = errors.New("the InstallPlan contains invalid data") + +// InstallPlanStatus represents the information about the status of +// steps required to complete installation. +// +// Status may trail the actual state of a system. +type InstallPlanStatus struct { + Phase InstallPlanPhase + Conditions []InstallPlanCondition + CatalogSources []string + Plan []*Step + // BundleLookups is the set of in-progress requests to pull and unpackage bundle content to the cluster. + // +optional + BundleLookups []BundleLookup + // AttenuatedServiceAccountRef references the service account that is used + // to do scoped operator install. + AttenuatedServiceAccountRef *corev1.ObjectReference +} + +// InstallPlanCondition represents the overall status of the execution of +// an InstallPlan. +type InstallPlanCondition struct { + Type InstallPlanConditionType + Status corev1.ConditionStatus // True, False, or Unknown + LastUpdateTime *metav1.Time + LastTransitionTime *metav1.Time + Reason InstallPlanConditionReason + Message string +} + +// allow overwriting `now` function for deterministic tests +var now = metav1.Now + +// GetCondition returns the InstallPlanCondition of the given type if it exists in the InstallPlanStatus' Conditions. +// Returns a condition of the given type with a ConditionStatus of "Unknown" if not found. +func (s InstallPlanStatus) GetCondition(conditionType InstallPlanConditionType) InstallPlanCondition { + for _, cond := range s.Conditions { + if cond.Type == conditionType { + return cond + } + } + + return InstallPlanCondition{ + Type: conditionType, + Status: corev1.ConditionUnknown, + } +} + +// SetCondition adds or updates a condition, using `Type` as merge key. +func (s *InstallPlanStatus) SetCondition(cond InstallPlanCondition) InstallPlanCondition { + for i, existing := range s.Conditions { + if existing.Type != cond.Type { + continue + } + if existing.Status == cond.Status { + cond.LastTransitionTime = existing.LastTransitionTime + } + s.Conditions[i] = cond + return cond + } + s.Conditions = append(s.Conditions, cond) + return cond +} + +func ConditionFailed(cond InstallPlanConditionType, reason InstallPlanConditionReason, message string, now *metav1.Time) InstallPlanCondition { + return InstallPlanCondition{ + Type: cond, + Status: corev1.ConditionFalse, + Reason: reason, + Message: message, + LastUpdateTime: now, + LastTransitionTime: now, + } +} + +func ConditionMet(cond InstallPlanConditionType, now *metav1.Time) InstallPlanCondition { + return InstallPlanCondition{ + Type: cond, + Status: corev1.ConditionTrue, + LastUpdateTime: now, + LastTransitionTime: now, + } +} + +// Step represents the status of an individual step in an InstallPlan. +type Step struct { + Resolving string + Resource StepResource + Status StepStatus +} + +// BundleLookupConditionType is a category of the overall state of a BundleLookup. +type BundleLookupConditionType string + +const ( + // BundleLookupPending describes BundleLookups that are not complete. + BundleLookupPending BundleLookupConditionType = "BundleLookupPending" + + crdKind = "CustomResourceDefinition" +) + +type BundleLookupCondition struct { + // Type of condition. + Type BundleLookupConditionType + // Status of the condition, one of True, False, Unknown. + Status corev1.ConditionStatus + // The reason for the condition's last transition. + // +optional + Reason string + // A human readable message indicating details about the transition. + // +optional + Message string + // Last time the condition was probed + // +optional + LastUpdateTime *metav1.Time + // Last time the condition transitioned from one status to another. + // +optional + LastTransitionTime *metav1.Time +} + +// BundleLookup is a request to pull and unpackage the content of a bundle to the cluster. +type BundleLookup struct { + // Path refers to the location of a bundle to pull. + // It's typically an image reference. + Path string + // Replaces is the name of the bundle to replace with the one found at Path. + Replaces string + // CatalogSourceRef is a reference to the CatalogSource the bundle path was resolved from. + CatalogSourceRef *corev1.ObjectReference + // Conditions represents the overall state of a BundleLookup. + // +optional + Conditions []BundleLookupCondition +} + +// GetCondition returns the BundleLookupCondition of the given type if it exists in the BundleLookup's Conditions. +// Returns a condition of the given type with a ConditionStatus of "Unknown" if not found. +func (b BundleLookup) GetCondition(conditionType BundleLookupConditionType) BundleLookupCondition { + for _, cond := range b.Conditions { + if cond.Type == conditionType { + return cond + } + } + + return BundleLookupCondition{ + Type: conditionType, + Status: corev1.ConditionUnknown, + } +} + +// RemoveCondition removes the BundleLookupCondition of the given type from the BundleLookup's Conditions if it exists. +func (b *BundleLookup) RemoveCondition(conditionType BundleLookupConditionType) { + for i, cond := range b.Conditions { + if cond.Type == conditionType { + b.Conditions = append(b.Conditions[:i], b.Conditions[i+1:]...) + if len(b.Conditions) == 0 { + b.Conditions = nil + } + return + } + } +} + +// SetCondition replaces the existing BundleLookupCondition of the same type, or adds it if it was not found. +func (b *BundleLookup) SetCondition(cond BundleLookupCondition) BundleLookupCondition { + for i, existing := range b.Conditions { + if existing.Type != cond.Type { + continue + } + if existing.Status == cond.Status { + cond.LastTransitionTime = existing.LastTransitionTime + } + b.Conditions[i] = cond + return cond + } + b.Conditions = append(b.Conditions, cond) + + return cond +} + +func OrderSteps(steps []*Step) []*Step { + // CSVs must be applied first + csvList := []*Step{} + + // CRDs must be applied second + crdList := []*Step{} + + // Other resources may be applied in any order + remainingResources := []*Step{} + for _, step := range steps { + switch step.Resource.Kind { + case crdKind: + crdList = append(crdList, step) + case ClusterServiceVersionKind: + csvList = append(csvList, step) + default: + remainingResources = append(remainingResources, step) + } + } + + result := make([]*Step, len(steps)) + i := 0 + + for j := range csvList { + result[i] = csvList[j] + i++ + } + + for j := range crdList { + result[i] = crdList[j] + i++ + } + + for j := range remainingResources { + result[i] = remainingResources[j] + i++ + } + + return result +} + +func (s InstallPlanStatus) NeedsRequeue() bool { + for _, step := range s.Plan { + switch step.Status { + case StepStatusWaitingForAPI: + return true + } + } + + return false +} + +// ManifestsMatch returns true if the CSV manifests in the StepResources of the given list of steps +// matches those in the InstallPlanStatus. +func (s *InstallPlanStatus) CSVManifestsMatch(steps []*Step) bool { + if s.Plan == nil && steps == nil { + return true + } + if s.Plan == nil || steps == nil { + return false + } + + manifests := make(map[string]struct{}) + for _, step := range s.Plan { + resource := step.Resource + if resource.Kind != ClusterServiceVersionKind { + continue + } + manifests[resource.Manifest] = struct{}{} + } + + for _, step := range steps { + resource := step.Resource + if resource.Kind != ClusterServiceVersionKind { + continue + } + if _, ok := manifests[resource.Manifest]; !ok { + return false + } + delete(manifests, resource.Manifest) + } + + return len(manifests) == 0 +} + +func (s *Step) String() string { + return fmt.Sprintf("%s: %s (%s)", s.Resolving, s.Resource, s.Status) +} + +// StepResource represents the status of a resource to be tracked by an +// InstallPlan. +type StepResource struct { + CatalogSource string + CatalogSourceNamespace string + Group string + Version string + Kind string + Name string + Manifest string +} + +func (r StepResource) String() string { + return fmt.Sprintf("%s[%s/%s/%s (%s/%s)]", r.Name, r.Group, r.Version, r.Kind, r.CatalogSource, r.CatalogSourceNamespace) +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient + +// InstallPlan defines the installation of a set of operators. +type InstallPlan struct { + metav1.TypeMeta + metav1.ObjectMeta + + Spec InstallPlanSpec + Status InstallPlanStatus +} + +// EnsureCatalogSource ensures that a CatalogSource is present in the Status +// block of an InstallPlan. +func (p *InstallPlan) EnsureCatalogSource(sourceName string) { + for _, srcName := range p.Status.CatalogSources { + if srcName == sourceName { + return + } + } + + p.Status.CatalogSources = append(p.Status.CatalogSources, sourceName) +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// InstallPlanList is a list of InstallPlan resources. +type InstallPlanList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []InstallPlan +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/operatorgroup_types.go b/vendor/github.com/operator-framework/api/pkg/operators/operatorgroup_types.go new file mode 100644 index 000000000..e94386c77 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/operatorgroup_types.go @@ -0,0 +1,79 @@ +package operators + +import ( + "sort" + "strings" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// OperatorGroupKind is the PascalCase name of an OperatorGroup's kind. +const OperatorGroupKind = "OperatorGroup" + +const ( + OperatorGroupAnnotationKey = "olm.operatorGroup" + OperatorGroupNamespaceAnnotationKey = "olm.operatorNamespace" + OperatorGroupTargetsAnnotationKey = "olm.targetNamespaces" + OperatorGroupProvidedAPIsAnnotationKey = "olm.providedAPIs" +) + +// OperatorGroupSpec is the spec for an OperatorGroup resource. +type OperatorGroupSpec struct { + // Selector selects the OperatorGroup's target namespaces. + // +optional + Selector *metav1.LabelSelector + + // TargetNamespaces is an explicit set of namespaces to target. + // If it is set, Selector is ignored. + // +optional + TargetNamespaces []string + + // ServiceAccountName is the admin specified service account which will be + // used to deploy operator(s) in this operator group. + ServiceAccountName string + + // Static tells OLM not to update the OperatorGroup's providedAPIs annotation + // +optional + StaticProvidedAPIs bool +} + +// OperatorGroupStatus is the status for an OperatorGroupResource. +type OperatorGroupStatus struct { + // Namespaces is the set of target namespaces for the OperatorGroup. + Namespaces []string + + // ServiceAccountRef references the service account object specified. + ServiceAccountRef *corev1.ObjectReference + + // LastUpdated is a timestamp of the last time the OperatorGroup's status was Updated. + LastUpdated *metav1.Time +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient + +// OperatorGroup is the unit of multitenancy for OLM managed operators. +// It constrains the installation of operators in its namespace to a specified set of target namespaces. +type OperatorGroup struct { + metav1.TypeMeta + metav1.ObjectMeta + + Spec OperatorGroupSpec + Status OperatorGroupStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// OperatorGroupList is a list of OperatorGroup resources. +type OperatorGroupList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []OperatorGroup +} + +func (o *OperatorGroup) BuildTargetNamespaces() string { + sort.Strings(o.Status.Namespaces) + return strings.Join(o.Status.Namespaces, ",") +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/register.go b/vendor/github.com/operator-framework/api/pkg/operators/register.go new file mode 100644 index 000000000..784b04026 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/register.go @@ -0,0 +1,50 @@ +package operators + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +const ( + // GroupName is the group name used in this package. + GroupName = "operators.coreos.com" + // GroupVersion is the group version used in this package. + GroupVersion = runtime.APIVersionInternal +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + // SchemeBuilder initializes a scheme builder + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + // AddToScheme is a global function that registers this API group & version to a scheme + AddToScheme = SchemeBuilder.AddToScheme +) + +// addKnownTypes adds the list of known types to Scheme +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &CatalogSource{}, + &CatalogSourceList{}, + &InstallPlan{}, + &InstallPlanList{}, + &Subscription{}, + &SubscriptionList{}, + &ClusterServiceVersion{}, + &ClusterServiceVersionList{}, + &OperatorGroup{}, + &OperatorGroupList{}, + ) + return nil +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/subscription_types.go b/vendor/github.com/operator-framework/api/pkg/operators/subscription_types.go new file mode 100644 index 000000000..931207681 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/subscription_types.go @@ -0,0 +1,312 @@ +package operators + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" +) + +// SubscriptionKind is the PascalCase name of a Subscription's kind. +const SubscriptionKind = "Subscription" + +// SubscriptionState tracks when updates are available, installing, or service is up to date +type SubscriptionState string + +const ( + SubscriptionStateNone = "" + SubscriptionStateFailed = "UpgradeFailed" + SubscriptionStateUpgradeAvailable = "UpgradeAvailable" + SubscriptionStateUpgradePending = "UpgradePending" + SubscriptionStateAtLatest = "AtLatestKnown" +) + +const ( + SubscriptionReasonInvalidCatalog ConditionReason = "InvalidCatalog" + SubscriptionReasonUpgradeSucceeded ConditionReason = "UpgradeSucceeded" +) + +// SubscriptionSpec defines an Application that can be installed +type SubscriptionSpec struct { + CatalogSource string + CatalogSourceNamespace string + Package string + Channel string + StartingCSV string + InstallPlanApproval Approval + Config SubscriptionConfig +} + +// SubscriptionConfig contains configuration specified for a subscription. +type SubscriptionConfig struct { + // Label selector for pods. Existing ReplicaSets whose pods are + // selected by this will be the ones affected by this deployment. + // It must match the pod template's labels. + Selector *metav1.LabelSelector `json:"selector,omitempty"` + + // NodeSelector is a selector which must be true for the pod to fit on a node. + // Selector which must match a node's labels for the pod to be scheduled on that node. + // More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/ + // +optional + NodeSelector map[string]string `json:"nodeSelector,omitempty"` + + // If specified, the pod's tolerations. + // +optional + Tolerations []corev1.Toleration `json:"tolerations,omitempty"` + + // Compute Resources required by this container. + // Cannot be updated. + // More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ + // +optional + Resources corev1.ResourceRequirements `json:"resources,omitempty"` + + // List of sources to populate environment variables in the container. + // The keys defined within a source must be a C_IDENTIFIER. All invalid keys + // will be reported as an event when the container is starting. When a key exists in multiple + // sources, the value associated with the last source will take precedence. + // Values defined by an Env with a duplicate key will take precedence. + // Cannot be updated. + // +optional + EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"` + // List of environment variables to set in the container. + // Cannot be updated. + // +optional + // +patchMergeKey=name + // +patchStrategy=merge + Env []corev1.EnvVar `json:"env,omitempty"` + + // List of Volumes to set in the podSpec. + // +optional + Volumes []corev1.Volume `json:"volumes,omitempty"` + + // List of VolumeMounts to set in the container. + // +optional + VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` +} + +// SubscriptionConditionType indicates an explicit state condition about a Subscription in "abnormal-true" +// polarity form (see https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties). +type SubscriptionConditionType string + +const ( + // SubscriptionCatalogSourcesUnhealthy indicates that some or all of the CatalogSources to be used in resolution are unhealthy. + SubscriptionCatalogSourcesUnhealthy SubscriptionConditionType = "CatalogSourcesUnhealthy" + + // SubscriptionInstallPlanMissing indicates that a Subscription's InstallPlan is missing. + SubscriptionInstallPlanMissing SubscriptionConditionType = "InstallPlanMissing" + + // SubscriptionInstallPlanPending indicates that a Subscription's InstallPlan is pending installation. + SubscriptionInstallPlanPending SubscriptionConditionType = "InstallPlanPending" + + // SubscriptionInstallPlanFailed indicates that the installation of a Subscription's InstallPlan has failed. + SubscriptionInstallPlanFailed SubscriptionConditionType = "InstallPlanFailed" +) + +const ( + // NoCatalogSourcesFound is a reason string for Subscriptions with unhealthy CatalogSources due to none being available. + NoCatalogSourcesFound = "NoCatalogSourcesFound" + + // AllCatalogSourcesHealthy is a reason string for Subscriptions that transitioned due to all CatalogSources being healthy. + AllCatalogSourcesHealthy = "AllCatalogSourcesHealthy" + + // CatalogSourcesAdded is a reason string for Subscriptions that transitioned due to CatalogSources being added. + CatalogSourcesAdded = "CatalogSourcesAdded" + + // CatalogSourcesUpdated is a reason string for Subscriptions that transitioned due to CatalogSource being updated. + CatalogSourcesUpdated = "CatalogSourcesUpdated" + + // CatalogSourcesDeleted is a reason string for Subscriptions that transitioned due to CatalogSources being removed. + CatalogSourcesDeleted = "CatalogSourcesDeleted" + + // UnhealthyCatalogSourceFound is a reason string for Subscriptions that transitioned because an unhealthy CatalogSource was found. + UnhealthyCatalogSourceFound = "UnhealthyCatalogSourceFound" + + // ReferencedInstallPlanNotFound is a reason string for Subscriptions that transitioned due to a referenced InstallPlan not being found. + ReferencedInstallPlanNotFound = "ReferencedInstallPlanNotFound" + + // InstallPlanNotYetReconciled is a reason string for Subscriptions that transitioned due to a referenced InstallPlan not being reconciled yet. + InstallPlanNotYetReconciled = "InstallPlanNotYetReconciled" + + // InstallPlanFailed is a reason string for Subscriptions that transitioned due to a referenced InstallPlan failing without setting an explicit failure condition. + InstallPlanFailed = "InstallPlanFailed" +) + +// SubscriptionCondition represents the latest available observations of a Subscription's state. +type SubscriptionCondition struct { + // Type is the type of Subscription condition. + Type SubscriptionConditionType + + // Status is the status of the condition, one of True, False, Unknown. + Status corev1.ConditionStatus + + // Reason is a one-word CamelCase reason for the condition's last transition. + // +optional + Reason string + + // Message is a human-readable message indicating details about last transition. + // +optional + Message string + + // LastHeartbeatTime is the last time we got an update on a given condition + // +optional + LastHeartbeatTime *metav1.Time + + // LastTransitionTime is the last time the condition transit from one status to another + // +optional + LastTransitionTime *metav1.Time +} + +// Equals returns true if a SubscriptionCondition equals the one given, false otherwise. +// Equality is determined by the equality of the type, status, reason, and message fields ONLY. +func (s SubscriptionCondition) Equals(condition SubscriptionCondition) bool { + return s.Type == condition.Type && s.Status == condition.Status && s.Reason == condition.Reason && s.Message == condition.Message +} + +type SubscriptionStatus struct { + // CurrentCSV is the CSV the Subscription is progressing to. + // +optional + CurrentCSV string + + // InstalledCSV is the CSV currently installed by the Subscription. + // +optional + InstalledCSV string + + // Install is a reference to the latest InstallPlan generated for the Subscription. + // DEPRECATED: InstallPlanRef + // +optional + Install *InstallPlanReference + + // State represents the current state of the Subscription + // +optional + State SubscriptionState + + // Reason is the reason the Subscription was transitioned to its current state. + // +optional + Reason ConditionReason + + // InstallPlanRef is a reference to the latest InstallPlan that contains the Subscription's current CSV. + // +optional + InstallPlanRef *corev1.ObjectReference + + // CatalogHealth contains the Subscription's view of its relevant CatalogSources' status. + // It is used to determine SubscriptionStatusConditions related to CatalogSources. + // +optional + CatalogHealth []SubscriptionCatalogHealth + + // Conditions is a list of the latest available observations about a Subscription's current state. + // +optional + Conditions []SubscriptionCondition `hash:"set"` + + // LastUpdated represents the last time that the Subscription status was updated. + LastUpdated metav1.Time +} + +// GetCondition returns the SubscriptionCondition of the given type if it exists in the SubscriptionStatus' Conditions. +// Returns a condition of the given type with a ConditionStatus of "Unknown" if not found. +func (s SubscriptionStatus) GetCondition(conditionType SubscriptionConditionType) SubscriptionCondition { + for _, cond := range s.Conditions { + if cond.Type == conditionType { + return cond + } + } + + return SubscriptionCondition{ + Type: conditionType, + Status: corev1.ConditionUnknown, + } +} + +// SetCondition sets the given SubscriptionCondition in the SubscriptionStatus' Conditions. +func (s *SubscriptionStatus) SetCondition(condition SubscriptionCondition) { + for i, cond := range s.Conditions { + if cond.Type == condition.Type { + s.Conditions[i] = condition + return + } + } + + s.Conditions = append(s.Conditions, condition) +} + +// RemoveConditions removes any conditions of the given types from the SubscriptionStatus' Conditions. +func (s *SubscriptionStatus) RemoveConditions(remove ...SubscriptionConditionType) { + exclusions := map[SubscriptionConditionType]struct{}{} + for _, r := range remove { + exclusions[r] = struct{}{} + } + + var filtered []SubscriptionCondition + for _, cond := range s.Conditions { + if _, ok := exclusions[cond.Type]; ok { + // Skip excluded condition types + continue + } + filtered = append(filtered, cond) + } + + s.Conditions = filtered +} + +type InstallPlanReference struct { + APIVersion string + Kind string + Name string + UID types.UID +} + +// SubscriptionCatalogHealth describes the health of a CatalogSource the Subscription knows about. +type SubscriptionCatalogHealth struct { + // CatalogSourceRef is a reference to a CatalogSource. + CatalogSourceRef *corev1.ObjectReference + + // LastUpdated represents the last time that the CatalogSourceHealth changed + LastUpdated *metav1.Time + + // Healthy is true if the CatalogSource is healthy; false otherwise. + Healthy bool +} + +// Equals returns true if a SubscriptionCatalogHealth equals the one given, false otherwise. +// Equality is based SOLEY on health and UID. +func (s SubscriptionCatalogHealth) Equals(health SubscriptionCatalogHealth) bool { + return s.Healthy == health.Healthy && s.CatalogSourceRef.UID == health.CatalogSourceRef.UID +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// +genclient + +// Subscription keeps operators up to date by tracking changes to Catalogs. +type Subscription struct { + metav1.TypeMeta + metav1.ObjectMeta + + Spec *SubscriptionSpec + Status SubscriptionStatus +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// SubscriptionList is a list of Subscription resources. +type SubscriptionList struct { + metav1.TypeMeta + metav1.ListMeta + + Items []Subscription +} + +// GetInstallPlanApproval gets the configured install plan approval or the default +func (s *Subscription) GetInstallPlanApproval() Approval { + if s.Spec.InstallPlanApproval == ApprovalManual { + return ApprovalManual + } + return ApprovalAutomatic +} + +// NewInstallPlanReference returns an InstallPlanReference for the given ObjectReference. +func NewInstallPlanReference(ref *corev1.ObjectReference) *InstallPlanReference { + return &InstallPlanReference{ + APIVersion: ref.APIVersion, + Kind: ref.Kind, + Name: ref.Name, + UID: ref.UID, + } +} diff --git a/vendor/github.com/operator-framework/api/pkg/operators/zz_generated.deepcopy.go b/vendor/github.com/operator-framework/api/pkg/operators/zz_generated.deepcopy.go new file mode 100644 index 000000000..8b8760842 --- /dev/null +++ b/vendor/github.com/operator-framework/api/pkg/operators/zz_generated.deepcopy.go @@ -0,0 +1,1457 @@ +// +build !ignore_autogenerated + +/* + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package operators + +import ( + "encoding/json" + corev1 "k8s.io/api/core/v1" + rbacv1 "k8s.io/api/rbac/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIResourceReference) DeepCopyInto(out *APIResourceReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIResourceReference. +func (in *APIResourceReference) DeepCopy() *APIResourceReference { + if in == nil { + return nil + } + out := new(APIResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServiceDefinitions) DeepCopyInto(out *APIServiceDefinitions) { + *out = *in + if in.Owned != nil { + in, out := &in.Owned, &out.Owned + *out = make([]APIServiceDescription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Required != nil { + in, out := &in.Required, &out.Required + *out = make([]APIServiceDescription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServiceDefinitions. +func (in *APIServiceDefinitions) DeepCopy() *APIServiceDefinitions { + if in == nil { + return nil + } + out := new(APIServiceDefinitions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIServiceDescription) DeepCopyInto(out *APIServiceDescription) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]APIResourceReference, len(*in)) + copy(*out, *in) + } + if in.StatusDescriptors != nil { + in, out := &in.StatusDescriptors, &out.StatusDescriptors + *out = make([]StatusDescriptor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpecDescriptors != nil { + in, out := &in.SpecDescriptors, &out.SpecDescriptors + *out = make([]SpecDescriptor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ActionDescriptor != nil { + in, out := &in.ActionDescriptor, &out.ActionDescriptor + *out = make([]ActionDescriptor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServiceDescription. +func (in *APIServiceDescription) DeepCopy() *APIServiceDescription { + if in == nil { + return nil + } + out := new(APIServiceDescription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ActionDescriptor) DeepCopyInto(out *ActionDescriptor) { + *out = *in + if in.XDescriptors != nil { + in, out := &in.XDescriptors, &out.XDescriptors + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActionDescriptor. +func (in *ActionDescriptor) DeepCopy() *ActionDescriptor { + if in == nil { + return nil + } + out := new(ActionDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AppLink) DeepCopyInto(out *AppLink) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AppLink. +func (in *AppLink) DeepCopy() *AppLink { + if in == nil { + return nil + } + out := new(AppLink) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BundleLookup) DeepCopyInto(out *BundleLookup) { + *out = *in + if in.CatalogSourceRef != nil { + in, out := &in.CatalogSourceRef, &out.CatalogSourceRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]BundleLookupCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleLookup. +func (in *BundleLookup) DeepCopy() *BundleLookup { + if in == nil { + return nil + } + out := new(BundleLookup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BundleLookupCondition) DeepCopyInto(out *BundleLookupCondition) { + *out = *in + if in.LastUpdateTime != nil { + in, out := &in.LastUpdateTime, &out.LastUpdateTime + *out = (*in).DeepCopy() + } + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BundleLookupCondition. +func (in *BundleLookupCondition) DeepCopy() *BundleLookupCondition { + if in == nil { + return nil + } + out := new(BundleLookupCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CRDDescription) DeepCopyInto(out *CRDDescription) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]APIResourceReference, len(*in)) + copy(*out, *in) + } + if in.StatusDescriptors != nil { + in, out := &in.StatusDescriptors, &out.StatusDescriptors + *out = make([]StatusDescriptor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.SpecDescriptors != nil { + in, out := &in.SpecDescriptors, &out.SpecDescriptors + *out = make([]SpecDescriptor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ActionDescriptor != nil { + in, out := &in.ActionDescriptor, &out.ActionDescriptor + *out = make([]ActionDescriptor, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CRDDescription. +func (in *CRDDescription) DeepCopy() *CRDDescription { + if in == nil { + return nil + } + out := new(CRDDescription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogSource) DeepCopyInto(out *CatalogSource) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSource. +func (in *CatalogSource) DeepCopy() *CatalogSource { + if in == nil { + return nil + } + out := new(CatalogSource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CatalogSource) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogSourceList) DeepCopyInto(out *CatalogSourceList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]CatalogSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSourceList. +func (in *CatalogSourceList) DeepCopy() *CatalogSourceList { + if in == nil { + return nil + } + out := new(CatalogSourceList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *CatalogSourceList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogSourceSpec) DeepCopyInto(out *CatalogSourceSpec) { + *out = *in + if in.UpdateStrategy != nil { + in, out := &in.UpdateStrategy, &out.UpdateStrategy + *out = new(UpdateStrategy) + (*in).DeepCopyInto(*out) + } + if in.Secrets != nil { + in, out := &in.Secrets, &out.Secrets + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Icon = in.Icon +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSourceSpec. +func (in *CatalogSourceSpec) DeepCopy() *CatalogSourceSpec { + if in == nil { + return nil + } + out := new(CatalogSourceSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CatalogSourceStatus) DeepCopyInto(out *CatalogSourceStatus) { + *out = *in + if in.ConfigMapResource != nil { + in, out := &in.ConfigMapResource, &out.ConfigMapResource + *out = new(ConfigMapResourceReference) + (*in).DeepCopyInto(*out) + } + if in.RegistryServiceStatus != nil { + in, out := &in.RegistryServiceStatus, &out.RegistryServiceStatus + *out = new(RegistryServiceStatus) + (*in).DeepCopyInto(*out) + } + if in.GRPCConnectionState != nil { + in, out := &in.GRPCConnectionState, &out.GRPCConnectionState + *out = new(GRPCConnectionState) + (*in).DeepCopyInto(*out) + } + if in.LatestImageRegistryPoll != nil { + in, out := &in.LatestImageRegistryPoll, &out.LatestImageRegistryPoll + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CatalogSourceStatus. +func (in *CatalogSourceStatus) DeepCopy() *CatalogSourceStatus { + if in == nil { + return nil + } + out := new(CatalogSourceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterServiceVersion) DeepCopyInto(out *ClusterServiceVersion) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersion. +func (in *ClusterServiceVersion) DeepCopy() *ClusterServiceVersion { + if in == nil { + return nil + } + out := new(ClusterServiceVersion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterServiceVersion) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterServiceVersionCondition) DeepCopyInto(out *ClusterServiceVersionCondition) { + *out = *in + if in.LastUpdateTime != nil { + in, out := &in.LastUpdateTime, &out.LastUpdateTime + *out = (*in).DeepCopy() + } + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionCondition. +func (in *ClusterServiceVersionCondition) DeepCopy() *ClusterServiceVersionCondition { + if in == nil { + return nil + } + out := new(ClusterServiceVersionCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterServiceVersionList) DeepCopyInto(out *ClusterServiceVersionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterServiceVersion, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionList. +func (in *ClusterServiceVersionList) DeepCopy() *ClusterServiceVersionList { + if in == nil { + return nil + } + out := new(ClusterServiceVersionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterServiceVersionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterServiceVersionSpec) DeepCopyInto(out *ClusterServiceVersionSpec) { + *out = *in + in.InstallStrategy.DeepCopyInto(&out.InstallStrategy) + in.Version.DeepCopyInto(&out.Version) + in.CustomResourceDefinitions.DeepCopyInto(&out.CustomResourceDefinitions) + in.APIServiceDefinitions.DeepCopyInto(&out.APIServiceDefinitions) + if in.NativeAPIs != nil { + in, out := &in.NativeAPIs, &out.NativeAPIs + *out = make([]v1.GroupVersionKind, len(*in)) + copy(*out, *in) + } + if in.Keywords != nil { + in, out := &in.Keywords, &out.Keywords + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Maintainers != nil { + in, out := &in.Maintainers, &out.Maintainers + *out = make([]Maintainer, len(*in)) + copy(*out, *in) + } + out.Provider = in.Provider + if in.Links != nil { + in, out := &in.Links, &out.Links + *out = make([]AppLink, len(*in)) + copy(*out, *in) + } + if in.Icon != nil { + in, out := &in.Icon, &out.Icon + *out = make([]Icon, len(*in)) + copy(*out, *in) + } + if in.InstallModes != nil { + in, out := &in.InstallModes, &out.InstallModes + *out = make([]InstallMode, len(*in)) + copy(*out, *in) + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionSpec. +func (in *ClusterServiceVersionSpec) DeepCopy() *ClusterServiceVersionSpec { + if in == nil { + return nil + } + out := new(ClusterServiceVersionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterServiceVersionStatus) DeepCopyInto(out *ClusterServiceVersionStatus) { + *out = *in + if in.LastUpdateTime != nil { + in, out := &in.LastUpdateTime, &out.LastUpdateTime + *out = (*in).DeepCopy() + } + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ClusterServiceVersionCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.RequirementStatus != nil { + in, out := &in.RequirementStatus, &out.RequirementStatus + *out = make([]RequirementStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CertsLastUpdated != nil { + in, out := &in.CertsLastUpdated, &out.CertsLastUpdated + *out = (*in).DeepCopy() + } + if in.CertsRotateAt != nil { + in, out := &in.CertsRotateAt, &out.CertsRotateAt + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterServiceVersionStatus. +func (in *ClusterServiceVersionStatus) DeepCopy() *ClusterServiceVersionStatus { + if in == nil { + return nil + } + out := new(ClusterServiceVersionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigMapResourceReference) DeepCopyInto(out *ConfigMapResourceReference) { + *out = *in + in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigMapResourceReference. +func (in *ConfigMapResourceReference) DeepCopy() *ConfigMapResourceReference { + if in == nil { + return nil + } + out := new(ConfigMapResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CustomResourceDefinitions) DeepCopyInto(out *CustomResourceDefinitions) { + *out = *in + if in.Owned != nil { + in, out := &in.Owned, &out.Owned + *out = make([]CRDDescription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Required != nil { + in, out := &in.Required, &out.Required + *out = make([]CRDDescription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CustomResourceDefinitions. +func (in *CustomResourceDefinitions) DeepCopy() *CustomResourceDefinitions { + if in == nil { + return nil + } + out := new(CustomResourceDefinitions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DependentStatus) DeepCopyInto(out *DependentStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DependentStatus. +func (in *DependentStatus) DeepCopy() *DependentStatus { + if in == nil { + return nil + } + out := new(DependentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GRPCConnectionState) DeepCopyInto(out *GRPCConnectionState) { + *out = *in + in.LastConnectTime.DeepCopyInto(&out.LastConnectTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCConnectionState. +func (in *GRPCConnectionState) DeepCopy() *GRPCConnectionState { + if in == nil { + return nil + } + out := new(GRPCConnectionState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Icon) DeepCopyInto(out *Icon) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Icon. +func (in *Icon) DeepCopy() *Icon { + if in == nil { + return nil + } + out := new(Icon) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallMode) DeepCopyInto(out *InstallMode) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallMode. +func (in *InstallMode) DeepCopy() *InstallMode { + if in == nil { + return nil + } + out := new(InstallMode) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in InstallModeSet) DeepCopyInto(out *InstallModeSet) { + { + in := &in + *out = make(InstallModeSet, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallModeSet. +func (in InstallModeSet) DeepCopy() InstallModeSet { + if in == nil { + return nil + } + out := new(InstallModeSet) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallPlan) DeepCopyInto(out *InstallPlan) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlan. +func (in *InstallPlan) DeepCopy() *InstallPlan { + if in == nil { + return nil + } + out := new(InstallPlan) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InstallPlan) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallPlanCondition) DeepCopyInto(out *InstallPlanCondition) { + *out = *in + if in.LastUpdateTime != nil { + in, out := &in.LastUpdateTime, &out.LastUpdateTime + *out = (*in).DeepCopy() + } + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanCondition. +func (in *InstallPlanCondition) DeepCopy() *InstallPlanCondition { + if in == nil { + return nil + } + out := new(InstallPlanCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallPlanList) DeepCopyInto(out *InstallPlanList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]InstallPlan, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanList. +func (in *InstallPlanList) DeepCopy() *InstallPlanList { + if in == nil { + return nil + } + out := new(InstallPlanList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *InstallPlanList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallPlanReference) DeepCopyInto(out *InstallPlanReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanReference. +func (in *InstallPlanReference) DeepCopy() *InstallPlanReference { + if in == nil { + return nil + } + out := new(InstallPlanReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallPlanSpec) DeepCopyInto(out *InstallPlanSpec) { + *out = *in + if in.ClusterServiceVersionNames != nil { + in, out := &in.ClusterServiceVersionNames, &out.ClusterServiceVersionNames + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanSpec. +func (in *InstallPlanSpec) DeepCopy() *InstallPlanSpec { + if in == nil { + return nil + } + out := new(InstallPlanSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstallPlanStatus) DeepCopyInto(out *InstallPlanStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]InstallPlanCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CatalogSources != nil { + in, out := &in.CatalogSources, &out.CatalogSources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Plan != nil { + in, out := &in.Plan, &out.Plan + *out = make([]*Step, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Step) + **out = **in + } + } + } + if in.BundleLookups != nil { + in, out := &in.BundleLookups, &out.BundleLookups + *out = make([]BundleLookup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AttenuatedServiceAccountRef != nil { + in, out := &in.AttenuatedServiceAccountRef, &out.AttenuatedServiceAccountRef + *out = new(corev1.ObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstallPlanStatus. +func (in *InstallPlanStatus) DeepCopy() *InstallPlanStatus { + if in == nil { + return nil + } + out := new(InstallPlanStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Maintainer) DeepCopyInto(out *Maintainer) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Maintainer. +func (in *Maintainer) DeepCopy() *Maintainer { + if in == nil { + return nil + } + out := new(Maintainer) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NamedInstallStrategy) DeepCopyInto(out *NamedInstallStrategy) { + *out = *in + in.StrategySpec.DeepCopyInto(&out.StrategySpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamedInstallStrategy. +func (in *NamedInstallStrategy) DeepCopy() *NamedInstallStrategy { + if in == nil { + return nil + } + out := new(NamedInstallStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroup) DeepCopyInto(out *OperatorGroup) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroup. +func (in *OperatorGroup) DeepCopy() *OperatorGroup { + if in == nil { + return nil + } + out := new(OperatorGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorGroup) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroupList) DeepCopyInto(out *OperatorGroupList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]OperatorGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroupList. +func (in *OperatorGroupList) DeepCopy() *OperatorGroupList { + if in == nil { + return nil + } + out := new(OperatorGroupList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *OperatorGroupList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroupSpec) DeepCopyInto(out *OperatorGroupSpec) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.TargetNamespaces != nil { + in, out := &in.TargetNamespaces, &out.TargetNamespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroupSpec. +func (in *OperatorGroupSpec) DeepCopy() *OperatorGroupSpec { + if in == nil { + return nil + } + out := new(OperatorGroupSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OperatorGroupStatus) DeepCopyInto(out *OperatorGroupStatus) { + *out = *in + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ServiceAccountRef != nil { + in, out := &in.ServiceAccountRef, &out.ServiceAccountRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OperatorGroupStatus. +func (in *OperatorGroupStatus) DeepCopy() *OperatorGroupStatus { + if in == nil { + return nil + } + out := new(OperatorGroupStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistryPoll) DeepCopyInto(out *RegistryPoll) { + *out = *in + if in.Interval != nil { + in, out := &in.Interval, &out.Interval + *out = new(v1.Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryPoll. +func (in *RegistryPoll) DeepCopy() *RegistryPoll { + if in == nil { + return nil + } + out := new(RegistryPoll) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RegistryServiceStatus) DeepCopyInto(out *RegistryServiceStatus) { + *out = *in + in.CreatedAt.DeepCopyInto(&out.CreatedAt) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RegistryServiceStatus. +func (in *RegistryServiceStatus) DeepCopy() *RegistryServiceStatus { + if in == nil { + return nil + } + out := new(RegistryServiceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RequirementStatus) DeepCopyInto(out *RequirementStatus) { + *out = *in + if in.Dependents != nil { + in, out := &in.Dependents, &out.Dependents + *out = make([]DependentStatus, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RequirementStatus. +func (in *RequirementStatus) DeepCopy() *RequirementStatus { + if in == nil { + return nil + } + out := new(RequirementStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpecDescriptor) DeepCopyInto(out *SpecDescriptor) { + *out = *in + if in.XDescriptors != nil { + in, out := &in.XDescriptors, &out.XDescriptors + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpecDescriptor. +func (in *SpecDescriptor) DeepCopy() *SpecDescriptor { + if in == nil { + return nil + } + out := new(SpecDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatusDescriptor) DeepCopyInto(out *StatusDescriptor) { + *out = *in + if in.XDescriptors != nil { + in, out := &in.XDescriptors, &out.XDescriptors + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = make(json.RawMessage, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusDescriptor. +func (in *StatusDescriptor) DeepCopy() *StatusDescriptor { + if in == nil { + return nil + } + out := new(StatusDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Step) DeepCopyInto(out *Step) { + *out = *in + out.Resource = in.Resource +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Step. +func (in *Step) DeepCopy() *Step { + if in == nil { + return nil + } + out := new(Step) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StepResource) DeepCopyInto(out *StepResource) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StepResource. +func (in *StepResource) DeepCopy() *StepResource { + if in == nil { + return nil + } + out := new(StepResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StrategyDeploymentPermissions) DeepCopyInto(out *StrategyDeploymentPermissions) { + *out = *in + if in.Rules != nil { + in, out := &in.Rules, &out.Rules + *out = make([]rbacv1.PolicyRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyDeploymentPermissions. +func (in *StrategyDeploymentPermissions) DeepCopy() *StrategyDeploymentPermissions { + if in == nil { + return nil + } + out := new(StrategyDeploymentPermissions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StrategyDeploymentSpec) DeepCopyInto(out *StrategyDeploymentSpec) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyDeploymentSpec. +func (in *StrategyDeploymentSpec) DeepCopy() *StrategyDeploymentSpec { + if in == nil { + return nil + } + out := new(StrategyDeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StrategyDetailsDeployment) DeepCopyInto(out *StrategyDetailsDeployment) { + *out = *in + if in.DeploymentSpecs != nil { + in, out := &in.DeploymentSpecs, &out.DeploymentSpecs + *out = make([]StrategyDeploymentSpec, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Permissions != nil { + in, out := &in.Permissions, &out.Permissions + *out = make([]StrategyDeploymentPermissions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ClusterPermissions != nil { + in, out := &in.ClusterPermissions, &out.ClusterPermissions + *out = make([]StrategyDeploymentPermissions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StrategyDetailsDeployment. +func (in *StrategyDetailsDeployment) DeepCopy() *StrategyDetailsDeployment { + if in == nil { + return nil + } + out := new(StrategyDetailsDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Subscription) DeepCopyInto(out *Subscription) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + if in.Spec != nil { + in, out := &in.Spec, &out.Spec + *out = new(SubscriptionSpec) + (*in).DeepCopyInto(*out) + } + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subscription. +func (in *Subscription) DeepCopy() *Subscription { + if in == nil { + return nil + } + out := new(Subscription) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Subscription) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionCatalogHealth) DeepCopyInto(out *SubscriptionCatalogHealth) { + *out = *in + if in.CatalogSourceRef != nil { + in, out := &in.CatalogSourceRef, &out.CatalogSourceRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionCatalogHealth. +func (in *SubscriptionCatalogHealth) DeepCopy() *SubscriptionCatalogHealth { + if in == nil { + return nil + } + out := new(SubscriptionCatalogHealth) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionCondition) DeepCopyInto(out *SubscriptionCondition) { + *out = *in + if in.LastHeartbeatTime != nil { + in, out := &in.LastHeartbeatTime, &out.LastHeartbeatTime + *out = (*in).DeepCopy() + } + if in.LastTransitionTime != nil { + in, out := &in.LastTransitionTime, &out.LastTransitionTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionCondition. +func (in *SubscriptionCondition) DeepCopy() *SubscriptionCondition { + if in == nil { + return nil + } + out := new(SubscriptionCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionConfig) DeepCopyInto(out *SubscriptionConfig) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.NodeSelector != nil { + in, out := &in.NodeSelector, &out.NodeSelector + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Tolerations != nil { + in, out := &in.Tolerations, &out.Tolerations + *out = make([]corev1.Toleration, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Resources.DeepCopyInto(&out.Resources) + if in.EnvFrom != nil { + in, out := &in.EnvFrom, &out.EnvFrom + *out = make([]corev1.EnvFromSource, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Env != nil { + in, out := &in.Env, &out.Env + *out = make([]corev1.EnvVar, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Volumes != nil { + in, out := &in.Volumes, &out.Volumes + *out = make([]corev1.Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.VolumeMounts != nil { + in, out := &in.VolumeMounts, &out.VolumeMounts + *out = make([]corev1.VolumeMount, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionConfig. +func (in *SubscriptionConfig) DeepCopy() *SubscriptionConfig { + if in == nil { + return nil + } + out := new(SubscriptionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionList) DeepCopyInto(out *SubscriptionList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Subscription, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionList. +func (in *SubscriptionList) DeepCopy() *SubscriptionList { + if in == nil { + return nil + } + out := new(SubscriptionList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *SubscriptionList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionSpec) DeepCopyInto(out *SubscriptionSpec) { + *out = *in + in.Config.DeepCopyInto(&out.Config) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionSpec. +func (in *SubscriptionSpec) DeepCopy() *SubscriptionSpec { + if in == nil { + return nil + } + out := new(SubscriptionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubscriptionStatus) DeepCopyInto(out *SubscriptionStatus) { + *out = *in + if in.Install != nil { + in, out := &in.Install, &out.Install + *out = new(InstallPlanReference) + **out = **in + } + if in.InstallPlanRef != nil { + in, out := &in.InstallPlanRef, &out.InstallPlanRef + *out = new(corev1.ObjectReference) + **out = **in + } + if in.CatalogHealth != nil { + in, out := &in.CatalogHealth, &out.CatalogHealth + *out = make([]SubscriptionCatalogHealth, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]SubscriptionCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.LastUpdated.DeepCopyInto(&out.LastUpdated) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubscriptionStatus. +func (in *SubscriptionStatus) DeepCopy() *SubscriptionStatus { + if in == nil { + return nil + } + out := new(SubscriptionStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy) { + *out = *in + if in.RegistryPoll != nil { + in, out := &in.RegistryPoll, &out.RegistryPoll + *out = new(RegistryPoll) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdateStrategy. +func (in *UpdateStrategy) DeepCopy() *UpdateStrategy { + if in == nil { + return nil + } + out := new(UpdateStrategy) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/operator-framework/operator-registry/LICENSE b/vendor/github.com/operator-framework/operator-registry/LICENSE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go new file mode 100644 index 000000000..1d0769876 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.pb.go @@ -0,0 +1,1558 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: registry.proto + +package api + +import ( + context "context" + fmt "fmt" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type Channel struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + CsvName string `protobuf:"bytes,2,opt,name=csvName,proto3" json:"csvName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Channel) Reset() { *m = Channel{} } +func (m *Channel) String() string { return proto.CompactTextString(m) } +func (*Channel) ProtoMessage() {} +func (*Channel) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{0} +} + +func (m *Channel) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Channel.Unmarshal(m, b) +} +func (m *Channel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Channel.Marshal(b, m, deterministic) +} +func (m *Channel) XXX_Merge(src proto.Message) { + xxx_messageInfo_Channel.Merge(m, src) +} +func (m *Channel) XXX_Size() int { + return xxx_messageInfo_Channel.Size(m) +} +func (m *Channel) XXX_DiscardUnknown() { + xxx_messageInfo_Channel.DiscardUnknown(m) +} + +var xxx_messageInfo_Channel proto.InternalMessageInfo + +func (m *Channel) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Channel) GetCsvName() string { + if m != nil { + return m.CsvName + } + return "" +} + +type PackageName struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PackageName) Reset() { *m = PackageName{} } +func (m *PackageName) String() string { return proto.CompactTextString(m) } +func (*PackageName) ProtoMessage() {} +func (*PackageName) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{1} +} + +func (m *PackageName) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_PackageName.Unmarshal(m, b) +} +func (m *PackageName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_PackageName.Marshal(b, m, deterministic) +} +func (m *PackageName) XXX_Merge(src proto.Message) { + xxx_messageInfo_PackageName.Merge(m, src) +} +func (m *PackageName) XXX_Size() int { + return xxx_messageInfo_PackageName.Size(m) +} +func (m *PackageName) XXX_DiscardUnknown() { + xxx_messageInfo_PackageName.DiscardUnknown(m) +} + +var xxx_messageInfo_PackageName proto.InternalMessageInfo + +func (m *PackageName) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type Package struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Channels []*Channel `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"` + DefaultChannelName string `protobuf:"bytes,3,opt,name=defaultChannelName,proto3" json:"defaultChannelName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Package) Reset() { *m = Package{} } +func (m *Package) String() string { return proto.CompactTextString(m) } +func (*Package) ProtoMessage() {} +func (*Package) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{2} +} + +func (m *Package) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Package.Unmarshal(m, b) +} +func (m *Package) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Package.Marshal(b, m, deterministic) +} +func (m *Package) XXX_Merge(src proto.Message) { + xxx_messageInfo_Package.Merge(m, src) +} +func (m *Package) XXX_Size() int { + return xxx_messageInfo_Package.Size(m) +} +func (m *Package) XXX_DiscardUnknown() { + xxx_messageInfo_Package.DiscardUnknown(m) +} + +var xxx_messageInfo_Package proto.InternalMessageInfo + +func (m *Package) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Package) GetChannels() []*Channel { + if m != nil { + return m.Channels + } + return nil +} + +func (m *Package) GetDefaultChannelName() string { + if m != nil { + return m.DefaultChannelName + } + return "" +} + +type GroupVersionKind struct { + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GroupVersionKind) Reset() { *m = GroupVersionKind{} } +func (m *GroupVersionKind) String() string { return proto.CompactTextString(m) } +func (*GroupVersionKind) ProtoMessage() {} +func (*GroupVersionKind) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{3} +} + +func (m *GroupVersionKind) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GroupVersionKind.Unmarshal(m, b) +} +func (m *GroupVersionKind) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GroupVersionKind.Marshal(b, m, deterministic) +} +func (m *GroupVersionKind) XXX_Merge(src proto.Message) { + xxx_messageInfo_GroupVersionKind.Merge(m, src) +} +func (m *GroupVersionKind) XXX_Size() int { + return xxx_messageInfo_GroupVersionKind.Size(m) +} +func (m *GroupVersionKind) XXX_DiscardUnknown() { + xxx_messageInfo_GroupVersionKind.DiscardUnknown(m) +} + +var xxx_messageInfo_GroupVersionKind proto.InternalMessageInfo + +func (m *GroupVersionKind) GetGroup() string { + if m != nil { + return m.Group + } + return "" +} + +func (m *GroupVersionKind) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *GroupVersionKind) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *GroupVersionKind) GetPlural() string { + if m != nil { + return m.Plural + } + return "" +} + +type Dependency struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Dependency) Reset() { *m = Dependency{} } +func (m *Dependency) String() string { return proto.CompactTextString(m) } +func (*Dependency) ProtoMessage() {} +func (*Dependency) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{4} +} + +func (m *Dependency) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Dependency.Unmarshal(m, b) +} +func (m *Dependency) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Dependency.Marshal(b, m, deterministic) +} +func (m *Dependency) XXX_Merge(src proto.Message) { + xxx_messageInfo_Dependency.Merge(m, src) +} +func (m *Dependency) XXX_Size() int { + return xxx_messageInfo_Dependency.Size(m) +} +func (m *Dependency) XXX_DiscardUnknown() { + xxx_messageInfo_Dependency.DiscardUnknown(m) +} + +var xxx_messageInfo_Dependency proto.InternalMessageInfo + +func (m *Dependency) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *Dependency) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +type Bundle struct { + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + PackageName string `protobuf:"bytes,2,opt,name=packageName,proto3" json:"packageName,omitempty"` + ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` + CsvJson string `protobuf:"bytes,4,opt,name=csvJson,proto3" json:"csvJson,omitempty"` + Object []string `protobuf:"bytes,5,rep,name=object,proto3" json:"object,omitempty"` + BundlePath string `protobuf:"bytes,6,opt,name=bundlePath,proto3" json:"bundlePath,omitempty"` + ProvidedApis []*GroupVersionKind `protobuf:"bytes,7,rep,name=providedApis,proto3" json:"providedApis,omitempty"` + RequiredApis []*GroupVersionKind `protobuf:"bytes,8,rep,name=requiredApis,proto3" json:"requiredApis,omitempty"` + Version string `protobuf:"bytes,9,opt,name=version,proto3" json:"version,omitempty"` + SkipRange string `protobuf:"bytes,10,opt,name=skipRange,proto3" json:"skipRange,omitempty"` + Dependencies []*Dependency `protobuf:"bytes,11,rep,name=dependencies,proto3" json:"dependencies,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Bundle) Reset() { *m = Bundle{} } +func (m *Bundle) String() string { return proto.CompactTextString(m) } +func (*Bundle) ProtoMessage() {} +func (*Bundle) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{5} +} + +func (m *Bundle) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Bundle.Unmarshal(m, b) +} +func (m *Bundle) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Bundle.Marshal(b, m, deterministic) +} +func (m *Bundle) XXX_Merge(src proto.Message) { + xxx_messageInfo_Bundle.Merge(m, src) +} +func (m *Bundle) XXX_Size() int { + return xxx_messageInfo_Bundle.Size(m) +} +func (m *Bundle) XXX_DiscardUnknown() { + xxx_messageInfo_Bundle.DiscardUnknown(m) +} + +var xxx_messageInfo_Bundle proto.InternalMessageInfo + +func (m *Bundle) GetCsvName() string { + if m != nil { + return m.CsvName + } + return "" +} + +func (m *Bundle) GetPackageName() string { + if m != nil { + return m.PackageName + } + return "" +} + +func (m *Bundle) GetChannelName() string { + if m != nil { + return m.ChannelName + } + return "" +} + +func (m *Bundle) GetCsvJson() string { + if m != nil { + return m.CsvJson + } + return "" +} + +func (m *Bundle) GetObject() []string { + if m != nil { + return m.Object + } + return nil +} + +func (m *Bundle) GetBundlePath() string { + if m != nil { + return m.BundlePath + } + return "" +} + +func (m *Bundle) GetProvidedApis() []*GroupVersionKind { + if m != nil { + return m.ProvidedApis + } + return nil +} + +func (m *Bundle) GetRequiredApis() []*GroupVersionKind { + if m != nil { + return m.RequiredApis + } + return nil +} + +func (m *Bundle) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *Bundle) GetSkipRange() string { + if m != nil { + return m.SkipRange + } + return "" +} + +func (m *Bundle) GetDependencies() []*Dependency { + if m != nil { + return m.Dependencies + } + return nil +} + +type ChannelEntry struct { + PackageName string `protobuf:"bytes,1,opt,name=packageName,proto3" json:"packageName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + BundleName string `protobuf:"bytes,3,opt,name=bundleName,proto3" json:"bundleName,omitempty"` + Replaces string `protobuf:"bytes,4,opt,name=replaces,proto3" json:"replaces,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ChannelEntry) Reset() { *m = ChannelEntry{} } +func (m *ChannelEntry) String() string { return proto.CompactTextString(m) } +func (*ChannelEntry) ProtoMessage() {} +func (*ChannelEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{6} +} + +func (m *ChannelEntry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ChannelEntry.Unmarshal(m, b) +} +func (m *ChannelEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ChannelEntry.Marshal(b, m, deterministic) +} +func (m *ChannelEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelEntry.Merge(m, src) +} +func (m *ChannelEntry) XXX_Size() int { + return xxx_messageInfo_ChannelEntry.Size(m) +} +func (m *ChannelEntry) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelEntry proto.InternalMessageInfo + +func (m *ChannelEntry) GetPackageName() string { + if m != nil { + return m.PackageName + } + return "" +} + +func (m *ChannelEntry) GetChannelName() string { + if m != nil { + return m.ChannelName + } + return "" +} + +func (m *ChannelEntry) GetBundleName() string { + if m != nil { + return m.BundleName + } + return "" +} + +func (m *ChannelEntry) GetReplaces() string { + if m != nil { + return m.Replaces + } + return "" +} + +type ListPackageRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListPackageRequest) Reset() { *m = ListPackageRequest{} } +func (m *ListPackageRequest) String() string { return proto.CompactTextString(m) } +func (*ListPackageRequest) ProtoMessage() {} +func (*ListPackageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{7} +} + +func (m *ListPackageRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListPackageRequest.Unmarshal(m, b) +} +func (m *ListPackageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListPackageRequest.Marshal(b, m, deterministic) +} +func (m *ListPackageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListPackageRequest.Merge(m, src) +} +func (m *ListPackageRequest) XXX_Size() int { + return xxx_messageInfo_ListPackageRequest.Size(m) +} +func (m *ListPackageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListPackageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListPackageRequest proto.InternalMessageInfo + +type ListBundlesRequest struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ListBundlesRequest) Reset() { *m = ListBundlesRequest{} } +func (m *ListBundlesRequest) String() string { return proto.CompactTextString(m) } +func (*ListBundlesRequest) ProtoMessage() {} +func (*ListBundlesRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{8} +} + +func (m *ListBundlesRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ListBundlesRequest.Unmarshal(m, b) +} +func (m *ListBundlesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ListBundlesRequest.Marshal(b, m, deterministic) +} +func (m *ListBundlesRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ListBundlesRequest.Merge(m, src) +} +func (m *ListBundlesRequest) XXX_Size() int { + return xxx_messageInfo_ListBundlesRequest.Size(m) +} +func (m *ListBundlesRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ListBundlesRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ListBundlesRequest proto.InternalMessageInfo + +type GetPackageRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetPackageRequest) Reset() { *m = GetPackageRequest{} } +func (m *GetPackageRequest) String() string { return proto.CompactTextString(m) } +func (*GetPackageRequest) ProtoMessage() {} +func (*GetPackageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{9} +} + +func (m *GetPackageRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetPackageRequest.Unmarshal(m, b) +} +func (m *GetPackageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetPackageRequest.Marshal(b, m, deterministic) +} +func (m *GetPackageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetPackageRequest.Merge(m, src) +} +func (m *GetPackageRequest) XXX_Size() int { + return xxx_messageInfo_GetPackageRequest.Size(m) +} +func (m *GetPackageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetPackageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetPackageRequest proto.InternalMessageInfo + +func (m *GetPackageRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type GetBundleRequest struct { + PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + CsvName string `protobuf:"bytes,3,opt,name=csvName,proto3" json:"csvName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBundleRequest) Reset() { *m = GetBundleRequest{} } +func (m *GetBundleRequest) String() string { return proto.CompactTextString(m) } +func (*GetBundleRequest) ProtoMessage() {} +func (*GetBundleRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{10} +} + +func (m *GetBundleRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBundleRequest.Unmarshal(m, b) +} +func (m *GetBundleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBundleRequest.Marshal(b, m, deterministic) +} +func (m *GetBundleRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBundleRequest.Merge(m, src) +} +func (m *GetBundleRequest) XXX_Size() int { + return xxx_messageInfo_GetBundleRequest.Size(m) +} +func (m *GetBundleRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetBundleRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBundleRequest proto.InternalMessageInfo + +func (m *GetBundleRequest) GetPkgName() string { + if m != nil { + return m.PkgName + } + return "" +} + +func (m *GetBundleRequest) GetChannelName() string { + if m != nil { + return m.ChannelName + } + return "" +} + +func (m *GetBundleRequest) GetCsvName() string { + if m != nil { + return m.CsvName + } + return "" +} + +type GetBundleInChannelRequest struct { + PkgName string `protobuf:"bytes,1,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,2,opt,name=channelName,proto3" json:"channelName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetBundleInChannelRequest) Reset() { *m = GetBundleInChannelRequest{} } +func (m *GetBundleInChannelRequest) String() string { return proto.CompactTextString(m) } +func (*GetBundleInChannelRequest) ProtoMessage() {} +func (*GetBundleInChannelRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{11} +} + +func (m *GetBundleInChannelRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetBundleInChannelRequest.Unmarshal(m, b) +} +func (m *GetBundleInChannelRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetBundleInChannelRequest.Marshal(b, m, deterministic) +} +func (m *GetBundleInChannelRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetBundleInChannelRequest.Merge(m, src) +} +func (m *GetBundleInChannelRequest) XXX_Size() int { + return xxx_messageInfo_GetBundleInChannelRequest.Size(m) +} +func (m *GetBundleInChannelRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetBundleInChannelRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetBundleInChannelRequest proto.InternalMessageInfo + +func (m *GetBundleInChannelRequest) GetPkgName() string { + if m != nil { + return m.PkgName + } + return "" +} + +func (m *GetBundleInChannelRequest) GetChannelName() string { + if m != nil { + return m.ChannelName + } + return "" +} + +type GetAllReplacementsRequest struct { + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllReplacementsRequest) Reset() { *m = GetAllReplacementsRequest{} } +func (m *GetAllReplacementsRequest) String() string { return proto.CompactTextString(m) } +func (*GetAllReplacementsRequest) ProtoMessage() {} +func (*GetAllReplacementsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{12} +} + +func (m *GetAllReplacementsRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllReplacementsRequest.Unmarshal(m, b) +} +func (m *GetAllReplacementsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllReplacementsRequest.Marshal(b, m, deterministic) +} +func (m *GetAllReplacementsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllReplacementsRequest.Merge(m, src) +} +func (m *GetAllReplacementsRequest) XXX_Size() int { + return xxx_messageInfo_GetAllReplacementsRequest.Size(m) +} +func (m *GetAllReplacementsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllReplacementsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllReplacementsRequest proto.InternalMessageInfo + +func (m *GetAllReplacementsRequest) GetCsvName() string { + if m != nil { + return m.CsvName + } + return "" +} + +type GetReplacementRequest struct { + CsvName string `protobuf:"bytes,1,opt,name=csvName,proto3" json:"csvName,omitempty"` + PkgName string `protobuf:"bytes,2,opt,name=pkgName,proto3" json:"pkgName,omitempty"` + ChannelName string `protobuf:"bytes,3,opt,name=channelName,proto3" json:"channelName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetReplacementRequest) Reset() { *m = GetReplacementRequest{} } +func (m *GetReplacementRequest) String() string { return proto.CompactTextString(m) } +func (*GetReplacementRequest) ProtoMessage() {} +func (*GetReplacementRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{13} +} + +func (m *GetReplacementRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetReplacementRequest.Unmarshal(m, b) +} +func (m *GetReplacementRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetReplacementRequest.Marshal(b, m, deterministic) +} +func (m *GetReplacementRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetReplacementRequest.Merge(m, src) +} +func (m *GetReplacementRequest) XXX_Size() int { + return xxx_messageInfo_GetReplacementRequest.Size(m) +} +func (m *GetReplacementRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetReplacementRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetReplacementRequest proto.InternalMessageInfo + +func (m *GetReplacementRequest) GetCsvName() string { + if m != nil { + return m.CsvName + } + return "" +} + +func (m *GetReplacementRequest) GetPkgName() string { + if m != nil { + return m.PkgName + } + return "" +} + +func (m *GetReplacementRequest) GetChannelName() string { + if m != nil { + return m.ChannelName + } + return "" +} + +type GetAllProvidersRequest struct { + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetAllProvidersRequest) Reset() { *m = GetAllProvidersRequest{} } +func (m *GetAllProvidersRequest) String() string { return proto.CompactTextString(m) } +func (*GetAllProvidersRequest) ProtoMessage() {} +func (*GetAllProvidersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{14} +} + +func (m *GetAllProvidersRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetAllProvidersRequest.Unmarshal(m, b) +} +func (m *GetAllProvidersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetAllProvidersRequest.Marshal(b, m, deterministic) +} +func (m *GetAllProvidersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetAllProvidersRequest.Merge(m, src) +} +func (m *GetAllProvidersRequest) XXX_Size() int { + return xxx_messageInfo_GetAllProvidersRequest.Size(m) +} +func (m *GetAllProvidersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetAllProvidersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetAllProvidersRequest proto.InternalMessageInfo + +func (m *GetAllProvidersRequest) GetGroup() string { + if m != nil { + return m.Group + } + return "" +} + +func (m *GetAllProvidersRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *GetAllProvidersRequest) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *GetAllProvidersRequest) GetPlural() string { + if m != nil { + return m.Plural + } + return "" +} + +type GetLatestProvidersRequest struct { + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetLatestProvidersRequest) Reset() { *m = GetLatestProvidersRequest{} } +func (m *GetLatestProvidersRequest) String() string { return proto.CompactTextString(m) } +func (*GetLatestProvidersRequest) ProtoMessage() {} +func (*GetLatestProvidersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{15} +} + +func (m *GetLatestProvidersRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetLatestProvidersRequest.Unmarshal(m, b) +} +func (m *GetLatestProvidersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetLatestProvidersRequest.Marshal(b, m, deterministic) +} +func (m *GetLatestProvidersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetLatestProvidersRequest.Merge(m, src) +} +func (m *GetLatestProvidersRequest) XXX_Size() int { + return xxx_messageInfo_GetLatestProvidersRequest.Size(m) +} +func (m *GetLatestProvidersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetLatestProvidersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetLatestProvidersRequest proto.InternalMessageInfo + +func (m *GetLatestProvidersRequest) GetGroup() string { + if m != nil { + return m.Group + } + return "" +} + +func (m *GetLatestProvidersRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *GetLatestProvidersRequest) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *GetLatestProvidersRequest) GetPlural() string { + if m != nil { + return m.Plural + } + return "" +} + +type GetDefaultProviderRequest struct { + Group string `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"` + Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` + Kind string `protobuf:"bytes,3,opt,name=kind,proto3" json:"kind,omitempty"` + Plural string `protobuf:"bytes,4,opt,name=plural,proto3" json:"plural,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetDefaultProviderRequest) Reset() { *m = GetDefaultProviderRequest{} } +func (m *GetDefaultProviderRequest) String() string { return proto.CompactTextString(m) } +func (*GetDefaultProviderRequest) ProtoMessage() {} +func (*GetDefaultProviderRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_41af05d40a615591, []int{16} +} + +func (m *GetDefaultProviderRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetDefaultProviderRequest.Unmarshal(m, b) +} +func (m *GetDefaultProviderRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetDefaultProviderRequest.Marshal(b, m, deterministic) +} +func (m *GetDefaultProviderRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetDefaultProviderRequest.Merge(m, src) +} +func (m *GetDefaultProviderRequest) XXX_Size() int { + return xxx_messageInfo_GetDefaultProviderRequest.Size(m) +} +func (m *GetDefaultProviderRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetDefaultProviderRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetDefaultProviderRequest proto.InternalMessageInfo + +func (m *GetDefaultProviderRequest) GetGroup() string { + if m != nil { + return m.Group + } + return "" +} + +func (m *GetDefaultProviderRequest) GetVersion() string { + if m != nil { + return m.Version + } + return "" +} + +func (m *GetDefaultProviderRequest) GetKind() string { + if m != nil { + return m.Kind + } + return "" +} + +func (m *GetDefaultProviderRequest) GetPlural() string { + if m != nil { + return m.Plural + } + return "" +} + +func init() { + proto.RegisterType((*Channel)(nil), "api.Channel") + proto.RegisterType((*PackageName)(nil), "api.PackageName") + proto.RegisterType((*Package)(nil), "api.Package") + proto.RegisterType((*GroupVersionKind)(nil), "api.GroupVersionKind") + proto.RegisterType((*Dependency)(nil), "api.Dependency") + proto.RegisterType((*Bundle)(nil), "api.Bundle") + proto.RegisterType((*ChannelEntry)(nil), "api.ChannelEntry") + proto.RegisterType((*ListPackageRequest)(nil), "api.ListPackageRequest") + proto.RegisterType((*ListBundlesRequest)(nil), "api.ListBundlesRequest") + proto.RegisterType((*GetPackageRequest)(nil), "api.GetPackageRequest") + proto.RegisterType((*GetBundleRequest)(nil), "api.GetBundleRequest") + proto.RegisterType((*GetBundleInChannelRequest)(nil), "api.GetBundleInChannelRequest") + proto.RegisterType((*GetAllReplacementsRequest)(nil), "api.GetAllReplacementsRequest") + proto.RegisterType((*GetReplacementRequest)(nil), "api.GetReplacementRequest") + proto.RegisterType((*GetAllProvidersRequest)(nil), "api.GetAllProvidersRequest") + proto.RegisterType((*GetLatestProvidersRequest)(nil), "api.GetLatestProvidersRequest") + proto.RegisterType((*GetDefaultProviderRequest)(nil), "api.GetDefaultProviderRequest") +} + +func init() { proto.RegisterFile("registry.proto", fileDescriptor_41af05d40a615591) } + +var fileDescriptor_41af05d40a615591 = []byte{ + // 766 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x56, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0x6e, 0x92, 0x36, 0x97, 0x93, 0xe8, 0xff, 0xdb, 0xf9, 0xdb, 0xfe, 0x26, 0x54, 0x55, 0x98, + 0x0d, 0x5d, 0x45, 0xa5, 0x05, 0x2a, 0x16, 0x2c, 0x5a, 0x0a, 0x11, 0x50, 0x50, 0x65, 0x71, 0x59, + 0xb0, 0x9a, 0xda, 0x43, 0x62, 0xe2, 0x8e, 0x5d, 0xcf, 0x38, 0x55, 0x5e, 0x82, 0x17, 0xe0, 0x95, + 0x78, 0x28, 0xe4, 0xf1, 0x8c, 0x3d, 0x76, 0x9c, 0x16, 0x09, 0x01, 0xbb, 0x9c, 0x33, 0xe7, 0xf2, + 0x9d, 0xcb, 0x77, 0x1c, 0xf8, 0x27, 0xa2, 0x63, 0x8f, 0x8b, 0x68, 0x3e, 0x0c, 0xa3, 0x40, 0x04, + 0xa8, 0x41, 0x42, 0x0f, 0x1f, 0x41, 0xeb, 0xd9, 0x84, 0x30, 0x46, 0x7d, 0x84, 0x60, 0x95, 0x91, + 0x4b, 0x6a, 0xd5, 0x06, 0xb5, 0xbd, 0x8e, 0x2d, 0x7f, 0x23, 0x0b, 0x5a, 0x0e, 0x9f, 0xbd, 0x4d, + 0xd4, 0x75, 0xa9, 0xd6, 0x22, 0xbe, 0x07, 0xdd, 0x73, 0xe2, 0x4c, 0xc9, 0x98, 0x26, 0x62, 0x95, + 0x33, 0xbe, 0x86, 0x96, 0x32, 0xa9, 0x8c, 0xbd, 0x07, 0x6d, 0x27, 0x4d, 0xcd, 0xad, 0xfa, 0xa0, + 0xb1, 0xd7, 0x3d, 0xe8, 0x0d, 0x49, 0xe8, 0x0d, 0x15, 0x1e, 0x3b, 0x7b, 0x45, 0x43, 0x40, 0x2e, + 0xfd, 0x4c, 0x62, 0x5f, 0xa8, 0x37, 0x09, 0xa8, 0x21, 0x63, 0x55, 0xbc, 0x60, 0x06, 0xeb, 0xa3, + 0x28, 0x88, 0xc3, 0x0f, 0x34, 0xe2, 0x5e, 0xc0, 0x5e, 0x7b, 0xcc, 0x45, 0x9b, 0xb0, 0x36, 0x4e, + 0x74, 0x0a, 0x42, 0x2a, 0x24, 0xf5, 0xcd, 0x52, 0x23, 0x5d, 0x9f, 0x12, 0x13, 0xc4, 0x53, 0x8f, + 0xb9, 0x2a, 0x8b, 0xfc, 0x8d, 0xb6, 0xa1, 0x19, 0xfa, 0x71, 0x44, 0x7c, 0x6b, 0x55, 0x6a, 0x95, + 0x84, 0x1f, 0x03, 0x9c, 0xd2, 0x90, 0x32, 0x97, 0x32, 0x67, 0x9e, 0x78, 0x8a, 0x79, 0x98, 0xd5, + 0x9a, 0xfc, 0x4e, 0xb2, 0xcf, 0x88, 0x1f, 0xeb, 0x2e, 0xa6, 0x02, 0xfe, 0xd6, 0x80, 0xe6, 0x49, + 0xcc, 0x5c, 0xbf, 0xd0, 0xe8, 0x5a, 0xa1, 0xd1, 0x68, 0x00, 0xdd, 0x30, 0x6f, 0xb4, 0x0a, 0x60, + 0xaa, 0x12, 0x0b, 0x67, 0xa1, 0x2f, 0xa6, 0x4a, 0x45, 0x7f, 0xc5, 0x03, 0xa6, 0x90, 0x6b, 0x31, + 0x29, 0x29, 0xb8, 0xf8, 0x42, 0x1d, 0x61, 0xad, 0x0d, 0x1a, 0x49, 0x49, 0xa9, 0x84, 0x76, 0x01, + 0x2e, 0x24, 0xb2, 0x73, 0x22, 0x26, 0x56, 0x53, 0x3a, 0x19, 0x1a, 0xf4, 0x04, 0x7a, 0x61, 0x14, + 0xcc, 0x3c, 0x97, 0xba, 0xc7, 0xa1, 0xc7, 0xad, 0x96, 0x1c, 0xe0, 0x96, 0x1c, 0x60, 0xb9, 0xf7, + 0x76, 0xc1, 0x34, 0x71, 0x8d, 0xe8, 0x55, 0xec, 0x45, 0xca, 0xb5, 0x7d, 0xa3, 0xab, 0x69, 0x6a, + 0x8e, 0xab, 0x53, 0x1c, 0xd7, 0x0e, 0x74, 0xf8, 0xd4, 0x0b, 0x6d, 0xc2, 0xc6, 0xd4, 0x02, 0xf9, + 0x96, 0x2b, 0xd0, 0x21, 0xf4, 0x5c, 0x3d, 0x20, 0x8f, 0x72, 0xab, 0x2b, 0x53, 0xfe, 0x2b, 0x53, + 0xe6, 0x93, 0xb3, 0x0b, 0x46, 0xf8, 0x6b, 0x0d, 0x7a, 0x6a, 0xab, 0x9e, 0x33, 0x11, 0xcd, 0xcb, + 0x93, 0xa8, 0xdd, 0x3a, 0x89, 0xfa, 0xe2, 0x24, 0xb2, 0xbe, 0x1a, 0xa3, 0x32, 0x34, 0xa8, 0x0f, + 0xed, 0x88, 0x86, 0x3e, 0x71, 0x28, 0x57, 0xa3, 0xca, 0x64, 0xbc, 0x09, 0xe8, 0xcc, 0xe3, 0x42, + 0x71, 0xca, 0xa6, 0x57, 0x31, 0xe5, 0x42, 0x6b, 0xd3, 0x3d, 0xe2, 0x5a, 0x7b, 0x1f, 0x36, 0x46, + 0xb4, 0x64, 0x5a, 0x49, 0xd2, 0x09, 0xac, 0x8f, 0xa8, 0xf2, 0xd6, 0x76, 0x16, 0xb4, 0xc2, 0xe9, + 0xd8, 0x5c, 0x46, 0x25, 0xfe, 0x44, 0x81, 0xc6, 0x22, 0x37, 0x8a, 0x17, 0xe3, 0x23, 0xdc, 0xc9, + 0x32, 0xbd, 0x64, 0x9a, 0xe5, 0xbf, 0x9e, 0x12, 0x3f, 0x92, 0x81, 0x8f, 0x7d, 0xdf, 0x4e, 0x3b, + 0x75, 0x49, 0x99, 0xe0, 0x46, 0xe0, 0x6a, 0x62, 0xe1, 0x4b, 0xd8, 0x1a, 0x51, 0x61, 0xf8, 0xdc, + 0xea, 0x62, 0xa2, 0xac, 0xdf, 0x88, 0x72, 0x91, 0x83, 0x58, 0xc0, 0x76, 0x8a, 0xf2, 0x3c, 0x25, + 0x43, 0x94, 0x41, 0xfc, 0x9d, 0xa7, 0xe9, 0x5a, 0xf6, 0xe6, 0x8c, 0x08, 0xca, 0xc5, 0x5f, 0x48, + 0x7c, 0x9a, 0x1e, 0x67, 0x9d, 0xf9, 0x0f, 0x24, 0x3e, 0xf8, 0xbe, 0x06, 0x6d, 0x5b, 0x7d, 0xe9, + 0xd0, 0x53, 0xe8, 0x19, 0x94, 0xe1, 0xe8, 0x7f, 0x49, 0xf9, 0x45, 0x16, 0xf5, 0xd7, 0xe5, 0x83, + 0xf1, 0x45, 0xc3, 0x2b, 0xfb, 0x35, 0xf4, 0x10, 0x20, 0x67, 0x11, 0xda, 0x4e, 0x4f, 0x54, 0x99, + 0x56, 0xfd, 0x9e, 0xe9, 0x8b, 0x57, 0xd0, 0x03, 0xe8, 0x64, 0x8b, 0x8e, 0xb6, 0xb4, 0x53, 0x81, + 0x62, 0xfd, 0xae, 0x54, 0xa7, 0x3a, 0xbc, 0x82, 0x4e, 0xe1, 0xbf, 0xcc, 0xe4, 0x45, 0x10, 0xe9, + 0x4f, 0xf2, 0x6e, 0xd1, 0xb9, 0xcc, 0x9a, 0x72, 0x94, 0xf7, 0xb0, 0x33, 0xa2, 0xc2, 0xb8, 0x59, + 0x1e, 0xe5, 0xef, 0x26, 0x44, 0xef, 0x78, 0x1e, 0xae, 0x9a, 0x2b, 0xfd, 0x0d, 0xf3, 0xfb, 0x2b, + 0x6f, 0x9e, 0xec, 0xc2, 0x89, 0x24, 0x4a, 0x9a, 0xc5, 0x08, 0xc7, 0x51, 0x5f, 0xc7, 0x5b, 0x24, + 0x51, 0x19, 0x9a, 0xbd, 0x04, 0x9a, 0xda, 0x0c, 0x74, 0xd7, 0x80, 0x56, 0xde, 0xd3, 0x65, 0xb8, + 0x3e, 0x01, 0xce, 0x76, 0x7b, 0x79, 0xe4, 0xac, 0xe8, 0x6a, 0x12, 0x2c, 0x0b, 0xfe, 0x46, 0x02, + 0x56, 0xfb, 0x9b, 0xd7, 0xae, 0xdc, 0x79, 0x1e, 0xb6, 0x7a, 0xc5, 0xcb, 0xf5, 0x1f, 0x41, 0xd7, + 0xb8, 0xd2, 0xc6, 0x1e, 0x16, 0xef, 0x76, 0xc9, 0x6d, 0xbf, 0x76, 0xd1, 0x94, 0x7f, 0xd6, 0x0e, + 0x7f, 0x04, 0x00, 0x00, 0xff, 0xff, 0x92, 0x79, 0x1b, 0xe1, 0xbe, 0x09, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// RegistryClient is the client API for Registry service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type RegistryClient interface { + ListPackages(ctx context.Context, in *ListPackageRequest, opts ...grpc.CallOption) (Registry_ListPackagesClient, error) + GetPackage(ctx context.Context, in *GetPackageRequest, opts ...grpc.CallOption) (*Package, error) + GetBundle(ctx context.Context, in *GetBundleRequest, opts ...grpc.CallOption) (*Bundle, error) + GetBundleForChannel(ctx context.Context, in *GetBundleInChannelRequest, opts ...grpc.CallOption) (*Bundle, error) + GetChannelEntriesThatReplace(ctx context.Context, in *GetAllReplacementsRequest, opts ...grpc.CallOption) (Registry_GetChannelEntriesThatReplaceClient, error) + GetBundleThatReplaces(ctx context.Context, in *GetReplacementRequest, opts ...grpc.CallOption) (*Bundle, error) + GetChannelEntriesThatProvide(ctx context.Context, in *GetAllProvidersRequest, opts ...grpc.CallOption) (Registry_GetChannelEntriesThatProvideClient, error) + GetLatestChannelEntriesThatProvide(ctx context.Context, in *GetLatestProvidersRequest, opts ...grpc.CallOption) (Registry_GetLatestChannelEntriesThatProvideClient, error) + GetDefaultBundleThatProvides(ctx context.Context, in *GetDefaultProviderRequest, opts ...grpc.CallOption) (*Bundle, error) + ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (Registry_ListBundlesClient, error) +} + +type registryClient struct { + cc *grpc.ClientConn +} + +func NewRegistryClient(cc *grpc.ClientConn) RegistryClient { + return ®istryClient{cc} +} + +func (c *registryClient) ListPackages(ctx context.Context, in *ListPackageRequest, opts ...grpc.CallOption) (Registry_ListPackagesClient, error) { + stream, err := c.cc.NewStream(ctx, &_Registry_serviceDesc.Streams[0], "/api.Registry/ListPackages", opts...) + if err != nil { + return nil, err + } + x := ®istryListPackagesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_ListPackagesClient interface { + Recv() (*PackageName, error) + grpc.ClientStream +} + +type registryListPackagesClient struct { + grpc.ClientStream +} + +func (x *registryListPackagesClient) Recv() (*PackageName, error) { + m := new(PackageName) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *registryClient) GetPackage(ctx context.Context, in *GetPackageRequest, opts ...grpc.CallOption) (*Package, error) { + out := new(Package) + err := c.cc.Invoke(ctx, "/api.Registry/GetPackage", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *registryClient) GetBundle(ctx context.Context, in *GetBundleRequest, opts ...grpc.CallOption) (*Bundle, error) { + out := new(Bundle) + err := c.cc.Invoke(ctx, "/api.Registry/GetBundle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *registryClient) GetBundleForChannel(ctx context.Context, in *GetBundleInChannelRequest, opts ...grpc.CallOption) (*Bundle, error) { + out := new(Bundle) + err := c.cc.Invoke(ctx, "/api.Registry/GetBundleForChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *registryClient) GetChannelEntriesThatReplace(ctx context.Context, in *GetAllReplacementsRequest, opts ...grpc.CallOption) (Registry_GetChannelEntriesThatReplaceClient, error) { + stream, err := c.cc.NewStream(ctx, &_Registry_serviceDesc.Streams[1], "/api.Registry/GetChannelEntriesThatReplace", opts...) + if err != nil { + return nil, err + } + x := ®istryGetChannelEntriesThatReplaceClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_GetChannelEntriesThatReplaceClient interface { + Recv() (*ChannelEntry, error) + grpc.ClientStream +} + +type registryGetChannelEntriesThatReplaceClient struct { + grpc.ClientStream +} + +func (x *registryGetChannelEntriesThatReplaceClient) Recv() (*ChannelEntry, error) { + m := new(ChannelEntry) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *registryClient) GetBundleThatReplaces(ctx context.Context, in *GetReplacementRequest, opts ...grpc.CallOption) (*Bundle, error) { + out := new(Bundle) + err := c.cc.Invoke(ctx, "/api.Registry/GetBundleThatReplaces", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *registryClient) GetChannelEntriesThatProvide(ctx context.Context, in *GetAllProvidersRequest, opts ...grpc.CallOption) (Registry_GetChannelEntriesThatProvideClient, error) { + stream, err := c.cc.NewStream(ctx, &_Registry_serviceDesc.Streams[2], "/api.Registry/GetChannelEntriesThatProvide", opts...) + if err != nil { + return nil, err + } + x := ®istryGetChannelEntriesThatProvideClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_GetChannelEntriesThatProvideClient interface { + Recv() (*ChannelEntry, error) + grpc.ClientStream +} + +type registryGetChannelEntriesThatProvideClient struct { + grpc.ClientStream +} + +func (x *registryGetChannelEntriesThatProvideClient) Recv() (*ChannelEntry, error) { + m := new(ChannelEntry) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *registryClient) GetLatestChannelEntriesThatProvide(ctx context.Context, in *GetLatestProvidersRequest, opts ...grpc.CallOption) (Registry_GetLatestChannelEntriesThatProvideClient, error) { + stream, err := c.cc.NewStream(ctx, &_Registry_serviceDesc.Streams[3], "/api.Registry/GetLatestChannelEntriesThatProvide", opts...) + if err != nil { + return nil, err + } + x := ®istryGetLatestChannelEntriesThatProvideClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_GetLatestChannelEntriesThatProvideClient interface { + Recv() (*ChannelEntry, error) + grpc.ClientStream +} + +type registryGetLatestChannelEntriesThatProvideClient struct { + grpc.ClientStream +} + +func (x *registryGetLatestChannelEntriesThatProvideClient) Recv() (*ChannelEntry, error) { + m := new(ChannelEntry) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *registryClient) GetDefaultBundleThatProvides(ctx context.Context, in *GetDefaultProviderRequest, opts ...grpc.CallOption) (*Bundle, error) { + out := new(Bundle) + err := c.cc.Invoke(ctx, "/api.Registry/GetDefaultBundleThatProvides", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *registryClient) ListBundles(ctx context.Context, in *ListBundlesRequest, opts ...grpc.CallOption) (Registry_ListBundlesClient, error) { + stream, err := c.cc.NewStream(ctx, &_Registry_serviceDesc.Streams[4], "/api.Registry/ListBundles", opts...) + if err != nil { + return nil, err + } + x := ®istryListBundlesClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Registry_ListBundlesClient interface { + Recv() (*Bundle, error) + grpc.ClientStream +} + +type registryListBundlesClient struct { + grpc.ClientStream +} + +func (x *registryListBundlesClient) Recv() (*Bundle, error) { + m := new(Bundle) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +// RegistryServer is the server API for Registry service. +type RegistryServer interface { + ListPackages(*ListPackageRequest, Registry_ListPackagesServer) error + GetPackage(context.Context, *GetPackageRequest) (*Package, error) + GetBundle(context.Context, *GetBundleRequest) (*Bundle, error) + GetBundleForChannel(context.Context, *GetBundleInChannelRequest) (*Bundle, error) + GetChannelEntriesThatReplace(*GetAllReplacementsRequest, Registry_GetChannelEntriesThatReplaceServer) error + GetBundleThatReplaces(context.Context, *GetReplacementRequest) (*Bundle, error) + GetChannelEntriesThatProvide(*GetAllProvidersRequest, Registry_GetChannelEntriesThatProvideServer) error + GetLatestChannelEntriesThatProvide(*GetLatestProvidersRequest, Registry_GetLatestChannelEntriesThatProvideServer) error + GetDefaultBundleThatProvides(context.Context, *GetDefaultProviderRequest) (*Bundle, error) + ListBundles(*ListBundlesRequest, Registry_ListBundlesServer) error +} + +// UnimplementedRegistryServer can be embedded to have forward compatible implementations. +type UnimplementedRegistryServer struct { +} + +func (*UnimplementedRegistryServer) ListPackages(req *ListPackageRequest, srv Registry_ListPackagesServer) error { + return status.Errorf(codes.Unimplemented, "method ListPackages not implemented") +} +func (*UnimplementedRegistryServer) GetPackage(ctx context.Context, req *GetPackageRequest) (*Package, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetPackage not implemented") +} +func (*UnimplementedRegistryServer) GetBundle(ctx context.Context, req *GetBundleRequest) (*Bundle, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBundle not implemented") +} +func (*UnimplementedRegistryServer) GetBundleForChannel(ctx context.Context, req *GetBundleInChannelRequest) (*Bundle, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBundleForChannel not implemented") +} +func (*UnimplementedRegistryServer) GetChannelEntriesThatReplace(req *GetAllReplacementsRequest, srv Registry_GetChannelEntriesThatReplaceServer) error { + return status.Errorf(codes.Unimplemented, "method GetChannelEntriesThatReplace not implemented") +} +func (*UnimplementedRegistryServer) GetBundleThatReplaces(ctx context.Context, req *GetReplacementRequest) (*Bundle, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBundleThatReplaces not implemented") +} +func (*UnimplementedRegistryServer) GetChannelEntriesThatProvide(req *GetAllProvidersRequest, srv Registry_GetChannelEntriesThatProvideServer) error { + return status.Errorf(codes.Unimplemented, "method GetChannelEntriesThatProvide not implemented") +} +func (*UnimplementedRegistryServer) GetLatestChannelEntriesThatProvide(req *GetLatestProvidersRequest, srv Registry_GetLatestChannelEntriesThatProvideServer) error { + return status.Errorf(codes.Unimplemented, "method GetLatestChannelEntriesThatProvide not implemented") +} +func (*UnimplementedRegistryServer) GetDefaultBundleThatProvides(ctx context.Context, req *GetDefaultProviderRequest) (*Bundle, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetDefaultBundleThatProvides not implemented") +} +func (*UnimplementedRegistryServer) ListBundles(req *ListBundlesRequest, srv Registry_ListBundlesServer) error { + return status.Errorf(codes.Unimplemented, "method ListBundles not implemented") +} + +func RegisterRegistryServer(s *grpc.Server, srv RegistryServer) { + s.RegisterService(&_Registry_serviceDesc, srv) +} + +func _Registry_ListPackages_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListPackageRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).ListPackages(m, ®istryListPackagesServer{stream}) +} + +type Registry_ListPackagesServer interface { + Send(*PackageName) error + grpc.ServerStream +} + +type registryListPackagesServer struct { + grpc.ServerStream +} + +func (x *registryListPackagesServer) Send(m *PackageName) error { + return x.ServerStream.SendMsg(m) +} + +func _Registry_GetPackage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetPackageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RegistryServer).GetPackage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Registry/GetPackage", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RegistryServer).GetPackage(ctx, req.(*GetPackageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Registry_GetBundle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBundleRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RegistryServer).GetBundle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Registry/GetBundle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RegistryServer).GetBundle(ctx, req.(*GetBundleRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Registry_GetBundleForChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBundleInChannelRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RegistryServer).GetBundleForChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Registry/GetBundleForChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RegistryServer).GetBundleForChannel(ctx, req.(*GetBundleInChannelRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Registry_GetChannelEntriesThatReplace_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetAllReplacementsRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).GetChannelEntriesThatReplace(m, ®istryGetChannelEntriesThatReplaceServer{stream}) +} + +type Registry_GetChannelEntriesThatReplaceServer interface { + Send(*ChannelEntry) error + grpc.ServerStream +} + +type registryGetChannelEntriesThatReplaceServer struct { + grpc.ServerStream +} + +func (x *registryGetChannelEntriesThatReplaceServer) Send(m *ChannelEntry) error { + return x.ServerStream.SendMsg(m) +} + +func _Registry_GetBundleThatReplaces_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetReplacementRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RegistryServer).GetBundleThatReplaces(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Registry/GetBundleThatReplaces", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RegistryServer).GetBundleThatReplaces(ctx, req.(*GetReplacementRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Registry_GetChannelEntriesThatProvide_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetAllProvidersRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).GetChannelEntriesThatProvide(m, ®istryGetChannelEntriesThatProvideServer{stream}) +} + +type Registry_GetChannelEntriesThatProvideServer interface { + Send(*ChannelEntry) error + grpc.ServerStream +} + +type registryGetChannelEntriesThatProvideServer struct { + grpc.ServerStream +} + +func (x *registryGetChannelEntriesThatProvideServer) Send(m *ChannelEntry) error { + return x.ServerStream.SendMsg(m) +} + +func _Registry_GetLatestChannelEntriesThatProvide_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetLatestProvidersRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).GetLatestChannelEntriesThatProvide(m, ®istryGetLatestChannelEntriesThatProvideServer{stream}) +} + +type Registry_GetLatestChannelEntriesThatProvideServer interface { + Send(*ChannelEntry) error + grpc.ServerStream +} + +type registryGetLatestChannelEntriesThatProvideServer struct { + grpc.ServerStream +} + +func (x *registryGetLatestChannelEntriesThatProvideServer) Send(m *ChannelEntry) error { + return x.ServerStream.SendMsg(m) +} + +func _Registry_GetDefaultBundleThatProvides_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetDefaultProviderRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RegistryServer).GetDefaultBundleThatProvides(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/api.Registry/GetDefaultBundleThatProvides", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RegistryServer).GetDefaultBundleThatProvides(ctx, req.(*GetDefaultProviderRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Registry_ListBundles_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(ListBundlesRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RegistryServer).ListBundles(m, ®istryListBundlesServer{stream}) +} + +type Registry_ListBundlesServer interface { + Send(*Bundle) error + grpc.ServerStream +} + +type registryListBundlesServer struct { + grpc.ServerStream +} + +func (x *registryListBundlesServer) Send(m *Bundle) error { + return x.ServerStream.SendMsg(m) +} + +var _Registry_serviceDesc = grpc.ServiceDesc{ + ServiceName: "api.Registry", + HandlerType: (*RegistryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GetPackage", + Handler: _Registry_GetPackage_Handler, + }, + { + MethodName: "GetBundle", + Handler: _Registry_GetBundle_Handler, + }, + { + MethodName: "GetBundleForChannel", + Handler: _Registry_GetBundleForChannel_Handler, + }, + { + MethodName: "GetBundleThatReplaces", + Handler: _Registry_GetBundleThatReplaces_Handler, + }, + { + MethodName: "GetDefaultBundleThatProvides", + Handler: _Registry_GetDefaultBundleThatProvides_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "ListPackages", + Handler: _Registry_ListPackages_Handler, + ServerStreams: true, + }, + { + StreamName: "GetChannelEntriesThatReplace", + Handler: _Registry_GetChannelEntriesThatReplace_Handler, + ServerStreams: true, + }, + { + StreamName: "GetChannelEntriesThatProvide", + Handler: _Registry_GetChannelEntriesThatProvide_Handler, + ServerStreams: true, + }, + { + StreamName: "GetLatestChannelEntriesThatProvide", + Handler: _Registry_GetLatestChannelEntriesThatProvide_Handler, + ServerStreams: true, + }, + { + StreamName: "ListBundles", + Handler: _Registry_ListBundles_Handler, + ServerStreams: true, + }, + }, + Metadata: "registry.proto", +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto new file mode 100644 index 000000000..bb32bee60 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/api/registry.proto @@ -0,0 +1,115 @@ +syntax = "proto3"; + +package api; + +service Registry { + rpc ListPackages(ListPackageRequest) returns (stream PackageName) {} + rpc GetPackage(GetPackageRequest) returns (Package) {} + rpc GetBundle(GetBundleRequest) returns (Bundle) {} + rpc GetBundleForChannel(GetBundleInChannelRequest) returns (Bundle) {} + rpc GetChannelEntriesThatReplace(GetAllReplacementsRequest) returns (stream ChannelEntry) {} + rpc GetBundleThatReplaces(GetReplacementRequest) returns (Bundle) {} + rpc GetChannelEntriesThatProvide(GetAllProvidersRequest) returns (stream ChannelEntry) {} + rpc GetLatestChannelEntriesThatProvide(GetLatestProvidersRequest) returns (stream ChannelEntry) {} + rpc GetDefaultBundleThatProvides(GetDefaultProviderRequest) returns (Bundle) {} + rpc ListBundles(ListBundlesRequest) returns (stream Bundle) {} +} + + +message Channel{ + string name = 1; + string csvName = 2; +} + +message PackageName{ + string name = 1; +} + +message Package{ + string name = 1; + repeated Channel channels = 2; + string defaultChannelName = 3; +} + +message GroupVersionKind{ + string group = 1; + string version = 2; + string kind = 3; + string plural = 4; +} + +message Dependency{ + string type = 1; + string value = 2; +} + +message Bundle{ + string csvName = 1; + string packageName = 2; + string channelName = 3; + string csvJson = 4; + repeated string object = 5; + string bundlePath = 6; + repeated GroupVersionKind providedApis = 7; + repeated GroupVersionKind requiredApis = 8; + string version = 9; + string skipRange = 10; + repeated Dependency dependencies = 11; +} + +message ChannelEntry{ + string packageName = 1; + string channelName = 2; + string bundleName = 3; + string replaces = 4; +} + +message ListPackageRequest{} + +message ListBundlesRequest{} + +message GetPackageRequest{ + string name = 1; +} + +message GetBundleRequest{ + string pkgName = 1; + string channelName = 2; + string csvName = 3; +} + +message GetBundleInChannelRequest{ + string pkgName = 1; + string channelName = 2; +} + +message GetAllReplacementsRequest{ + string csvName = 1; +} + +message GetReplacementRequest{ + string csvName = 1; + string pkgName = 2; + string channelName = 3; +} + +message GetAllProvidersRequest{ + string group = 1; + string version = 2; + string kind = 3; + string plural = 4; +} + +message GetLatestProvidersRequest{ + string group = 1; + string version = 2; + string kind = 3; + string plural = 4; +} + +message GetDefaultProviderRequest{ + string group = 1; + string version = 2; + string kind = 3; + string plural = 4; +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/image/reference.go b/vendor/github.com/operator-framework/operator-registry/pkg/image/reference.go new file mode 100644 index 000000000..660df5089 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/image/reference.go @@ -0,0 +1,16 @@ +package image + +import "fmt" + +// Reference describes a reference to a container image. +type Reference interface { + fmt.Stringer +} + +// SimpleReference is a reference backed by a string with no additional validation. +type SimpleReference string + +func (s SimpleReference) String() string { + ref := string(s) + return ref +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/image/registry.go b/vendor/github.com/operator-framework/operator-registry/pkg/image/registry.go new file mode 100644 index 000000000..d47507ab2 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/image/registry.go @@ -0,0 +1,32 @@ +package image + +import ( + "context" +) + +// Registry knows how to Pull and Unpack Operator Bundle images to the filesystem. +// Note: In the future, Registry will know how to Build and Push Operator Bundle images as well. +type Registry interface { + // Pull fetches and stores an image by reference. + Pull(ctx context.Context, ref Reference) error + + // Push uploads an image to the remote registry of its reference. + // If the referenced image does not exist in the registry, an error is returned. + // Push(ctx context.Context, ref string) error + + // Unpack writes the unpackaged content of an image to a directory. + // If the referenced image does not exist in the registry, an error is returned. + Unpack(ctx context.Context, ref Reference, dir string) error + + // Labels gets the labels for an image that is already stored. + Labels(ctx context.Context, ref Reference) (map[string]string, error) + + // Destroy cleans up any on-disk resources used to track images + Destroy() error + + // Pack creates and stores an image based on the given reference and returns a reference to the new image. + // If the referenced image does not exist in the registry, a new image is created from scratch. + // If it exists, it's used as the base image. + // Pack(ctx context.Context, ref Reference, from io.Reader) (next string, err error) +} + diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/bundle.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/bundle.go new file mode 100644 index 000000000..e16540868 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/bundle.go @@ -0,0 +1,318 @@ +package registry + +import ( + "fmt" + "strings" + + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/yaml" +) + +const ( + v1beta1CRDVersion = "v1beta1" + v1CRDVersion = "v1" + CRDKind = "CustomResourceDefinition" +) +// Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered. +var Scheme = runtime.NewScheme() + +// Codecs provides access to encoding and decoding for the scheme +var Codecs = serializer.NewCodecFactory(Scheme) + +func DefaultYAMLDecoder() runtime.Decoder { + return Codecs.UniversalDeserializer() +} + +func init() { + utilruntime.Must(apiextensionsv1beta1.AddToScheme(Scheme)) + utilruntime.Must(apiextensionsv1.AddToScheme(Scheme)) +} + +type Bundle struct { + Name string + Objects []*unstructured.Unstructured + Package string + Channels []string + BundleImage string + csv *ClusterServiceVersion + v1beta1crds []*apiextensionsv1beta1.CustomResourceDefinition + v1crds []*apiextensionsv1.CustomResourceDefinition + Dependencies []*Dependency + cacheStale bool +} + +func NewBundle(name, pkgName string, channels []string, objs ...*unstructured.Unstructured) *Bundle { + bundle := &Bundle{Name: name, Package: pkgName, Channels: channels, cacheStale: false} + for _, o := range objs { + bundle.Add(o) + } + return bundle +} + +func NewBundleFromStrings(name, pkgName string, channels []string, objs []string) (*Bundle, error) { + unstObjs := []*unstructured.Unstructured{} + for _, o := range objs { + dec := yaml.NewYAMLOrJSONDecoder(strings.NewReader(o), 10) + unst := &unstructured.Unstructured{} + if err := dec.Decode(unst); err != nil { + return nil, err + } + unstObjs = append(unstObjs, unst) + } + return NewBundle(name, pkgName, channels, unstObjs...), nil +} + +func (b *Bundle) Size() int { + return len(b.Objects) +} + +func (b *Bundle) Add(obj *unstructured.Unstructured) { + b.Objects = append(b.Objects, obj) + b.cacheStale = true +} + +func (b *Bundle) ClusterServiceVersion() (*ClusterServiceVersion, error) { + if err := b.cache(); err != nil { + return nil, err + } + return b.csv, nil +} + +func (b *Bundle) Version() (string, error) { + if err := b.cache(); err != nil { + return "", err + } + return b.csv.GetVersion() +} + +func (b *Bundle) SkipRange() (string, error) { + if err := b.cache(); err != nil { + return "", err + } + return b.csv.GetSkipRange(), nil +} + +func (b *Bundle) Replaces() (string, error) { + if err := b.cache(); err != nil { + return "", err + } + return b.csv.GetReplaces() +} + +func (b *Bundle) Skips() ([]string, error) { + if err := b.cache(); err != nil { + return nil, err + } + return b.csv.GetSkips() +} + +func (b *Bundle) CustomResourceDefinitions() ([]runtime.Object, error) { + if err := b.cache(); err != nil { + return nil, err + } + var crds []runtime.Object + for _, crd := range b.v1crds { + crds = append(crds, crd) + } + for _, crd := range b.v1beta1crds { + crds = append(crds, crd) + } + return crds, nil +} + +func (b *Bundle) ProvidedAPIs() (map[APIKey]struct{}, error) { + provided := map[APIKey]struct{}{} + crds, err := b.CustomResourceDefinitions() + if err != nil { + return nil, err + } + + for _, c := range crds { + switch crd := c.(type) { + case *apiextensionsv1.CustomResourceDefinition: + for _, v := range crd.Spec.Versions { + provided[APIKey{Group: crd.Spec.Group, Version: v.Name, Kind: crd.Spec.Names.Kind, Plural: crd.Spec.Names.Plural}] = struct{}{} + } + case *apiextensionsv1beta1.CustomResourceDefinition: + for _, v := range crd.Spec.Versions { + provided[APIKey{Group: crd.Spec.Group, Version: v.Name, Kind: crd.Spec.Names.Kind, Plural: crd.Spec.Names.Plural}] = struct{}{} + } + if crd.Spec.Version != "" { + provided[APIKey{Group: crd.Spec.Group, Version: crd.Spec.Version, Kind: crd.Spec.Names.Kind, Plural: crd.Spec.Names.Plural}] = struct{}{} + } + default: + return nil, fmt.Errorf("unknown api version in crd: %#v", crd) + } + } + + csv, err := b.ClusterServiceVersion() + if err != nil { + return nil, err + } + + ownedAPIs, _, err := csv.GetApiServiceDefinitions() + if err != nil { + return nil, err + } + for _, api := range ownedAPIs { + provided[APIKey{Group: api.Group, Version: api.Version, Kind: api.Kind, Plural: api.Name}] = struct{}{} + } + return provided, nil +} + +func (b *Bundle) RequiredAPIs() (map[APIKey]struct{}, error) { + required := map[APIKey]struct{}{} + csv, err := b.ClusterServiceVersion() + if err != nil { + return nil, err + } + + _, requiredCRDs, err := csv.GetCustomResourceDefintions() + if err != nil { + return nil, err + } + for _, api := range requiredCRDs { + parts := strings.SplitN(api.Name, ".", 2) + if len(parts) < 2 { + return nil, fmt.Errorf("couldn't parse plural.group from crd name: %s", api.Name) + } + required[APIKey{parts[1], api.Version, api.Kind, parts[0]}] = struct{}{} + + } + _, requiredAPIs, err := csv.GetApiServiceDefinitions() + if err != nil { + return nil, err + } + for _, api := range requiredAPIs { + required[APIKey{Group: api.Group, Version: api.Version, Kind: api.Kind, Plural: api.Name}] = struct{}{} + } + return required, nil +} + +func (b *Bundle) AllProvidedAPIsInBundle() error { + csv, err := b.ClusterServiceVersion() + if err != nil { + return err + } + bundleAPIs, err := b.ProvidedAPIs() + if err != nil { + return err + } + ownedCRDs, _, err := csv.GetCustomResourceDefintions() + if err != nil { + return err + } + shouldExist := make(map[APIKey]struct{}, len(ownedCRDs)) + for _, crdDef := range ownedCRDs { + parts := strings.SplitN(crdDef.Name, ".", 2) + if len(parts) < 2 { + return fmt.Errorf("couldn't parse plural.group from crd name: %s", crdDef.Name) + } + shouldExist[APIKey{parts[1], crdDef.Version, crdDef.Kind, parts[0]}] = struct{}{} + } + for key := range shouldExist { + if _, ok := bundleAPIs[key]; !ok { + return fmt.Errorf("couldn't find %v in bundle. found: %v", key, bundleAPIs) + } + } + // note: don't need to check bundle for extension apiserver types, which don't require extra bundle entries + return nil +} + +func (b *Bundle) Serialize() (csvName, bundleImage string, csvBytes []byte, bundleBytes []byte, err error) { + csvCount := 0 + for _, obj := range b.Objects { + objBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) + if err != nil { + return "", "", nil, nil, err + } + bundleBytes = append(bundleBytes, objBytes...) + + if obj.GroupVersionKind().Kind == "ClusterServiceVersion" { + csvName = obj.GetName() + csvBytes, err = runtime.Encode(unstructured.UnstructuredJSONScheme, obj) + if err != nil { + return "", "", nil, nil, err + } + csvCount += 1 + if csvCount > 1 { + return "", "", nil, nil, fmt.Errorf("two csvs found in one bundle") + } + } + } + + return csvName, b.BundleImage, csvBytes, bundleBytes, nil +} + +func (b *Bundle) Images() (map[string]struct{}, error) { + csv, err := b.ClusterServiceVersion() + if err != nil { + return nil, err + } + + images, err := csv.GetOperatorImages() + if err != nil { + return nil, err + } + + relatedImages, err := csv.GetRelatedImages() + if err != nil { + return nil, err + } + for img := range relatedImages { + images[img] = struct{}{} + } + + return images, nil +} + +func (b *Bundle) cache() error { + if !b.cacheStale { + return nil + } + for _, o := range b.Objects { + if o.GroupVersionKind().Kind == "ClusterServiceVersion" { + csv := &ClusterServiceVersion{} + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(o.UnstructuredContent(), csv); err != nil { + return err + } + b.csv = csv + break + } + } + + for _, o := range b.Objects { + if o.GroupVersionKind().Kind == CRDKind { + // Marshal Unstructured and Decode as CustomResourceDefinition. FromUnstructured has issues + // converting JSON numbers to float64 for CRD minimum/maximum validation. + cb, err := o.MarshalJSON() + if err != nil { + return err + } + dec := serializer.NewCodecFactory(Scheme).UniversalDeserializer() + switch o.GroupVersionKind().Version { + case v1CRDVersion: + crd := &apiextensionsv1.CustomResourceDefinition{} + if _, _, err = dec.Decode(cb, nil, crd); err != nil { + return fmt.Errorf("error decoding v1 CRD: %v", err) + } + b.v1crds = append(b.v1crds, crd) + case v1beta1CRDVersion: + crd := &apiextensionsv1beta1.CustomResourceDefinition{} + if _, _, err = dec.Decode(cb, nil, crd); err != nil { + return fmt.Errorf("error decoding v1beta1 CRD: %v", err) + } + b.v1beta1crds = append(b.v1beta1crds, crd) + } + } + } + + b.cacheStale = false + return nil +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/bundlegraphloader.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/bundlegraphloader.go new file mode 100644 index 000000000..f03c128a3 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/bundlegraphloader.go @@ -0,0 +1,147 @@ +package registry + +import ( + "fmt" + + "github.com/blang/semver" +) + +// BundleGraphLoader generates updated graphs by adding bundles to them, updating +// the graph implicitly via semantic version of each bundle +type BundleGraphLoader struct { +} + +// AddBundleToGraph takes a bundle and an existing graph and updates the graph to insert the new bundle +// into each channel it is included in +func (g *BundleGraphLoader) AddBundleToGraph(bundle *Bundle, graph *Package, newDefaultChannel string, skippatch bool) (*Package, error) { + bundleVersion, err := bundle.Version() + if err != nil { + return nil, fmt.Errorf("Unable to extract bundle version from bundle %s, can't insert in semver mode", bundle.BundleImage) + } + + versionToAdd, err := semver.Make(bundleVersion) + if err != nil { + return nil, fmt.Errorf("Bundle version %s is not valid", bundleVersion) + } + + newBundleKey := BundleKey{ + CsvName: bundle.Name, + Version: versionToAdd.String(), + BundlePath: bundle.BundleImage, + } + + // initialize the graph if it started empty + if graph.Name == "" { + graph.Name = bundle.Package + } + if newDefaultChannel != "" { + graph.DefaultChannel = newDefaultChannel + } + + // generate the DAG for each channel the new bundle is being insert into + for _, channel := range bundle.Channels { + replaces := make(map[BundleKey]struct{}, 0) + + // If the channel doesn't exist yet, initialize it + if !graph.HasChannel(channel) { + // create the channel and add a single node + newChannelGraph := Channel{ + Head: newBundleKey, + Nodes: map[BundleKey]map[BundleKey]struct{}{ + newBundleKey: nil, + }, + } + if graph.Channels == nil { + graph.Channels = make(map[string]Channel, 1) + } + graph.Channels[channel] = newChannelGraph + continue + } + + // find the version(s) it should sit between + channelGraph := graph.Channels[channel] + if channelGraph.Nodes == nil { + channelGraph.Nodes = make(map[BundleKey]map[BundleKey]struct{}, 1) + } + + lowestAhead := BundleKey{} + greatestBehind := BundleKey{} + skipPatchCandidates := []BundleKey{} + + // Iterate over existing nodes and compare the new node's version to find the + // lowest version above it and highest version below it (to insert between these nodes) + for node := range channelGraph.Nodes { + nodeVersion, err := semver.Make(node.Version) + if err != nil { + return nil, fmt.Errorf("Unable to parse existing bundle version stored in index %s %s %s", + node.CsvName, node.Version, node.BundlePath) + } + + switch comparison := nodeVersion.Compare(versionToAdd); comparison { + case 0: + return nil, fmt.Errorf("Bundle version %s already added to index", bundleVersion) + case 1: + if lowestAhead.IsEmpty() { + lowestAhead = node + } else { + lowestAheadSemver, _ := semver.Make(lowestAhead.Version) + if nodeVersion.LT(lowestAheadSemver) { + lowestAhead = node + } + } + case -1: + if greatestBehind.IsEmpty() { + greatestBehind = node + } else { + greatestBehindSemver, _ := semver.Make(greatestBehind.Version) + if nodeVersion.GT(greatestBehindSemver) { + greatestBehind = node + } + } + } + + // if skippatch mode is enabled, check each node to determine if z-updates should + // be replaced as well. Keep track of them to delete those nodes from the graph itself, + // just be aware of them for replacements + if skippatch { + if isSkipPatchCandidate(versionToAdd, nodeVersion) { + skipPatchCandidates = append(skipPatchCandidates, node) + replaces[node] = struct{}{} + } + } + } + + // If we found a node behind the one we're adding, make the new node replace it + if !greatestBehind.IsEmpty() { + replaces[greatestBehind] = struct{}{} + } + + // If we found a node ahead of the one we're adding, make the lowest to replace + // the new node. If we didn't find a node semantically ahead, the new node is + // the new channel head + if !lowestAhead.IsEmpty() { + channelGraph.Nodes[lowestAhead] = map[BundleKey]struct{}{ + newBundleKey: struct{}{}, + } + } else { + channelGraph.Head = newBundleKey + } + + if skippatch { + // Remove the nodes that are now being skipped by a new patch version update + for _, candidate := range skipPatchCandidates { + delete(channelGraph.Nodes, candidate) + } + } + + // add the node and update the graph + channelGraph.Nodes[newBundleKey] = replaces + graph.Channels[channel] = channelGraph + } + + return graph, nil +} + +func isSkipPatchCandidate(version, toCompare semver.Version) bool { + return (version.Major == toCompare.Major) && (version.Minor == toCompare.Minor) && (version.Patch > toCompare.Patch) +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/channelupdateoptions.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/channelupdateoptions.go new file mode 100644 index 000000000..85f5acb40 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/channelupdateoptions.go @@ -0,0 +1,27 @@ +package registry + +import ( + "fmt" + "strings" +) + +type Mode int + +const ( + ReplacesMode = iota + SemVerMode + SkipPatchMode +) + +func GetModeFromString(mode string) (Mode, error) { + switch strings.ToLower(mode) { + case "replaces": + return ReplacesMode, nil + case "semver": + return SemVerMode, nil + case "semver-skippatch": + return SkipPatchMode, nil + default: + return -1, fmt.Errorf("Invalid channel update mode %s specified", mode) + } +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/conversion.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/conversion.go new file mode 100644 index 000000000..fd79b31c2 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/conversion.go @@ -0,0 +1,83 @@ +package registry + +import ( + "encoding/json" + "fmt" + "strings" + + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/operator-framework/operator-registry/pkg/api" +) + +func PackageManifestToAPIPackage(manifest *PackageManifest) *api.Package { + channels := []*api.Channel{} + for _, c := range manifest.Channels { + channels = append(channels, PackageChannelToAPIChannel(&c)) + } + return &api.Package{ + Name: manifest.PackageName, + DefaultChannelName: manifest.DefaultChannelName, + Channels: channels, + } +} + +func PackageChannelToAPIChannel(channel *PackageChannel) *api.Channel { + return &api.Channel{ + Name: channel.Name, + CsvName: channel.CurrentCSVName, + } +} + +func ChannelEntryToAPIChannelEntry(entry *ChannelEntry) *api.ChannelEntry { + return &api.ChannelEntry{ + PackageName: entry.PackageName, + ChannelName: entry.ChannelName, + BundleName: entry.BundleName, + Replaces: entry.Replaces, + } +} + +// Bundle strings are appended json objects, we need to split them apart +// e.g. {"my":"obj"}{"csv":"data"}{"crd":"too"} +func BundleStringToObjectStrings(bundleString string) ([]string, error) { + objs := []string{} + dec := json.NewDecoder(strings.NewReader(bundleString)) + + for dec.More() { + var m json.RawMessage + err := dec.Decode(&m) + if err != nil { + return nil, err + } + objs = append(objs, string(m)) + } + return objs, nil +} + +func BundleStringToAPIBundle(bundleString string) (*api.Bundle, error) { + objs, err := BundleStringToObjectStrings(bundleString) + if err != nil { + return nil, err + } + out := &api.Bundle{ + Object: objs, + } + for _, o := range objs { + dec := yaml.NewYAMLOrJSONDecoder(strings.NewReader(o), 10) + unst := &unstructured.Unstructured{} + if err := dec.Decode(unst); err != nil { + return nil, err + } + if unst.GetKind() == "ClusterServiceVersion" { + out.CsvName = unst.GetName() + out.CsvJson = o + break + } + } + if out.CsvName == "" { + return nil, fmt.Errorf("no csv in bundle") + } + return out, nil +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/csv.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/csv.go new file mode 100644 index 000000000..28d59ce83 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/csv.go @@ -0,0 +1,342 @@ +package registry + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + "path" + + v1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/operator-framework/api/pkg/operators" +) + +const ( + // Name of the CSV's kind + clusterServiceVersionKind = "ClusterServiceVersion" + + // Name of the section under which the list of owned and required list of + // CRD(s) is specified inside an operator manifest. + customResourceDefinitions = "customresourcedefinitions" + + // Name of the section under which the list of owned and required list of + // apiservices is specified inside an operator manifest. + apiServiceDefinitions = "apiservicedefinitions" + + // The yaml attribute that points to the name of an older + // ClusterServiceVersion object that the current ClusterServiceVersion + // replaces. + replaces = "replaces" + + // The yaml attribute that points to the names of older + // ClusterServiceVersion objects that the current ClusterServiceVersion + // skips + skips = "skips" + + // The yaml attribute that specifies the version of the ClusterServiceVersion + // expected to be semver and parseable by blang/semver + version = "version" + + // The yaml attribute that specifies the related images of the ClusterServiceVersion + relatedImages = "relatedImages" + + // The yaml attribute that specifies the skipRange of the ClusterServiceVersion + skipRangeAnnotationKey = "olm.skipRange" +) + +// ClusterServiceVersion is a structured representation of cluster service +// version object(s) specified inside the 'clusterServiceVersions' section of +// an operator manifest. +type ClusterServiceVersion struct { + // Type metadata. + metav1.TypeMeta `json:",inline"` + + // Object metadata. + metav1.ObjectMeta `json:"metadata"` + + // Spec is the raw representation of the 'spec' element of + // ClusterServiceVersion object. Since we are + // not interested in the content of spec we are not parsing it. + Spec json.RawMessage `json:"spec"` +} + +// ReadCSVFromBundleDirectory tries to parse every YAML file in the directory without inspecting sub-directories and +// returns a CSV. According to the strict one CSV per bundle rule, func returns an error if more than one CSV is found. +func ReadCSVFromBundleDirectory(bundleDir string) (*ClusterServiceVersion, error) { + dirContent, err := ioutil.ReadDir(bundleDir) + if err != nil { + return nil, fmt.Errorf("error reading bundle directory %s, %v", bundleDir, err) + } + + files := []string{} + for _, f := range dirContent { + if !f.IsDir() { + files = append(files, f.Name()) + } + } + + csv := ClusterServiceVersion{} + foundCSV := false + for _, file := range files { + yamlReader, err := os.Open(path.Join(bundleDir, file)) + if err != nil { + continue + } + + unstructuredCSV := unstructured.Unstructured{} + + decoder := yaml.NewYAMLOrJSONDecoder(yamlReader, 30) + if err = decoder.Decode(&unstructuredCSV); err != nil { + continue + } + + if unstructuredCSV.GetKind() != operators.ClusterServiceVersionKind { + continue + } + + if foundCSV { + return nil, fmt.Errorf("more than one ClusterServiceVersion is found in bundle") + } + + if err := runtime.DefaultUnstructuredConverter.FromUnstructured(unstructuredCSV.UnstructuredContent(), + &csv); err != nil { + return nil, err + } + foundCSV = true + } + + if foundCSV { + return &csv, nil + } + return nil, fmt.Errorf("no ClusterServiceVersion object found in %s", bundleDir) + +} + +// GetReplaces returns the name of the older ClusterServiceVersion object that +// is replaced by this ClusterServiceVersion object. +// +// If not defined, the function returns an empty string. +func (csv *ClusterServiceVersion) GetReplaces() (string, error) { + var objmap map[string]*json.RawMessage + if err := json.Unmarshal(csv.Spec, &objmap); err != nil { + return "", err + } + + rawValue, ok := objmap[replaces] + if !ok || rawValue == nil { + return "", nil + } + + var replaces string + if err := json.Unmarshal(*rawValue, &replaces); err != nil { + return "", err + } + + return replaces, nil +} + +// GetVersion returns the version of the CSV +// +// If not defined, the function returns an empty string. +func (csv *ClusterServiceVersion) GetVersion() (string, error) { + var objmap map[string]*json.RawMessage + if err := json.Unmarshal(csv.Spec, &objmap); err != nil { + return "", err + } + + rawValue, ok := objmap[version] + if !ok || rawValue == nil { + return "", nil + } + + var v string + if err := json.Unmarshal(*rawValue, &v); err != nil { + return "", err + } + + return v, nil +} + +// GetSkipRange returns the skiprange of the CSV +// +// If not defined, the function returns an empty string. +func (csv *ClusterServiceVersion) GetSkipRange() string { + skipRange, ok := csv.Annotations[skipRangeAnnotationKey] + if !ok { + return "" + } + return skipRange +} + +// GetSkips returns the name of the older ClusterServiceVersion objects that +// are skipped by this ClusterServiceVersion object. +// +// If not defined, the function returns an empty string. +func (csv *ClusterServiceVersion) GetSkips() ([]string, error) { + var objmap map[string]*json.RawMessage + if err := json.Unmarshal(csv.Spec, &objmap); err != nil { + return nil, err + } + + rawValue, ok := objmap[skips] + if !ok || rawValue == nil { + return nil, nil + } + + var skips []string + if err := json.Unmarshal(*rawValue, &skips); err != nil { + return nil, err + } + + return skips, nil +} + +// GetCustomResourceDefintions returns a list of owned and required +// CustomResourceDefinition object(s) specified inside the +// 'customresourcedefinitions' section of a ClusterServiceVersion 'spec'. +// +// owned represents the list of CRD(s) managed by this ClusterServiceVersion +// object. +// required represents the list of CRD(s) that this ClusterServiceVersion +// object depends on. +// +// If owned or required is not defined in the spec then an empty list is +// returned respectively. +func (csv *ClusterServiceVersion) GetCustomResourceDefintions() (owned []*DefinitionKey, required []*DefinitionKey, err error) { + var objmap map[string]*json.RawMessage + + if err = json.Unmarshal(csv.Spec, &objmap); err != nil { + return + } + + rawValue, ok := objmap[customResourceDefinitions] + if !ok || rawValue == nil { + return + } + + var definitions struct { + Owned []*DefinitionKey `json:"owned"` + Required []*DefinitionKey `json:"required"` + } + + if err = json.Unmarshal(*rawValue, &definitions); err != nil { + return + } + + owned = definitions.Owned + required = definitions.Required + return +} + +// GetApiServiceDefinitions returns a list of owned and required +// APISerivces specified inside the +// 'apiservicedefinitions' section of a ClusterServiceVersion 'spec'. +// +// owned represents the list of apiservices managed by this ClusterServiceVersion +// object. +// required represents the list of apiservices that this ClusterServiceVersion +// object depends on. +// +// If owned or required is not defined in the spec then an empty list is +// returned respectively. +func (csv *ClusterServiceVersion) GetApiServiceDefinitions() (owned []*DefinitionKey, required []*DefinitionKey, err error) { + var objmap map[string]*json.RawMessage + + if err = json.Unmarshal(csv.Spec, &objmap); err != nil { + return + } + + rawValue, ok := objmap[apiServiceDefinitions] + if !ok || rawValue == nil { + return + } + + var definitions struct { + Owned []*DefinitionKey `json:"owned"` + Required []*DefinitionKey `json:"required"` + } + + if err = json.Unmarshal(*rawValue, &definitions); err != nil { + return + } + + owned = definitions.Owned + required = definitions.Required + return +} + +// GetRelatedImage returns the list of associated images for the operator +func (csv *ClusterServiceVersion) GetRelatedImages() (imageSet map[string]struct{}, err error) { + var objmap map[string]*json.RawMessage + imageSet = make(map[string]struct{}) + + if err = json.Unmarshal(csv.Spec, &objmap); err != nil { + return + } + + rawValue, ok := objmap[relatedImages] + if !ok || rawValue == nil { + return + } + + type relatedImage struct { + Name string `json:"name"` + Ref string `json:"image"` + } + var relatedImages []relatedImage + if err = json.Unmarshal(*rawValue, &relatedImages); err != nil { + return + } + + for _, img := range relatedImages { + imageSet[img.Ref] = struct{}{} + } + + return +} + +// GetOperatorImages returns a list of any images used to run the operator. +// Currently this pulls any images in the pod specs of operator deployments. +func (csv *ClusterServiceVersion) GetOperatorImages() (map[string]struct{}, error) { + type dep struct { + Name string + Spec v1.DeploymentSpec + } + type strategySpec struct { + Deployments []dep + } + type strategy struct { + Name string `json:"strategy"` + Spec strategySpec `json:"spec"` + } + type csvSpec struct { + Install strategy + } + + var spec csvSpec + if err := json.Unmarshal(csv.Spec, &spec); err != nil { + return nil, err + } + + // this is the only install strategy we know about + if spec.Install.Name != "deployment" { + return nil, nil + } + + images := map[string]struct{}{} + for _, d := range spec.Install.Spec.Deployments { + for _, c := range d.Spec.Template.Spec.Containers { + images[c.Image] = struct{}{} + } + for _, c := range d.Spec.Template.Spec.InitContainers { + images[c.Image] = struct{}{} + } + } + + return images, nil +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/decode.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/decode.go new file mode 100644 index 000000000..4d418df76 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/decode.go @@ -0,0 +1,43 @@ +package registry + +import ( + "errors" + "fmt" + "io" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/apimachinery/pkg/util/yaml" +) + +// DecodeUnstructured decodes a raw stream into a an +// unstructured.Unstructured instance. +func DecodeUnstructured(reader io.Reader) (obj *unstructured.Unstructured, err error) { + decoder := yaml.NewYAMLOrJSONDecoder(reader, 30) + + t := &unstructured.Unstructured{} + if err = decoder.Decode(t); err != nil { + return + } + + obj = t + return +} + +// DecodePackageManifest decodes a raw stream into a a PackageManifest instance. +// If a package name is empty we consider the object invalid! +func DecodePackageManifest(reader io.Reader) (manifest *PackageManifest, err error) { + decoder := yaml.NewYAMLOrJSONDecoder(reader, 30) + + obj := &PackageManifest{} + if decodeErr := decoder.Decode(obj); decodeErr != nil { + err = fmt.Errorf("could not decode contents into package manifest - %v", decodeErr) + return + } + + if obj.PackageName == "" { + err = errors.New("name of package (packageName) is missing") + return + } + + manifest = obj + return +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/directoryGraphLoader.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/directoryGraphLoader.go new file mode 100644 index 000000000..bd336f9f8 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/directoryGraphLoader.go @@ -0,0 +1,226 @@ +package registry + +import ( + "fmt" + "io/ioutil" + "os" + "path" + "path/filepath" + "sort" + + "github.com/blang/semver" + "github.com/onsi/gomega/gstruct/errors" +) + +type DirGraphLoader struct { + PackageDir string + CsvNameAndReplaceMap map[string]csvReplaces + SortedCSVs csvs // only contains bundles with version field which will be considered for skip range. +} + +type csvReplaces struct { + replaces []string + skipRange semver.Range +} + +type csv struct { + name string + version semver.Version +} + +type csvs []csv + +func (c csvs) Len() int { return len(c) } +func (c csvs) Less(i, j int) bool { return c[i].version.LT(c[j].version) } +func (c csvs) Swap(i, j int) { c[i], c[j] = c[j], c[i] } + +// NewPackageGraphLoaderFromDir takes the root directory of the package in the file system. +func NewPackageGraphLoaderFromDir(packageDir string) (*DirGraphLoader, error) { + _, err := ioutil.ReadDir(packageDir) + if err != nil { + return nil, fmt.Errorf("error reading from %s directory, %v", packageDir, err) + } + + loader := DirGraphLoader{ + PackageDir: packageDir, + } + + return &loader, nil +} + +// Generate returns Package graph by parsing through package directory assuming all bundles in the package exist. +func (g *DirGraphLoader) Generate() (*Package, error) { + err := g.loadBundleCsvPathMap() + if err != nil { + return nil, fmt.Errorf("error geting CSVs from bundles in the package directory, %v", err) + } + + g.loadReplaces() + + pkg, err := g.parsePackageYAMLFile() + if err != nil { + return nil, fmt.Errorf("error parsing package.yaml file in the package root directory, %v", err) + } + + for chName, ch := range pkg.Channels { + pkg.Channels[chName] = Channel{ + Head: ch.Head, + Nodes: *g.getChannelNodes(ch.Head.CsvName), + } + } + return pkg, nil +} + +// loadBundleCsvPathMap loads the CsvNameAndReplaceMap and SortedCSVs in the Package Struct. +func (g *DirGraphLoader) loadBundleCsvPathMap() error { + bundleDirs, err := ioutil.ReadDir(g.PackageDir) + if err != nil { + return fmt.Errorf("error reading from %s directory, %v", g.PackageDir, err) + } + CsvNameAndReplaceMap := make(map[string]csvReplaces) + for _, bundlePath := range bundleDirs { + if bundlePath.IsDir() { + csvStruct, err := ReadCSVFromBundleDirectory(filepath.Join(g.PackageDir, bundlePath.Name())) + if err != nil { + return err + } + + // Best effort to get Skips, Replace, and SkipRange + srString := csvStruct.GetSkipRange() + sr, _ := semver.ParseRange(srString) + + var replaceStrings []string + rs, err := csvStruct.GetSkips() + if err == nil && rs != nil { + replaceStrings = rs + } + + r, err := csvStruct.GetReplaces() + if err == nil && r != "" { + replaceStrings = append(replaceStrings, r) + } + + CsvNameAndReplaceMap[csvStruct.GetName()] = csvReplaces{ + replaces: replaceStrings, + skipRange: sr, + } + + version, err := csvStruct.GetVersion() + if err == nil && version != "" { + v, err := semver.Parse(version) + if err == nil { + g.SortedCSVs = append(g.SortedCSVs, csv{name: csvStruct.GetName(), version: v}) + } + } + } + } + + g.CsvNameAndReplaceMap = CsvNameAndReplaceMap + sort.Sort(g.SortedCSVs) + return nil +} + +// loadReplaces converts skipRange to explicit csv name and write to replaces in CsvNameAndReplaceMap. +func (g *DirGraphLoader) loadReplaces() { + for csvName, replace := range g.CsvNameAndReplaceMap { + if replace.skipRange != nil { + for _, v := range g.SortedCSVs { + if replace.skipRange(v.version) { + g.CsvNameAndReplaceMap[csvName] = csvReplaces{ + replaces: append(g.CsvNameAndReplaceMap[csvName].replaces, v.name), + skipRange: g.CsvNameAndReplaceMap[csvName].skipRange, + } + } + } + } + } +} + +// getChannelNodes follows the head of the channel csv through all replaces to fill the nodes until the tail of the +// channel which will not replace anything. +func (g *DirGraphLoader) getChannelNodes(channelHeadCsv string) *map[BundleKey]map[BundleKey]struct{} { + nodes := make(map[BundleKey]map[BundleKey]struct{}) + remainingCSVsInChannel := make(map[BundleKey]struct{}) + + remainingCSVsInChannel[BundleKey{CsvName: channelHeadCsv}] = struct{}{} + for _, csv := range g.CsvNameAndReplaceMap[channelHeadCsv].replaces { + remainingCSVsInChannel[BundleKey{CsvName: csv}] = struct{}{} + } + + // Iterate through remainingCSVsInChannel and add replaces of each encountered CSVs if not already in nodes. + // Loop only exit after all remaining csvs are visited/deleted. + for len(remainingCSVsInChannel) > 0 { + for bk, _ := range remainingCSVsInChannel { + if _, ok := nodes[BundleKey{CsvName: bk.CsvName}]; !ok { + nodes[BundleKey{CsvName: bk.CsvName}] = func() map[BundleKey]struct{} { + subNode := make(map[BundleKey]struct{}) + for _, csv := range g.CsvNameAndReplaceMap[bk.CsvName].replaces { + subNode[BundleKey{CsvName: csv}] = struct{}{} + } + return subNode + }() + for _, csv := range g.CsvNameAndReplaceMap[bk.CsvName].replaces { + if _, ok := nodes[BundleKey{CsvName: csv}]; !ok { + remainingCSVsInChannel[BundleKey{CsvName: csv}] = struct{}{} + } + } + } + delete(remainingCSVsInChannel, bk) + } + } + return &nodes +} + +// parsePackageYAMLFile parses the *.package.yaml file and fills the information in Package including name, +// defaultchannel, and head of all Channels. It returns parsing error if any. +func (g *DirGraphLoader) parsePackageYAMLFile() (*Package, error) { + files, err := ioutil.ReadDir(g.PackageDir) + if err != nil { + return nil, fmt.Errorf("error reading bundle parent directory, %v", err) + } + + var ymlFiles []string + for _, f := range files { + if !f.IsDir() { + ymlFiles = append(ymlFiles, f.Name()) + } + } + + errs := errors.AggregateError{} + + for _, ymlFile := range ymlFiles { + ymlFile = path.Join(g.PackageDir, ymlFile) + ymlReader, err := os.Open(ymlFile) + if err != nil { + errs = append(errs, fmt.Errorf("error opening %s file, %v", ymlFile, err)) + continue + } + + pkgManifest, err := DecodePackageManifest(ymlReader) + if err != nil { + errs = append(errs, fmt.Errorf("error parsing %s as package.yaml file, %v", ymlFile, err)) + continue + } + return convertFromPackageManifest(*pkgManifest), nil + } + + return nil, fmt.Errorf("valid PackageManifest YAML file not found in %s, %s", g.PackageDir, errs.Error()) +} + +func convertFromPackageManifest(pkgManifest PackageManifest) *Package { + pkgChannels := make(map[string]Channel) + for _, channel := range pkgManifest.Channels { + pkgChannels[channel.Name] = Channel{ + Head: BundleKey{ + CsvName: channel.CurrentCSVName, + }, + } + } + + return &Package{ + Name: pkgManifest.PackageName, + DefaultChannel: pkgManifest.GetDefaultChannel(), + Channels: pkgChannels, + } + +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go new file mode 100644 index 000000000..a35bf3eb8 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/empty.go @@ -0,0 +1,111 @@ +package registry + +import ( + "context" + "errors" + + "github.com/operator-framework/operator-registry/pkg/api" +) + +// EmptyQuery acts as a "zero value" implementation of the Query interface. +// +// EmptyQuery can be used as a substitute for any operation dependent on Query. +type EmptyQuery struct{} + +func (EmptyQuery) ListTables(ctx context.Context) ([]string, error) { + return nil, errors.New("empty querier: cannot list tables") +} + +func (EmptyQuery) ListPackages(ctx context.Context) ([]string, error) { + return nil, errors.New("empty querier: cannot list packages") +} + +func (EmptyQuery) GetPackage(ctx context.Context, name string) (*PackageManifest, error) { + return nil, errors.New("empty querier: cannot get package") +} + +func (EmptyQuery) GetDefaultPackage(ctx context.Context, name string) (string, error) { + return "", errors.New("empty querier: cannot get default package") +} + +func (EmptyQuery) GetChannelEntriesFromPackage(ctx context.Context, packageName string) ([]ChannelEntryAnnotated, error) { + return nil, errors.New("empty querier: cannot get all channel entries for package") +} + +func (EmptyQuery) GetBundle(ctx context.Context, pkgName, channelName, csvName string) (*api.Bundle, error) { + return nil, errors.New("empty querier: cannot get bundle") +} + +func (EmptyQuery) GetBundleForChannel(ctx context.Context, pkgName string, channelName string) (*api.Bundle, error) { + return nil, errors.New("empty querier: cannot get bundle for channel") +} + +func (EmptyQuery) GetChannelEntriesThatReplace(ctx context.Context, name string) (entries []*ChannelEntry, err error) { + return nil, errors.New("empty querier: cannot get channel entries that replace") +} + +func (EmptyQuery) GetBundleThatReplaces(ctx context.Context, name, pkgName, channelName string) (*api.Bundle, error) { + return nil, errors.New("empty querier: cannot get bundle that replaces") +} + +func (EmptyQuery) GetChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*ChannelEntry, err error) { + return nil, errors.New("empty querier: cannot get channel entries that provide") +} + +func (EmptyQuery) GetLatestChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*ChannelEntry, err error) { + return nil, errors.New("empty querier: cannot get latest channel entries that provide") +} + +func (EmptyQuery) GetBundleThatProvides(ctx context.Context, group, version, kind string) (*api.Bundle, error) { + return nil, errors.New("empty querier: cannot get bundle that provides") +} + +func (EmptyQuery) ListImages(ctx context.Context) ([]string, error) { + return nil, errors.New("empty querier: cannot get image list") +} + +func (EmptyQuery) GetImagesForBundle(ctx context.Context, bundleName string) ([]string, error) { + return nil, errors.New("empty querier: cannot get image list") +} + +func (EmptyQuery) GetApisForEntry(ctx context.Context, entryId int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) { + return nil, nil, errors.New("empty querier: cannot apis") +} + +func (EmptyQuery) GetBundleVersion(ctx context.Context, image string) (string, error) { + return "", errors.New("empty querier: cannot get version") +} + +func (EmptyQuery) GetBundlePathsForPackage(ctx context.Context, pkgName string) ([]string, error) { + return nil, errors.New("empty querier: cannot get images") +} + +func (EmptyQuery) GetBundlesForPackage(ctx context.Context, pkgName string) (map[BundleKey]struct{}, error) { + return nil, errors.New("empty querier: cannot get bundles") +} + +func (EmptyQuery) GetDefaultChannelForPackage(ctx context.Context, pkgName string) (string, error) { + return "", errors.New("empty querier: cannot get default channel") +} + +func (EmptyQuery) ListChannels(ctx context.Context, pkgName string) ([]string, error) { + return nil, errors.New("empty querier: cannot list channels") +} + +func (EmptyQuery) GetCurrentCSVNameForChannel(ctx context.Context, pkgName, channel string) (string, error) { + return "", errors.New("empty querier: cannot get csv name for package and channel") +} + +func (EmptyQuery) ListBundles(ctx context.Context) ([]*api.Bundle, error) { + return nil, errors.New("empty querier: cannot list bundles") +} + +func (EmptyQuery) GetDependenciesForBundle(ctx context.Context, name, version, path string) (dependencies []*api.Dependency, err error) { + return nil, errors.New("empty querier: cannot get dependencies for bundle") +} + +var _ Query = &EmptyQuery{} + +func NewEmptyQuerier() *EmptyQuery { + return &EmptyQuery{} +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/graph.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/graph.go new file mode 100644 index 000000000..f62a30ab4 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/graph.go @@ -0,0 +1,51 @@ +package registry + +import ( + "fmt" +) + +type Package struct { + Name string + DefaultChannel string + Channels map[string]Channel +} + +type Channel struct { + Head BundleKey + Nodes map[BundleKey]map[BundleKey]struct{} +} + +type BundleKey struct { + BundlePath string + Version string //semver string + CsvName string +} + +func (b *BundleKey) IsEmpty() bool { + return b.BundlePath == "" && b.Version == "" && b.CsvName == "" +} + +func (b *BundleKey) String() string { + return fmt.Sprintf("%s %s %s", b.CsvName, b.Version, b.BundlePath) +} + +func (p *Package) HasChannel(channel string) bool { + if p.Channels == nil { + return false + } + + _, found := p.Channels[channel] + return found +} + +func (p *Package) HasCsv(csv string) bool { + for _, channelGraph := range p.Channels { + for node := range channelGraph.Nodes { + if node.CsvName == csv { + return true + } + } + } + + return false +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/imageinput.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/imageinput.go new file mode 100644 index 000000000..4572b620b --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/imageinput.go @@ -0,0 +1,125 @@ +package registry + +import ( + "fmt" + "io/ioutil" + "path/filepath" + "strings" + + "github.com/sirupsen/logrus" + + "github.com/operator-framework/operator-registry/pkg/image" +) + +type ImageInput struct { + manifestsDir string + metadataDir string + to image.Reference + from string + annotationsFile *AnnotationsFile + dependenciesFile *DependenciesFile + bundle *Bundle +} + +func NewImageInput(to image.Reference, from string) (*ImageInput, error) { + var annotationsFound, dependenciesFound bool + path := from + manifests := filepath.Join(path, "manifests") + metadata := filepath.Join(path, "metadata") + // Get annotations file + log := logrus.WithFields(logrus.Fields{"dir": from, "file": metadata, "load": "annotations"}) + files, err := ioutil.ReadDir(metadata) + if err != nil { + return nil, fmt.Errorf("unable to read directory %s: %s", metadata, err) + } + + // Look for the metadata and manifests sub-directories to find the annotations.yaml + // file that will inform how the manifests of the bundle should be loaded into the database. + // If dependencies.yaml which contains operator dependencies in metadata directory + // exists, parse and load it into the DB + annotationsFile := &AnnotationsFile{} + dependenciesFile := &DependenciesFile{} + for _, f := range files { + if !annotationsFound { + err = DecodeFile(filepath.Join(metadata, f.Name()), annotationsFile) + if err == nil && *annotationsFile != (AnnotationsFile{}) { + annotationsFound = true + continue + } + } + + if !dependenciesFound { + err = parseDependenciesFile(filepath.Join(metadata, f.Name()), dependenciesFile) + if err == nil && len(dependenciesFile.Dependencies) > 0 { + dependenciesFound = true + } + } + } + + if !annotationsFound { + return nil, fmt.Errorf("Could not find annotations file") + } + + if !dependenciesFound { + log.Info("Could not find optional dependencies file") + } + + imageInput := &ImageInput{ + manifestsDir: manifests, + metadataDir: metadata, + to: to, + from: from, + annotationsFile: annotationsFile, + dependenciesFile: dependenciesFile, + } + + err = imageInput.getBundleFromManifests() + if err != nil { + return nil, err + } + + return imageInput, nil +} + +func (i *ImageInput) getBundleFromManifests() error { + log := logrus.WithFields(logrus.Fields{"dir": i.from, "file": i.manifestsDir, "load": "bundle"}) + + csv, err := i.findCSV(i.manifestsDir) + if err != nil { + return err + } + + if csv.Object == nil { + return fmt.Errorf("csv is empty: %s", err) + } + + log.Info("found csv, loading bundle") + + csvName := csv.GetName() + + bundle, err := loadBundle(csvName, i.manifestsDir) + if err != nil { + return fmt.Errorf("error loading objs in directory: %s", err) + } + + if bundle == nil || bundle.Size() == 0 { + return fmt.Errorf("no bundle objects found") + } + + // set the bundleimage on the bundle + bundle.BundleImage = i.to.String() + // set the dependencies on the bundle + bundle.Dependencies = i.dependenciesFile.GetDependencies() + + bundle.Name = csvName + bundle.Package = i.annotationsFile.Annotations.PackageName + bundle.Channels = strings.Split(i.annotationsFile.Annotations.Channels, ",") + + if err := bundle.AllProvidedAPIsInBundle(); err != nil { + return fmt.Errorf("error checking provided apis in bundle %s: %s", bundle.Name, err) + } + + i.bundle = bundle + + return nil +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go new file mode 100644 index 000000000..3df0713cd --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/interface.go @@ -0,0 +1,70 @@ +package registry + +import ( + "context" + + "github.com/operator-framework/operator-registry/pkg/api" +) + +type Load interface { + AddOperatorBundle(bundle *Bundle) error + AddBundleSemver(graph *Package, bundle *Bundle) error + AddPackageChannels(manifest PackageManifest) error + AddBundlePackageChannels(manifest PackageManifest, bundle *Bundle) error + RemovePackage(packageName string) error + ClearNonHeadBundles() error +} + +type Query interface { + ListTables(ctx context.Context) ([]string, error) + ListPackages(ctx context.Context) ([]string, error) + GetPackage(ctx context.Context, name string) (*PackageManifest, error) + GetDefaultPackage(ctx context.Context, name string) (string, error) + GetChannelEntriesFromPackage(ctx context.Context, packageName string) ([]ChannelEntryAnnotated, error) + GetBundle(ctx context.Context, pkgName, channelName, csvName string) (*api.Bundle, error) + GetBundleForChannel(ctx context.Context, pkgName string, channelName string) (*api.Bundle, error) + // Get all channel entries that say they replace this one + GetChannelEntriesThatReplace(ctx context.Context, name string) (entries []*ChannelEntry, err error) + // Get the bundle in a package/channel that replace this one + GetBundleThatReplaces(ctx context.Context, name, pkgName, channelName string) (*api.Bundle, error) + // Get all channel entries that provide an api + GetChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*ChannelEntry, err error) + // Get latest channel entries that provide an api + GetLatestChannelEntriesThatProvide(ctx context.Context, group, version, kind string) (entries []*ChannelEntry, err error) + // Get the the latest bundle that provides the API in a default channel + GetBundleThatProvides(ctx context.Context, group, version, kind string) (*api.Bundle, error) + // List all images in the database + ListImages(ctx context.Context) ([]string, error) + // List all images for a particular bundle + GetImagesForBundle(ctx context.Context, bundleName string) ([]string, error) + // Get Provided and Required APIs for a particular bundle + GetApisForEntry(ctx context.Context, entryID int64) (provided []*api.GroupVersionKind, required []*api.GroupVersionKind, err error) + // Get Version of a Bundle Image + GetBundleVersion(ctx context.Context, image string) (string, error) + // List Images for Package + GetBundlePathsForPackage(ctx context.Context, pkgName string) ([]string, error) + // List Bundles for Package + GetBundlesForPackage(ctx context.Context, pkgName string) (map[BundleKey]struct{}, error) + // Get DefaultChannel for Package + GetDefaultChannelForPackage(ctx context.Context, pkgName string) (string, error) + // List channels for package + ListChannels(ctx context.Context, pkgName string) ([]string, error) + // Get CurrentCSV name for channel and package + GetCurrentCSVNameForChannel(ctx context.Context, pkgName, channel string) (string, error) + // List all available bundles in the database + ListBundles(ctx context.Context) (bundles []*api.Bundle, err error) + // Get the list of dependencies for a bundle + GetDependenciesForBundle(ctx context.Context, name, version, path string) (dependencies []*api.Dependency, err error) +} + +// GraphLoader generates a graph +// GraphLoader supports multiple different loading schemes +// GraphLoader from SQL, GraphLoader from old format (filesystem), GraphLoader from SQL + input bundles +type GraphLoader interface { + Generate(packageName string) (*Package, error) +} + +// RegistryPopulator populates a registry. +type RegistryPopulator interface { + Populate() error +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/populator.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/populator.go new file mode 100644 index 000000000..b9b2655e9 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/populator.go @@ -0,0 +1,405 @@ +package registry + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strings" + + "github.com/sirupsen/logrus" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + utilerrors "k8s.io/apimachinery/pkg/util/errors" + "k8s.io/apimachinery/pkg/util/yaml" + + "github.com/operator-framework/operator-registry/pkg/image" +) + +type Dependencies struct { + RawMessage []map[string]string `json:"dependencies" yaml:"dependencies"` +} + +// DirectoryPopulator loads an unpacked operator bundle from a directory into the database. +type DirectoryPopulator struct { + loader Load + graphLoader GraphLoader + querier Query + imageDirMap map[image.Reference]string +} + +func NewDirectoryPopulator(loader Load, graphLoader GraphLoader, querier Query, imageDirMap map[image.Reference]string) *DirectoryPopulator { + return &DirectoryPopulator{ + loader: loader, + graphLoader: graphLoader, + querier: querier, + imageDirMap: imageDirMap, + } +} + +func (i *DirectoryPopulator) Populate(mode Mode) error { + var errs []error + imagesToAdd := make([]*ImageInput, 0) + for to, from := range i.imageDirMap { + imageInput, err := NewImageInput(to, from) + if err != nil { + errs = append(errs, err) + continue + } + + imagesToAdd = append(imagesToAdd, imageInput) + } + + if len(errs) > 0 { + return utilerrors.NewAggregate(errs) + } + + err := i.loadManifests(imagesToAdd, mode) + if err != nil { + return err + } + + return nil +} + +func (i *DirectoryPopulator) loadManifests(imagesToAdd []*ImageInput, mode Mode) error { + switch mode { + case ReplacesMode: + // TODO: This is relatively inefficient. Ideally, we should be able to use a replaces + // graph loader to construct what the graph would look like with a set of new bundles + // and use that to return an error if it's not valid, rather than insert one at a time + // and reinspect the database. + // + // Additionally, it would be preferrable if there was a single database transaction + // that took the updated graph as a whole as input, rather than inserting bundles of the + // same package linearly. + var err error + var validImagesToAdd []*ImageInput + for len(imagesToAdd) > 0 { + validImagesToAdd, imagesToAdd, err = i.getNextReplacesImagesToAdd(imagesToAdd) + if err != nil { + return err + } + for _, image := range validImagesToAdd { + err := i.loadManifestsReplaces(image.bundle, image.annotationsFile) + if err != nil { + return err + } + } + } + case SemVerMode: + for _, image := range imagesToAdd { + err := i.loadManifestsSemver(image.bundle, image.annotationsFile, false) + if err != nil { + return err + } + } + case SkipPatchMode: + for _, image := range imagesToAdd { + err := i.loadManifestsSemver(image.bundle, image.annotationsFile, true) + if err != nil { + return err + } + } + default: + err := fmt.Errorf("Unsupported update mode") + if err != nil { + return err + } + } + + // Finally let's delete all the old bundles + if err := i.loader.ClearNonHeadBundles(); err != nil { + return fmt.Errorf("Error deleting previous bundles: %s", err) + } + + return nil +} + +func (i *DirectoryPopulator) loadManifestsReplaces(bundle *Bundle, annotationsFile *AnnotationsFile) error { + channels, err := i.querier.ListChannels(context.TODO(), annotationsFile.GetName()) + existingPackageChannels := map[string]string{} + for _, c := range channels { + current, err := i.querier.GetCurrentCSVNameForChannel(context.TODO(), annotationsFile.GetName(), c) + if err != nil { + return err + } + existingPackageChannels[c] = current + } + + bcsv, err := bundle.ClusterServiceVersion() + if err != nil { + return fmt.Errorf("error getting csv from bundle %s: %s", bundle.Name, err) + } + + packageManifest, err := translateAnnotationsIntoPackage(annotationsFile, bcsv, existingPackageChannels) + if err != nil { + return fmt.Errorf("Could not translate annotations file into packageManifest %s", err) + } + + if err := i.loadOperatorBundle(packageManifest, bundle); err != nil { + return fmt.Errorf("Error adding package %s", err) + } + + return nil +} + +func (i *DirectoryPopulator) getNextReplacesImagesToAdd(imagesToAdd []*ImageInput) ([]*ImageInput, []*ImageInput, error) { + remainingImages := make([]*ImageInput, 0) + foundImages := make([]*ImageInput, 0) + + var errs []error + + // Separate these image sets per package, since multiple different packages have + // separate graph + imagesPerPackage := make(map[string][]*ImageInput, 0) + for _, image := range imagesToAdd { + pkg := image.bundle.Package + if _, ok := imagesPerPackage[pkg]; !ok { + newPkgImages := make([]*ImageInput, 0) + newPkgImages = append(newPkgImages, image) + imagesPerPackage[pkg] = newPkgImages + } else { + imagesPerPackage[pkg] = append(imagesPerPackage[pkg], image) + } + } + + for pkg, pkgImages := range imagesPerPackage { + // keep a tally of valid and invalid images to ensure at least one + // image per package is valid. If not, throw an error + pkgRemainingImages := 0 + pkgFoundImages := 0 + + // first, try to pull the existing package graph from the database if it exists + graph, err := i.graphLoader.Generate(pkg) + if err != nil && !errors.Is(err, ErrPackageNotInDatabase) { + return nil, nil, err + } + + var pkgErrs []error + // then check each image to see if it can be a replacement + replacesLoader := ReplacesGraphLoader{} + for _, pkgImage := range pkgImages { + canAdd, err := replacesLoader.CanAdd(pkgImage.bundle, graph) + if err != nil { + pkgErrs = append(pkgErrs, err) + } + if canAdd { + pkgFoundImages++ + foundImages = append(foundImages, pkgImage) + } else { + pkgRemainingImages++ + remainingImages = append(remainingImages, pkgImage) + } + } + + // no new images can be added, the current iteration aggregates all the + // errors that describe invalid bundles + if pkgFoundImages == 0 && pkgRemainingImages > 0 { + errs = append(errs, utilerrors.NewAggregate(pkgErrs)) + } + } + + if len(errs) > 0 { + return nil, nil, utilerrors.NewAggregate(errs) + } + + return foundImages, remainingImages, nil +} + +func (i *DirectoryPopulator) loadManifestsSemver(bundle *Bundle, annotations *AnnotationsFile, skippatch bool) error { + graph, err := i.graphLoader.Generate(bundle.Package) + if err != nil && !errors.Is(err, ErrPackageNotInDatabase) { + return err + } + + // add to the graph + bundleLoader := BundleGraphLoader{} + updatedGraph, err := bundleLoader.AddBundleToGraph(bundle, graph, annotations.Annotations.DefaultChannelName, skippatch) + if err != nil { + return err + } + + if err := i.loader.AddBundleSemver(updatedGraph, bundle); err != nil { + return fmt.Errorf("error loading bundle into db: %s", err) + } + + return nil +} + +// loadBundle takes the directory that a CSV is in and assumes the rest of the objects in that directory +// are part of the bundle. +func loadBundle(csvName string, dir string) (*Bundle, error) { + log := logrus.WithFields(logrus.Fields{"dir": dir, "load": "bundle"}) + files, err := ioutil.ReadDir(dir) + if err != nil { + return nil, err + } + + bundle := &Bundle{ + Name: csvName, + } + for _, f := range files { + log = log.WithField("file", f.Name()) + if f.IsDir() { + log.Info("skipping directory") + continue + } + + if strings.HasPrefix(f.Name(), ".") { + log.Info("skipping hidden file") + continue + } + + log.Info("loading bundle file") + var ( + obj = &unstructured.Unstructured{} + path = filepath.Join(dir, f.Name()) + ) + if err = DecodeFile(path, obj); err != nil { + log.WithError(err).Debugf("could not decode file contents for %s", path) + continue + } + + // Don't include other CSVs in the bundle + if obj.GetKind() == "ClusterServiceVersion" && obj.GetName() != csvName { + continue + } + + if obj.Object != nil { + bundle.Add(obj) + } + } + + return bundle, nil +} + +// findCSV looks through the bundle directory to find a csv +func (i *ImageInput) findCSV(manifests string) (*unstructured.Unstructured, error) { + log := logrus.WithFields(logrus.Fields{"dir": i.from, "find": "csv"}) + + files, err := ioutil.ReadDir(manifests) + if err != nil { + return nil, fmt.Errorf("unable to read directory %s: %s", manifests, err) + } + + for _, f := range files { + log = log.WithField("file", f.Name()) + if f.IsDir() { + log.Info("skipping directory") + continue + } + + if strings.HasPrefix(f.Name(), ".") { + log.Info("skipping hidden file") + continue + } + + var ( + obj = &unstructured.Unstructured{} + path = filepath.Join(manifests, f.Name()) + ) + if err = DecodeFile(path, obj); err != nil { + log.WithError(err).Debugf("could not decode file contents for %s", path) + continue + } + + if obj.GetKind() != clusterServiceVersionKind { + continue + } + + return obj, nil + } + + return nil, fmt.Errorf("no csv found in bundle") +} + +// loadOperatorBundle adds the package information to the loader's store +func (i *DirectoryPopulator) loadOperatorBundle(manifest PackageManifest, bundle *Bundle) error { + if manifest.PackageName == "" { + return nil + } + + if err := i.loader.AddBundlePackageChannels(manifest, bundle); err != nil { + return fmt.Errorf("error loading bundle into db: %s", err) + } + + return nil +} + +// translateAnnotationsIntoPackage attempts to translate the channels.yaml file at the given path into a package.yaml +func translateAnnotationsIntoPackage(annotations *AnnotationsFile, csv *ClusterServiceVersion, existingPackageChannels map[string]string) (PackageManifest, error) { + manifest := PackageManifest{} + + for _, ch := range annotations.GetChannels() { + existingPackageChannels[ch] = csv.GetName() + } + + channels := []PackageChannel{} + for c, current := range existingPackageChannels { + channels = append(channels, + PackageChannel{ + Name: c, + CurrentCSVName: current, + }) + } + + manifest = PackageManifest{ + PackageName: annotations.GetName(), + DefaultChannelName: annotations.GetDefaultChannelName(), + Channels: channels, + } + + return manifest, nil +} + +// DecodeFile decodes the file at a path into the given interface. +func DecodeFile(path string, into interface{}) error { + if into == nil { + panic("programmer error: decode destination must be instantiated before decode") + } + + fileReader, err := os.Open(path) + if err != nil { + return fmt.Errorf("unable to read file %s: %s", path, err) + } + defer fileReader.Close() + + decoder := yaml.NewYAMLOrJSONDecoder(fileReader, 30) + + return decoder.Decode(into) +} + +func parseDependenciesFile(path string, depFile *DependenciesFile) error { + deps := Dependencies{} + err := DecodeFile(path, &deps) + if err != nil || len(deps.RawMessage) == 0 { + return fmt.Errorf("Unable to decode the dependencies file %s", path) + } + depList := []Dependency{} + for _, v := range deps.RawMessage { + // convert map to json + jsonStr, _ := json.Marshal(v) + + // Check dependency type + dep := Dependency{} + err := json.Unmarshal(jsonStr, &dep) + if err != nil { + return err + } + + switch dep.GetType() { + case GVKType, PackageType: + dep.Value = string(jsonStr) + default: + return fmt.Errorf("Unsupported dependency type %s", dep.GetType()) + } + depList = append(depList, dep) + } + + depFile.Dependencies = depList + + return nil +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/replacesgraphloader.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/replacesgraphloader.go new file mode 100644 index 000000000..a57df6e13 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/replacesgraphloader.go @@ -0,0 +1,40 @@ +package registry + +import ( + "fmt" + + utilerrors "k8s.io/apimachinery/pkg/util/errors" +) + +type ReplacesGraphLoader struct { +} + +// CanAdd checks that a new bundle can be added in replaces mode (i.e. the replaces +// defined for the bundle already exists) +func (r *ReplacesGraphLoader) CanAdd(bundle *Bundle, graph *Package) (bool, error) { + replaces, err := bundle.Replaces() + if err != nil { + return false, fmt.Errorf("Invalid content, unable to parse bundle") + } + + csvName := bundle.Name + + // adding the first bundle in the graph + if replaces == "" { + return true, nil + } + + var errs []error + + // check that the bundle can be added + if !graph.HasCsv(replaces) { + err := fmt.Errorf("Invalid bundle %s, bundle specifies a non-existent replacement %s", csvName, replaces) + errs = append(errs, err) + } + + if len(errs) > 0 { + return false, utilerrors.NewAggregate(errs) + } + + return true, nil +} diff --git a/vendor/github.com/operator-framework/operator-registry/pkg/registry/types.go b/vendor/github.com/operator-framework/operator-registry/pkg/registry/types.go new file mode 100644 index 000000000..a9fc5a678 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-registry/pkg/registry/types.go @@ -0,0 +1,271 @@ +package registry + +import ( + "encoding/json" + "errors" + "fmt" + "strings" + + "github.com/blang/semver" +) + +var ( + // ErrPackageNotInDatabase is an error that describes a package not found error when querying the registry + ErrPackageNotInDatabase = errors.New("Package not in database") +) + +const ( + GVKType = "olm.gvk" + PackageType = "olm.package" +) + +// APIKey stores GroupVersionKind for use as map keys +type APIKey struct { + Group string + Version string + Kind string + Plural string +} + +func (k APIKey) String() string { + return fmt.Sprintf("%s/%s/%s (%s)", k.Group, k.Version, k.Kind, k.Plural) +} + +// DefinitionKey represents the metadata for either an APIservice or a CRD from a CSV spec +type DefinitionKey struct { + Group string `json:"group"` + Kind string `json:"kind"` + Name string `json:"name"` + Version string `json:"version"` +} + +// PackageManifest holds information about a package, which is a reference to one (or more) +// channels under a single package. +type PackageManifest struct { + // PackageName is the name of the overall package, ala `etcd`. + PackageName string `json:"packageName" yaml:"packageName"` + + // Channels are the declared channels for the package, ala `stable` or `alpha`. + Channels []PackageChannel `json:"channels" yaml:"channels"` + + // DefaultChannelName is, if specified, the name of the default channel for the package. The + // default channel will be installed if no other channel is explicitly given. If the package + // has a single channel, then that channel is implicitly the default. + DefaultChannelName string `json:"defaultChannel" yaml:"defaultChannel"` +} + +// GetDefaultChannel gets the default channel or returns the only one if there's only one. returns empty string if it +// can't determine the default +func (m PackageManifest) GetDefaultChannel() string { + if m.DefaultChannelName != "" { + return m.DefaultChannelName + } + if len(m.Channels) == 1 { + return m.Channels[0].Name + } + return "" +} + +// PackageChannel defines a single channel under a package, pointing to a version of that +// package. +type PackageChannel struct { + // Name is the name of the channel, e.g. `alpha` or `stable` + Name string `json:"name" yaml:"name"` + + // CurrentCSVName defines a reference to the CSV holding the version of this package currently + // for the channel. + CurrentCSVName string `json:"currentCSV" yaml:"currentCSV"` +} + +// IsDefaultChannel returns true if the PackageChennel is the default for the PackageManifest +func (pc PackageChannel) IsDefaultChannel(pm PackageManifest) bool { + return pc.Name == pm.DefaultChannelName || len(pm.Channels) == 1 +} + +// ChannelEntry is a denormalized node in a channel graph +type ChannelEntry struct { + PackageName string + ChannelName string + BundleName string + Replaces string +} + +// ChannelEntryAnnotated is a denormalized node in a channel graph annotated with additional entry level info +type ChannelEntryAnnotated struct { + PackageName string + ChannelName string + BundleName string + BundlePath string + Version string + Replaces string + ReplacesVersion string + ReplacesBundlePath string +} + +// AnnotationsFile holds annotation information about a bundle +type AnnotationsFile struct { + // annotations is a list of annotations for a given bundle + Annotations Annotations `json:"annotations" yaml:"annotations"` +} + +// Annotations is a list of annotations for a given bundle +type Annotations struct { + // PackageName is the name of the overall package, ala `etcd`. + PackageName string `json:"operators.operatorframework.io.bundle.package.v1" yaml:"operators.operatorframework.io.bundle.package.v1"` + + // Channels are a comma separated list of the declared channels for the bundle, ala `stable` or `alpha`. + Channels string `json:"operators.operatorframework.io.bundle.channels.v1" yaml:"operators.operatorframework.io.bundle.channels.v1"` + + // DefaultChannelName is, if specified, the name of the default channel for the package. The + // default channel will be installed if no other channel is explicitly given. If the package + // has a single channel, then that channel is implicitly the default. + DefaultChannelName string `json:"operators.operatorframework.io.bundle.channel.default.v1" yaml:"operators.operatorframework.io.bundle.channel.default.v1"` +} + +// DependenciesFile holds dependency information about a bundle +type DependenciesFile struct { + // Dependencies is a list of dependencies for a given bundle + Dependencies []Dependency `json:"dependencies" yaml:"dependencies"` +} + +// Dependencies is a list of dependencies for a given bundle +type Dependency struct { + // The type of dependency. It can be `olm.package` for operator-version based + // dependency or `olm.gvk` for gvk based dependency. This field is required. + Type string `json:"type" yaml:"type"` + + // The value of the dependency (either GVKDependency or PackageDependency) + Value string `json:"value" yaml:"value"` +} + +type GVKDependency struct { + // The group of GVK based dependency + Group string `json:"group" yaml:"group"` + + // The kind of GVK based dependency + Kind string `json:"kind" yaml:"kind"` + + // The version of dependency in semver format + Version string `json:"version" yaml:"version"` +} + +type PackageDependency struct { + // The name of dependency such as 'etcd' + PackageName string `json:"packageName" yaml:"packageName"` + + // The version of dependency in semver format + Version string `json:"version" yaml:"version"` +} + +// Validate will validate GVK dependency type and return error(s) +func (gd *GVKDependency) Validate() []error { + errs := []error{} + if gd.Group == "" { + errs = append(errs, fmt.Errorf("API Group is empty")) + } + if gd.Version == "" { + errs = append(errs, fmt.Errorf("API Version is empty")) + } + if gd.Kind == "" { + errs = append(errs, fmt.Errorf("API Kind is empty")) + } + return errs +} + +// Validate will validate package dependency type and return error(s) +func (pd *PackageDependency) Validate() []error { + errs := []error{} + if pd.PackageName == "" { + errs = append(errs, fmt.Errorf("Package name is empty")) + } + if pd.Version == "" { + errs = append(errs, fmt.Errorf("Package version is empty")) + } else { + _, err := semver.Parse(pd.Version) + if err != nil { + _, err := semver.ParseRange(pd.Version) + if err != nil { + errs = append(errs, fmt.Errorf("Invalid semver format version")) + } + } + } + return errs +} + +// GetDependencies returns the list of dependency +func (d *DependenciesFile) GetDependencies() []*Dependency { + var dependencies []*Dependency + for _, item := range d.Dependencies { + dep := item + dependencies = append(dependencies, &dep) + } + return dependencies +} + +// GetType returns the type of dependency +func (e *Dependency) GetType() string { + if e.Type != "" { + return e.Type + } + return "" +} + +// GetTypeValue returns the dependency object that is converted +// from value string +func (e *Dependency) GetTypeValue() interface{} { + if e.Type != "" { + switch e.GetType() { + case GVKType: + dep := GVKDependency{} + err := json.Unmarshal([]byte(e.GetValue()), &dep) + if err != nil { + return nil + } + return dep + case PackageType: + dep := PackageDependency{} + err := json.Unmarshal([]byte(e.GetValue()), &dep) + if err != nil { + return nil + } + return dep + } + } + return nil +} + +// GetValue returns the value content of dependency +func (e *Dependency) GetValue() string { + if e.Value != "" { + return e.Value + } + return "" +} + +// GetName returns the package name of the bundle +func (a *AnnotationsFile) GetName() string { + if a.Annotations.PackageName != "" { + return a.Annotations.PackageName + } + return "" +} + +// GetChannels returns the channels that this bundle should be added to +func (a *AnnotationsFile) GetChannels() []string { + if a.Annotations.Channels != "" { + return strings.Split(a.Annotations.Channels, ",") + } + return []string{} +} + +// GetDefaultChannelName returns the name of the default channel +func (a *AnnotationsFile) GetDefaultChannelName() string { + if a.Annotations.DefaultChannelName != "" { + return a.Annotations.DefaultChannelName + } + channels := a.GetChannels() + if len(channels) == 1 { + return channels[0] + } + return "" +} diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/go_mod.go b/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/go_mod.go index f0168c55a..9adb47511 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/go_mod.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/go_mod.go @@ -41,12 +41,12 @@ const goModTmpl = `module {{ .Repo }} go 1.13 require ( - github.com/operator-framework/operator-sdk v0.17.0 - sigs.k8s.io/controller-runtime v0.5.2 + github.com/operator-framework/operator-sdk v0.18.2 + sigs.k8s.io/controller-runtime v0.6.0 ) replace ( - k8s.io/client-go => k8s.io/client-go v0.17.4 // Required by prometheus-operator + k8s.io/client-go => k8s.io/client-go v0.18.2 // Required by prometheus-operator github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible // Required by OLM ) ` diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/role.go b/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/role.go index 032a0c10b..b442a15e9 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/role.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/scaffold/role.go @@ -15,19 +15,19 @@ package scaffold import ( - "encoding/json" "errors" "fmt" "io/ioutil" "path/filepath" - - "github.com/operator-framework/operator-sdk/internal/scaffold/input" - "github.com/operator-framework/operator-sdk/internal/util/fileutil" + "sort" log "github.com/sirupsen/logrus" - yaml "gopkg.in/yaml.v2" rbacv1 "k8s.io/api/rbac/v1" cgoscheme "k8s.io/client-go/kubernetes/scheme" + yaml "sigs.k8s.io/yaml" + + "github.com/operator-framework/operator-sdk/internal/scaffold/input" + "github.com/operator-framework/operator-sdk/internal/util/fileutil" ) const RoleYamlFile = "role.yaml" @@ -61,9 +61,9 @@ func UpdateRoleForResource(r *Resource, absProjectPath string) error { return fmt.Errorf("failed to decode role manifest %v: %v", roleFilePath, err) } switch role := obj.(type) { - // TODO: use rbac/v1. case *rbacv1.Role: pr := &rbacv1.PolicyRule{} + apiGroupFound := false for i := range role.Rules { if role.Rules[i].APIGroups[0] == r.FullGroup { @@ -72,6 +72,7 @@ func UpdateRoleForResource(r *Resource, absProjectPath string) error { break } } + // check if the resource already exists for _, resource := range pr.Resources { if resource == r.Resource { @@ -143,16 +144,108 @@ func UpdateRoleForResource(r *Resource, absProjectPath string) error { } } -func updateRoleFile(role interface{}, roleFilePath string) error { - d, err := json.Marshal(&role) +// MergeRoleForResource merges incoming new API resource rules with existing deploy/role.yaml +func MergeRoleForResource(r *Resource, absProjectPath string, roleScaffold Role) error { + roleFilePath := filepath.Join(absProjectPath, DeployDir, RoleYamlFile) + roleYAML, err := ioutil.ReadFile(roleFilePath) if err != nil { - return fmt.Errorf("failed to marshal role(%+v): %v", role, err) + return fmt.Errorf("failed to read role manifest %v: %v", roleFilePath, err) + } + // Check for existing role.yaml + if len(roleYAML) == 0 { + return fmt.Errorf("empty Role File at: %v", absProjectPath) + } + // Check for incoming new Role + if len(roleScaffold.CustomRules) == 0 { + return fmt.Errorf("customRules cannot be empty for new Role at: %v", r.APIVersion) + } + + obj, _, err := cgoscheme.Codecs.UniversalDeserializer().Decode(roleYAML, nil, nil) + if err != nil { + return fmt.Errorf("failed to decode role manifest %v: %v", roleFilePath, err) + } + switch role := obj.(type) { + case *rbacv1.Role: + // TODO: Add logic to merge Cluster scoped rules into existing Kind: Role scoped rules + // Error out for ClusterRole merging with existing Kind: Role + if roleScaffold.IsClusterScoped { + return fmt.Errorf("cannot Merge Cluster scoped rules with existing deploy/role.yaml. " + + "please modify existing deploy/role.yaml and deploy/role_binding.yaml " + + "to reflect Cluster scope and try again") + } + mergedRoleRules := mergeRules(role.Rules, roleScaffold) + role.Rules = mergedRoleRules + case *rbacv1.ClusterRole: + mergedClusterRoleRules := mergeRules(role.Rules, roleScaffold) + role.Rules = mergedClusterRoleRules + default: + log.Errorf("Failed to parse role.yaml as a role %v", err) + } + + if err := updateRoleFile(obj, roleFilePath); err != nil { + return fmt.Errorf("failed to update for resource (%v, %v): %v", + r.APIVersion, r.Kind, err) + } + + return UpdateRoleForResource(r, absProjectPath) +} + +func ifMatches(pr []string, newPr []string) bool { + + sort.Strings(pr) + sort.Strings(newPr) + + if len(pr) != len(newPr) { + return false + } + for i, v := range pr { + if v != newPr[i] { + return false + } } - m := &map[string]interface{}{} - if err := yaml.Unmarshal(d, m); err != nil { - return fmt.Errorf("failed to unmarshal role(%+v): %v", role, err) + return true +} + +func findResource(resources []string, search string) bool { + for _, r := range resources { + if r == search || r == "*" { + return true + } + } + return false +} + +func mergeRules(rules1 []rbacv1.PolicyRule, rules2 Role) []rbacv1.PolicyRule { + for j := range rules2.CustomRules { + ruleFound := false + prj := &rules2.CustomRules[j] + iLoop: + for i, pri := range rules1 { + // check if apiGroup, verbs, resourceName, and nonResourceURLS matches for new resource. + apiGroupsEqual := ifMatches(pri.APIGroups, prj.APIGroups) + verbsEqual := ifMatches(pri.Verbs, prj.Verbs) + resourceNamesEqual := ifMatches(pri.ResourceNames, prj.ResourceNames) + nonResourceURLsEqual := ifMatches(pri.NonResourceURLs, prj.NonResourceURLs) + + if apiGroupsEqual && verbsEqual && resourceNamesEqual && nonResourceURLsEqual { + for _, newResource := range prj.Resources { + if !findResource(pri.Resources, newResource) { + // append rbac rule to deploy/role.yaml + rules1[i].Resources = append(rules1[i].Resources, newResource) + } + } + ruleFound = true + break iLoop + } + } + if !ruleFound { + rules1 = append(rules1, *prj) + } } - data, err := yaml.Marshal(m) + return rules1 +} +func updateRoleFile(role interface{}, roleFilePath string) error { + data, err := yaml.Marshal(&role) if err != nil { return fmt.Errorf("failed to marshal role(%+v): %v", role, err) } diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/api.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/api.go index 5d367500a..5cc64d23a 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/api.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/api.go @@ -15,36 +15,52 @@ package k8sutil import ( + "bytes" "fmt" "io/ioutil" "path" "path/filepath" "regexp" - "github.com/ghodss/yaml" + "github.com/operator-framework/operator-registry/pkg/registry" log "github.com/sirupsen/logrus" + apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions" + apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apiextv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/version" + "sigs.k8s.io/yaml" ) -// GetCustomResourceDefinitions returns all CRD manifests in the directory -// crdsDir. -func GetCustomResourceDefinitions(crdsDir string) (crds []apiextv1beta1.CustomResourceDefinition, err error) { +// GetCustomResourceDefinitions returns all CRD manifests of both v1 and v1beta1 +// versions in the directory crdsDir. If a duplicate object with different API +// versions is found, and error is returned. +func GetCustomResourceDefinitions(crdsDir string) ( + v1crds []apiextv1.CustomResourceDefinition, + v1beta1crds []apiextv1beta1.CustomResourceDefinition, + err error) { + infos, err := ioutil.ReadDir(crdsDir) if err != nil { - return nil, err + return nil, nil, err } + + // The set of all custom resource GVKs in found CRDs. + crGVKSet := map[schema.GroupVersionKind]struct{}{} for _, info := range infos { + path := filepath.Join(crdsDir, info.Name()) + if info.IsDir() { + log.Debugf("Skipping dir: %s", path) continue } - path := filepath.Join(crdsDir, info.Name()) + b, err := ioutil.ReadFile(path) if err != nil { - return nil, fmt.Errorf("error reading manifest %s: %w", path, err) + return nil, nil, fmt.Errorf("error reading manifest %s: %w", path, err) } - scanner := NewYAMLScanner(b) + scanner := NewYAMLScanner(bytes.NewBuffer(b)) for scanner.Scan() { manifest := scanner.Bytes() typeMeta, err := GetTypeMetaFromBytes(manifest) @@ -52,19 +68,114 @@ func GetCustomResourceDefinitions(crdsDir string) (crds []apiextv1beta1.CustomRe log.Debugf("Skipping manifest in %s: %v", path, err) continue } - if typeMeta.Kind == "CustomResourceDefinition" { - crd := apiextv1beta1.CustomResourceDefinition{} + if typeMeta.Kind != "CustomResourceDefinition" { + continue + } + + // Unmarshal based on CRD version. + var crGVKs []schema.GroupVersionKind + switch gvk := typeMeta.GroupVersionKind(); gvk.Version { + case apiextv1.SchemeGroupVersion.Version: + crd := apiextv1.CustomResourceDefinition{} if err = yaml.Unmarshal(manifest, &crd); err != nil { - return nil, fmt.Errorf("error unmarshalling CustomResourceDefinition: %w", err) + return nil, nil, err + } + v1crds = append(v1crds, crd) + crGVKs = append(crGVKs, GVKsForV1CustomResourceDefinitions(crd)...) + case apiextv1beta1.SchemeGroupVersion.Version: + crd := apiextv1beta1.CustomResourceDefinition{} + if err := yaml.Unmarshal(manifest, &crd); err != nil { + return nil, nil, err } - crds = append(crds, crd) + v1beta1crds = append(v1beta1crds, crd) + crGVKs = append(crGVKs, GVKsForV1beta1CustomResourceDefinitions(crd)...) + default: + return nil, nil, fmt.Errorf("unrecognized CustomResourceDefinition version %q", gvk.Version) } + + // Check if any GVK in crd is a duplicate. + for _, gvk := range crGVKs { + if _, hasGVK := crGVKSet[gvk]; hasGVK { + return nil, nil, fmt.Errorf("duplicate custom resource GVK %s in %s", gvk, path) + } + crGVKSet[gvk] = struct{}{} + } + } if err = scanner.Err(); err != nil { - return nil, fmt.Errorf("error scanning %s: %w", path, err) + return nil, nil, fmt.Errorf("error scanning %s: %w", path, err) + } + } + return v1crds, v1beta1crds, nil +} + +// DefinitionsForV1CustomResourceDefinitions returns definition keys for all +// custom resource versions in each crd in crds. +//nolint:lll +func DefinitionsForV1CustomResourceDefinitions(crds ...apiextv1.CustomResourceDefinition) (keys []registry.DefinitionKey) { + for _, crd := range crds { + for _, ver := range crd.Spec.Versions { + keys = append(keys, registry.DefinitionKey{ + Name: crd.GetName(), + Group: crd.Spec.Group, + Version: ver.Name, + Kind: crd.Spec.Names.Kind, + }) + } + } + return keys +} + +// DefinitionsForV1beta1CustomResourceDefinitions returns definition keys for all +// custom resource versions in each crd in crds. +//nolint:lll +func DefinitionsForV1beta1CustomResourceDefinitions(crds ...apiextv1beta1.CustomResourceDefinition) (keys []registry.DefinitionKey) { + for _, crd := range crds { + if len(crd.Spec.Versions) == 0 { + keys = append(keys, registry.DefinitionKey{ + Name: crd.GetName(), + Group: crd.Spec.Group, + Version: crd.Spec.Version, + Kind: crd.Spec.Names.Kind, + }) + } + for _, ver := range crd.Spec.Versions { + keys = append(keys, registry.DefinitionKey{ + Name: crd.GetName(), + Group: crd.Spec.Group, + Version: ver.Name, + Kind: crd.Spec.Names.Kind, + }) } } - return crds, nil + return keys +} + +// GVKsForV1CustomResourceDefinitions returns GroupVersionKind's for all +// custom resource versions in each crd in crds. +func GVKsForV1CustomResourceDefinitions(crds ...apiextv1.CustomResourceDefinition) (gvks []schema.GroupVersionKind) { + for _, key := range DefinitionsForV1CustomResourceDefinitions(crds...) { + gvks = append(gvks, schema.GroupVersionKind{ + Group: key.Group, + Version: key.Version, + Kind: key.Kind, + }) + } + return gvks +} + +// GVKsForV1beta1CustomResourceDefinitions returns GroupVersionKind's for all +// custom resource versions in each crd in crds. +//nolint:lll +func GVKsForV1beta1CustomResourceDefinitions(crds ...apiextv1beta1.CustomResourceDefinition) (gvks []schema.GroupVersionKind) { + for _, key := range DefinitionsForV1beta1CustomResourceDefinitions(crds...) { + gvks = append(gvks, schema.GroupVersionKind{ + Group: key.Group, + Version: key.Version, + Kind: key.Kind, + }) + } + return gvks } // ParseGroupSubpackages parses the apisDir directory tree and returns a map of @@ -152,3 +263,20 @@ func (vs CRDVersions) Less(i, j int) bool { return version.CompareKubeAwareVersionStrings(vs[i].Name, vs[j].Name) > 0 } func (vs CRDVersions) Swap(i, j int) { vs[i], vs[j] = vs[j], vs[i] } + +//nolint:lll +func Convertv1beta1Tov1CustomResourceDefinition(in *apiextv1beta1.CustomResourceDefinition) (*apiextv1.CustomResourceDefinition, error) { + var unversioned apiext.CustomResourceDefinition + //nolint:lll + if err := apiextv1beta1.Convert_v1beta1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(in, &unversioned, nil); err != nil { + return nil, err + } + var out apiextv1.CustomResourceDefinition + out.TypeMeta.APIVersion = apiextv1.SchemeGroupVersion.String() + out.TypeMeta.Kind = "CustomResourceDefinition" + //nolint:lll + if err := apiextv1.Convert_apiextensions_CustomResourceDefinition_To_v1_CustomResourceDefinition(&unversioned, &out, nil); err != nil { + return nil, err + } + return &out, nil +} diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/k8sutil.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/k8sutil.go index 4fad74a28..3594169b3 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/k8sutil.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/k8sutil.go @@ -128,3 +128,12 @@ func FormatOperatorNameDNS1123(name string) string { } return name } + +// TrimDNS1123Label trims a label to meet the DNS 1123 label length requirement +// by removing characters from the beginning of label such that len(label) <= 63. +func TrimDNS1123Label(label string) string { + if len(label) > validation.DNS1123LabelMaxLength { + return label[len(label)-validation.DNS1123LabelMaxLength:] + } + return label +} diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/manifest.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/manifest.go index 4a2bbf19f..6bb364d46 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/manifest.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/manifest.go @@ -24,8 +24,8 @@ import ( "github.com/operator-framework/operator-sdk/internal/scaffold" "github.com/operator-framework/operator-sdk/internal/util/fileutil" - "github.com/ghodss/yaml" log "github.com/sirupsen/logrus" + "sigs.k8s.io/yaml" ) var yamlSep = []byte("\n\n---\n\n") @@ -110,15 +110,22 @@ func GenerateCombinedGlobalManifest(crdsDir string) (*os.File, error) { } }() - crds, err := GetCustomResourceDefinitions(crdsDir) + v1crds, v1beta1crds, err := GetCustomResourceDefinitions(crdsDir) if err != nil { return nil, fmt.Errorf("error getting CRD's from %s: %v", crdsDir, err) } combined := []byte{} - for _, crd := range crds { + for _, crd := range v1crds { b, err := yaml.Marshal(crd) if err != nil { - return nil, fmt.Errorf("error marshalling CRD %s bytes: %v", crd.GetName(), err) + return nil, fmt.Errorf("error marshaling %s: %v", crd.GetObjectKind().GroupVersionKind(), err) + } + combined = CombineManifests(combined, b) + } + for _, crd := range v1beta1crds { + b, err := yaml.Marshal(crd) + if err != nil { + return nil, fmt.Errorf("error marshaling %s: %v", crd.GetObjectKind().GroupVersionKind(), err) } combined = CombineManifests(combined, b) } diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/options.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/options.go deleted file mode 100644 index 586620551..000000000 --- a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/options.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2019 The Operator-SDK Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package k8sutil - -import ( - "k8s.io/apimachinery/pkg/fields" - "sigs.k8s.io/controller-runtime/pkg/client" -) - -// NOTE: use controller-runtime's version of MatchingFields if the following -// issue is accepted as a feature: -// https://github.com/kubernetes-sigs/controller-runtime/issues/576 - -// MatchingFields implements the client.ListOption and client.DeleteAllOfOption -// interfaces so fields.Selector can be used directly in client.List and -// client.DeleteAllOf. -type MatchingFields struct { - Sel fields.Selector -} - -var _ client.ListOption = MatchingFields{} - -func (m MatchingFields) ApplyToList(opts *client.ListOptions) { - opts.FieldSelector = m.Sel -} - -var _ client.DeleteAllOfOption = MatchingFields{} - -func (m MatchingFields) ApplyToDeleteAllOf(opts *client.DeleteAllOfOptions) { - opts.FieldSelector = m.Sel -} diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/scan.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/scan.go index 85deb10e2..14e07905b 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/scan.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/k8sutil/scan.go @@ -34,9 +34,8 @@ type Scanner struct { done bool // Scan has finished. } -func NewYAMLScanner(b []byte) *Scanner { - r := bufio.NewReader(bytes.NewBuffer(b)) - return &Scanner{reader: k8syaml.NewYAMLReader(r)} +func NewYAMLScanner(r io.Reader) *Scanner { + return &Scanner{reader: k8syaml.NewYAMLReader(bufio.NewReader(r))} } func (s *Scanner) Err() error { diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/constants.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/constants.go new file mode 100644 index 000000000..334714473 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/constants.go @@ -0,0 +1,19 @@ +// Copyright 2020 The Operator-SDK Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package kbutil + +const ( + BinBuildDir = "bin" +) diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/project.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/project.go new file mode 100644 index 000000000..305d91054 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/kubebuilder/project.go @@ -0,0 +1,52 @@ +// Copyright 2020 The Operator-SDK Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package kbutil + +import ( + "io/ioutil" + "os" + + log "github.com/sirupsen/logrus" + "sigs.k8s.io/kubebuilder/pkg/model/config" +) + +const configFile = "PROJECT" + +// HasProjectFile returns true if the project is configured as a kubebuilder +// project. +func HasProjectFile() bool { + _, err := os.Stat(configFile) + if err != nil { + if os.IsNotExist(err) { + return false + } + log.Fatalf("Failed to read PROJECT file to detect kubebuilder project: %v", err) + } + return true +} + +// ReadConfig returns a configuration if a file containing one exists at the +// default path (project root). +func ReadConfig() (*config.Config, error) { + b, err := ioutil.ReadFile(configFile) + if err != nil { + return nil, err + } + c := &config.Config{} + if err = c.Unmarshal(b); err != nil { + return nil, err + } + return c, nil +} diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/interactive_promt_util.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/interactive_promt_util.go new file mode 100644 index 000000000..621a261c1 --- /dev/null +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/interactive_promt_util.go @@ -0,0 +1,113 @@ +// Copyright 2020 The Operator-SDK Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package projutil + +import ( + "bufio" + "fmt" + "io" + "log" + "os" + "strings" +) + +// InteractiveLevel captures the user preference on the generation of interactive +// commands. +type InteractiveLevel int + +const ( + // User has not turned interactive mode on or off, default to off. + InteractiveSoftOff InteractiveLevel = iota + // User has explicitly turned interactive mode off. + InteractiveHardOff + // User only explicitly turned interactive mode on. + InteractiveOnAll +) + +func printMessage(msg string, isOptional bool) { + fmt.Println() + if isOptional { + fmt.Print(strings.TrimSpace(msg) + " (optional): " + "\n" + "> ") + } else { + fmt.Print(strings.TrimSpace(msg) + " (required): " + "\n" + "> ") + } +} + +func GetRequiredInput(msg string) string { + return getRequiredInput(os.Stdin, msg) +} + +func getRequiredInput(rd io.Reader, msg string) string { + reader := bufio.NewReader(rd) + + for { + printMessage(msg, false) + value := readInput(reader) + if value != "" { + return value + } + fmt.Printf("Input is required. ") + } +} + +func GetOptionalInput(msg string) string { + printMessage(msg, true) + value := readInput(bufio.NewReader(os.Stdin)) + return value +} + +func GetStringArray(msg string) []string { + return getStringArray(os.Stdin, msg) +} + +func getStringArray(rd io.Reader, msg string) []string { + reader := bufio.NewReader(rd) + for { + printMessage(msg, false) + value := readArray(reader) + if len(value) != 0 && len(value[0]) != 0 { + return value + } + fmt.Printf("No list provided. ") + } +} + +// readstdin reads a line from stdin and returns the value. +func readLine(reader *bufio.Reader) string { + text, err := reader.ReadString('\n') + if err != nil { + log.Fatalf("Error when reading input: %v", err) + } + return strings.TrimSpace(text) +} + +func readInput(reader *bufio.Reader) string { + for { + text := readLine(reader) + return text + } +} + +// readArray parses the line from stdin, returns an array +// of words. +func readArray(reader *bufio.Reader) []string { + arr := make([]string, 0) + text := readLine(reader) + + for _, words := range strings.Split(text, ",") { + arr = append(arr, strings.TrimSpace(words)) + } + return arr +} diff --git a/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/project_util.go b/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/project_util.go index 597ffd47d..8625f9454 100644 --- a/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/project_util.go +++ b/vendor/github.com/operator-framework/operator-sdk/internal/util/projutil/project_util.go @@ -26,6 +26,8 @@ import ( "github.com/rogpeppe/go-internal/modfile" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" + + kbutil "github.com/operator-framework/operator-sdk/internal/util/kubebuilder" ) const ( @@ -34,15 +36,16 @@ const ( GoModEnv = "GO111MODULE" SrcDir = "src" - fsep = string(filepath.Separator) - mainFile = "main.go" - managerMainFile = "cmd" + fsep + "manager" + fsep + mainFile - buildDockerfile = "build" + fsep + "Dockerfile" - rolesDir = "roles" - requirementsFile = "requirements.yml" - moleculeDir = "molecule" - helmChartsDir = "helm-charts" - goModFile = "go.mod" + fsep = string(filepath.Separator) + mainFile = "main.go" + managerMainFile = "cmd" + fsep + "manager" + fsep + mainFile + buildDockerfile = "build" + fsep + "Dockerfile" + rolesDir = "roles" + requirementsFile = "requirements.yml" + moleculeDir = "molecule" + helmChartsDir = "helm-charts" + goModFile = "go.mod" + defaultPermission = 0644 noticeColor = "\033[1;36m%s\033[0m" ) @@ -82,9 +85,14 @@ func MustInProjectRoot() { // CheckProjectRoot checks if the current dir is the project root, and returns // an error if not. -// TODO(hasbro17): Change this to check for go.mod // "build/Dockerfile" may not be present in all projects +// todo: scaffold Project file for Ansible and Helm with the type information func CheckProjectRoot() error { + if kbutil.HasProjectFile() { + return nil + } + + // todo(camilamacedo86): remove the following check when we no longer support the legacy scaffold layout // If the current directory has a "build/Dockerfile", then it is safe to say // we are at the project root. if _, err := os.Stat(buildDockerfile); err != nil { @@ -199,6 +207,14 @@ func GetOperatorType() OperatorType { } func IsOperatorGo() bool { + // todo: in the future we should check the plugin prefix to ensure the operator type + // for now, we can assume that any project with the kubebuilder layout is Go Type + if kbutil.HasProjectFile() { + return true + } + + // todo: remove the following code when the legacy layout is no longer supported + // we can check it using the Project File _, err := os.Stat(managerMainFile) if err == nil || os.IsExist(err) { return true @@ -298,7 +314,7 @@ func CheckGoModules() error { } if !goModOn { return fmt.Errorf(`using go modules requires GO111MODULE="on", "auto", or unset.` + - ` More info: https://github.com/operator-framework/operator-sdk/blob/master/doc/user-guide.md#go-modules`) + ` More info: https://sdk.operatorframework.io/docs/golang/quickstart/#a-note-on-dependency-management`) } return nil } @@ -306,5 +322,48 @@ func CheckGoModules() error { // PrintDeprecationWarning prints a colored warning wrapping msg to the terminal. func PrintDeprecationWarning(msg string) { fmt.Printf(noticeColor, "[Deprecation Notice] "+msg+". Refer to the version upgrade guide "+ - "for more information: https://operator-sdk.netlify.com/docs/migration/version-upgrade-guide\n\n") + "for more information: https://sdk.operatorframework.io/docs/migration/version-upgrade-guide/\n\n") +} + +// RewriteFileContents adds the provided content before the last occurrence of the word label +// and rewrites the file with the new content. +func RewriteFileContents(filename, instruction, content string) error { + text, err := ioutil.ReadFile(filename) + + if err != nil { + return fmt.Errorf("error in getting contents from the file, %v", err) + } + + existingContent := string(text) + + modifiedContent, err := appendContent(existingContent, instruction, content) + if err != nil { + return err + } + + err = ioutil.WriteFile(filename, []byte(modifiedContent), defaultPermission) + if err != nil { + return fmt.Errorf("error writing modified contents to file, %v", err) + } + return nil +} + +func appendContent(fileContents, instruction, content string) (string, error) { + labelIndex := strings.LastIndex(fileContents, instruction) + + if labelIndex == -1 { + return "", fmt.Errorf("instruction not present previously in dockerfile") + } + + separationIndex := strings.Index(fileContents[labelIndex:], "\n") + if separationIndex == -1 { + return "", fmt.Errorf("no new line at the end of dockerfile command %s", fileContents[labelIndex:]) + } + + index := labelIndex + separationIndex + 1 + + newContent := fileContents[:index] + content + fileContents[index:] + + return newContent, nil + } diff --git a/vendor/github.com/operator-framework/operator-sdk/pkg/k8sutil/k8sutil.go b/vendor/github.com/operator-framework/operator-sdk/pkg/k8sutil/k8sutil.go index 00a3debc3..a5afe1b10 100644 --- a/vendor/github.com/operator-framework/operator-sdk/pkg/k8sutil/k8sutil.go +++ b/vendor/github.com/operator-framework/operator-sdk/pkg/k8sutil/k8sutil.go @@ -22,6 +22,7 @@ import ( "strings" corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" discovery "k8s.io/client-go/discovery" @@ -183,3 +184,49 @@ func isKubeMetaKind(kind string) bool { func isRunModeLocal() bool { return os.Getenv(ForceRunModeEnv) == string(LocalRunMode) } + +// SupportsOwnerReference checks whether a given dependent supports owner references, based on the owner. +// This function performs following checks: +// -- True: Owner is cluster-scoped. +// -- True: Both Owner and dependent are Namespaced with in same namespace. +// -- False: Owner is Namespaced and dependent is Cluster-scoped. +// -- False: Both Owner and dependent are Namespaced with different namespaces. +func SupportsOwnerReference(restMapper meta.RESTMapper, owner, dependent runtime.Object) (bool, error) { + ownerGVK := owner.GetObjectKind().GroupVersionKind() + ownerMapping, err := restMapper.RESTMapping(ownerGVK.GroupKind(), ownerGVK.Version) + if err != nil { + return false, err + } + mOwner, err := meta.Accessor(owner) + if err != nil { + return false, err + } + + depGVK := dependent.GetObjectKind().GroupVersionKind() + depMapping, err := restMapper.RESTMapping(depGVK.GroupKind(), depGVK.Version) + if err != nil { + return false, err + } + mDep, err := meta.Accessor(dependent) + if err != nil { + return false, err + } + ownerClusterScoped := ownerMapping.Scope.Name() == meta.RESTScopeNameRoot + ownerNamespace := mOwner.GetNamespace() + depClusterScoped := depMapping.Scope.Name() == meta.RESTScopeNameRoot + depNamespace := mDep.GetNamespace() + + if ownerClusterScoped { + return true, nil + } + + if depClusterScoped { + return false, nil + } + + if ownerNamespace != depNamespace { + return false, nil + } + // Both owner and dependent are namespace-scoped and in the same namespace. + return true, nil +} diff --git a/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/server.go b/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/server.go index b70c16c20..e6bb73c84 100644 --- a/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/server.go +++ b/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/server.go @@ -35,8 +35,9 @@ func ServeMetrics(stores [][]*metricsstore.MetricsStore, host string, port int32 // Add healthzPath mux.HandleFunc(healthzPath, func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(200) - _, err := w.Write([]byte("ok")) - log.Error(err, "Unable to write to serve custom metrics") + if _, err := w.Write([]byte("ok")); err != nil { + log.Error(err, "Unable to write to serve custom metrics") + } }) // Add index mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { @@ -50,7 +51,9 @@ func ServeMetrics(stores [][]*metricsstore.MetricsStore, host string, port int32 `)) - log.Error(err, "Unable to write to serve custom metrics") + if err != nil { + log.Error(err, "Unable to write to serve custom metrics") + } }) err := http.ListenAndServe(listenAddress, mux) log.Error(err, "Failed to serve custom metrics") diff --git a/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/store.go b/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/store.go index add00dbe5..72363b3e5 100644 --- a/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/store.go +++ b/vendor/github.com/operator-framework/operator-sdk/pkg/kube-metrics/store.go @@ -106,10 +106,10 @@ func namespacedListWatchFunc(dynamicInterface dynamic.NamespaceableResourceInter namespace string) cache.ListWatch { return cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - return dynamicInterface.Namespace(namespace).List(opts) + return dynamicInterface.Namespace(namespace).List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - return dynamicInterface.Namespace(namespace).Watch(opts) + return dynamicInterface.Namespace(namespace).Watch(context.TODO(), opts) }, } } @@ -117,10 +117,10 @@ func namespacedListWatchFunc(dynamicInterface dynamic.NamespaceableResourceInter func clusterScopeListWatchFunc(dynamicInterface dynamic.NamespaceableResourceInterface) cache.ListWatch { return cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { - return dynamicInterface.List(opts) + return dynamicInterface.List(context.TODO(), opts) }, WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { - return dynamicInterface.Watch(opts) + return dynamicInterface.Watch(context.TODO(), opts) }, } } diff --git a/vendor/github.com/operator-framework/operator-sdk/pkg/metrics/service-monitor.go b/vendor/github.com/operator-framework/operator-sdk/pkg/metrics/service-monitor.go index dd18bd46d..9971865cf 100644 --- a/vendor/github.com/operator-framework/operator-sdk/pkg/metrics/service-monitor.go +++ b/vendor/github.com/operator-framework/operator-sdk/pkg/metrics/service-monitor.go @@ -15,6 +15,7 @@ package metrics import ( + "context" "fmt" monitoringv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" @@ -57,7 +58,7 @@ func CreateServiceMonitors(config *rest.Config, ns string, services []*v1.Servic } } - smc, err := mclient.ServiceMonitors(ns).Create(sm) + smc, err := mclient.ServiceMonitors(ns).Create(context.TODO(), sm, metav1.CreateOptions{}) if err != nil { return serviceMonitors, err } diff --git a/vendor/github.com/operator-framework/operator-sdk/pkg/test/e2eutil/wait_util.go b/vendor/github.com/operator-framework/operator-sdk/pkg/test/e2eutil/wait_util.go index 8aa32301c..46c6e82c3 100644 --- a/vendor/github.com/operator-framework/operator-sdk/pkg/test/e2eutil/wait_util.go +++ b/vendor/github.com/operator-framework/operator-sdk/pkg/test/e2eutil/wait_util.go @@ -52,7 +52,7 @@ func waitForDeployment(t *testing.T, kubeclient kubernetes.Interface, namespace, return nil } err := wait.Poll(retryInterval, timeout, func() (done bool, err error) { - deployment, err := kubeclient.AppsV1().Deployments(namespace).Get(name, metav1.GetOptions{}) + deployment, err := kubeclient.AppsV1().Deployments(namespace).Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { if apierrors.IsNotFound(err) { t.Logf("Waiting for availability of Deployment: %s in Namespace: %s \n", name, namespace) diff --git a/vendor/github.com/operator-framework/operator-sdk/pkg/test/resource_creator.go b/vendor/github.com/operator-framework/operator-sdk/pkg/test/resource_creator.go index 89090aefd..dd045b95d 100644 --- a/vendor/github.com/operator-framework/operator-sdk/pkg/test/resource_creator.go +++ b/vendor/github.com/operator-framework/operator-sdk/pkg/test/resource_creator.go @@ -15,64 +15,61 @@ package test import ( + "bytes" goctx "context" "fmt" "io/ioutil" "os" "time" - "github.com/operator-framework/operator-sdk/internal/util/k8sutil" - - "github.com/ghodss/yaml" + "golang.org/x/net/context" core "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/util/wait" + "sigs.k8s.io/yaml" + + "github.com/operator-framework/operator-sdk/internal/util/k8sutil" ) // TODO: remove before 1.0.0 // Deprecated: GetNamespace() exists for historical compatibility. // Use GetOperatorNamespace() or GetWatchNamespace() instead func (ctx *Context) GetNamespace() (string, error) { - if ctx.namespace != "" { - return ctx.namespace, nil - } - // create namespace - ctx.namespace = ctx.GetID() - namespaceObj := &core.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ctx.namespace}} - _, err := ctx.kubeclient.CoreV1().Namespaces().Create(namespaceObj) - if apierrors.IsAlreadyExists(err) { - return "", fmt.Errorf("namespace %s already exists: %w", ctx.namespace, err) - } else if err != nil { - return "", err - } - ctx.AddCleanupFn(func() error { - return ctx.kubeclient.CoreV1().Namespaces().Delete(ctx.namespace, metav1.NewDeleteOptions(0)) - }) - return ctx.namespace, nil + var err error + ctx.namespace, err = ctx.getNamespace(ctx.namespace) + return ctx.namespace, err } // GetOperatorNamespace will return an Operator Namespace, // if the flag --operator-namespace not be used (TestOpeatorNamespaceEnv not set) // then it will create a new namespace with randon name and return that namespace func (ctx *Context) GetOperatorNamespace() (string, error) { - if ctx.operatorNamespace != "" { - return ctx.operatorNamespace, nil + var err error + ctx.operatorNamespace, err = ctx.getNamespace(ctx.operatorNamespace) + return ctx.operatorNamespace, err +} + +func (ctx *Context) getNamespace(ns string) (string, error) { + if ns != "" { + return ns, nil } // create namespace - ctx.operatorNamespace = ctx.GetID() - namespaceObj := &core.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ctx.operatorNamespace}} - _, err := ctx.kubeclient.CoreV1().Namespaces().Create(namespaceObj) + ns = ctx.GetID() + namespaceObj := &core.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ns}} + _, err := ctx.kubeclient.CoreV1().Namespaces().Create(context.TODO(), namespaceObj, metav1.CreateOptions{}) if apierrors.IsAlreadyExists(err) { - return "", fmt.Errorf("namespace %s already exists: %w", ctx.operatorNamespace, err) + return "", fmt.Errorf("namespace %s already exists: %w", ns, err) } else if err != nil { return "", err } ctx.AddCleanupFn(func() error { - return ctx.kubeclient.CoreV1().Namespaces().Delete(ctx.operatorNamespace, metav1.NewDeleteOptions(0)) + gracePeriodSeconds := int64(0) + opts := metav1.DeleteOptions{GracePeriodSeconds: &gracePeriodSeconds} + return ctx.kubeclient.CoreV1().Namespaces().Delete(context.TODO(), ns, opts) }) - return ctx.operatorNamespace, nil + return ns, nil } // GetWatchNamespace will return the namespaces to operator @@ -104,7 +101,7 @@ func (ctx *Context) createFromYAML(yamlFile []byte, skipIfExists bool, cleanupOp if err != nil { return err } - scanner := k8sutil.NewYAMLScanner(yamlFile) + scanner := k8sutil.NewYAMLScanner(bytes.NewBuffer(yamlFile)) for scanner.Scan() { yamlSpec := scanner.Bytes() diff --git a/vendor/github.com/operator-framework/operator-sdk/version/version.go b/vendor/github.com/operator-framework/operator-sdk/version/version.go index 5213139fe..7a649a333 100644 --- a/vendor/github.com/operator-framework/operator-sdk/version/version.go +++ b/vendor/github.com/operator-framework/operator-sdk/version/version.go @@ -21,7 +21,7 @@ import ( //var needs to be used instead of const for ldflags var ( - Version = "v0.17.0" + Version = "v0.18.2" GitVersion = "unknown" GitCommit = "unknown" KubernetesVersion = "unknown" diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go index cea466913..f74620450 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/clientset.go @@ -67,7 +67,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/clustertask.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/clustertask.go index 72c651410..570202483 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/clustertask.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/clustertask.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,14 +38,14 @@ type ClusterTasksGetter interface { // ClusterTaskInterface has methods to work with ClusterTask resources. type ClusterTaskInterface interface { - Create(*v1alpha1.ClusterTask) (*v1alpha1.ClusterTask, error) - Update(*v1alpha1.ClusterTask) (*v1alpha1.ClusterTask, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.ClusterTask, error) - List(opts v1.ListOptions) (*v1alpha1.ClusterTaskList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterTask, err error) + Create(ctx context.Context, clusterTask *v1alpha1.ClusterTask, opts v1.CreateOptions) (*v1alpha1.ClusterTask, error) + Update(ctx context.Context, clusterTask *v1alpha1.ClusterTask, opts v1.UpdateOptions) (*v1alpha1.ClusterTask, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterTask, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterTaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTask, err error) ClusterTaskExpansion } @@ -61,19 +62,19 @@ func newClusterTasks(c *TektonV1alpha1Client) *clusterTasks { } // Get takes name of the clusterTask, and returns the corresponding clusterTask object, and an error if there is any. -func (c *clusterTasks) Get(name string, options v1.GetOptions) (result *v1alpha1.ClusterTask, err error) { +func (c *clusterTasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTask, err error) { result = &v1alpha1.ClusterTask{} err = c.client.Get(). Resource("clustertasks"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterTasks that match those selectors. -func (c *clusterTasks) List(opts v1.ListOptions) (result *v1alpha1.ClusterTaskList, err error) { +func (c *clusterTasks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTaskList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterTasks) List(opts v1.ListOptions) (result *v1alpha1.ClusterTaskLi Resource("clustertasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterTasks. -func (c *clusterTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterTasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("clustertasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterTask and creates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *clusterTasks) Create(clusterTask *v1alpha1.ClusterTask) (result *v1alpha1.ClusterTask, err error) { +func (c *clusterTasks) Create(ctx context.Context, clusterTask *v1alpha1.ClusterTask, opts v1.CreateOptions) (result *v1alpha1.ClusterTask, err error) { result = &v1alpha1.ClusterTask{} err = c.client.Post(). Resource("clustertasks"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterTask). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterTask and updates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *clusterTasks) Update(clusterTask *v1alpha1.ClusterTask) (result *v1alpha1.ClusterTask, err error) { +func (c *clusterTasks) Update(ctx context.Context, clusterTask *v1alpha1.ClusterTask, opts v1.UpdateOptions) (result *v1alpha1.ClusterTask, err error) { result = &v1alpha1.ClusterTask{} err = c.client.Put(). Resource("clustertasks"). Name(clusterTask.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterTask). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterTask and deletes it. Returns an error if one occurs. -func (c *clusterTasks) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterTasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clustertasks"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterTasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterTasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clustertasks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterTask. -func (c *clusterTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterTask, err error) { +func (c *clusterTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTask, err error) { result = &v1alpha1.ClusterTask{} err = c.client.Patch(pt). Resource("clustertasks"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/condition.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/condition.go index 6402ee1f1..ab26eea6e 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/condition.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/condition.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,14 +38,14 @@ type ConditionsGetter interface { // ConditionInterface has methods to work with Condition resources. type ConditionInterface interface { - Create(*v1alpha1.Condition) (*v1alpha1.Condition, error) - Update(*v1alpha1.Condition) (*v1alpha1.Condition, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Condition, error) - List(opts v1.ListOptions) (*v1alpha1.ConditionList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Condition, err error) + Create(ctx context.Context, condition *v1alpha1.Condition, opts v1.CreateOptions) (*v1alpha1.Condition, error) + Update(ctx context.Context, condition *v1alpha1.Condition, opts v1.UpdateOptions) (*v1alpha1.Condition, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Condition, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ConditionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Condition, err error) ConditionExpansion } @@ -63,20 +64,20 @@ func newConditions(c *TektonV1alpha1Client, namespace string) *conditions { } // Get takes name of the condition, and returns the corresponding condition object, and an error if there is any. -func (c *conditions) Get(name string, options v1.GetOptions) (result *v1alpha1.Condition, err error) { +func (c *conditions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Condition, err error) { result = &v1alpha1.Condition{} err = c.client.Get(). Namespace(c.ns). Resource("conditions"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Conditions that match those selectors. -func (c *conditions) List(opts v1.ListOptions) (result *v1alpha1.ConditionList, err error) { +func (c *conditions) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ConditionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *conditions) List(opts v1.ListOptions) (result *v1alpha1.ConditionList, Resource("conditions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested conditions. -func (c *conditions) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *conditions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *conditions) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("conditions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a condition and creates it. Returns the server's representation of the condition, and an error, if there is any. -func (c *conditions) Create(condition *v1alpha1.Condition) (result *v1alpha1.Condition, err error) { +func (c *conditions) Create(ctx context.Context, condition *v1alpha1.Condition, opts v1.CreateOptions) (result *v1alpha1.Condition, err error) { result = &v1alpha1.Condition{} err = c.client.Post(). Namespace(c.ns). Resource("conditions"). + VersionedParams(&opts, scheme.ParameterCodec). Body(condition). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a condition and updates it. Returns the server's representation of the condition, and an error, if there is any. -func (c *conditions) Update(condition *v1alpha1.Condition) (result *v1alpha1.Condition, err error) { +func (c *conditions) Update(ctx context.Context, condition *v1alpha1.Condition, opts v1.UpdateOptions) (result *v1alpha1.Condition, err error) { result = &v1alpha1.Condition{} err = c.client.Put(). Namespace(c.ns). Resource("conditions"). Name(condition.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(condition). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the condition and deletes it. Returns an error if one occurs. -func (c *conditions) Delete(name string, options *v1.DeleteOptions) error { +func (c *conditions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("conditions"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *conditions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *conditions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("conditions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched condition. -func (c *conditions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Condition, err error) { +func (c *conditions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Condition, err error) { result = &v1alpha1.Condition{} err = c.client.Patch(pt). Namespace(c.ns). Resource("conditions"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go index 46bcb5560..cc0a370f7 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipeline.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,14 +38,14 @@ type PipelinesGetter interface { // PipelineInterface has methods to work with Pipeline resources. type PipelineInterface interface { - Create(*v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) - Update(*v1alpha1.Pipeline) (*v1alpha1.Pipeline, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Pipeline, error) - List(opts v1.ListOptions) (*v1alpha1.PipelineList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pipeline, err error) + Create(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.CreateOptions) (*v1alpha1.Pipeline, error) + Update(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (*v1alpha1.Pipeline, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Pipeline, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PipelineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Pipeline, err error) PipelineExpansion } @@ -63,20 +64,20 @@ func newPipelines(c *TektonV1alpha1Client, namespace string) *pipelines { } // Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. -func (c *pipelines) Get(name string, options v1.GetOptions) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Get(). Namespace(c.ns). Resource("pipelines"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Pipelines that match those selectors. -func (c *pipelines) List(opts v1.ListOptions) (result *v1alpha1.PipelineList, err error) { +func (c *pipelines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PipelineList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *pipelines) List(opts v1.ListOptions) (result *v1alpha1.PipelineList, er Resource("pipelines"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelines. -func (c *pipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *pipelines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *pipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("pipelines"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Create(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Create(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.CreateOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Post(). Namespace(c.ns). Resource("pipelines"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Update(pipeline *v1alpha1.Pipeline) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Update(ctx context.Context, pipeline *v1alpha1.Pipeline, opts v1.UpdateOptions) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Put(). Namespace(c.ns). Resource("pipelines"). Name(pipeline.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipeline and deletes it. Returns an error if one occurs. -func (c *pipelines) Delete(name string, options *v1.DeleteOptions) error { +func (c *pipelines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelines"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *pipelines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pipelines"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipeline. -func (c *pipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Pipeline, err error) { +func (c *pipelines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Pipeline, err error) { result = &v1alpha1.Pipeline{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelines"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipelinerun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipelinerun.go index e76542c45..cdf2a1e36 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipelinerun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/pipelinerun.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,15 +38,15 @@ type PipelineRunsGetter interface { // PipelineRunInterface has methods to work with PipelineRun resources. type PipelineRunInterface interface { - Create(*v1alpha1.PipelineRun) (*v1alpha1.PipelineRun, error) - Update(*v1alpha1.PipelineRun) (*v1alpha1.PipelineRun, error) - UpdateStatus(*v1alpha1.PipelineRun) (*v1alpha1.PipelineRun, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.PipelineRun, error) - List(opts v1.ListOptions) (*v1alpha1.PipelineRunList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PipelineRun, err error) + Create(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, opts v1.CreateOptions) (*v1alpha1.PipelineRun, error) + Update(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, opts v1.UpdateOptions) (*v1alpha1.PipelineRun, error) + UpdateStatus(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, opts v1.UpdateOptions) (*v1alpha1.PipelineRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PipelineRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PipelineRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PipelineRun, err error) PipelineRunExpansion } @@ -64,20 +65,20 @@ func newPipelineRuns(c *TektonV1alpha1Client, namespace string) *pipelineRuns { } // Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any. -func (c *pipelineRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.PipelineRun, err error) { +func (c *pipelineRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PipelineRun, err error) { result = &v1alpha1.PipelineRun{} err = c.client.Get(). Namespace(c.ns). Resource("pipelineruns"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PipelineRuns that match those selectors. -func (c *pipelineRuns) List(opts v1.ListOptions) (result *v1alpha1.PipelineRunList, err error) { +func (c *pipelineRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PipelineRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *pipelineRuns) List(opts v1.ListOptions) (result *v1alpha1.PipelineRunLi Resource("pipelineruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelineRuns. -func (c *pipelineRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *pipelineRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *pipelineRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("pipelineruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *pipelineRuns) Create(pipelineRun *v1alpha1.PipelineRun) (result *v1alpha1.PipelineRun, err error) { +func (c *pipelineRuns) Create(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, opts v1.CreateOptions) (result *v1alpha1.PipelineRun, err error) { result = &v1alpha1.PipelineRun{} err = c.client.Post(). Namespace(c.ns). Resource("pipelineruns"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineRun). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *pipelineRuns) Update(pipelineRun *v1alpha1.PipelineRun) (result *v1alpha1.PipelineRun, err error) { +func (c *pipelineRuns) Update(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, opts v1.UpdateOptions) (result *v1alpha1.PipelineRun, err error) { result = &v1alpha1.PipelineRun{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineruns"). Name(pipelineRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineRun). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *pipelineRuns) UpdateStatus(pipelineRun *v1alpha1.PipelineRun) (result *v1alpha1.PipelineRun, err error) { +func (c *pipelineRuns) UpdateStatus(ctx context.Context, pipelineRun *v1alpha1.PipelineRun, opts v1.UpdateOptions) (result *v1alpha1.PipelineRun, err error) { result = &v1alpha1.PipelineRun{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineruns"). Name(pipelineRun.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineRun). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs. -func (c *pipelineRuns) Delete(name string, options *v1.DeleteOptions) error { +func (c *pipelineRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelineruns"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelineRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *pipelineRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pipelineruns"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipelineRun. -func (c *pipelineRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PipelineRun, err error) { +func (c *pipelineRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PipelineRun, err error) { result = &v1alpha1.PipelineRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelineruns"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/run.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/run.go index 9efaff0ba..417dd8212 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/run.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/run.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,15 +38,15 @@ type RunsGetter interface { // RunInterface has methods to work with Run resources. type RunInterface interface { - Create(*v1alpha1.Run) (*v1alpha1.Run, error) - Update(*v1alpha1.Run) (*v1alpha1.Run, error) - UpdateStatus(*v1alpha1.Run) (*v1alpha1.Run, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Run, error) - List(opts v1.ListOptions) (*v1alpha1.RunList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Run, err error) + Create(ctx context.Context, run *v1alpha1.Run, opts v1.CreateOptions) (*v1alpha1.Run, error) + Update(ctx context.Context, run *v1alpha1.Run, opts v1.UpdateOptions) (*v1alpha1.Run, error) + UpdateStatus(ctx context.Context, run *v1alpha1.Run, opts v1.UpdateOptions) (*v1alpha1.Run, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Run, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Run, err error) RunExpansion } @@ -64,20 +65,20 @@ func newRuns(c *TektonV1alpha1Client, namespace string) *runs { } // Get takes name of the run, and returns the corresponding run object, and an error if there is any. -func (c *runs) Get(name string, options v1.GetOptions) (result *v1alpha1.Run, err error) { +func (c *runs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Run, err error) { result = &v1alpha1.Run{} err = c.client.Get(). Namespace(c.ns). Resource("runs"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Runs that match those selectors. -func (c *runs) List(opts v1.ListOptions) (result *v1alpha1.RunList, err error) { +func (c *runs) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *runs) List(opts v1.ListOptions) (result *v1alpha1.RunList, err error) { Resource("runs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested runs. -func (c *runs) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *runs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *runs) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("runs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a run and creates it. Returns the server's representation of the run, and an error, if there is any. -func (c *runs) Create(run *v1alpha1.Run) (result *v1alpha1.Run, err error) { +func (c *runs) Create(ctx context.Context, run *v1alpha1.Run, opts v1.CreateOptions) (result *v1alpha1.Run, err error) { result = &v1alpha1.Run{} err = c.client.Post(). Namespace(c.ns). Resource("runs"). + VersionedParams(&opts, scheme.ParameterCodec). Body(run). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a run and updates it. Returns the server's representation of the run, and an error, if there is any. -func (c *runs) Update(run *v1alpha1.Run) (result *v1alpha1.Run, err error) { +func (c *runs) Update(ctx context.Context, run *v1alpha1.Run, opts v1.UpdateOptions) (result *v1alpha1.Run, err error) { result = &v1alpha1.Run{} err = c.client.Put(). Namespace(c.ns). Resource("runs"). Name(run.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(run). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *runs) UpdateStatus(run *v1alpha1.Run) (result *v1alpha1.Run, err error) { +func (c *runs) UpdateStatus(ctx context.Context, run *v1alpha1.Run, opts v1.UpdateOptions) (result *v1alpha1.Run, err error) { result = &v1alpha1.Run{} err = c.client.Put(). Namespace(c.ns). Resource("runs"). Name(run.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(run). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the run and deletes it. Returns an error if one occurs. -func (c *runs) Delete(name string, options *v1.DeleteOptions) error { +func (c *runs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("runs"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *runs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *runs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("runs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched run. -func (c *runs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Run, err error) { +func (c *runs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Run, err error) { result = &v1alpha1.Run{} err = c.client.Patch(pt). Namespace(c.ns). Resource("runs"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/task.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/task.go index 400962878..ba5b46d27 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/task.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/task.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,14 +38,14 @@ type TasksGetter interface { // TaskInterface has methods to work with Task resources. type TaskInterface interface { - Create(*v1alpha1.Task) (*v1alpha1.Task, error) - Update(*v1alpha1.Task) (*v1alpha1.Task, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Task, error) - List(opts v1.ListOptions) (*v1alpha1.TaskList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Task, err error) + Create(ctx context.Context, task *v1alpha1.Task, opts v1.CreateOptions) (*v1alpha1.Task, error) + Update(ctx context.Context, task *v1alpha1.Task, opts v1.UpdateOptions) (*v1alpha1.Task, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Task, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Task, err error) TaskExpansion } @@ -63,20 +64,20 @@ func newTasks(c *TektonV1alpha1Client, namespace string) *tasks { } // Get takes name of the task, and returns the corresponding task object, and an error if there is any. -func (c *tasks) Get(name string, options v1.GetOptions) (result *v1alpha1.Task, err error) { +func (c *tasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Task, err error) { result = &v1alpha1.Task{} err = c.client.Get(). Namespace(c.ns). Resource("tasks"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Tasks that match those selectors. -func (c *tasks) List(opts v1.ListOptions) (result *v1alpha1.TaskList, err error) { +func (c *tasks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TaskList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *tasks) List(opts v1.ListOptions) (result *v1alpha1.TaskList, err error) Resource("tasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested tasks. -func (c *tasks) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *tasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *tasks) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("tasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Create(task *v1alpha1.Task) (result *v1alpha1.Task, err error) { +func (c *tasks) Create(ctx context.Context, task *v1alpha1.Task, opts v1.CreateOptions) (result *v1alpha1.Task, err error) { result = &v1alpha1.Task{} err = c.client.Post(). Namespace(c.ns). Resource("tasks"). + VersionedParams(&opts, scheme.ParameterCodec). Body(task). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Update(task *v1alpha1.Task) (result *v1alpha1.Task, err error) { +func (c *tasks) Update(ctx context.Context, task *v1alpha1.Task, opts v1.UpdateOptions) (result *v1alpha1.Task, err error) { result = &v1alpha1.Task{} err = c.client.Put(). Namespace(c.ns). Resource("tasks"). Name(task.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(task). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the task and deletes it. Returns an error if one occurs. -func (c *tasks) Delete(name string, options *v1.DeleteOptions) error { +func (c *tasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("tasks"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *tasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *tasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("tasks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched task. -func (c *tasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Task, err error) { +func (c *tasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Task, err error) { result = &v1alpha1.Task{} err = c.client.Patch(pt). Namespace(c.ns). Resource("tasks"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/taskrun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/taskrun.go index 3335adb48..d3e7f1b70 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/taskrun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1alpha1/taskrun.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1" @@ -37,15 +38,15 @@ type TaskRunsGetter interface { // TaskRunInterface has methods to work with TaskRun resources. type TaskRunInterface interface { - Create(*v1alpha1.TaskRun) (*v1alpha1.TaskRun, error) - Update(*v1alpha1.TaskRun) (*v1alpha1.TaskRun, error) - UpdateStatus(*v1alpha1.TaskRun) (*v1alpha1.TaskRun, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.TaskRun, error) - List(opts v1.ListOptions) (*v1alpha1.TaskRunList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TaskRun, err error) + Create(ctx context.Context, taskRun *v1alpha1.TaskRun, opts v1.CreateOptions) (*v1alpha1.TaskRun, error) + Update(ctx context.Context, taskRun *v1alpha1.TaskRun, opts v1.UpdateOptions) (*v1alpha1.TaskRun, error) + UpdateStatus(ctx context.Context, taskRun *v1alpha1.TaskRun, opts v1.UpdateOptions) (*v1alpha1.TaskRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.TaskRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.TaskRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TaskRun, err error) TaskRunExpansion } @@ -64,20 +65,20 @@ func newTaskRuns(c *TektonV1alpha1Client, namespace string) *taskRuns { } // Get takes name of the taskRun, and returns the corresponding taskRun object, and an error if there is any. -func (c *taskRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.TaskRun, err error) { +func (c *taskRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.TaskRun, err error) { result = &v1alpha1.TaskRun{} err = c.client.Get(). Namespace(c.ns). Resource("taskruns"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of TaskRuns that match those selectors. -func (c *taskRuns) List(opts v1.ListOptions) (result *v1alpha1.TaskRunList, err error) { +func (c *taskRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.TaskRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *taskRuns) List(opts v1.ListOptions) (result *v1alpha1.TaskRunList, err Resource("taskruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested taskRuns. -func (c *taskRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *taskRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *taskRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("taskruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a taskRun and creates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *taskRuns) Create(taskRun *v1alpha1.TaskRun) (result *v1alpha1.TaskRun, err error) { +func (c *taskRuns) Create(ctx context.Context, taskRun *v1alpha1.TaskRun, opts v1.CreateOptions) (result *v1alpha1.TaskRun, err error) { result = &v1alpha1.TaskRun{} err = c.client.Post(). Namespace(c.ns). Resource("taskruns"). + VersionedParams(&opts, scheme.ParameterCodec). Body(taskRun). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a taskRun and updates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *taskRuns) Update(taskRun *v1alpha1.TaskRun) (result *v1alpha1.TaskRun, err error) { +func (c *taskRuns) Update(ctx context.Context, taskRun *v1alpha1.TaskRun, opts v1.UpdateOptions) (result *v1alpha1.TaskRun, err error) { result = &v1alpha1.TaskRun{} err = c.client.Put(). Namespace(c.ns). Resource("taskruns"). Name(taskRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(taskRun). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *taskRuns) UpdateStatus(taskRun *v1alpha1.TaskRun) (result *v1alpha1.TaskRun, err error) { +func (c *taskRuns) UpdateStatus(ctx context.Context, taskRun *v1alpha1.TaskRun, opts v1.UpdateOptions) (result *v1alpha1.TaskRun, err error) { result = &v1alpha1.TaskRun{} err = c.client.Put(). Namespace(c.ns). Resource("taskruns"). Name(taskRun.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(taskRun). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the taskRun and deletes it. Returns an error if one occurs. -func (c *taskRuns) Delete(name string, options *v1.DeleteOptions) error { +func (c *taskRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("taskruns"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *taskRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *taskRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("taskruns"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched taskRun. -func (c *taskRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.TaskRun, err error) { +func (c *taskRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.TaskRun, err error) { result = &v1alpha1.TaskRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("taskruns"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go index 8961ca389..80c11ff5a 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/clustertask.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -37,14 +38,14 @@ type ClusterTasksGetter interface { // ClusterTaskInterface has methods to work with ClusterTask resources. type ClusterTaskInterface interface { - Create(*v1beta1.ClusterTask) (*v1beta1.ClusterTask, error) - Update(*v1beta1.ClusterTask) (*v1beta1.ClusterTask, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ClusterTask, error) - List(opts v1.ListOptions) (*v1beta1.ClusterTaskList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterTask, err error) + Create(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.CreateOptions) (*v1beta1.ClusterTask, error) + Update(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.UpdateOptions) (*v1beta1.ClusterTask, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterTask, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterTaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterTask, err error) ClusterTaskExpansion } @@ -61,19 +62,19 @@ func newClusterTasks(c *TektonV1beta1Client) *clusterTasks { } // Get takes name of the clusterTask, and returns the corresponding clusterTask object, and an error if there is any. -func (c *clusterTasks) Get(name string, options v1.GetOptions) (result *v1beta1.ClusterTask, err error) { +func (c *clusterTasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterTask, err error) { result = &v1beta1.ClusterTask{} err = c.client.Get(). Resource("clustertasks"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterTasks that match those selectors. -func (c *clusterTasks) List(opts v1.ListOptions) (result *v1beta1.ClusterTaskList, err error) { +func (c *clusterTasks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterTaskList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterTasks) List(opts v1.ListOptions) (result *v1beta1.ClusterTaskLis Resource("clustertasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterTasks. -func (c *clusterTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterTasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterTasks) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("clustertasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterTask and creates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *clusterTasks) Create(clusterTask *v1beta1.ClusterTask) (result *v1beta1.ClusterTask, err error) { +func (c *clusterTasks) Create(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.CreateOptions) (result *v1beta1.ClusterTask, err error) { result = &v1beta1.ClusterTask{} err = c.client.Post(). Resource("clustertasks"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterTask). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterTask and updates it. Returns the server's representation of the clusterTask, and an error, if there is any. -func (c *clusterTasks) Update(clusterTask *v1beta1.ClusterTask) (result *v1beta1.ClusterTask, err error) { +func (c *clusterTasks) Update(ctx context.Context, clusterTask *v1beta1.ClusterTask, opts v1.UpdateOptions) (result *v1beta1.ClusterTask, err error) { result = &v1beta1.ClusterTask{} err = c.client.Put(). Resource("clustertasks"). Name(clusterTask.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterTask). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterTask and deletes it. Returns an error if one occurs. -func (c *clusterTasks) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterTasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clustertasks"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterTasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterTasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clustertasks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterTask. -func (c *clusterTasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterTask, err error) { +func (c *clusterTasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterTask, err error) { result = &v1beta1.ClusterTask{} err = c.client.Patch(pt). Resource("clustertasks"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go index faea5452f..1bfe8d58a 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipeline.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -37,14 +38,14 @@ type PipelinesGetter interface { // PipelineInterface has methods to work with Pipeline resources. type PipelineInterface interface { - Create(*v1beta1.Pipeline) (*v1beta1.Pipeline, error) - Update(*v1beta1.Pipeline) (*v1beta1.Pipeline, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Pipeline, error) - List(opts v1.ListOptions) (*v1beta1.PipelineList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Pipeline, err error) + Create(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.CreateOptions) (*v1beta1.Pipeline, error) + Update(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.UpdateOptions) (*v1beta1.Pipeline, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Pipeline, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PipelineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Pipeline, err error) PipelineExpansion } @@ -63,20 +64,20 @@ func newPipelines(c *TektonV1beta1Client, namespace string) *pipelines { } // Get takes name of the pipeline, and returns the corresponding pipeline object, and an error if there is any. -func (c *pipelines) Get(name string, options v1.GetOptions) (result *v1beta1.Pipeline, err error) { +func (c *pipelines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Pipeline, err error) { result = &v1beta1.Pipeline{} err = c.client.Get(). Namespace(c.ns). Resource("pipelines"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Pipelines that match those selectors. -func (c *pipelines) List(opts v1.ListOptions) (result *v1beta1.PipelineList, err error) { +func (c *pipelines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PipelineList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *pipelines) List(opts v1.ListOptions) (result *v1beta1.PipelineList, err Resource("pipelines"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelines. -func (c *pipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *pipelines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *pipelines) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("pipelines"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pipeline and creates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Create(pipeline *v1beta1.Pipeline) (result *v1beta1.Pipeline, err error) { +func (c *pipelines) Create(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.CreateOptions) (result *v1beta1.Pipeline, err error) { result = &v1beta1.Pipeline{} err = c.client.Post(). Namespace(c.ns). Resource("pipelines"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipeline and updates it. Returns the server's representation of the pipeline, and an error, if there is any. -func (c *pipelines) Update(pipeline *v1beta1.Pipeline) (result *v1beta1.Pipeline, err error) { +func (c *pipelines) Update(ctx context.Context, pipeline *v1beta1.Pipeline, opts v1.UpdateOptions) (result *v1beta1.Pipeline, err error) { result = &v1beta1.Pipeline{} err = c.client.Put(). Namespace(c.ns). Resource("pipelines"). Name(pipeline.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipeline). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipeline and deletes it. Returns an error if one occurs. -func (c *pipelines) Delete(name string, options *v1.DeleteOptions) error { +func (c *pipelines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelines"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *pipelines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pipelines"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipeline. -func (c *pipelines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Pipeline, err error) { +func (c *pipelines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Pipeline, err error) { result = &v1beta1.Pipeline{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelines"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go index 015c63c05..5399858ff 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/pipelinerun.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -37,15 +38,15 @@ type PipelineRunsGetter interface { // PipelineRunInterface has methods to work with PipelineRun resources. type PipelineRunInterface interface { - Create(*v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) - Update(*v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) - UpdateStatus(*v1beta1.PipelineRun) (*v1beta1.PipelineRun, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.PipelineRun, error) - List(opts v1.ListOptions) (*v1beta1.PipelineRunList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PipelineRun, err error) + Create(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.CreateOptions) (*v1beta1.PipelineRun, error) + Update(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) + UpdateStatus(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (*v1beta1.PipelineRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PipelineRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PipelineRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PipelineRun, err error) PipelineRunExpansion } @@ -64,20 +65,20 @@ func newPipelineRuns(c *TektonV1beta1Client, namespace string) *pipelineRuns { } // Get takes name of the pipelineRun, and returns the corresponding pipelineRun object, and an error if there is any. -func (c *pipelineRuns) Get(name string, options v1.GetOptions) (result *v1beta1.PipelineRun, err error) { +func (c *pipelineRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PipelineRun, err error) { result = &v1beta1.PipelineRun{} err = c.client.Get(). Namespace(c.ns). Resource("pipelineruns"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PipelineRuns that match those selectors. -func (c *pipelineRuns) List(opts v1.ListOptions) (result *v1beta1.PipelineRunList, err error) { +func (c *pipelineRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PipelineRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *pipelineRuns) List(opts v1.ListOptions) (result *v1beta1.PipelineRunLis Resource("pipelineruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pipelineRuns. -func (c *pipelineRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *pipelineRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *pipelineRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("pipelineruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pipelineRun and creates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *pipelineRuns) Create(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { +func (c *pipelineRuns) Create(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.CreateOptions) (result *v1beta1.PipelineRun, err error) { result = &v1beta1.PipelineRun{} err = c.client.Post(). Namespace(c.ns). Resource("pipelineruns"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineRun). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pipelineRun and updates it. Returns the server's representation of the pipelineRun, and an error, if there is any. -func (c *pipelineRuns) Update(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { +func (c *pipelineRuns) Update(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (result *v1beta1.PipelineRun, err error) { result = &v1beta1.PipelineRun{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineruns"). Name(pipelineRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineRun). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *pipelineRuns) UpdateStatus(pipelineRun *v1beta1.PipelineRun) (result *v1beta1.PipelineRun, err error) { +func (c *pipelineRuns) UpdateStatus(ctx context.Context, pipelineRun *v1beta1.PipelineRun, opts v1.UpdateOptions) (result *v1beta1.PipelineRun, err error) { result = &v1beta1.PipelineRun{} err = c.client.Put(). Namespace(c.ns). Resource("pipelineruns"). Name(pipelineRun.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pipelineRun). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pipelineRun and deletes it. Returns an error if one occurs. -func (c *pipelineRuns) Delete(name string, options *v1.DeleteOptions) error { +func (c *pipelineRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pipelineruns"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pipelineRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *pipelineRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pipelineruns"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pipelineRun. -func (c *pipelineRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PipelineRun, err error) { +func (c *pipelineRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PipelineRun, err error) { result = &v1beta1.PipelineRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pipelineruns"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go index 998e6f85a..a024ed714 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/task.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -37,14 +38,14 @@ type TasksGetter interface { // TaskInterface has methods to work with Task resources. type TaskInterface interface { - Create(*v1beta1.Task) (*v1beta1.Task, error) - Update(*v1beta1.Task) (*v1beta1.Task, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Task, error) - List(opts v1.ListOptions) (*v1beta1.TaskList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Task, err error) + Create(ctx context.Context, task *v1beta1.Task, opts v1.CreateOptions) (*v1beta1.Task, error) + Update(ctx context.Context, task *v1beta1.Task, opts v1.UpdateOptions) (*v1beta1.Task, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Task, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TaskList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Task, err error) TaskExpansion } @@ -63,20 +64,20 @@ func newTasks(c *TektonV1beta1Client, namespace string) *tasks { } // Get takes name of the task, and returns the corresponding task object, and an error if there is any. -func (c *tasks) Get(name string, options v1.GetOptions) (result *v1beta1.Task, err error) { +func (c *tasks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Task, err error) { result = &v1beta1.Task{} err = c.client.Get(). Namespace(c.ns). Resource("tasks"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Tasks that match those selectors. -func (c *tasks) List(opts v1.ListOptions) (result *v1beta1.TaskList, err error) { +func (c *tasks) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TaskList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *tasks) List(opts v1.ListOptions) (result *v1beta1.TaskList, err error) Resource("tasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested tasks. -func (c *tasks) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *tasks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *tasks) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("tasks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a task and creates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Create(task *v1beta1.Task) (result *v1beta1.Task, err error) { +func (c *tasks) Create(ctx context.Context, task *v1beta1.Task, opts v1.CreateOptions) (result *v1beta1.Task, err error) { result = &v1beta1.Task{} err = c.client.Post(). Namespace(c.ns). Resource("tasks"). + VersionedParams(&opts, scheme.ParameterCodec). Body(task). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a task and updates it. Returns the server's representation of the task, and an error, if there is any. -func (c *tasks) Update(task *v1beta1.Task) (result *v1beta1.Task, err error) { +func (c *tasks) Update(ctx context.Context, task *v1beta1.Task, opts v1.UpdateOptions) (result *v1beta1.Task, err error) { result = &v1beta1.Task{} err = c.client.Put(). Namespace(c.ns). Resource("tasks"). Name(task.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(task). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the task and deletes it. Returns an error if one occurs. -func (c *tasks) Delete(name string, options *v1.DeleteOptions) error { +func (c *tasks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("tasks"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *tasks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *tasks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("tasks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched task. -func (c *tasks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Task, err error) { +func (c *tasks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Task, err error) { result = &v1beta1.Task{} err = c.client.Patch(pt). Namespace(c.ns). Resource("tasks"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go index e48b23f3a..5611be7d6 100644 --- a/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go +++ b/vendor/github.com/tektoncd/pipeline/pkg/client/clientset/versioned/typed/pipeline/v1beta1/taskrun.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" @@ -37,15 +38,15 @@ type TaskRunsGetter interface { // TaskRunInterface has methods to work with TaskRun resources. type TaskRunInterface interface { - Create(*v1beta1.TaskRun) (*v1beta1.TaskRun, error) - Update(*v1beta1.TaskRun) (*v1beta1.TaskRun, error) - UpdateStatus(*v1beta1.TaskRun) (*v1beta1.TaskRun, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.TaskRun, error) - List(opts v1.ListOptions) (*v1beta1.TaskRunList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TaskRun, err error) + Create(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.CreateOptions) (*v1beta1.TaskRun, error) + Update(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) + UpdateStatus(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (*v1beta1.TaskRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.TaskRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.TaskRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TaskRun, err error) TaskRunExpansion } @@ -64,20 +65,20 @@ func newTaskRuns(c *TektonV1beta1Client, namespace string) *taskRuns { } // Get takes name of the taskRun, and returns the corresponding taskRun object, and an error if there is any. -func (c *taskRuns) Get(name string, options v1.GetOptions) (result *v1beta1.TaskRun, err error) { +func (c *taskRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.TaskRun, err error) { result = &v1beta1.TaskRun{} err = c.client.Get(). Namespace(c.ns). Resource("taskruns"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of TaskRuns that match those selectors. -func (c *taskRuns) List(opts v1.ListOptions) (result *v1beta1.TaskRunList, err error) { +func (c *taskRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.TaskRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *taskRuns) List(opts v1.ListOptions) (result *v1beta1.TaskRunList, err e Resource("taskruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested taskRuns. -func (c *taskRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *taskRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *taskRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("taskruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a taskRun and creates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *taskRuns) Create(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { +func (c *taskRuns) Create(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.CreateOptions) (result *v1beta1.TaskRun, err error) { result = &v1beta1.TaskRun{} err = c.client.Post(). Namespace(c.ns). Resource("taskruns"). + VersionedParams(&opts, scheme.ParameterCodec). Body(taskRun). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a taskRun and updates it. Returns the server's representation of the taskRun, and an error, if there is any. -func (c *taskRuns) Update(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { +func (c *taskRuns) Update(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (result *v1beta1.TaskRun, err error) { result = &v1beta1.TaskRun{} err = c.client.Put(). Namespace(c.ns). Resource("taskruns"). Name(taskRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(taskRun). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *taskRuns) UpdateStatus(taskRun *v1beta1.TaskRun) (result *v1beta1.TaskRun, err error) { +func (c *taskRuns) UpdateStatus(ctx context.Context, taskRun *v1beta1.TaskRun, opts v1.UpdateOptions) (result *v1beta1.TaskRun, err error) { result = &v1beta1.TaskRun{} err = c.client.Put(). Namespace(c.ns). Resource("taskruns"). Name(taskRun.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(taskRun). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the taskRun and deletes it. Returns an error if one occurs. -func (c *taskRuns) Delete(name string, options *v1.DeleteOptions) error { +func (c *taskRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("taskruns"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *taskRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *taskRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("taskruns"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched taskRun. -func (c *taskRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.TaskRun, err error) { +func (c *taskRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.TaskRun, err error) { result = &v1beta1.TaskRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("taskruns"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 345b7cd85..02714ade6 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -2020,7 +2020,11 @@ func (sc *serverConn) newWriterAndRequest(st *stream, f *MetaHeadersFrame) (*res } if bodyOpen { if vv, ok := rp.header["Content-Length"]; ok { - req.ContentLength, _ = strconv.ParseInt(vv[0], 10, 64) + if cl, err := strconv.ParseUint(vv[0], 10, 63); err == nil { + req.ContentLength = int64(cl) + } else { + req.ContentLength = 0 + } } else { req.ContentLength = -1 } @@ -2403,9 +2407,8 @@ func (rws *responseWriterState) writeChunk(p []byte) (n int, err error) { var ctype, clen string if clen = rws.snapHeader.Get("Content-Length"); clen != "" { rws.snapHeader.Del("Content-Length") - clen64, err := strconv.ParseInt(clen, 10, 64) - if err == nil && clen64 >= 0 { - rws.sentContentLen = clen64 + if cl, err := strconv.ParseUint(clen, 10, 63); err == nil { + rws.sentContentLen = int64(cl) } else { clen = "" } diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 2482f7bf9..4ec326699 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -2006,8 +2006,8 @@ func (rl *clientConnReadLoop) handleResponse(cs *clientStream, f *MetaHeadersFra if !streamEnded || isHead { res.ContentLength = -1 if clens := res.Header["Content-Length"]; len(clens) == 1 { - if clen64, err := strconv.ParseInt(clens[0], 10, 64); err == nil { - res.ContentLength = clen64 + if cl, err := strconv.ParseUint(clens[0], 10, 63); err == nil { + res.ContentLength = int64(cl) } else { // TODO: care? unlike http/1, it won't mess up our framing, so it's // more safe smuggling-wise to ignore. diff --git a/vendor/golang.org/x/net/internal/timeseries/timeseries.go b/vendor/golang.org/x/net/internal/timeseries/timeseries.go new file mode 100644 index 000000000..dc5225b6d --- /dev/null +++ b/vendor/golang.org/x/net/internal/timeseries/timeseries.go @@ -0,0 +1,525 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package timeseries implements a time series structure for stats collection. +package timeseries // import "golang.org/x/net/internal/timeseries" + +import ( + "fmt" + "log" + "time" +) + +const ( + timeSeriesNumBuckets = 64 + minuteHourSeriesNumBuckets = 60 +) + +var timeSeriesResolutions = []time.Duration{ + 1 * time.Second, + 10 * time.Second, + 1 * time.Minute, + 10 * time.Minute, + 1 * time.Hour, + 6 * time.Hour, + 24 * time.Hour, // 1 day + 7 * 24 * time.Hour, // 1 week + 4 * 7 * 24 * time.Hour, // 4 weeks + 16 * 7 * 24 * time.Hour, // 16 weeks +} + +var minuteHourSeriesResolutions = []time.Duration{ + 1 * time.Second, + 1 * time.Minute, +} + +// An Observable is a kind of data that can be aggregated in a time series. +type Observable interface { + Multiply(ratio float64) // Multiplies the data in self by a given ratio + Add(other Observable) // Adds the data from a different observation to self + Clear() // Clears the observation so it can be reused. + CopyFrom(other Observable) // Copies the contents of a given observation to self +} + +// Float attaches the methods of Observable to a float64. +type Float float64 + +// NewFloat returns a Float. +func NewFloat() Observable { + f := Float(0) + return &f +} + +// String returns the float as a string. +func (f *Float) String() string { return fmt.Sprintf("%g", f.Value()) } + +// Value returns the float's value. +func (f *Float) Value() float64 { return float64(*f) } + +func (f *Float) Multiply(ratio float64) { *f *= Float(ratio) } + +func (f *Float) Add(other Observable) { + o := other.(*Float) + *f += *o +} + +func (f *Float) Clear() { *f = 0 } + +func (f *Float) CopyFrom(other Observable) { + o := other.(*Float) + *f = *o +} + +// A Clock tells the current time. +type Clock interface { + Time() time.Time +} + +type defaultClock int + +var defaultClockInstance defaultClock + +func (defaultClock) Time() time.Time { return time.Now() } + +// Information kept per level. Each level consists of a circular list of +// observations. The start of the level may be derived from end and the +// len(buckets) * sizeInMillis. +type tsLevel struct { + oldest int // index to oldest bucketed Observable + newest int // index to newest bucketed Observable + end time.Time // end timestamp for this level + size time.Duration // duration of the bucketed Observable + buckets []Observable // collections of observations + provider func() Observable // used for creating new Observable +} + +func (l *tsLevel) Clear() { + l.oldest = 0 + l.newest = len(l.buckets) - 1 + l.end = time.Time{} + for i := range l.buckets { + if l.buckets[i] != nil { + l.buckets[i].Clear() + l.buckets[i] = nil + } + } +} + +func (l *tsLevel) InitLevel(size time.Duration, numBuckets int, f func() Observable) { + l.size = size + l.provider = f + l.buckets = make([]Observable, numBuckets) +} + +// Keeps a sequence of levels. Each level is responsible for storing data at +// a given resolution. For example, the first level stores data at a one +// minute resolution while the second level stores data at a one hour +// resolution. + +// Each level is represented by a sequence of buckets. Each bucket spans an +// interval equal to the resolution of the level. New observations are added +// to the last bucket. +type timeSeries struct { + provider func() Observable // make more Observable + numBuckets int // number of buckets in each level + levels []*tsLevel // levels of bucketed Observable + lastAdd time.Time // time of last Observable tracked + total Observable // convenient aggregation of all Observable + clock Clock // Clock for getting current time + pending Observable // observations not yet bucketed + pendingTime time.Time // what time are we keeping in pending + dirty bool // if there are pending observations +} + +// init initializes a level according to the supplied criteria. +func (ts *timeSeries) init(resolutions []time.Duration, f func() Observable, numBuckets int, clock Clock) { + ts.provider = f + ts.numBuckets = numBuckets + ts.clock = clock + ts.levels = make([]*tsLevel, len(resolutions)) + + for i := range resolutions { + if i > 0 && resolutions[i-1] >= resolutions[i] { + log.Print("timeseries: resolutions must be monotonically increasing") + break + } + newLevel := new(tsLevel) + newLevel.InitLevel(resolutions[i], ts.numBuckets, ts.provider) + ts.levels[i] = newLevel + } + + ts.Clear() +} + +// Clear removes all observations from the time series. +func (ts *timeSeries) Clear() { + ts.lastAdd = time.Time{} + ts.total = ts.resetObservation(ts.total) + ts.pending = ts.resetObservation(ts.pending) + ts.pendingTime = time.Time{} + ts.dirty = false + + for i := range ts.levels { + ts.levels[i].Clear() + } +} + +// Add records an observation at the current time. +func (ts *timeSeries) Add(observation Observable) { + ts.AddWithTime(observation, ts.clock.Time()) +} + +// AddWithTime records an observation at the specified time. +func (ts *timeSeries) AddWithTime(observation Observable, t time.Time) { + + smallBucketDuration := ts.levels[0].size + + if t.After(ts.lastAdd) { + ts.lastAdd = t + } + + if t.After(ts.pendingTime) { + ts.advance(t) + ts.mergePendingUpdates() + ts.pendingTime = ts.levels[0].end + ts.pending.CopyFrom(observation) + ts.dirty = true + } else if t.After(ts.pendingTime.Add(-1 * smallBucketDuration)) { + // The observation is close enough to go into the pending bucket. + // This compensates for clock skewing and small scheduling delays + // by letting the update stay in the fast path. + ts.pending.Add(observation) + ts.dirty = true + } else { + ts.mergeValue(observation, t) + } +} + +// mergeValue inserts the observation at the specified time in the past into all levels. +func (ts *timeSeries) mergeValue(observation Observable, t time.Time) { + for _, level := range ts.levels { + index := (ts.numBuckets - 1) - int(level.end.Sub(t)/level.size) + if 0 <= index && index < ts.numBuckets { + bucketNumber := (level.oldest + index) % ts.numBuckets + if level.buckets[bucketNumber] == nil { + level.buckets[bucketNumber] = level.provider() + } + level.buckets[bucketNumber].Add(observation) + } + } + ts.total.Add(observation) +} + +// mergePendingUpdates applies the pending updates into all levels. +func (ts *timeSeries) mergePendingUpdates() { + if ts.dirty { + ts.mergeValue(ts.pending, ts.pendingTime) + ts.pending = ts.resetObservation(ts.pending) + ts.dirty = false + } +} + +// advance cycles the buckets at each level until the latest bucket in +// each level can hold the time specified. +func (ts *timeSeries) advance(t time.Time) { + if !t.After(ts.levels[0].end) { + return + } + for i := 0; i < len(ts.levels); i++ { + level := ts.levels[i] + if !level.end.Before(t) { + break + } + + // If the time is sufficiently far, just clear the level and advance + // directly. + if !t.Before(level.end.Add(level.size * time.Duration(ts.numBuckets))) { + for _, b := range level.buckets { + ts.resetObservation(b) + } + level.end = time.Unix(0, (t.UnixNano()/level.size.Nanoseconds())*level.size.Nanoseconds()) + } + + for t.After(level.end) { + level.end = level.end.Add(level.size) + level.newest = level.oldest + level.oldest = (level.oldest + 1) % ts.numBuckets + ts.resetObservation(level.buckets[level.newest]) + } + + t = level.end + } +} + +// Latest returns the sum of the num latest buckets from the level. +func (ts *timeSeries) Latest(level, num int) Observable { + now := ts.clock.Time() + if ts.levels[0].end.Before(now) { + ts.advance(now) + } + + ts.mergePendingUpdates() + + result := ts.provider() + l := ts.levels[level] + index := l.newest + + for i := 0; i < num; i++ { + if l.buckets[index] != nil { + result.Add(l.buckets[index]) + } + if index == 0 { + index = ts.numBuckets + } + index-- + } + + return result +} + +// LatestBuckets returns a copy of the num latest buckets from level. +func (ts *timeSeries) LatestBuckets(level, num int) []Observable { + if level < 0 || level > len(ts.levels) { + log.Print("timeseries: bad level argument: ", level) + return nil + } + if num < 0 || num >= ts.numBuckets { + log.Print("timeseries: bad num argument: ", num) + return nil + } + + results := make([]Observable, num) + now := ts.clock.Time() + if ts.levels[0].end.Before(now) { + ts.advance(now) + } + + ts.mergePendingUpdates() + + l := ts.levels[level] + index := l.newest + + for i := 0; i < num; i++ { + result := ts.provider() + results[i] = result + if l.buckets[index] != nil { + result.CopyFrom(l.buckets[index]) + } + + if index == 0 { + index = ts.numBuckets + } + index -= 1 + } + return results +} + +// ScaleBy updates observations by scaling by factor. +func (ts *timeSeries) ScaleBy(factor float64) { + for _, l := range ts.levels { + for i := 0; i < ts.numBuckets; i++ { + l.buckets[i].Multiply(factor) + } + } + + ts.total.Multiply(factor) + ts.pending.Multiply(factor) +} + +// Range returns the sum of observations added over the specified time range. +// If start or finish times don't fall on bucket boundaries of the same +// level, then return values are approximate answers. +func (ts *timeSeries) Range(start, finish time.Time) Observable { + return ts.ComputeRange(start, finish, 1)[0] +} + +// Recent returns the sum of observations from the last delta. +func (ts *timeSeries) Recent(delta time.Duration) Observable { + now := ts.clock.Time() + return ts.Range(now.Add(-delta), now) +} + +// Total returns the total of all observations. +func (ts *timeSeries) Total() Observable { + ts.mergePendingUpdates() + return ts.total +} + +// ComputeRange computes a specified number of values into a slice using +// the observations recorded over the specified time period. The return +// values are approximate if the start or finish times don't fall on the +// bucket boundaries at the same level or if the number of buckets spanning +// the range is not an integral multiple of num. +func (ts *timeSeries) ComputeRange(start, finish time.Time, num int) []Observable { + if start.After(finish) { + log.Printf("timeseries: start > finish, %v>%v", start, finish) + return nil + } + + if num < 0 { + log.Printf("timeseries: num < 0, %v", num) + return nil + } + + results := make([]Observable, num) + + for _, l := range ts.levels { + if !start.Before(l.end.Add(-l.size * time.Duration(ts.numBuckets))) { + ts.extract(l, start, finish, num, results) + return results + } + } + + // Failed to find a level that covers the desired range. So just + // extract from the last level, even if it doesn't cover the entire + // desired range. + ts.extract(ts.levels[len(ts.levels)-1], start, finish, num, results) + + return results +} + +// RecentList returns the specified number of values in slice over the most +// recent time period of the specified range. +func (ts *timeSeries) RecentList(delta time.Duration, num int) []Observable { + if delta < 0 { + return nil + } + now := ts.clock.Time() + return ts.ComputeRange(now.Add(-delta), now, num) +} + +// extract returns a slice of specified number of observations from a given +// level over a given range. +func (ts *timeSeries) extract(l *tsLevel, start, finish time.Time, num int, results []Observable) { + ts.mergePendingUpdates() + + srcInterval := l.size + dstInterval := finish.Sub(start) / time.Duration(num) + dstStart := start + srcStart := l.end.Add(-srcInterval * time.Duration(ts.numBuckets)) + + srcIndex := 0 + + // Where should scanning start? + if dstStart.After(srcStart) { + advance := int(dstStart.Sub(srcStart) / srcInterval) + srcIndex += advance + srcStart = srcStart.Add(time.Duration(advance) * srcInterval) + } + + // The i'th value is computed as show below. + // interval = (finish/start)/num + // i'th value = sum of observation in range + // [ start + i * interval, + // start + (i + 1) * interval ) + for i := 0; i < num; i++ { + results[i] = ts.resetObservation(results[i]) + dstEnd := dstStart.Add(dstInterval) + for srcIndex < ts.numBuckets && srcStart.Before(dstEnd) { + srcEnd := srcStart.Add(srcInterval) + if srcEnd.After(ts.lastAdd) { + srcEnd = ts.lastAdd + } + + if !srcEnd.Before(dstStart) { + srcValue := l.buckets[(srcIndex+l.oldest)%ts.numBuckets] + if !srcStart.Before(dstStart) && !srcEnd.After(dstEnd) { + // dst completely contains src. + if srcValue != nil { + results[i].Add(srcValue) + } + } else { + // dst partially overlaps src. + overlapStart := maxTime(srcStart, dstStart) + overlapEnd := minTime(srcEnd, dstEnd) + base := srcEnd.Sub(srcStart) + fraction := overlapEnd.Sub(overlapStart).Seconds() / base.Seconds() + + used := ts.provider() + if srcValue != nil { + used.CopyFrom(srcValue) + } + used.Multiply(fraction) + results[i].Add(used) + } + + if srcEnd.After(dstEnd) { + break + } + } + srcIndex++ + srcStart = srcStart.Add(srcInterval) + } + dstStart = dstStart.Add(dstInterval) + } +} + +// resetObservation clears the content so the struct may be reused. +func (ts *timeSeries) resetObservation(observation Observable) Observable { + if observation == nil { + observation = ts.provider() + } else { + observation.Clear() + } + return observation +} + +// TimeSeries tracks data at granularities from 1 second to 16 weeks. +type TimeSeries struct { + timeSeries +} + +// NewTimeSeries creates a new TimeSeries using the function provided for creating new Observable. +func NewTimeSeries(f func() Observable) *TimeSeries { + return NewTimeSeriesWithClock(f, defaultClockInstance) +} + +// NewTimeSeriesWithClock creates a new TimeSeries using the function provided for creating new Observable and the clock for +// assigning timestamps. +func NewTimeSeriesWithClock(f func() Observable, clock Clock) *TimeSeries { + ts := new(TimeSeries) + ts.timeSeries.init(timeSeriesResolutions, f, timeSeriesNumBuckets, clock) + return ts +} + +// MinuteHourSeries tracks data at granularities of 1 minute and 1 hour. +type MinuteHourSeries struct { + timeSeries +} + +// NewMinuteHourSeries creates a new MinuteHourSeries using the function provided for creating new Observable. +func NewMinuteHourSeries(f func() Observable) *MinuteHourSeries { + return NewMinuteHourSeriesWithClock(f, defaultClockInstance) +} + +// NewMinuteHourSeriesWithClock creates a new MinuteHourSeries using the function provided for creating new Observable and the clock for +// assigning timestamps. +func NewMinuteHourSeriesWithClock(f func() Observable, clock Clock) *MinuteHourSeries { + ts := new(MinuteHourSeries) + ts.timeSeries.init(minuteHourSeriesResolutions, f, + minuteHourSeriesNumBuckets, clock) + return ts +} + +func (ts *MinuteHourSeries) Minute() Observable { + return ts.timeSeries.Latest(0, 60) +} + +func (ts *MinuteHourSeries) Hour() Observable { + return ts.timeSeries.Latest(1, 60) +} + +func minTime(a, b time.Time) time.Time { + if a.Before(b) { + return a + } + return b +} + +func maxTime(a, b time.Time) time.Time { + if a.After(b) { + return a + } + return b +} diff --git a/vendor/golang.org/x/net/trace/events.go b/vendor/golang.org/x/net/trace/events.go new file mode 100644 index 000000000..c646a6952 --- /dev/null +++ b/vendor/golang.org/x/net/trace/events.go @@ -0,0 +1,532 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package trace + +import ( + "bytes" + "fmt" + "html/template" + "io" + "log" + "net/http" + "runtime" + "sort" + "strconv" + "strings" + "sync" + "sync/atomic" + "text/tabwriter" + "time" +) + +const maxEventsPerLog = 100 + +type bucket struct { + MaxErrAge time.Duration + String string +} + +var buckets = []bucket{ + {0, "total"}, + {10 * time.Second, "errs<10s"}, + {1 * time.Minute, "errs<1m"}, + {10 * time.Minute, "errs<10m"}, + {1 * time.Hour, "errs<1h"}, + {10 * time.Hour, "errs<10h"}, + {24000 * time.Hour, "errors"}, +} + +// RenderEvents renders the HTML page typically served at /debug/events. +// It does not do any auth checking. The request may be nil. +// +// Most users will use the Events handler. +func RenderEvents(w http.ResponseWriter, req *http.Request, sensitive bool) { + now := time.Now() + data := &struct { + Families []string // family names + Buckets []bucket + Counts [][]int // eventLog count per family/bucket + + // Set when a bucket has been selected. + Family string + Bucket int + EventLogs eventLogs + Expanded bool + }{ + Buckets: buckets, + } + + data.Families = make([]string, 0, len(families)) + famMu.RLock() + for name := range families { + data.Families = append(data.Families, name) + } + famMu.RUnlock() + sort.Strings(data.Families) + + // Count the number of eventLogs in each family for each error age. + data.Counts = make([][]int, len(data.Families)) + for i, name := range data.Families { + // TODO(sameer): move this loop under the family lock. + f := getEventFamily(name) + data.Counts[i] = make([]int, len(data.Buckets)) + for j, b := range data.Buckets { + data.Counts[i][j] = f.Count(now, b.MaxErrAge) + } + } + + if req != nil { + var ok bool + data.Family, data.Bucket, ok = parseEventsArgs(req) + if !ok { + // No-op + } else { + data.EventLogs = getEventFamily(data.Family).Copy(now, buckets[data.Bucket].MaxErrAge) + } + if data.EventLogs != nil { + defer data.EventLogs.Free() + sort.Sort(data.EventLogs) + } + if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { + data.Expanded = exp + } + } + + famMu.RLock() + defer famMu.RUnlock() + if err := eventsTmpl().Execute(w, data); err != nil { + log.Printf("net/trace: Failed executing template: %v", err) + } +} + +func parseEventsArgs(req *http.Request) (fam string, b int, ok bool) { + fam, bStr := req.FormValue("fam"), req.FormValue("b") + if fam == "" || bStr == "" { + return "", 0, false + } + b, err := strconv.Atoi(bStr) + if err != nil || b < 0 || b >= len(buckets) { + return "", 0, false + } + return fam, b, true +} + +// An EventLog provides a log of events associated with a specific object. +type EventLog interface { + // Printf formats its arguments with fmt.Sprintf and adds the + // result to the event log. + Printf(format string, a ...interface{}) + + // Errorf is like Printf, but it marks this event as an error. + Errorf(format string, a ...interface{}) + + // Finish declares that this event log is complete. + // The event log should not be used after calling this method. + Finish() +} + +// NewEventLog returns a new EventLog with the specified family name +// and title. +func NewEventLog(family, title string) EventLog { + el := newEventLog() + el.ref() + el.Family, el.Title = family, title + el.Start = time.Now() + el.events = make([]logEntry, 0, maxEventsPerLog) + el.stack = make([]uintptr, 32) + n := runtime.Callers(2, el.stack) + el.stack = el.stack[:n] + + getEventFamily(family).add(el) + return el +} + +func (el *eventLog) Finish() { + getEventFamily(el.Family).remove(el) + el.unref() // matches ref in New +} + +var ( + famMu sync.RWMutex + families = make(map[string]*eventFamily) // family name => family +) + +func getEventFamily(fam string) *eventFamily { + famMu.Lock() + defer famMu.Unlock() + f := families[fam] + if f == nil { + f = &eventFamily{} + families[fam] = f + } + return f +} + +type eventFamily struct { + mu sync.RWMutex + eventLogs eventLogs +} + +func (f *eventFamily) add(el *eventLog) { + f.mu.Lock() + f.eventLogs = append(f.eventLogs, el) + f.mu.Unlock() +} + +func (f *eventFamily) remove(el *eventLog) { + f.mu.Lock() + defer f.mu.Unlock() + for i, el0 := range f.eventLogs { + if el == el0 { + copy(f.eventLogs[i:], f.eventLogs[i+1:]) + f.eventLogs = f.eventLogs[:len(f.eventLogs)-1] + return + } + } +} + +func (f *eventFamily) Count(now time.Time, maxErrAge time.Duration) (n int) { + f.mu.RLock() + defer f.mu.RUnlock() + for _, el := range f.eventLogs { + if el.hasRecentError(now, maxErrAge) { + n++ + } + } + return +} + +func (f *eventFamily) Copy(now time.Time, maxErrAge time.Duration) (els eventLogs) { + f.mu.RLock() + defer f.mu.RUnlock() + els = make(eventLogs, 0, len(f.eventLogs)) + for _, el := range f.eventLogs { + if el.hasRecentError(now, maxErrAge) { + el.ref() + els = append(els, el) + } + } + return +} + +type eventLogs []*eventLog + +// Free calls unref on each element of the list. +func (els eventLogs) Free() { + for _, el := range els { + el.unref() + } +} + +// eventLogs may be sorted in reverse chronological order. +func (els eventLogs) Len() int { return len(els) } +func (els eventLogs) Less(i, j int) bool { return els[i].Start.After(els[j].Start) } +func (els eventLogs) Swap(i, j int) { els[i], els[j] = els[j], els[i] } + +// A logEntry is a timestamped log entry in an event log. +type logEntry struct { + When time.Time + Elapsed time.Duration // since previous event in log + NewDay bool // whether this event is on a different day to the previous event + What string + IsErr bool +} + +// WhenString returns a string representation of the elapsed time of the event. +// It will include the date if midnight was crossed. +func (e logEntry) WhenString() string { + if e.NewDay { + return e.When.Format("2006/01/02 15:04:05.000000") + } + return e.When.Format("15:04:05.000000") +} + +// An eventLog represents an active event log. +type eventLog struct { + // Family is the top-level grouping of event logs to which this belongs. + Family string + + // Title is the title of this event log. + Title string + + // Timing information. + Start time.Time + + // Call stack where this event log was created. + stack []uintptr + + // Append-only sequence of events. + // + // TODO(sameer): change this to a ring buffer to avoid the array copy + // when we hit maxEventsPerLog. + mu sync.RWMutex + events []logEntry + LastErrorTime time.Time + discarded int + + refs int32 // how many buckets this is in +} + +func (el *eventLog) reset() { + // Clear all but the mutex. Mutexes may not be copied, even when unlocked. + el.Family = "" + el.Title = "" + el.Start = time.Time{} + el.stack = nil + el.events = nil + el.LastErrorTime = time.Time{} + el.discarded = 0 + el.refs = 0 +} + +func (el *eventLog) hasRecentError(now time.Time, maxErrAge time.Duration) bool { + if maxErrAge == 0 { + return true + } + el.mu.RLock() + defer el.mu.RUnlock() + return now.Sub(el.LastErrorTime) < maxErrAge +} + +// delta returns the elapsed time since the last event or the log start, +// and whether it spans midnight. +// L >= el.mu +func (el *eventLog) delta(t time.Time) (time.Duration, bool) { + if len(el.events) == 0 { + return t.Sub(el.Start), false + } + prev := el.events[len(el.events)-1].When + return t.Sub(prev), prev.Day() != t.Day() + +} + +func (el *eventLog) Printf(format string, a ...interface{}) { + el.printf(false, format, a...) +} + +func (el *eventLog) Errorf(format string, a ...interface{}) { + el.printf(true, format, a...) +} + +func (el *eventLog) printf(isErr bool, format string, a ...interface{}) { + e := logEntry{When: time.Now(), IsErr: isErr, What: fmt.Sprintf(format, a...)} + el.mu.Lock() + e.Elapsed, e.NewDay = el.delta(e.When) + if len(el.events) < maxEventsPerLog { + el.events = append(el.events, e) + } else { + // Discard the oldest event. + if el.discarded == 0 { + // el.discarded starts at two to count for the event it + // is replacing, plus the next one that we are about to + // drop. + el.discarded = 2 + } else { + el.discarded++ + } + // TODO(sameer): if this causes allocations on a critical path, + // change eventLog.What to be a fmt.Stringer, as in trace.go. + el.events[0].What = fmt.Sprintf("(%d events discarded)", el.discarded) + // The timestamp of the discarded meta-event should be + // the time of the last event it is representing. + el.events[0].When = el.events[1].When + copy(el.events[1:], el.events[2:]) + el.events[maxEventsPerLog-1] = e + } + if e.IsErr { + el.LastErrorTime = e.When + } + el.mu.Unlock() +} + +func (el *eventLog) ref() { + atomic.AddInt32(&el.refs, 1) +} + +func (el *eventLog) unref() { + if atomic.AddInt32(&el.refs, -1) == 0 { + freeEventLog(el) + } +} + +func (el *eventLog) When() string { + return el.Start.Format("2006/01/02 15:04:05.000000") +} + +func (el *eventLog) ElapsedTime() string { + elapsed := time.Since(el.Start) + return fmt.Sprintf("%.6f", elapsed.Seconds()) +} + +func (el *eventLog) Stack() string { + buf := new(bytes.Buffer) + tw := tabwriter.NewWriter(buf, 1, 8, 1, '\t', 0) + printStackRecord(tw, el.stack) + tw.Flush() + return buf.String() +} + +// printStackRecord prints the function + source line information +// for a single stack trace. +// Adapted from runtime/pprof/pprof.go. +func printStackRecord(w io.Writer, stk []uintptr) { + for _, pc := range stk { + f := runtime.FuncForPC(pc) + if f == nil { + continue + } + file, line := f.FileLine(pc) + name := f.Name() + // Hide runtime.goexit and any runtime functions at the beginning. + if strings.HasPrefix(name, "runtime.") { + continue + } + fmt.Fprintf(w, "# %s\t%s:%d\n", name, file, line) + } +} + +func (el *eventLog) Events() []logEntry { + el.mu.RLock() + defer el.mu.RUnlock() + return el.events +} + +// freeEventLogs is a freelist of *eventLog +var freeEventLogs = make(chan *eventLog, 1000) + +// newEventLog returns a event log ready to use. +func newEventLog() *eventLog { + select { + case el := <-freeEventLogs: + return el + default: + return new(eventLog) + } +} + +// freeEventLog adds el to freeEventLogs if there's room. +// This is non-blocking. +func freeEventLog(el *eventLog) { + el.reset() + select { + case freeEventLogs <- el: + default: + } +} + +var eventsTmplCache *template.Template +var eventsTmplOnce sync.Once + +func eventsTmpl() *template.Template { + eventsTmplOnce.Do(func() { + eventsTmplCache = template.Must(template.New("events").Funcs(template.FuncMap{ + "elapsed": elapsed, + "trimSpace": strings.TrimSpace, + }).Parse(eventsHTML)) + }) + return eventsTmplCache +} + +const eventsHTML = ` + + + events + + + + +

/debug/events

+ + + {{range $i, $fam := .Families}} + + + + {{range $j, $bucket := $.Buckets}} + {{$n := index $.Counts $i $j}} + + {{end}} + + {{end}} +
{{$fam}} + {{if $n}}{{end}} + [{{$n}} {{$bucket.String}}] + {{if $n}}{{end}} +
+ +{{if $.EventLogs}} +
+

Family: {{$.Family}}

+ +{{if $.Expanded}}{{end}} +[Summary]{{if $.Expanded}}{{end}} + +{{if not $.Expanded}}{{end}} +[Expanded]{{if not $.Expanded}}{{end}} + + + + {{range $el := $.EventLogs}} + + + + + {{if $.Expanded}} + + + + + + {{range $el.Events}} + + + + + + {{end}} + {{end}} + {{end}} +
WhenElapsed
{{$el.When}}{{$el.ElapsedTime}}{{$el.Title}} +
{{$el.Stack|trimSpace}}
{{.WhenString}}{{elapsed .Elapsed}}.{{if .IsErr}}E{{else}}.{{end}}. {{.What}}
+{{end}} + + +` diff --git a/vendor/golang.org/x/net/trace/histogram.go b/vendor/golang.org/x/net/trace/histogram.go new file mode 100644 index 000000000..9bf4286c7 --- /dev/null +++ b/vendor/golang.org/x/net/trace/histogram.go @@ -0,0 +1,365 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package trace + +// This file implements histogramming for RPC statistics collection. + +import ( + "bytes" + "fmt" + "html/template" + "log" + "math" + "sync" + + "golang.org/x/net/internal/timeseries" +) + +const ( + bucketCount = 38 +) + +// histogram keeps counts of values in buckets that are spaced +// out in powers of 2: 0-1, 2-3, 4-7... +// histogram implements timeseries.Observable +type histogram struct { + sum int64 // running total of measurements + sumOfSquares float64 // square of running total + buckets []int64 // bucketed values for histogram + value int // holds a single value as an optimization + valueCount int64 // number of values recorded for single value +} + +// AddMeasurement records a value measurement observation to the histogram. +func (h *histogram) addMeasurement(value int64) { + // TODO: assert invariant + h.sum += value + h.sumOfSquares += float64(value) * float64(value) + + bucketIndex := getBucket(value) + + if h.valueCount == 0 || (h.valueCount > 0 && h.value == bucketIndex) { + h.value = bucketIndex + h.valueCount++ + } else { + h.allocateBuckets() + h.buckets[bucketIndex]++ + } +} + +func (h *histogram) allocateBuckets() { + if h.buckets == nil { + h.buckets = make([]int64, bucketCount) + h.buckets[h.value] = h.valueCount + h.value = 0 + h.valueCount = -1 + } +} + +func log2(i int64) int { + n := 0 + for ; i >= 0x100; i >>= 8 { + n += 8 + } + for ; i > 0; i >>= 1 { + n += 1 + } + return n +} + +func getBucket(i int64) (index int) { + index = log2(i) - 1 + if index < 0 { + index = 0 + } + if index >= bucketCount { + index = bucketCount - 1 + } + return +} + +// Total returns the number of recorded observations. +func (h *histogram) total() (total int64) { + if h.valueCount >= 0 { + total = h.valueCount + } + for _, val := range h.buckets { + total += int64(val) + } + return +} + +// Average returns the average value of recorded observations. +func (h *histogram) average() float64 { + t := h.total() + if t == 0 { + return 0 + } + return float64(h.sum) / float64(t) +} + +// Variance returns the variance of recorded observations. +func (h *histogram) variance() float64 { + t := float64(h.total()) + if t == 0 { + return 0 + } + s := float64(h.sum) / t + return h.sumOfSquares/t - s*s +} + +// StandardDeviation returns the standard deviation of recorded observations. +func (h *histogram) standardDeviation() float64 { + return math.Sqrt(h.variance()) +} + +// PercentileBoundary estimates the value that the given fraction of recorded +// observations are less than. +func (h *histogram) percentileBoundary(percentile float64) int64 { + total := h.total() + + // Corner cases (make sure result is strictly less than Total()) + if total == 0 { + return 0 + } else if total == 1 { + return int64(h.average()) + } + + percentOfTotal := round(float64(total) * percentile) + var runningTotal int64 + + for i := range h.buckets { + value := h.buckets[i] + runningTotal += value + if runningTotal == percentOfTotal { + // We hit an exact bucket boundary. If the next bucket has data, it is a + // good estimate of the value. If the bucket is empty, we interpolate the + // midpoint between the next bucket's boundary and the next non-zero + // bucket. If the remaining buckets are all empty, then we use the + // boundary for the next bucket as the estimate. + j := uint8(i + 1) + min := bucketBoundary(j) + if runningTotal < total { + for h.buckets[j] == 0 { + j++ + } + } + max := bucketBoundary(j) + return min + round(float64(max-min)/2) + } else if runningTotal > percentOfTotal { + // The value is in this bucket. Interpolate the value. + delta := runningTotal - percentOfTotal + percentBucket := float64(value-delta) / float64(value) + bucketMin := bucketBoundary(uint8(i)) + nextBucketMin := bucketBoundary(uint8(i + 1)) + bucketSize := nextBucketMin - bucketMin + return bucketMin + round(percentBucket*float64(bucketSize)) + } + } + return bucketBoundary(bucketCount - 1) +} + +// Median returns the estimated median of the observed values. +func (h *histogram) median() int64 { + return h.percentileBoundary(0.5) +} + +// Add adds other to h. +func (h *histogram) Add(other timeseries.Observable) { + o := other.(*histogram) + if o.valueCount == 0 { + // Other histogram is empty + } else if h.valueCount >= 0 && o.valueCount > 0 && h.value == o.value { + // Both have a single bucketed value, aggregate them + h.valueCount += o.valueCount + } else { + // Two different values necessitate buckets in this histogram + h.allocateBuckets() + if o.valueCount >= 0 { + h.buckets[o.value] += o.valueCount + } else { + for i := range h.buckets { + h.buckets[i] += o.buckets[i] + } + } + } + h.sumOfSquares += o.sumOfSquares + h.sum += o.sum +} + +// Clear resets the histogram to an empty state, removing all observed values. +func (h *histogram) Clear() { + h.buckets = nil + h.value = 0 + h.valueCount = 0 + h.sum = 0 + h.sumOfSquares = 0 +} + +// CopyFrom copies from other, which must be a *histogram, into h. +func (h *histogram) CopyFrom(other timeseries.Observable) { + o := other.(*histogram) + if o.valueCount == -1 { + h.allocateBuckets() + copy(h.buckets, o.buckets) + } + h.sum = o.sum + h.sumOfSquares = o.sumOfSquares + h.value = o.value + h.valueCount = o.valueCount +} + +// Multiply scales the histogram by the specified ratio. +func (h *histogram) Multiply(ratio float64) { + if h.valueCount == -1 { + for i := range h.buckets { + h.buckets[i] = int64(float64(h.buckets[i]) * ratio) + } + } else { + h.valueCount = int64(float64(h.valueCount) * ratio) + } + h.sum = int64(float64(h.sum) * ratio) + h.sumOfSquares = h.sumOfSquares * ratio +} + +// New creates a new histogram. +func (h *histogram) New() timeseries.Observable { + r := new(histogram) + r.Clear() + return r +} + +func (h *histogram) String() string { + return fmt.Sprintf("%d, %f, %d, %d, %v", + h.sum, h.sumOfSquares, h.value, h.valueCount, h.buckets) +} + +// round returns the closest int64 to the argument +func round(in float64) int64 { + return int64(math.Floor(in + 0.5)) +} + +// bucketBoundary returns the first value in the bucket. +func bucketBoundary(bucket uint8) int64 { + if bucket == 0 { + return 0 + } + return 1 << bucket +} + +// bucketData holds data about a specific bucket for use in distTmpl. +type bucketData struct { + Lower, Upper int64 + N int64 + Pct, CumulativePct float64 + GraphWidth int +} + +// data holds data about a Distribution for use in distTmpl. +type data struct { + Buckets []*bucketData + Count, Median int64 + Mean, StandardDeviation float64 +} + +// maxHTMLBarWidth is the maximum width of the HTML bar for visualizing buckets. +const maxHTMLBarWidth = 350.0 + +// newData returns data representing h for use in distTmpl. +func (h *histogram) newData() *data { + // Force the allocation of buckets to simplify the rendering implementation + h.allocateBuckets() + // We scale the bars on the right so that the largest bar is + // maxHTMLBarWidth pixels in width. + maxBucket := int64(0) + for _, n := range h.buckets { + if n > maxBucket { + maxBucket = n + } + } + total := h.total() + barsizeMult := maxHTMLBarWidth / float64(maxBucket) + var pctMult float64 + if total == 0 { + pctMult = 1.0 + } else { + pctMult = 100.0 / float64(total) + } + + buckets := make([]*bucketData, len(h.buckets)) + runningTotal := int64(0) + for i, n := range h.buckets { + if n == 0 { + continue + } + runningTotal += n + var upperBound int64 + if i < bucketCount-1 { + upperBound = bucketBoundary(uint8(i + 1)) + } else { + upperBound = math.MaxInt64 + } + buckets[i] = &bucketData{ + Lower: bucketBoundary(uint8(i)), + Upper: upperBound, + N: n, + Pct: float64(n) * pctMult, + CumulativePct: float64(runningTotal) * pctMult, + GraphWidth: int(float64(n) * barsizeMult), + } + } + return &data{ + Buckets: buckets, + Count: total, + Median: h.median(), + Mean: h.average(), + StandardDeviation: h.standardDeviation(), + } +} + +func (h *histogram) html() template.HTML { + buf := new(bytes.Buffer) + if err := distTmpl().Execute(buf, h.newData()); err != nil { + buf.Reset() + log.Printf("net/trace: couldn't execute template: %v", err) + } + return template.HTML(buf.String()) +} + +var distTmplCache *template.Template +var distTmplOnce sync.Once + +func distTmpl() *template.Template { + distTmplOnce.Do(func() { + // Input: data + distTmplCache = template.Must(template.New("distTmpl").Parse(` + + + + + + + +
Count: {{.Count}}Mean: {{printf "%.0f" .Mean}}StdDev: {{printf "%.0f" .StandardDeviation}}Median: {{.Median}}
+
+ +{{range $b := .Buckets}} +{{if $b}} + + + + + + + + + +{{end}} +{{end}} +
[{{.Lower}},{{.Upper}}){{.N}}{{printf "%#.3f" .Pct}}%{{printf "%#.3f" .CumulativePct}}%
+`)) + }) + return distTmplCache +} diff --git a/vendor/golang.org/x/net/trace/trace.go b/vendor/golang.org/x/net/trace/trace.go new file mode 100644 index 000000000..3ebf6f2da --- /dev/null +++ b/vendor/golang.org/x/net/trace/trace.go @@ -0,0 +1,1130 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +/* +Package trace implements tracing of requests and long-lived objects. +It exports HTTP interfaces on /debug/requests and /debug/events. + +A trace.Trace provides tracing for short-lived objects, usually requests. +A request handler might be implemented like this: + + func fooHandler(w http.ResponseWriter, req *http.Request) { + tr := trace.New("mypkg.Foo", req.URL.Path) + defer tr.Finish() + ... + tr.LazyPrintf("some event %q happened", str) + ... + if err := somethingImportant(); err != nil { + tr.LazyPrintf("somethingImportant failed: %v", err) + tr.SetError() + } + } + +The /debug/requests HTTP endpoint organizes the traces by family, +errors, and duration. It also provides histogram of request duration +for each family. + +A trace.EventLog provides tracing for long-lived objects, such as RPC +connections. + + // A Fetcher fetches URL paths for a single domain. + type Fetcher struct { + domain string + events trace.EventLog + } + + func NewFetcher(domain string) *Fetcher { + return &Fetcher{ + domain, + trace.NewEventLog("mypkg.Fetcher", domain), + } + } + + func (f *Fetcher) Fetch(path string) (string, error) { + resp, err := http.Get("http://" + f.domain + "/" + path) + if err != nil { + f.events.Errorf("Get(%q) = %v", path, err) + return "", err + } + f.events.Printf("Get(%q) = %s", path, resp.Status) + ... + } + + func (f *Fetcher) Close() error { + f.events.Finish() + return nil + } + +The /debug/events HTTP endpoint organizes the event logs by family and +by time since the last error. The expanded view displays recent log +entries and the log's call stack. +*/ +package trace // import "golang.org/x/net/trace" + +import ( + "bytes" + "context" + "fmt" + "html/template" + "io" + "log" + "net" + "net/http" + "net/url" + "runtime" + "sort" + "strconv" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/internal/timeseries" +) + +// DebugUseAfterFinish controls whether to debug uses of Trace values after finishing. +// FOR DEBUGGING ONLY. This will slow down the program. +var DebugUseAfterFinish = false + +// HTTP ServeMux paths. +const ( + debugRequestsPath = "/debug/requests" + debugEventsPath = "/debug/events" +) + +// AuthRequest determines whether a specific request is permitted to load the +// /debug/requests or /debug/events pages. +// +// It returns two bools; the first indicates whether the page may be viewed at all, +// and the second indicates whether sensitive events will be shown. +// +// AuthRequest may be replaced by a program to customize its authorization requirements. +// +// The default AuthRequest function returns (true, true) if and only if the request +// comes from localhost/127.0.0.1/[::1]. +var AuthRequest = func(req *http.Request) (any, sensitive bool) { + // RemoteAddr is commonly in the form "IP" or "IP:port". + // If it is in the form "IP:port", split off the port. + host, _, err := net.SplitHostPort(req.RemoteAddr) + if err != nil { + host = req.RemoteAddr + } + switch host { + case "localhost", "127.0.0.1", "::1": + return true, true + default: + return false, false + } +} + +func init() { + _, pat := http.DefaultServeMux.Handler(&http.Request{URL: &url.URL{Path: debugRequestsPath}}) + if pat == debugRequestsPath { + panic("/debug/requests is already registered. You may have two independent copies of " + + "golang.org/x/net/trace in your binary, trying to maintain separate state. This may " + + "involve a vendored copy of golang.org/x/net/trace.") + } + + // TODO(jbd): Serve Traces from /debug/traces in the future? + // There is no requirement for a request to be present to have traces. + http.HandleFunc(debugRequestsPath, Traces) + http.HandleFunc(debugEventsPath, Events) +} + +// NewContext returns a copy of the parent context +// and associates it with a Trace. +func NewContext(ctx context.Context, tr Trace) context.Context { + return context.WithValue(ctx, contextKey, tr) +} + +// FromContext returns the Trace bound to the context, if any. +func FromContext(ctx context.Context) (tr Trace, ok bool) { + tr, ok = ctx.Value(contextKey).(Trace) + return +} + +// Traces responds with traces from the program. +// The package initialization registers it in http.DefaultServeMux +// at /debug/requests. +// +// It performs authorization by running AuthRequest. +func Traces(w http.ResponseWriter, req *http.Request) { + any, sensitive := AuthRequest(req) + if !any { + http.Error(w, "not allowed", http.StatusUnauthorized) + return + } + w.Header().Set("Content-Type", "text/html; charset=utf-8") + Render(w, req, sensitive) +} + +// Events responds with a page of events collected by EventLogs. +// The package initialization registers it in http.DefaultServeMux +// at /debug/events. +// +// It performs authorization by running AuthRequest. +func Events(w http.ResponseWriter, req *http.Request) { + any, sensitive := AuthRequest(req) + if !any { + http.Error(w, "not allowed", http.StatusUnauthorized) + return + } + w.Header().Set("Content-Type", "text/html; charset=utf-8") + RenderEvents(w, req, sensitive) +} + +// Render renders the HTML page typically served at /debug/requests. +// It does not do any auth checking. The request may be nil. +// +// Most users will use the Traces handler. +func Render(w io.Writer, req *http.Request, sensitive bool) { + data := &struct { + Families []string + ActiveTraceCount map[string]int + CompletedTraces map[string]*family + + // Set when a bucket has been selected. + Traces traceList + Family string + Bucket int + Expanded bool + Traced bool + Active bool + ShowSensitive bool // whether to show sensitive events + + Histogram template.HTML + HistogramWindow string // e.g. "last minute", "last hour", "all time" + + // If non-zero, the set of traces is a partial set, + // and this is the total number. + Total int + }{ + CompletedTraces: completedTraces, + } + + data.ShowSensitive = sensitive + if req != nil { + // Allow show_sensitive=0 to force hiding of sensitive data for testing. + // This only goes one way; you can't use show_sensitive=1 to see things. + if req.FormValue("show_sensitive") == "0" { + data.ShowSensitive = false + } + + if exp, err := strconv.ParseBool(req.FormValue("exp")); err == nil { + data.Expanded = exp + } + if exp, err := strconv.ParseBool(req.FormValue("rtraced")); err == nil { + data.Traced = exp + } + } + + completedMu.RLock() + data.Families = make([]string, 0, len(completedTraces)) + for fam := range completedTraces { + data.Families = append(data.Families, fam) + } + completedMu.RUnlock() + sort.Strings(data.Families) + + // We are careful here to minimize the time spent locking activeMu, + // since that lock is required every time an RPC starts and finishes. + data.ActiveTraceCount = make(map[string]int, len(data.Families)) + activeMu.RLock() + for fam, s := range activeTraces { + data.ActiveTraceCount[fam] = s.Len() + } + activeMu.RUnlock() + + var ok bool + data.Family, data.Bucket, ok = parseArgs(req) + switch { + case !ok: + // No-op + case data.Bucket == -1: + data.Active = true + n := data.ActiveTraceCount[data.Family] + data.Traces = getActiveTraces(data.Family) + if len(data.Traces) < n { + data.Total = n + } + case data.Bucket < bucketsPerFamily: + if b := lookupBucket(data.Family, data.Bucket); b != nil { + data.Traces = b.Copy(data.Traced) + } + default: + if f := getFamily(data.Family, false); f != nil { + var obs timeseries.Observable + f.LatencyMu.RLock() + switch o := data.Bucket - bucketsPerFamily; o { + case 0: + obs = f.Latency.Minute() + data.HistogramWindow = "last minute" + case 1: + obs = f.Latency.Hour() + data.HistogramWindow = "last hour" + case 2: + obs = f.Latency.Total() + data.HistogramWindow = "all time" + } + f.LatencyMu.RUnlock() + if obs != nil { + data.Histogram = obs.(*histogram).html() + } + } + } + + if data.Traces != nil { + defer data.Traces.Free() + sort.Sort(data.Traces) + } + + completedMu.RLock() + defer completedMu.RUnlock() + if err := pageTmpl().ExecuteTemplate(w, "Page", data); err != nil { + log.Printf("net/trace: Failed executing template: %v", err) + } +} + +func parseArgs(req *http.Request) (fam string, b int, ok bool) { + if req == nil { + return "", 0, false + } + fam, bStr := req.FormValue("fam"), req.FormValue("b") + if fam == "" || bStr == "" { + return "", 0, false + } + b, err := strconv.Atoi(bStr) + if err != nil || b < -1 { + return "", 0, false + } + + return fam, b, true +} + +func lookupBucket(fam string, b int) *traceBucket { + f := getFamily(fam, false) + if f == nil || b < 0 || b >= len(f.Buckets) { + return nil + } + return f.Buckets[b] +} + +type contextKeyT string + +var contextKey = contextKeyT("golang.org/x/net/trace.Trace") + +// Trace represents an active request. +type Trace interface { + // LazyLog adds x to the event log. It will be evaluated each time the + // /debug/requests page is rendered. Any memory referenced by x will be + // pinned until the trace is finished and later discarded. + LazyLog(x fmt.Stringer, sensitive bool) + + // LazyPrintf evaluates its arguments with fmt.Sprintf each time the + // /debug/requests page is rendered. Any memory referenced by a will be + // pinned until the trace is finished and later discarded. + LazyPrintf(format string, a ...interface{}) + + // SetError declares that this trace resulted in an error. + SetError() + + // SetRecycler sets a recycler for the trace. + // f will be called for each event passed to LazyLog at a time when + // it is no longer required, whether while the trace is still active + // and the event is discarded, or when a completed trace is discarded. + SetRecycler(f func(interface{})) + + // SetTraceInfo sets the trace info for the trace. + // This is currently unused. + SetTraceInfo(traceID, spanID uint64) + + // SetMaxEvents sets the maximum number of events that will be stored + // in the trace. This has no effect if any events have already been + // added to the trace. + SetMaxEvents(m int) + + // Finish declares that this trace is complete. + // The trace should not be used after calling this method. + Finish() +} + +type lazySprintf struct { + format string + a []interface{} +} + +func (l *lazySprintf) String() string { + return fmt.Sprintf(l.format, l.a...) +} + +// New returns a new Trace with the specified family and title. +func New(family, title string) Trace { + tr := newTrace() + tr.ref() + tr.Family, tr.Title = family, title + tr.Start = time.Now() + tr.maxEvents = maxEventsPerTrace + tr.events = tr.eventsBuf[:0] + + activeMu.RLock() + s := activeTraces[tr.Family] + activeMu.RUnlock() + if s == nil { + activeMu.Lock() + s = activeTraces[tr.Family] // check again + if s == nil { + s = new(traceSet) + activeTraces[tr.Family] = s + } + activeMu.Unlock() + } + s.Add(tr) + + // Trigger allocation of the completed trace structure for this family. + // This will cause the family to be present in the request page during + // the first trace of this family. We don't care about the return value, + // nor is there any need for this to run inline, so we execute it in its + // own goroutine, but only if the family isn't allocated yet. + completedMu.RLock() + if _, ok := completedTraces[tr.Family]; !ok { + go allocFamily(tr.Family) + } + completedMu.RUnlock() + + return tr +} + +func (tr *trace) Finish() { + elapsed := time.Now().Sub(tr.Start) + tr.mu.Lock() + tr.Elapsed = elapsed + tr.mu.Unlock() + + if DebugUseAfterFinish { + buf := make([]byte, 4<<10) // 4 KB should be enough + n := runtime.Stack(buf, false) + tr.finishStack = buf[:n] + } + + activeMu.RLock() + m := activeTraces[tr.Family] + activeMu.RUnlock() + m.Remove(tr) + + f := getFamily(tr.Family, true) + tr.mu.RLock() // protects tr fields in Cond.match calls + for _, b := range f.Buckets { + if b.Cond.match(tr) { + b.Add(tr) + } + } + tr.mu.RUnlock() + + // Add a sample of elapsed time as microseconds to the family's timeseries + h := new(histogram) + h.addMeasurement(elapsed.Nanoseconds() / 1e3) + f.LatencyMu.Lock() + f.Latency.Add(h) + f.LatencyMu.Unlock() + + tr.unref() // matches ref in New +} + +const ( + bucketsPerFamily = 9 + tracesPerBucket = 10 + maxActiveTraces = 20 // Maximum number of active traces to show. + maxEventsPerTrace = 10 + numHistogramBuckets = 38 +) + +var ( + // The active traces. + activeMu sync.RWMutex + activeTraces = make(map[string]*traceSet) // family -> traces + + // Families of completed traces. + completedMu sync.RWMutex + completedTraces = make(map[string]*family) // family -> traces +) + +type traceSet struct { + mu sync.RWMutex + m map[*trace]bool + + // We could avoid the entire map scan in FirstN by having a slice of all the traces + // ordered by start time, and an index into that from the trace struct, with a periodic + // repack of the slice after enough traces finish; we could also use a skip list or similar. + // However, that would shift some of the expense from /debug/requests time to RPC time, + // which is probably the wrong trade-off. +} + +func (ts *traceSet) Len() int { + ts.mu.RLock() + defer ts.mu.RUnlock() + return len(ts.m) +} + +func (ts *traceSet) Add(tr *trace) { + ts.mu.Lock() + if ts.m == nil { + ts.m = make(map[*trace]bool) + } + ts.m[tr] = true + ts.mu.Unlock() +} + +func (ts *traceSet) Remove(tr *trace) { + ts.mu.Lock() + delete(ts.m, tr) + ts.mu.Unlock() +} + +// FirstN returns the first n traces ordered by time. +func (ts *traceSet) FirstN(n int) traceList { + ts.mu.RLock() + defer ts.mu.RUnlock() + + if n > len(ts.m) { + n = len(ts.m) + } + trl := make(traceList, 0, n) + + // Fast path for when no selectivity is needed. + if n == len(ts.m) { + for tr := range ts.m { + tr.ref() + trl = append(trl, tr) + } + sort.Sort(trl) + return trl + } + + // Pick the oldest n traces. + // This is inefficient. See the comment in the traceSet struct. + for tr := range ts.m { + // Put the first n traces into trl in the order they occur. + // When we have n, sort trl, and thereafter maintain its order. + if len(trl) < n { + tr.ref() + trl = append(trl, tr) + if len(trl) == n { + // This is guaranteed to happen exactly once during this loop. + sort.Sort(trl) + } + continue + } + if tr.Start.After(trl[n-1].Start) { + continue + } + + // Find where to insert this one. + tr.ref() + i := sort.Search(n, func(i int) bool { return trl[i].Start.After(tr.Start) }) + trl[n-1].unref() + copy(trl[i+1:], trl[i:]) + trl[i] = tr + } + + return trl +} + +func getActiveTraces(fam string) traceList { + activeMu.RLock() + s := activeTraces[fam] + activeMu.RUnlock() + if s == nil { + return nil + } + return s.FirstN(maxActiveTraces) +} + +func getFamily(fam string, allocNew bool) *family { + completedMu.RLock() + f := completedTraces[fam] + completedMu.RUnlock() + if f == nil && allocNew { + f = allocFamily(fam) + } + return f +} + +func allocFamily(fam string) *family { + completedMu.Lock() + defer completedMu.Unlock() + f := completedTraces[fam] + if f == nil { + f = newFamily() + completedTraces[fam] = f + } + return f +} + +// family represents a set of trace buckets and associated latency information. +type family struct { + // traces may occur in multiple buckets. + Buckets [bucketsPerFamily]*traceBucket + + // latency time series + LatencyMu sync.RWMutex + Latency *timeseries.MinuteHourSeries +} + +func newFamily() *family { + return &family{ + Buckets: [bucketsPerFamily]*traceBucket{ + {Cond: minCond(0)}, + {Cond: minCond(50 * time.Millisecond)}, + {Cond: minCond(100 * time.Millisecond)}, + {Cond: minCond(200 * time.Millisecond)}, + {Cond: minCond(500 * time.Millisecond)}, + {Cond: minCond(1 * time.Second)}, + {Cond: minCond(10 * time.Second)}, + {Cond: minCond(100 * time.Second)}, + {Cond: errorCond{}}, + }, + Latency: timeseries.NewMinuteHourSeries(func() timeseries.Observable { return new(histogram) }), + } +} + +// traceBucket represents a size-capped bucket of historic traces, +// along with a condition for a trace to belong to the bucket. +type traceBucket struct { + Cond cond + + // Ring buffer implementation of a fixed-size FIFO queue. + mu sync.RWMutex + buf [tracesPerBucket]*trace + start int // < tracesPerBucket + length int // <= tracesPerBucket +} + +func (b *traceBucket) Add(tr *trace) { + b.mu.Lock() + defer b.mu.Unlock() + + i := b.start + b.length + if i >= tracesPerBucket { + i -= tracesPerBucket + } + if b.length == tracesPerBucket { + // "Remove" an element from the bucket. + b.buf[i].unref() + b.start++ + if b.start == tracesPerBucket { + b.start = 0 + } + } + b.buf[i] = tr + if b.length < tracesPerBucket { + b.length++ + } + tr.ref() +} + +// Copy returns a copy of the traces in the bucket. +// If tracedOnly is true, only the traces with trace information will be returned. +// The logs will be ref'd before returning; the caller should call +// the Free method when it is done with them. +// TODO(dsymonds): keep track of traced requests in separate buckets. +func (b *traceBucket) Copy(tracedOnly bool) traceList { + b.mu.RLock() + defer b.mu.RUnlock() + + trl := make(traceList, 0, b.length) + for i, x := 0, b.start; i < b.length; i++ { + tr := b.buf[x] + if !tracedOnly || tr.spanID != 0 { + tr.ref() + trl = append(trl, tr) + } + x++ + if x == b.length { + x = 0 + } + } + return trl +} + +func (b *traceBucket) Empty() bool { + b.mu.RLock() + defer b.mu.RUnlock() + return b.length == 0 +} + +// cond represents a condition on a trace. +type cond interface { + match(t *trace) bool + String() string +} + +type minCond time.Duration + +func (m minCond) match(t *trace) bool { return t.Elapsed >= time.Duration(m) } +func (m minCond) String() string { return fmt.Sprintf("≥%gs", time.Duration(m).Seconds()) } + +type errorCond struct{} + +func (e errorCond) match(t *trace) bool { return t.IsError } +func (e errorCond) String() string { return "errors" } + +type traceList []*trace + +// Free calls unref on each element of the list. +func (trl traceList) Free() { + for _, t := range trl { + t.unref() + } +} + +// traceList may be sorted in reverse chronological order. +func (trl traceList) Len() int { return len(trl) } +func (trl traceList) Less(i, j int) bool { return trl[i].Start.After(trl[j].Start) } +func (trl traceList) Swap(i, j int) { trl[i], trl[j] = trl[j], trl[i] } + +// An event is a timestamped log entry in a trace. +type event struct { + When time.Time + Elapsed time.Duration // since previous event in trace + NewDay bool // whether this event is on a different day to the previous event + Recyclable bool // whether this event was passed via LazyLog + Sensitive bool // whether this event contains sensitive information + What interface{} // string or fmt.Stringer +} + +// WhenString returns a string representation of the elapsed time of the event. +// It will include the date if midnight was crossed. +func (e event) WhenString() string { + if e.NewDay { + return e.When.Format("2006/01/02 15:04:05.000000") + } + return e.When.Format("15:04:05.000000") +} + +// discarded represents a number of discarded events. +// It is stored as *discarded to make it easier to update in-place. +type discarded int + +func (d *discarded) String() string { + return fmt.Sprintf("(%d events discarded)", int(*d)) +} + +// trace represents an active or complete request, +// either sent or received by this program. +type trace struct { + // Family is the top-level grouping of traces to which this belongs. + Family string + + // Title is the title of this trace. + Title string + + // Start time of the this trace. + Start time.Time + + mu sync.RWMutex + events []event // Append-only sequence of events (modulo discards). + maxEvents int + recycler func(interface{}) + IsError bool // Whether this trace resulted in an error. + Elapsed time.Duration // Elapsed time for this trace, zero while active. + traceID uint64 // Trace information if non-zero. + spanID uint64 + + refs int32 // how many buckets this is in + disc discarded // scratch space to avoid allocation + + finishStack []byte // where finish was called, if DebugUseAfterFinish is set + + eventsBuf [4]event // preallocated buffer in case we only log a few events +} + +func (tr *trace) reset() { + // Clear all but the mutex. Mutexes may not be copied, even when unlocked. + tr.Family = "" + tr.Title = "" + tr.Start = time.Time{} + + tr.mu.Lock() + tr.Elapsed = 0 + tr.traceID = 0 + tr.spanID = 0 + tr.IsError = false + tr.maxEvents = 0 + tr.events = nil + tr.recycler = nil + tr.mu.Unlock() + + tr.refs = 0 + tr.disc = 0 + tr.finishStack = nil + for i := range tr.eventsBuf { + tr.eventsBuf[i] = event{} + } +} + +// delta returns the elapsed time since the last event or the trace start, +// and whether it spans midnight. +// L >= tr.mu +func (tr *trace) delta(t time.Time) (time.Duration, bool) { + if len(tr.events) == 0 { + return t.Sub(tr.Start), false + } + prev := tr.events[len(tr.events)-1].When + return t.Sub(prev), prev.Day() != t.Day() +} + +func (tr *trace) addEvent(x interface{}, recyclable, sensitive bool) { + if DebugUseAfterFinish && tr.finishStack != nil { + buf := make([]byte, 4<<10) // 4 KB should be enough + n := runtime.Stack(buf, false) + log.Printf("net/trace: trace used after finish:\nFinished at:\n%s\nUsed at:\n%s", tr.finishStack, buf[:n]) + } + + /* + NOTE TO DEBUGGERS + + If you are here because your program panicked in this code, + it is almost definitely the fault of code using this package, + and very unlikely to be the fault of this code. + + The most likely scenario is that some code elsewhere is using + a trace.Trace after its Finish method is called. + You can temporarily set the DebugUseAfterFinish var + to help discover where that is; do not leave that var set, + since it makes this package much less efficient. + */ + + e := event{When: time.Now(), What: x, Recyclable: recyclable, Sensitive: sensitive} + tr.mu.Lock() + e.Elapsed, e.NewDay = tr.delta(e.When) + if len(tr.events) < tr.maxEvents { + tr.events = append(tr.events, e) + } else { + // Discard the middle events. + di := int((tr.maxEvents - 1) / 2) + if d, ok := tr.events[di].What.(*discarded); ok { + (*d)++ + } else { + // disc starts at two to count for the event it is replacing, + // plus the next one that we are about to drop. + tr.disc = 2 + if tr.recycler != nil && tr.events[di].Recyclable { + go tr.recycler(tr.events[di].What) + } + tr.events[di].What = &tr.disc + } + // The timestamp of the discarded meta-event should be + // the time of the last event it is representing. + tr.events[di].When = tr.events[di+1].When + + if tr.recycler != nil && tr.events[di+1].Recyclable { + go tr.recycler(tr.events[di+1].What) + } + copy(tr.events[di+1:], tr.events[di+2:]) + tr.events[tr.maxEvents-1] = e + } + tr.mu.Unlock() +} + +func (tr *trace) LazyLog(x fmt.Stringer, sensitive bool) { + tr.addEvent(x, true, sensitive) +} + +func (tr *trace) LazyPrintf(format string, a ...interface{}) { + tr.addEvent(&lazySprintf{format, a}, false, false) +} + +func (tr *trace) SetError() { + tr.mu.Lock() + tr.IsError = true + tr.mu.Unlock() +} + +func (tr *trace) SetRecycler(f func(interface{})) { + tr.mu.Lock() + tr.recycler = f + tr.mu.Unlock() +} + +func (tr *trace) SetTraceInfo(traceID, spanID uint64) { + tr.mu.Lock() + tr.traceID, tr.spanID = traceID, spanID + tr.mu.Unlock() +} + +func (tr *trace) SetMaxEvents(m int) { + tr.mu.Lock() + // Always keep at least three events: first, discarded count, last. + if len(tr.events) == 0 && m > 3 { + tr.maxEvents = m + } + tr.mu.Unlock() +} + +func (tr *trace) ref() { + atomic.AddInt32(&tr.refs, 1) +} + +func (tr *trace) unref() { + if atomic.AddInt32(&tr.refs, -1) == 0 { + tr.mu.RLock() + if tr.recycler != nil { + // freeTrace clears tr, so we hold tr.recycler and tr.events here. + go func(f func(interface{}), es []event) { + for _, e := range es { + if e.Recyclable { + f(e.What) + } + } + }(tr.recycler, tr.events) + } + tr.mu.RUnlock() + + freeTrace(tr) + } +} + +func (tr *trace) When() string { + return tr.Start.Format("2006/01/02 15:04:05.000000") +} + +func (tr *trace) ElapsedTime() string { + tr.mu.RLock() + t := tr.Elapsed + tr.mu.RUnlock() + + if t == 0 { + // Active trace. + t = time.Since(tr.Start) + } + return fmt.Sprintf("%.6f", t.Seconds()) +} + +func (tr *trace) Events() []event { + tr.mu.RLock() + defer tr.mu.RUnlock() + return tr.events +} + +var traceFreeList = make(chan *trace, 1000) // TODO(dsymonds): Use sync.Pool? + +// newTrace returns a trace ready to use. +func newTrace() *trace { + select { + case tr := <-traceFreeList: + return tr + default: + return new(trace) + } +} + +// freeTrace adds tr to traceFreeList if there's room. +// This is non-blocking. +func freeTrace(tr *trace) { + if DebugUseAfterFinish { + return // never reuse + } + tr.reset() + select { + case traceFreeList <- tr: + default: + } +} + +func elapsed(d time.Duration) string { + b := []byte(fmt.Sprintf("%.6f", d.Seconds())) + + // For subsecond durations, blank all zeros before decimal point, + // and all zeros between the decimal point and the first non-zero digit. + if d < time.Second { + dot := bytes.IndexByte(b, '.') + for i := 0; i < dot; i++ { + b[i] = ' ' + } + for i := dot + 1; i < len(b); i++ { + if b[i] == '0' { + b[i] = ' ' + } else { + break + } + } + } + + return string(b) +} + +var pageTmplCache *template.Template +var pageTmplOnce sync.Once + +func pageTmpl() *template.Template { + pageTmplOnce.Do(func() { + pageTmplCache = template.Must(template.New("Page").Funcs(template.FuncMap{ + "elapsed": elapsed, + "add": func(a, b int) int { return a + b }, + }).Parse(pageHTML)) + }) + return pageTmplCache +} + +const pageHTML = ` +{{template "Prolog" .}} +{{template "StatusTable" .}} +{{template "Epilog" .}} + +{{define "Prolog"}} + + + /debug/requests + + + + +

/debug/requests

+{{end}} {{/* end of Prolog */}} + +{{define "StatusTable"}} + + {{range $fam := .Families}} + + + + {{$n := index $.ActiveTraceCount $fam}} + + + {{$f := index $.CompletedTraces $fam}} + {{range $i, $b := $f.Buckets}} + {{$empty := $b.Empty}} + + {{end}} + + {{$nb := len $f.Buckets}} + + + + + + {{end}} +
{{$fam}} + {{if $n}}{{end}} + [{{$n}} active] + {{if $n}}{{end}} + + {{if not $empty}}{{end}} + [{{.Cond}}] + {{if not $empty}}{{end}} + + [minute] + + [hour] + + [total] +
+{{end}} {{/* end of StatusTable */}} + +{{define "Epilog"}} +{{if $.Traces}} +
+

Family: {{$.Family}}

+ +{{if or $.Expanded $.Traced}} + [Normal/Summary] +{{else}} + [Normal/Summary] +{{end}} + +{{if or (not $.Expanded) $.Traced}} + [Normal/Expanded] +{{else}} + [Normal/Expanded] +{{end}} + +{{if not $.Active}} + {{if or $.Expanded (not $.Traced)}} + [Traced/Summary] + {{else}} + [Traced/Summary] + {{end}} + {{if or (not $.Expanded) (not $.Traced)}} + [Traced/Expanded] + {{else}} + [Traced/Expanded] + {{end}} +{{end}} + +{{if $.Total}} +

Showing {{len $.Traces}} of {{$.Total}} traces.

+{{end}} + + + + + {{range $tr := $.Traces}} + + + + + {{/* TODO: include traceID/spanID */}} + + {{if $.Expanded}} + {{range $tr.Events}} + + + + + + {{end}} + {{end}} + {{end}} +
+ {{if $.Active}}Active{{else}}Completed{{end}} Requests +
WhenElapsed (s)
{{$tr.When}}{{$tr.ElapsedTime}}{{$tr.Title}}
{{.WhenString}}{{elapsed .Elapsed}}{{if or $.ShowSensitive (not .Sensitive)}}... {{.What}}{{else}}[redacted]{{end}}
+{{end}} {{/* if $.Traces */}} + +{{if $.Histogram}} +

Latency (µs) of {{$.Family}} over {{$.HistogramWindow}}

+{{$.Histogram}} +{{end}} {{/* if $.Histogram */}} + + + +{{end}} {{/* end of Epilog */}} +` diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index d46fb8a9c..cab45604c 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -194,6 +194,7 @@ struct ltchars { #include #include #include +#include #include #include #include diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go index 6a15cba61..b31ef0358 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go @@ -10,6 +10,8 @@ import ( "unsafe" ) +const _SYS_GETDIRENTRIES64 = 344 + func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { // To implement this using libSystem we'd need syscall_syscallPtr for // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall @@ -20,7 +22,7 @@ func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { } else { p = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) + r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { return n, errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 0cf31acf0..e2a05eed0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -49,6 +49,11 @@ type SockaddrDatalink struct { raw RawSockaddrDatalink } +// Some external packages rely on SYS___SYSCTL being defined to implement their +// own sysctl wrappers. Provide it here, even though direct syscalls are no +// longer supported on darwin. +const SYS___SYSCTL = 202 + // Translate "kern.hostname" to []_C_int{0,1,2,3}. func nametomib(name string) (mib []_C_int, err error) { const siz = unsafe.Sizeof(mib[0]) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index a274da7a7..388050a0f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -2043,6 +2043,7 @@ const ( SOL_ATM = 0x108 SOL_CAIF = 0x116 SOL_CAN_BASE = 0x64 + SOL_CAN_RAW = 0x65 SOL_DCCP = 0x10d SOL_DECNET = 0x105 SOL_ICMPV6 = 0x3a diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 953166c73..1879d5789 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -2527,3 +2527,12 @@ const ( NHA_GROUPS = 0x9 NHA_MASTER = 0xa ) + +const ( + CAN_RAW_FILTER = 0x1 + CAN_RAW_ERR_FILTER = 0x2 + CAN_RAW_LOOPBACK = 0x3 + CAN_RAW_RECV_OWN_MSGS = 0x4 + CAN_RAW_FD_FRAMES = 0x5 + CAN_RAW_JOIN_FILTERS = 0x6 +) diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 62cf70e9f..2aa29e839 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -303,6 +303,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys ResumeThread(thread Handle) (ret uint32, err error) [failretval==0xffffffff] = kernel32.ResumeThread //sys SetPriorityClass(process Handle, priorityClass uint32) (err error) = kernel32.SetPriorityClass //sys GetPriorityClass(process Handle) (ret uint32, err error) = kernel32.GetPriorityClass +//sys QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) = kernel32.QueryInformationJobObject //sys SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) //sys GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) //sys GetProcessId(process Handle) (id uint32, err error) diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 809fff0b4..da1652e74 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1584,18 +1584,6 @@ const ( JOB_OBJECT_LIMIT_WORKINGSET = 0x00000001 ) -type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { - PerProcessUserTimeLimit int64 - PerJobUserTimeLimit int64 - LimitFlags uint32 - MinimumWorkingSetSize uintptr - MaximumWorkingSetSize uintptr - ActiveProcessLimit uint32 - Affinity uintptr - PriorityClass uint32 - SchedulingClass uint32 -} - type IO_COUNTERS struct { ReadOperationCount uint64 WriteOperationCount uint64 diff --git a/vendor/golang.org/x/sys/windows/types_windows_386.go b/vendor/golang.org/x/sys/windows/types_windows_386.go index fe0ddd031..8bce3e2fc 100644 --- a/vendor/golang.org/x/sys/windows/types_windows_386.go +++ b/vendor/golang.org/x/sys/windows/types_windows_386.go @@ -20,3 +20,16 @@ type Servent struct { Port uint16 Proto *byte } + +type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { + PerProcessUserTimeLimit int64 + PerJobUserTimeLimit int64 + LimitFlags uint32 + MinimumWorkingSetSize uintptr + MaximumWorkingSetSize uintptr + ActiveProcessLimit uint32 + Affinity uintptr + PriorityClass uint32 + SchedulingClass uint32 + _ uint32 // pad to 8 byte boundary +} diff --git a/vendor/golang.org/x/sys/windows/types_windows_amd64.go b/vendor/golang.org/x/sys/windows/types_windows_amd64.go index 7e154c2df..fdddc0c70 100644 --- a/vendor/golang.org/x/sys/windows/types_windows_amd64.go +++ b/vendor/golang.org/x/sys/windows/types_windows_amd64.go @@ -20,3 +20,15 @@ type Servent struct { Proto *byte Port uint16 } + +type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { + PerProcessUserTimeLimit int64 + PerJobUserTimeLimit int64 + LimitFlags uint32 + MinimumWorkingSetSize uintptr + MaximumWorkingSetSize uintptr + ActiveProcessLimit uint32 + Affinity uintptr + PriorityClass uint32 + SchedulingClass uint32 +} diff --git a/vendor/golang.org/x/sys/windows/types_windows_arm.go b/vendor/golang.org/x/sys/windows/types_windows_arm.go index 74571e360..321872c3e 100644 --- a/vendor/golang.org/x/sys/windows/types_windows_arm.go +++ b/vendor/golang.org/x/sys/windows/types_windows_arm.go @@ -20,3 +20,16 @@ type Servent struct { Port uint16 Proto *byte } + +type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { + PerProcessUserTimeLimit int64 + PerJobUserTimeLimit int64 + LimitFlags uint32 + MinimumWorkingSetSize uintptr + MaximumWorkingSetSize uintptr + ActiveProcessLimit uint32 + Affinity uintptr + PriorityClass uint32 + SchedulingClass uint32 + _ uint32 // pad to 8 byte boundary +} diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 8a562feed..347f13dbf 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -212,6 +212,7 @@ var ( procResumeThread = modkernel32.NewProc("ResumeThread") procSetPriorityClass = modkernel32.NewProc("SetPriorityClass") procGetPriorityClass = modkernel32.NewProc("GetPriorityClass") + procQueryInformationJobObject = modkernel32.NewProc("QueryInformationJobObject") procSetInformationJobObject = modkernel32.NewProc("SetInformationJobObject") procGenerateConsoleCtrlEvent = modkernel32.NewProc("GenerateConsoleCtrlEvent") procGetProcessId = modkernel32.NewProc("GetProcessId") @@ -2341,6 +2342,18 @@ func GetPriorityClass(process Handle) (ret uint32, err error) { return } +func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { + r1, _, e1 := syscall.Syscall6(procQueryInformationJobObject.Addr(), 5, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)), 0) + if r1 == 0 { + if e1 != 0 { + err = errnoErr(e1) + } else { + err = syscall.EINVAL + } + } + return +} + func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) { r0, _, e1 := syscall.Syscall6(procSetInformationJobObject.Addr(), 4, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), 0, 0) ret = int(r0) diff --git a/vendor/gonum.org/v1/gonum/AUTHORS b/vendor/gonum.org/v1/gonum/AUTHORS deleted file mode 100644 index 417db9b89..000000000 --- a/vendor/gonum.org/v1/gonum/AUTHORS +++ /dev/null @@ -1,89 +0,0 @@ -# This is the official list of gonum authors for copyright purposes. -# This file is distinct from the CONTRIBUTORS files. -# See the latter for an explanation. - -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# Please keep the list sorted. - -Alexander Egurnov -Bill Gray -Bill Noon -Brendan Tracey -Brent Pedersen -Chad Kunde -Chih-Wei Chang -Chris Tessum -Christophe Meessen -Clayton Northey -Dan Kortschak -Daniel Fireman -David Samborski -Davor Kapsa -DeepMind Technologies -Dezmond Goff -Egon Elbre -Ekaterina Efimova -Ethan Burns -Evert Lammerts -Facundo Gaich -Fazlul Shahriar -Francesc Campoy -Google Inc -Gustaf Johansson -Iakov Davydov -Igor Mikushkin -Iskander Sharipov -Jalem Raj Rohit -James Bell -James Bowman -James Holmes <32bitkid@gmail.com> -Janne Snabb -Jeff Juozapaitis -Jeremy Atkinson -Jonas Kahler -Jonas Schulze -Jonathan J Lawlor -Jonathan Schroeder -Joseph Watson -Josh Wilson -Julien Roland -Kai Trukenmüller -Kent English -Kevin C. Zimmerman -Kirill Motkov -Konstantin Shaposhnikov -Leonid Kneller -Lyron Winderbaum -Martin Diz -Matthieu Di Mercurio -Max Halford -MinJae Kwon -Nick Potts -Olivier Wulveryck -Or Rikon -Pontus Melke -Renée French -Rishi Desai -Robin Eklind -Sam Zaydel -Samuel Kelemen -Saran Ahluwalia -Scott Holden -Sebastien Binet -Shawn Smith -source{d} -Spencer Lyon -Steve McCoy -Taesu Pyo -Takeshi Yoneda -The University of Adelaide -The University of Minnesota -The University of Washington -Thomas Berg -Tobin Harding -Vincent Thiery -Vladimír Chalupecký -Yevgeniy Vahlis diff --git a/vendor/gonum.org/v1/gonum/CONTRIBUTORS b/vendor/gonum.org/v1/gonum/CONTRIBUTORS deleted file mode 100644 index 0c7cc46a7..000000000 --- a/vendor/gonum.org/v1/gonum/CONTRIBUTORS +++ /dev/null @@ -1,91 +0,0 @@ -# This is the official list of people who can contribute -# (and typically have contributed) code to the gonum -# repository. -# -# The AUTHORS file lists the copyright holders; this file -# lists people. For example, Google employees would be listed here -# but not in AUTHORS, because Google would hold the copyright. -# -# When adding J Random Contributor's name to this file, -# either J's name or J's organization's name should be -# added to the AUTHORS file. -# -# Names should be added to this file like so: -# Name -# -# Please keep the list sorted. - -Alexander Egurnov -Andrew Brampton -Bill Gray -Bill Noon -Brendan Tracey -Brent Pedersen -Chad Kunde -Chih-Wei Chang -Chris Tessum -Christophe Meessen -Clayton Northey -Dan Kortschak -Daniel Fireman -David Samborski -Davor Kapsa -Dezmond Goff -Egon Elbre -Ekaterina Efimova -Ethan Burns -Evert Lammerts -Facundo Gaich -Fazlul Shahriar -Francesc Campoy -Gustaf Johansson -Iakov Davydov -Igor Mikushkin -Iskander Sharipov -Jalem Raj Rohit -James Bell -James Bowman -James Holmes <32bitkid@gmail.com> -Janne Snabb -Jeff Juozapaitis -Jeremy Atkinson -Jonas Kahler -Jonas Schulze -Jonathan J Lawlor -Jonathan Schroeder -Joseph Watson -Josh Wilson -Julien Roland -Kai Trukenmüller -Kent English -Kevin C. Zimmerman -Kirill Motkov -Konstantin Shaposhnikov -Leonid Kneller -Lyron Winderbaum -Martin Diz -Matthieu Di Mercurio -Max Halford -MinJae Kwon -Nick Potts -Olivier Wulveryck -Or Rikon -Pontus Melke -Renée French -Rishi Desai -Robin Eklind -Sam Zaydel -Samuel Kelemen -Saran Ahluwalia -Scott Holden -Sebastien Binet -Shawn Smith -Spencer Lyon -Steve McCoy -Taesu Pyo -Takeshi Yoneda -Thomas Berg -Tobin Harding -Vincent Thiery -Vladimír Chalupecký -Yevgeniy Vahlis diff --git a/vendor/gonum.org/v1/gonum/LICENSE b/vendor/gonum.org/v1/gonum/LICENSE deleted file mode 100644 index 5f1c3f9cc..000000000 --- a/vendor/gonum.org/v1/gonum/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -Copyright ©2013 The Gonum Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the gonum project nor the names of its authors and - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/blas/README.md b/vendor/gonum.org/v1/gonum/blas/README.md deleted file mode 100644 index e9d33eeeb..000000000 --- a/vendor/gonum.org/v1/gonum/blas/README.md +++ /dev/null @@ -1,47 +0,0 @@ -# Gonum BLAS [![GoDoc](https://godoc.org/gonum.org/v1/gonum/blas?status.svg)](https://godoc.org/gonum.org/v1/gonum/blas) - -A collection of packages to provide BLAS functionality for the [Go programming -language](http://golang.org) - -## Installation -```sh - go get gonum.org/v1/gonum/blas/... -``` - -## Packages - -### blas - -Defines [BLAS API](http://www.netlib.org/blas/blast-forum/cinterface.pdf) split in several -interfaces. - -### blas/gonum - -Go implementation of the BLAS API (incomplete, implements the `float32` and `float64` API). - -### blas/blas64 and blas/blas32 - -Wrappers for an implementation of the double (i.e., `float64`) and single (`float32`) -precision real parts of the BLAS API. - -```Go -package main - -import ( - "fmt" - - "gonum.org/v1/gonum/blas/blas64" -) - -func main() { - v := blas64.Vector{Inc: 1, Data: []float64{1, 1, 1}} - fmt.Println("v has length:", blas64.Nrm2(len(v.Data), v)) -} -``` - -### blas/cblas128 and blas/cblas64 - -Wrappers for an implementation of the double (i.e., `complex128`) and single (`complex64`) -precision complex parts of the blas API. - -Currently blas/cblas64 and blas/cblas128 require gonum.org/v1/netlib/blas. diff --git a/vendor/gonum.org/v1/gonum/blas/blas.go b/vendor/gonum.org/v1/gonum/blas/blas.go deleted file mode 100644 index 9b933e3fc..000000000 --- a/vendor/gonum.org/v1/gonum/blas/blas.go +++ /dev/null @@ -1,283 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate ./conversions.bash - -package blas - -// Flag constants indicate Givens transformation H matrix state. -type Flag int - -const ( - Identity Flag = -2 // H is the identity matrix; no rotation is needed. - Rescaling Flag = -1 // H specifies rescaling. - OffDiagonal Flag = 0 // Off-diagonal elements of H are non-unit. - Diagonal Flag = 1 // Diagonal elements of H are non-unit. -) - -// SrotmParams contains Givens transformation parameters returned -// by the Float32 Srotm method. -type SrotmParams struct { - Flag - H [4]float32 // Column-major 2 by 2 matrix. -} - -// DrotmParams contains Givens transformation parameters returned -// by the Float64 Drotm method. -type DrotmParams struct { - Flag - H [4]float64 // Column-major 2 by 2 matrix. -} - -// Transpose specifies the transposition operation of a matrix. -type Transpose byte - -const ( - NoTrans Transpose = 'N' - Trans Transpose = 'T' - ConjTrans Transpose = 'C' -) - -// Uplo specifies whether a matrix is upper or lower triangular. -type Uplo byte - -const ( - Upper Uplo = 'U' - Lower Uplo = 'L' - All Uplo = 'A' -) - -// Diag specifies whether a matrix is unit triangular. -type Diag byte - -const ( - NonUnit Diag = 'N' - Unit Diag = 'U' -) - -// Side specifies from which side a multiplication operation is performed. -type Side byte - -const ( - Left Side = 'L' - Right Side = 'R' -) - -// Float32 implements the single precision real BLAS routines. -type Float32 interface { - Float32Level1 - Float32Level2 - Float32Level3 -} - -// Float32Level1 implements the single precision real BLAS Level 1 routines. -type Float32Level1 interface { - Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32 - Dsdot(n int, x []float32, incX int, y []float32, incY int) float64 - Sdot(n int, x []float32, incX int, y []float32, incY int) float32 - Snrm2(n int, x []float32, incX int) float32 - Sasum(n int, x []float32, incX int) float32 - Isamax(n int, x []float32, incX int) int - Sswap(n int, x []float32, incX int, y []float32, incY int) - Scopy(n int, x []float32, incX int, y []float32, incY int) - Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int) - Srotg(a, b float32) (c, s, r, z float32) - Srotmg(d1, d2, b1, b2 float32) (p SrotmParams, rd1, rd2, rb1 float32) - Srot(n int, x []float32, incX int, y []float32, incY int, c, s float32) - Srotm(n int, x []float32, incX int, y []float32, incY int, p SrotmParams) - Sscal(n int, alpha float32, x []float32, incX int) -} - -// Float32Level2 implements the single precision real BLAS Level 2 routines. -type Float32Level2 interface { - Sgemv(tA Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Sgbmv(tA Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Strmv(ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int) - Stbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []float32, lda int, x []float32, incX int) - Stpmv(ul Uplo, tA Transpose, d Diag, n int, ap []float32, x []float32, incX int) - Strsv(ul Uplo, tA Transpose, d Diag, n int, a []float32, lda int, x []float32, incX int) - Stbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []float32, lda int, x []float32, incX int) - Stpsv(ul Uplo, tA Transpose, d Diag, n int, ap []float32, x []float32, incX int) - Ssymv(ul Uplo, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Ssbmv(ul Uplo, n, k int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) - Sspmv(ul Uplo, n int, alpha float32, ap []float32, x []float32, incX int, beta float32, y []float32, incY int) - Sger(m, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) - Ssyr(ul Uplo, n int, alpha float32, x []float32, incX int, a []float32, lda int) - Sspr(ul Uplo, n int, alpha float32, x []float32, incX int, ap []float32) - Ssyr2(ul Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) - Sspr2(ul Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32) -} - -// Float32Level3 implements the single precision real BLAS Level 3 routines. -type Float32Level3 interface { - Sgemm(tA, tB Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) - Ssymm(s Side, ul Uplo, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) - Ssyrk(ul Uplo, t Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32, ldc int) - Ssyr2k(ul Uplo, t Transpose, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) - Strmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) - Strsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) -} - -// Float64 implements the single precision real BLAS routines. -type Float64 interface { - Float64Level1 - Float64Level2 - Float64Level3 -} - -// Float64Level1 implements the double precision real BLAS Level 1 routines. -type Float64Level1 interface { - Ddot(n int, x []float64, incX int, y []float64, incY int) float64 - Dnrm2(n int, x []float64, incX int) float64 - Dasum(n int, x []float64, incX int) float64 - Idamax(n int, x []float64, incX int) int - Dswap(n int, x []float64, incX int, y []float64, incY int) - Dcopy(n int, x []float64, incX int, y []float64, incY int) - Daxpy(n int, alpha float64, x []float64, incX int, y []float64, incY int) - Drotg(a, b float64) (c, s, r, z float64) - Drotmg(d1, d2, b1, b2 float64) (p DrotmParams, rd1, rd2, rb1 float64) - Drot(n int, x []float64, incX int, y []float64, incY int, c float64, s float64) - Drotm(n int, x []float64, incX int, y []float64, incY int, p DrotmParams) - Dscal(n int, alpha float64, x []float64, incX int) -} - -// Float64Level2 implements the double precision real BLAS Level 2 routines. -type Float64Level2 interface { - Dgemv(tA Transpose, m, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dgbmv(tA Transpose, m, n, kL, kU int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dtrmv(ul Uplo, tA Transpose, d Diag, n int, a []float64, lda int, x []float64, incX int) - Dtbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []float64, lda int, x []float64, incX int) - Dtpmv(ul Uplo, tA Transpose, d Diag, n int, ap []float64, x []float64, incX int) - Dtrsv(ul Uplo, tA Transpose, d Diag, n int, a []float64, lda int, x []float64, incX int) - Dtbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []float64, lda int, x []float64, incX int) - Dtpsv(ul Uplo, tA Transpose, d Diag, n int, ap []float64, x []float64, incX int) - Dsymv(ul Uplo, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dsbmv(ul Uplo, n, k int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) - Dspmv(ul Uplo, n int, alpha float64, ap []float64, x []float64, incX int, beta float64, y []float64, incY int) - Dger(m, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) - Dsyr(ul Uplo, n int, alpha float64, x []float64, incX int, a []float64, lda int) - Dspr(ul Uplo, n int, alpha float64, x []float64, incX int, ap []float64) - Dsyr2(ul Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) - Dspr2(ul Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64) -} - -// Float64Level3 implements the double precision real BLAS Level 3 routines. -type Float64Level3 interface { - Dgemm(tA, tB Transpose, m, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) - Dsymm(s Side, ul Uplo, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) - Dsyrk(ul Uplo, t Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) - Dsyr2k(ul Uplo, t Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) - Dtrmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) - Dtrsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) -} - -// Complex64 implements the single precision complex BLAS routines. -type Complex64 interface { - Complex64Level1 - Complex64Level2 - Complex64Level3 -} - -// Complex64Level1 implements the single precision complex BLAS Level 1 routines. -type Complex64Level1 interface { - Cdotu(n int, x []complex64, incX int, y []complex64, incY int) (dotu complex64) - Cdotc(n int, x []complex64, incX int, y []complex64, incY int) (dotc complex64) - Scnrm2(n int, x []complex64, incX int) float32 - Scasum(n int, x []complex64, incX int) float32 - Icamax(n int, x []complex64, incX int) int - Cswap(n int, x []complex64, incX int, y []complex64, incY int) - Ccopy(n int, x []complex64, incX int, y []complex64, incY int) - Caxpy(n int, alpha complex64, x []complex64, incX int, y []complex64, incY int) - Cscal(n int, alpha complex64, x []complex64, incX int) - Csscal(n int, alpha float32, x []complex64, incX int) -} - -// Complex64Level2 implements the single precision complex BLAS routines Level 2 routines. -type Complex64Level2 interface { - Cgemv(tA Transpose, m, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Cgbmv(tA Transpose, m, n, kL, kU int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Ctrmv(ul Uplo, tA Transpose, d Diag, n int, a []complex64, lda int, x []complex64, incX int) - Ctbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex64, lda int, x []complex64, incX int) - Ctpmv(ul Uplo, tA Transpose, d Diag, n int, ap []complex64, x []complex64, incX int) - Ctrsv(ul Uplo, tA Transpose, d Diag, n int, a []complex64, lda int, x []complex64, incX int) - Ctbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex64, lda int, x []complex64, incX int) - Ctpsv(ul Uplo, tA Transpose, d Diag, n int, ap []complex64, x []complex64, incX int) - Chemv(ul Uplo, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Chbmv(ul Uplo, n, k int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) - Chpmv(ul Uplo, n int, alpha complex64, ap []complex64, x []complex64, incX int, beta complex64, y []complex64, incY int) - Cgeru(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) - Cgerc(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) - Cher(ul Uplo, n int, alpha float32, x []complex64, incX int, a []complex64, lda int) - Chpr(ul Uplo, n int, alpha float32, x []complex64, incX int, a []complex64) - Cher2(ul Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) - Chpr2(ul Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, ap []complex64) -} - -// Complex64Level3 implements the single precision complex BLAS Level 3 routines. -type Complex64Level3 interface { - Cgemm(tA, tB Transpose, m, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Csymm(s Side, ul Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Csyrk(ul Uplo, t Transpose, n, k int, alpha complex64, a []complex64, lda int, beta complex64, c []complex64, ldc int) - Csyr2k(ul Uplo, t Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Ctrmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) - Ctrsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) - Chemm(s Side, ul Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) - Cherk(ul Uplo, t Transpose, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64, ldc int) - Cher2k(ul Uplo, t Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta float32, c []complex64, ldc int) -} - -// Complex128 implements the double precision complex BLAS routines. -type Complex128 interface { - Complex128Level1 - Complex128Level2 - Complex128Level3 -} - -// Complex128Level1 implements the double precision complex BLAS Level 1 routines. -type Complex128Level1 interface { - Zdotu(n int, x []complex128, incX int, y []complex128, incY int) (dotu complex128) - Zdotc(n int, x []complex128, incX int, y []complex128, incY int) (dotc complex128) - Dznrm2(n int, x []complex128, incX int) float64 - Dzasum(n int, x []complex128, incX int) float64 - Izamax(n int, x []complex128, incX int) int - Zswap(n int, x []complex128, incX int, y []complex128, incY int) - Zcopy(n int, x []complex128, incX int, y []complex128, incY int) - Zaxpy(n int, alpha complex128, x []complex128, incX int, y []complex128, incY int) - Zscal(n int, alpha complex128, x []complex128, incX int) - Zdscal(n int, alpha float64, x []complex128, incX int) -} - -// Complex128Level2 implements the double precision complex BLAS Level 2 routines. -type Complex128Level2 interface { - Zgemv(tA Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zgbmv(tA Transpose, m, n int, kL int, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Ztrmv(ul Uplo, tA Transpose, d Diag, n int, a []complex128, lda int, x []complex128, incX int) - Ztbmv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex128, lda int, x []complex128, incX int) - Ztpmv(ul Uplo, tA Transpose, d Diag, n int, ap []complex128, x []complex128, incX int) - Ztrsv(ul Uplo, tA Transpose, d Diag, n int, a []complex128, lda int, x []complex128, incX int) - Ztbsv(ul Uplo, tA Transpose, d Diag, n, k int, a []complex128, lda int, x []complex128, incX int) - Ztpsv(ul Uplo, tA Transpose, d Diag, n int, ap []complex128, x []complex128, incX int) - Zhemv(ul Uplo, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zhbmv(ul Uplo, n, k int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zhpmv(ul Uplo, n int, alpha complex128, ap []complex128, x []complex128, incX int, beta complex128, y []complex128, incY int) - Zgeru(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) - Zgerc(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) - Zher(ul Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int) - Zhpr(ul Uplo, n int, alpha float64, x []complex128, incX int, a []complex128) - Zher2(ul Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) - Zhpr2(ul Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, ap []complex128) -} - -// Complex128Level3 implements the double precision complex BLAS Level 3 routines. -type Complex128Level3 interface { - Zgemm(tA, tB Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Zsymm(s Side, ul Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Zsyrk(ul Uplo, t Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) - Zsyr2k(ul Uplo, t Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Ztrmm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) - Ztrsm(s Side, ul Uplo, tA Transpose, d Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) - Zhemm(s Side, ul Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) - Zherk(ul Uplo, t Transpose, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128, ldc int) - Zher2k(ul Uplo, t Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta float64, c []complex128, ldc int) -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go b/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go deleted file mode 100644 index 551983836..000000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/blas64.go +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blas64 - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/gonum" -) - -var blas64 blas.Float64 = gonum.Implementation{} - -// Use sets the BLAS float64 implementation to be used by subsequent BLAS calls. -// The default implementation is -// gonum.org/v1/gonum/blas/gonum.Implementation. -func Use(b blas.Float64) { - blas64 = b -} - -// Implementation returns the current BLAS float64 implementation. -// -// Implementation allows direct calls to the current the BLAS float64 implementation -// giving finer control of parameters. -func Implementation() blas.Float64 { - return blas64 -} - -// Vector represents a vector with an associated element increment. -type Vector struct { - N int - Data []float64 - Inc int -} - -// General represents a matrix using the conventional storage scheme. -type General struct { - Rows, Cols int - Data []float64 - Stride int -} - -// Band represents a band matrix using the band storage scheme. -type Band struct { - Rows, Cols int - KL, KU int - Data []float64 - Stride int -} - -// Triangular represents a triangular matrix using the conventional storage scheme. -type Triangular struct { - Uplo blas.Uplo - Diag blas.Diag - N int - Data []float64 - Stride int -} - -// TriangularBand represents a triangular matrix using the band storage scheme. -type TriangularBand struct { - Uplo blas.Uplo - Diag blas.Diag - N, K int - Data []float64 - Stride int -} - -// TriangularPacked represents a triangular matrix using the packed storage scheme. -type TriangularPacked struct { - Uplo blas.Uplo - Diag blas.Diag - N int - Data []float64 -} - -// Symmetric represents a symmetric matrix using the conventional storage scheme. -type Symmetric struct { - Uplo blas.Uplo - N int - Data []float64 - Stride int -} - -// SymmetricBand represents a symmetric matrix using the band storage scheme. -type SymmetricBand struct { - Uplo blas.Uplo - N, K int - Data []float64 - Stride int -} - -// SymmetricPacked represents a symmetric matrix using the packed storage scheme. -type SymmetricPacked struct { - Uplo blas.Uplo - N int - Data []float64 -} - -// Level 1 - -const ( - negInc = "blas64: negative vector increment" - badLength = "blas64: vector length mismatch" -) - -// Dot computes the dot product of the two vectors: -// \sum_i x[i]*y[i]. -func Dot(x, y Vector) float64 { - if x.N != y.N { - panic(badLength) - } - return blas64.Ddot(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Nrm2 computes the Euclidean norm of the vector x: -// sqrt(\sum_i x[i]*x[i]). -// -// Nrm2 will panic if the vector increment is negative. -func Nrm2(x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return blas64.Dnrm2(x.N, x.Data, x.Inc) -} - -// Asum computes the sum of the absolute values of the elements of x: -// \sum_i |x[i]|. -// -// Asum will panic if the vector increment is negative. -func Asum(x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return blas64.Dasum(x.N, x.Data, x.Inc) -} - -// Iamax returns the index of an element of x with the largest absolute value. -// If there are multiple such indices the earliest is returned. -// Iamax returns -1 if n == 0. -// -// Iamax will panic if the vector increment is negative. -func Iamax(x Vector) int { - if x.Inc < 0 { - panic(negInc) - } - return blas64.Idamax(x.N, x.Data, x.Inc) -} - -// Swap exchanges the elements of the two vectors: -// x[i], y[i] = y[i], x[i] for all i. -func Swap(x, y Vector) { - if x.N != y.N { - panic(badLength) - } - blas64.Dswap(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Copy copies the elements of x into the elements of y: -// y[i] = x[i] for all i. -// Copy requires that the lengths of x and y match and will panic otherwise. -func Copy(x, y Vector) { - if x.N != y.N { - panic(badLength) - } - blas64.Dcopy(x.N, x.Data, x.Inc, y.Data, y.Inc) -} - -// Axpy adds x scaled by alpha to y: -// y[i] += alpha*x[i] for all i. -func Axpy(alpha float64, x, y Vector) { - if x.N != y.N { - panic(badLength) - } - blas64.Daxpy(x.N, alpha, x.Data, x.Inc, y.Data, y.Inc) -} - -// Rotg computes the parameters of a Givens plane rotation so that -// ⎡ c s⎤ ⎡a⎤ ⎡r⎤ -// ⎣-s c⎦ * ⎣b⎦ = ⎣0⎦ -// where a and b are the Cartesian coordinates of a given point. -// c, s, and r are defined as -// r = ±Sqrt(a^2 + b^2), -// c = a/r, the cosine of the rotation angle, -// s = a/r, the sine of the rotation angle, -// and z is defined such that -// if |a| > |b|, z = s, -// otherwise if c != 0, z = 1/c, -// otherwise z = 1. -func Rotg(a, b float64) (c, s, r, z float64) { - return blas64.Drotg(a, b) -} - -// Rotmg computes the modified Givens rotation. See -// http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html -// for more details. -func Rotmg(d1, d2, b1, b2 float64) (p blas.DrotmParams, rd1, rd2, rb1 float64) { - return blas64.Drotmg(d1, d2, b1, b2) -} - -// Rot applies a plane transformation to n points represented by the vectors x -// and y: -// x[i] = c*x[i] + s*y[i], -// y[i] = -s*x[i] + c*y[i], for all i. -func Rot(x, y Vector, c, s float64) { - if x.N != y.N { - panic(badLength) - } - blas64.Drot(x.N, x.Data, x.Inc, y.Data, y.Inc, c, s) -} - -// Rotm applies the modified Givens rotation to n points represented by the -// vectors x and y. -func Rotm(x, y Vector, p blas.DrotmParams) { - if x.N != y.N { - panic(badLength) - } - blas64.Drotm(x.N, x.Data, x.Inc, y.Data, y.Inc, p) -} - -// Scal scales the vector x by alpha: -// x[i] *= alpha for all i. -// -// Scal will panic if the vector increment is negative. -func Scal(alpha float64, x Vector) { - if x.Inc < 0 { - panic(negInc) - } - blas64.Dscal(x.N, alpha, x.Data, x.Inc) -} - -// Level 2 - -// Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func Gemv(t blas.Transpose, alpha float64, a General, x Vector, beta float64, y Vector) { - blas64.Dgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans or blas.ConjTrans, -// where A is an m×n band matrix, x and y are vectors, and alpha and beta are scalars. -func Gbmv(t blas.Transpose, alpha float64, a Band, x Vector, beta float64, y Vector) { - blas64.Dgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix, and x is a vector. -func Trmv(t blas.Transpose, a Triangular, x Vector) { - blas64.Dtrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular band matrix, and x is a vector. -func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { - blas64.Dtbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix in packed format, and x is a vector. -func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { - blas64.Dtpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Trsv(t blas.Transpose, a Triangular, x Vector) { - blas64.Dtrsv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular band matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { - blas64.Dtbsv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans or blas.ConjTrans, -// where A is an n×n triangular matrix in packed format, and x and b are -// vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { - blas64.Dtpsv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Symv computes -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -func Symv(alpha float64, a Symmetric, x Vector, beta float64, y Vector) { - blas64.Dsymv(a.Uplo, a.N, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Sbmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric band matrix, x and y are vectors, and alpha -// and beta are scalars. -func Sbmv(alpha float64, a SymmetricBand, x Vector, beta float64, y Vector) { - blas64.Dsbmv(a.Uplo, a.N, a.K, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Spmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -func Spmv(alpha float64, a SymmetricPacked, x Vector, beta float64, y Vector) { - blas64.Dspmv(a.Uplo, a.N, alpha, a.Data, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Ger performs a rank-1 update -// A += alpha * x * y^T, -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(alpha float64, x, y Vector, a General) { - blas64.Dger(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Syr performs a rank-1 update -// A += alpha * x * x^T, -// where A is an n×n symmetric matrix, x is a vector, and alpha is a scalar. -func Syr(alpha float64, x Vector, a Symmetric) { - blas64.Dsyr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) -} - -// Spr performs the rank-1 update -// A += alpha * x * x^T, -// where A is an n×n symmetric matrix in packed format, x is a vector, and -// alpha is a scalar. -func Spr(alpha float64, x Vector, a SymmetricPacked) { - blas64.Dspr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data) -} - -// Syr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, -// where A is a symmetric n×n matrix, x and y are vectors, and alpha is a scalar. -func Syr2(alpha float64, x, y Vector, a Symmetric) { - blas64.Dsyr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Spr2 performs a rank-2 update -// A += alpha * x * y^T + alpha * y * x^T, -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha is a scalar. -func Spr2(alpha float64, x, y Vector, a SymmetricPacked) { - blas64.Dspr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data) -} - -// Level 3 - -// Gemm computes -// C = alpha * A * B + beta * C, -// where A, B, and C are dense matrices, and alpha and beta are scalars. -// tA and tB specify whether A or B are transposed. -func Gemm(tA, tB blas.Transpose, alpha float64, a, b General, beta float64, c General) { - var m, n, k int - if tA == blas.NoTrans { - m, k = a.Rows, a.Cols - } else { - m, k = a.Cols, a.Rows - } - if tB == blas.NoTrans { - n = b.Cols - } else { - n = b.Rows - } - blas64.Dgemm(tA, tB, m, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and -// alpha is a scalar. -func Symm(s blas.Side, alpha float64, a Symmetric, b General, beta float64, c General) { - var m, n int - if s == blas.Left { - m, n = a.N, b.Cols - } else { - m, n = b.Rows, a.N - } - blas64.Dsymm(s, a.Uplo, m, n, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, -// where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans and -// a k×n matrix otherwise, and alpha and beta are scalars. -func Syrk(t blas.Transpose, alpha float64, a General, beta float64, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - blas64.Dsyrk(c.Uplo, t, n, k, alpha, a.Data, a.Stride, beta, c.Data, c.Stride) -} - -// Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans or blas.ConjTrans, -// where C is an n×n symmetric matrix, A and B are n×k matrices if t == NoTrans -// and k×n matrices otherwise, and alpha and beta are scalars. -func Syr2k(t blas.Transpose, alpha float64, a, b General, beta float64, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - blas64.Dsyr2k(c.Uplo, t, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is -// a scalar. -func Trmm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General) { - blas64.Dtrmm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} - -// Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans and s == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans or blas.ConjTrans, and s == blas.Right, -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and -// alpha is a scalar. -// -// At entry to the function, X contains the values of B, and the result is -// stored in-place into X. -// -// No check is made that A is invertible. -func Trsm(s blas.Side, tA blas.Transpose, alpha float64, a Triangular, b General) { - blas64.Dtrsm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/conv.go b/vendor/gonum.org/v1/gonum/blas/blas64/conv.go deleted file mode 100644 index 882fd8a71..000000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/conv.go +++ /dev/null @@ -1,277 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blas64 - -import "gonum.org/v1/gonum/blas" - -// GeneralCols represents a matrix using the conventional column-major storage scheme. -type GeneralCols General - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t GeneralCols) From(a General) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if len(t.Data) < (t.Cols-1)*t.Stride+t.Rows { - panic("blas64: short data slice") - } - for i := 0; i < a.Rows; i++ { - for j, v := range a.Data[i*a.Stride : i*a.Stride+a.Cols] { - t.Data[i+j*t.Stride] = v - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t General) From(a GeneralCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if len(t.Data) < (t.Rows-1)*t.Stride+t.Cols { - panic("blas64: short data slice") - } - for j := 0; j < a.Cols; j++ { - for i, v := range a.Data[j*a.Stride : j*a.Stride+a.Rows] { - t.Data[i*t.Stride+j] = v - } - } -} - -// TriangularCols represents a matrix using the conventional column-major storage scheme. -type TriangularCols Triangular - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t TriangularCols) From(a Triangular) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t Triangular) From(a TriangularCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// BandCols represents a matrix using the band column-major storage scheme. -type BandCols Band - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t BandCols) From(a Band) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("blas64: short stride for destination") - } - for i := 0; i < a.Rows; i++ { - for j := max(0, i-a.KL); j < min(i+a.KU+1, a.Cols); j++ { - t.Data[i+t.KU-j+j*t.Stride] = a.Data[j+a.KL-i+i*a.Stride] - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t Band) From(a BandCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("blas64: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("blas64: short stride for destination") - } - for j := 0; j < a.Cols; j++ { - for i := max(0, j-a.KU); i < min(j+a.KL+1, a.Rows); i++ { - t.Data[j+a.KL-i+i*a.Stride] = a.Data[i+t.KU-j+j*t.Stride] - } - } -} - -// TriangularBandCols represents a symmetric matrix using the band column-major storage scheme. -type TriangularBandCols TriangularBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBandCols) From(a TriangularBand) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBand) From(a TriangularBandCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("blas64: mismatched BLAS diag") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go b/vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go deleted file mode 100644 index 5146f1a1c..000000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/conv_symmetric.go +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package blas64 - -import "gonum.org/v1/gonum/blas" - -// SymmetricCols represents a matrix using the conventional column-major storage scheme. -type SymmetricCols Symmetric - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t SymmetricCols) From(a Symmetric) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t Symmetric) From(a SymmetricCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// SymmetricBandCols represents a symmetric matrix using the band column-major storage scheme. -type SymmetricBandCols SymmetricBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBandCols) From(a SymmetricBand) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBand) From(a SymmetricBandCols) { - if t.N != a.N { - panic("blas64: mismatched dimension") - } - if t.K != a.K { - panic("blas64: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("blas64: short stride for source") - } - if t.Stride < t.K+1 { - panic("blas64: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("blas64: mismatched BLAS uplo") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("blas64: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} diff --git a/vendor/gonum.org/v1/gonum/blas/blas64/doc.go b/vendor/gonum.org/v1/gonum/blas/blas64/doc.go deleted file mode 100644 index 7410cee48..000000000 --- a/vendor/gonum.org/v1/gonum/blas/blas64/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package blas64 provides a simple interface to the float64 BLAS API. -package blas64 // import "gonum.org/v1/gonum/blas/blas64" diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go b/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go deleted file mode 100644 index 1205da8af..000000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/cblas128.go +++ /dev/null @@ -1,508 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cblas128 - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/gonum" -) - -var cblas128 blas.Complex128 = gonum.Implementation{} - -// Use sets the BLAS complex128 implementation to be used by subsequent BLAS calls. -// The default implementation is -// gonum.org/v1/gonum/blas/gonum.Implementation. -func Use(b blas.Complex128) { - cblas128 = b -} - -// Implementation returns the current BLAS complex128 implementation. -// -// Implementation allows direct calls to the current the BLAS complex128 implementation -// giving finer control of parameters. -func Implementation() blas.Complex128 { - return cblas128 -} - -// Vector represents a vector with an associated element increment. -type Vector struct { - Inc int - Data []complex128 -} - -// General represents a matrix using the conventional storage scheme. -type General struct { - Rows, Cols int - Stride int - Data []complex128 -} - -// Band represents a band matrix using the band storage scheme. -type Band struct { - Rows, Cols int - KL, KU int - Stride int - Data []complex128 -} - -// Triangular represents a triangular matrix using the conventional storage scheme. -type Triangular struct { - N int - Stride int - Data []complex128 - Uplo blas.Uplo - Diag blas.Diag -} - -// TriangularBand represents a triangular matrix using the band storage scheme. -type TriangularBand struct { - N, K int - Stride int - Data []complex128 - Uplo blas.Uplo - Diag blas.Diag -} - -// TriangularPacked represents a triangular matrix using the packed storage scheme. -type TriangularPacked struct { - N int - Data []complex128 - Uplo blas.Uplo - Diag blas.Diag -} - -// Symmetric represents a symmetric matrix using the conventional storage scheme. -type Symmetric struct { - N int - Stride int - Data []complex128 - Uplo blas.Uplo -} - -// SymmetricBand represents a symmetric matrix using the band storage scheme. -type SymmetricBand struct { - N, K int - Stride int - Data []complex128 - Uplo blas.Uplo -} - -// SymmetricPacked represents a symmetric matrix using the packed storage scheme. -type SymmetricPacked struct { - N int - Data []complex128 - Uplo blas.Uplo -} - -// Hermitian represents an Hermitian matrix using the conventional storage scheme. -type Hermitian Symmetric - -// HermitianBand represents an Hermitian matrix using the band storage scheme. -type HermitianBand SymmetricBand - -// HermitianPacked represents an Hermitian matrix using the packed storage scheme. -type HermitianPacked SymmetricPacked - -// Level 1 - -const negInc = "cblas128: negative vector increment" - -// Dotu computes the dot product of the two vectors without -// complex conjugation: -// x^T * y. -func Dotu(n int, x, y Vector) complex128 { - return cblas128.Zdotu(n, x.Data, x.Inc, y.Data, y.Inc) -} - -// Dotc computes the dot product of the two vectors with -// complex conjugation: -// x^H * y. -func Dotc(n int, x, y Vector) complex128 { - return cblas128.Zdotc(n, x.Data, x.Inc, y.Data, y.Inc) -} - -// Nrm2 computes the Euclidean norm of the vector x: -// sqrt(\sum_i x[i] * x[i]). -// -// Nrm2 will panic if the vector increment is negative. -func Nrm2(n int, x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return cblas128.Dznrm2(n, x.Data, x.Inc) -} - -// Asum computes the sum of magnitudes of the real and imaginary parts of -// elements of the vector x: -// \sum_i (|Re x[i]| + |Im x[i]|). -// -// Asum will panic if the vector increment is negative. -func Asum(n int, x Vector) float64 { - if x.Inc < 0 { - panic(negInc) - } - return cblas128.Dzasum(n, x.Data, x.Inc) -} - -// Iamax returns the index of an element of x with the largest sum of -// magnitudes of the real and imaginary parts (|Re x[i]|+|Im x[i]|). -// If there are multiple such indices, the earliest is returned. -// -// Iamax returns -1 if n == 0. -// -// Iamax will panic if the vector increment is negative. -func Iamax(n int, x Vector) int { - if x.Inc < 0 { - panic(negInc) - } - return cblas128.Izamax(n, x.Data, x.Inc) -} - -// Swap exchanges the elements of two vectors: -// x[i], y[i] = y[i], x[i] for all i. -func Swap(n int, x, y Vector) { - cblas128.Zswap(n, x.Data, x.Inc, y.Data, y.Inc) -} - -// Copy copies the elements of x into the elements of y: -// y[i] = x[i] for all i. -func Copy(n int, x, y Vector) { - cblas128.Zcopy(n, x.Data, x.Inc, y.Data, y.Inc) -} - -// Axpy computes -// y = alpha * x + y, -// where x and y are vectors, and alpha is a scalar. -func Axpy(n int, alpha complex128, x, y Vector) { - cblas128.Zaxpy(n, alpha, x.Data, x.Inc, y.Data, y.Inc) -} - -// Scal computes -// x = alpha * x, -// where x is a vector, and alpha is a scalar. -// -// Scal will panic if the vector increment is negative. -func Scal(n int, alpha complex128, x Vector) { - if x.Inc < 0 { - panic(negInc) - } - cblas128.Zscal(n, alpha, x.Data, x.Inc) -} - -// Dscal computes -// x = alpha * x, -// where x is a vector, and alpha is a real scalar. -// -// Dscal will panic if the vector increment is negative. -func Dscal(n int, alpha float64, x Vector) { - if x.Inc < 0 { - panic(negInc) - } - cblas128.Zdscal(n, alpha, x.Data, x.Inc) -} - -// Level 2 - -// Gemv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are -// scalars. -func Gemv(t blas.Transpose, alpha complex128, a General, x Vector, beta complex128, y Vector) { - cblas128.Zgemv(t, a.Rows, a.Cols, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Gbmv computes -// y = alpha * A * x + beta * y, if t == blas.NoTrans, -// y = alpha * A^T * x + beta * y, if t == blas.Trans, -// y = alpha * A^H * x + beta * y, if t == blas.ConjTrans, -// where A is an m×n band matrix, x and y are vectors, and alpha and beta are -// scalars. -func Gbmv(t blas.Transpose, alpha complex128, a Band, x Vector, beta complex128, y Vector) { - cblas128.Zgbmv(t, a.Rows, a.Cols, a.KL, a.KU, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Trmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, -// where A is an n×n triangular matrix, and x is a vector. -func Trmv(t blas.Transpose, a Triangular, x Vector) { - cblas128.Ztrmv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, -// where A is an n×n triangular band matrix, and x is a vector. -func Tbmv(t blas.Transpose, a TriangularBand, x Vector) { - cblas128.Ztbmv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpmv computes -// x = A * x, if t == blas.NoTrans, -// x = A^T * x, if t == blas.Trans, -// x = A^H * x, if t == blas.ConjTrans, -// where A is an n×n triangular matrix in packed format, and x is a vector. -func Tpmv(t blas.Transpose, a TriangularPacked, x Vector) { - cblas128.Ztpmv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Trsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, -// where A is an n×n triangular matrix and x is a vector. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Trsv(t blas.Transpose, a Triangular, x Vector) { - cblas128.Ztrsv(a.Uplo, t, a.Diag, a.N, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tbsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, -// where A is an n×n triangular band matrix, and x is a vector. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tbsv(t blas.Transpose, a TriangularBand, x Vector) { - cblas128.Ztbsv(a.Uplo, t, a.Diag, a.N, a.K, a.Data, a.Stride, x.Data, x.Inc) -} - -// Tpsv solves -// A * x = b, if t == blas.NoTrans, -// A^T * x = b, if t == blas.Trans, -// A^H * x = b, if t == blas.ConjTrans, -// where A is an n×n triangular matrix in packed format and x is a vector. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func Tpsv(t blas.Transpose, a TriangularPacked, x Vector) { - cblas128.Ztpsv(a.Uplo, t, a.Diag, a.N, a.Data, x.Data, x.Inc) -} - -// Hemv computes -// y = alpha * A * x + beta * y, -// where A is an n×n Hermitian matrix, x and y are vectors, and alpha and -// beta are scalars. -func Hemv(alpha complex128, a Hermitian, x Vector, beta complex128, y Vector) { - cblas128.Zhemv(a.Uplo, a.N, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Hbmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n Hermitian band matrix, x and y are vectors, and alpha -// and beta are scalars. -func Hbmv(alpha complex128, a HermitianBand, x Vector, beta complex128, y Vector) { - cblas128.Zhbmv(a.Uplo, a.N, a.K, alpha, a.Data, a.Stride, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Hpmv performs -// y = alpha * A * x + beta * y, -// where A is an n×n Hermitian matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -func Hpmv(alpha complex128, a HermitianPacked, x Vector, beta complex128, y Vector) { - cblas128.Zhpmv(a.Uplo, a.N, alpha, a.Data, x.Data, x.Inc, beta, y.Data, y.Inc) -} - -// Geru performs a rank-1 update -// A += alpha * x * y^T, -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Geru(alpha complex128, x, y Vector, a General) { - cblas128.Zgeru(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Gerc performs a rank-1 update -// A += alpha * x * y^H, -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Gerc(alpha complex128, x, y Vector, a General) { - cblas128.Zgerc(a.Rows, a.Cols, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Her performs a rank-1 update -// A += alpha * x * y^T, -// where A is an m×n Hermitian matrix, x and y are vectors, and alpha is a scalar. -func Her(alpha float64, x Vector, a Hermitian) { - cblas128.Zher(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data, a.Stride) -} - -// Hpr performs a rank-1 update -// A += alpha * x * x^H, -// where A is an n×n Hermitian matrix in packed format, x is a vector, and -// alpha is a scalar. -func Hpr(alpha float64, x Vector, a HermitianPacked) { - cblas128.Zhpr(a.Uplo, a.N, alpha, x.Data, x.Inc, a.Data) -} - -// Her2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, -// where A is an n×n Hermitian matrix, x and y are vectors, and alpha is a scalar. -func Her2(alpha complex128, x, y Vector, a Hermitian) { - cblas128.Zher2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data, a.Stride) -} - -// Hpr2 performs a rank-2 update -// A += alpha * x * y^H + conj(alpha) * y * x^H, -// where A is an n×n Hermitian matrix in packed format, x and y are vectors, -// and alpha is a scalar. -func Hpr2(alpha complex128, x, y Vector, a HermitianPacked) { - cblas128.Zhpr2(a.Uplo, a.N, alpha, x.Data, x.Inc, y.Data, y.Inc, a.Data) -} - -// Level 3 - -// Gemm computes -// C = alpha * A * B + beta * C, -// where A, B, and C are dense matrices, and alpha and beta are scalars. -// tA and tB specify whether A or B are transposed or conjugated. -func Gemm(tA, tB blas.Transpose, alpha complex128, a, b General, beta complex128, c General) { - var m, n, k int - if tA == blas.NoTrans { - m, k = a.Rows, a.Cols - } else { - m, k = a.Cols, a.Rows - } - if tB == blas.NoTrans { - n = b.Cols - } else { - n = b.Rows - } - cblas128.Zgemm(tA, tB, m, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Symm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and -// alpha and beta are scalars. -func Symm(s blas.Side, alpha complex128, a Symmetric, b General, beta complex128, c General) { - var m, n int - if s == blas.Left { - m, n = a.N, b.Cols - } else { - m, n = b.Rows, a.N - } - cblas128.Zsymm(s, a.Uplo, m, n, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Syrk performs a symmetric rank-k update -// C = alpha * A * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * A + beta * C, if t == blas.Trans, -// where C is an n×n symmetric matrix, A is an n×k matrix if t == blas.NoTrans -// and a k×n matrix otherwise, and alpha and beta are scalars. -func Syrk(t blas.Transpose, alpha complex128, a General, beta complex128, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zsyrk(c.Uplo, t, n, k, alpha, a.Data, a.Stride, beta, c.Data, c.Stride) -} - -// Syr2k performs a symmetric rank-2k update -// C = alpha * A * B^T + alpha * B * A^T + beta * C, if t == blas.NoTrans, -// C = alpha * A^T * B + alpha * B^T * A + beta * C, if t == blas.Trans, -// where C is an n×n symmetric matrix, A and B are n×k matrices if -// t == blas.NoTrans and k×n otherwise, and alpha and beta are scalars. -func Syr2k(t blas.Transpose, alpha complex128, a, b General, beta complex128, c Symmetric) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zsyr2k(c.Uplo, t, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Trmm performs -// B = alpha * A * B, if tA == blas.NoTrans and s == blas.Left, -// B = alpha * A^T * B, if tA == blas.Trans and s == blas.Left, -// B = alpha * A^H * B, if tA == blas.ConjTrans and s == blas.Left, -// B = alpha * B * A, if tA == blas.NoTrans and s == blas.Right, -// B = alpha * B * A^T, if tA == blas.Trans and s == blas.Right, -// B = alpha * B * A^H, if tA == blas.ConjTrans and s == blas.Right, -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is -// a scalar. -func Trmm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b General) { - cblas128.Ztrmm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} - -// Trsm solves -// A * X = alpha * B, if tA == blas.NoTrans and s == blas.Left, -// A^T * X = alpha * B, if tA == blas.Trans and s == blas.Left, -// A^H * X = alpha * B, if tA == blas.ConjTrans and s == blas.Left, -// X * A = alpha * B, if tA == blas.NoTrans and s == blas.Right, -// X * A^T = alpha * B, if tA == blas.Trans and s == blas.Right, -// X * A^H = alpha * B, if tA == blas.ConjTrans and s == blas.Right, -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and -// alpha is a scalar. -// -// At entry to the function, b contains the values of B, and the result is -// stored in-place into b. -// -// No check is made that A is invertible. -func Trsm(s blas.Side, tA blas.Transpose, alpha complex128, a Triangular, b General) { - cblas128.Ztrsm(s, a.Uplo, tA, a.Diag, b.Rows, b.Cols, alpha, a.Data, a.Stride, b.Data, b.Stride) -} - -// Hemm performs -// C = alpha * A * B + beta * C, if s == blas.Left, -// C = alpha * B * A + beta * C, if s == blas.Right, -// where A is an n×n or m×m Hermitian matrix, B and C are m×n matrices, and -// alpha and beta are scalars. -func Hemm(s blas.Side, alpha complex128, a Hermitian, b General, beta complex128, c General) { - var m, n int - if s == blas.Left { - m, n = a.N, b.Cols - } else { - m, n = b.Rows, a.N - } - cblas128.Zhemm(s, a.Uplo, m, n, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} - -// Herk performs the Hermitian rank-k update -// C = alpha * A * A^H + beta*C, if t == blas.NoTrans, -// C = alpha * A^H * A + beta*C, if t == blas.ConjTrans, -// where C is an n×n Hermitian matrix, A is an n×k matrix if t == blas.NoTrans -// and a k×n matrix otherwise, and alpha and beta are scalars. -func Herk(t blas.Transpose, alpha float64, a General, beta float64, c Hermitian) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zherk(c.Uplo, t, n, k, alpha, a.Data, a.Stride, beta, c.Data, c.Stride) -} - -// Her2k performs the Hermitian rank-2k update -// C = alpha * A * B^H + conj(alpha) * B * A^H + beta * C, if t == blas.NoTrans, -// C = alpha * A^H * B + conj(alpha) * B^H * A + beta * C, if t == blas.ConjTrans, -// where C is an n×n Hermitian matrix, A and B are n×k matrices if t == NoTrans -// and k×n matrices otherwise, and alpha and beta are scalars. -func Her2k(t blas.Transpose, alpha complex128, a, b General, beta float64, c Hermitian) { - var n, k int - if t == blas.NoTrans { - n, k = a.Rows, a.Cols - } else { - n, k = a.Cols, a.Rows - } - cblas128.Zher2k(c.Uplo, t, n, k, alpha, a.Data, a.Stride, b.Data, b.Stride, beta, c.Data, c.Stride) -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go deleted file mode 100644 index 93e3cd2f9..000000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cblas128 - -import "gonum.org/v1/gonum/blas" - -// GeneralCols represents a matrix using the conventional column-major storage scheme. -type GeneralCols General - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t GeneralCols) From(a General) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if len(t.Data) < (t.Cols-1)*t.Stride+t.Rows { - panic("cblas128: short data slice") - } - for i := 0; i < a.Rows; i++ { - for j, v := range a.Data[i*a.Stride : i*a.Stride+a.Cols] { - t.Data[i+j*t.Stride] = v - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions as a and have adequate backing -// data storage. -func (t General) From(a GeneralCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if len(t.Data) < (t.Rows-1)*t.Stride+t.Cols { - panic("cblas128: short data slice") - } - for j := 0; j < a.Cols; j++ { - for i, v := range a.Data[j*a.Stride : j*a.Stride+a.Rows] { - t.Data[i*t.Stride+j] = v - } - } -} - -// TriangularCols represents a matrix using the conventional column-major storage scheme. -type TriangularCols Triangular - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t TriangularCols) From(a Triangular) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, uplo and diag as a and have -// adequate backing data storage. -func (t Triangular) From(a TriangularCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.All: - for i := 0; i < a.N; i++ { - for j := 0; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// BandCols represents a matrix using the band column-major storage scheme. -type BandCols Band - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t BandCols) From(a Band) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("cblas128: short stride for destination") - } - for i := 0; i < a.Rows; i++ { - for j := max(0, i-a.KL); j < min(i+a.KU+1, a.Cols); j++ { - t.Data[i+t.KU-j+j*t.Stride] = a.Data[j+a.KL-i+i*a.Stride] - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and bandwidth as a and have -// adequate backing data storage. -func (t Band) From(a BandCols) { - if t.Rows != a.Rows || t.Cols != a.Cols { - panic("cblas128: mismatched dimension") - } - if t.KL != a.KL || t.KU != a.KU { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.KL+a.KU+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.KL+t.KU+1 { - panic("cblas128: short stride for destination") - } - for j := 0; j < a.Cols; j++ { - for i := max(0, j-a.KU); i < min(j+a.KL+1, a.Rows); i++ { - t.Data[j+a.KL-i+i*a.Stride] = a.Data[i+t.KU-j+j*t.Stride] - } - } -} - -// TriangularBandCols represents a symmetric matrix using the band column-major storage scheme. -type TriangularBandCols TriangularBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBandCols) From(a TriangularBand) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t TriangularBand) From(a TriangularBandCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - if t.Diag != a.Diag { - panic("cblas128: mismatched BLAS diag") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go deleted file mode 100644 index 51c3a5777..000000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_hermitian.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cblas128 - -import "gonum.org/v1/gonum/blas" - -// HermitianCols represents a matrix using the conventional column-major storage scheme. -type HermitianCols Hermitian - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t HermitianCols) From(a Hermitian) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t Hermitian) From(a HermitianCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// HermitianBandCols represents an Hermitian matrix using the band column-major storage scheme. -type HermitianBandCols HermitianBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t HermitianBandCols) From(a HermitianBand) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t HermitianBand) From(a HermitianBandCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go b/vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go deleted file mode 100644 index f1bf40c20..000000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/conv_symmetric.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cblas128 - -import "gonum.org/v1/gonum/blas" - -// SymmetricCols represents a matrix using the conventional column-major storage scheme. -type SymmetricCols Symmetric - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t SymmetricCols) From(a Symmetric) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i+j*t.Stride] = a.Data[i*a.Stride+j] - } - } - } -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions and uplo as a and have adequate -// backing data storage. -func (t Symmetric) From(a SymmetricCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - for i := 0; i < a.N; i++ { - for j := i; j < a.N; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - case blas.Lower: - for i := 0; i < a.N; i++ { - for j := 0; j <= i; j++ { - t.Data[i*t.Stride+j] = a.Data[i+j*a.Stride] - } - } - } -} - -// SymmetricBandCols represents a symmetric matrix using the band column-major storage scheme. -type SymmetricBandCols SymmetricBand - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBandCols) From(a SymmetricBand) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := BandCols{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := Band{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} - -// From fills the receiver with elements from a. The receiver -// must have the same dimensions, bandwidth and uplo as a and -// have adequate backing data storage. -func (t SymmetricBand) From(a SymmetricBandCols) { - if t.N != a.N { - panic("cblas128: mismatched dimension") - } - if t.K != a.K { - panic("cblas128: mismatched bandwidth") - } - if a.Stride < a.K+1 { - panic("cblas128: short stride for source") - } - if t.Stride < t.K+1 { - panic("cblas128: short stride for destination") - } - if t.Uplo != a.Uplo { - panic("cblas128: mismatched BLAS uplo") - } - dst := Band{ - Rows: t.N, Cols: t.N, - Stride: t.Stride, - Data: t.Data, - } - src := BandCols{ - Rows: a.N, Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } - switch a.Uplo { - default: - panic("cblas128: bad BLAS uplo") - case blas.Upper: - dst.KU = t.K - src.KU = a.K - case blas.Lower: - dst.KL = t.K - src.KL = a.K - } - dst.From(src) -} diff --git a/vendor/gonum.org/v1/gonum/blas/cblas128/doc.go b/vendor/gonum.org/v1/gonum/blas/cblas128/doc.go deleted file mode 100644 index 09719b19e..000000000 --- a/vendor/gonum.org/v1/gonum/blas/cblas128/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package cblas128 provides a simple interface to the complex128 BLAS API. -package cblas128 // import "gonum.org/v1/gonum/blas/cblas128" diff --git a/vendor/gonum.org/v1/gonum/blas/conversions.bash b/vendor/gonum.org/v1/gonum/blas/conversions.bash deleted file mode 100644 index d1c0ef0d9..000000000 --- a/vendor/gonum.org/v1/gonum/blas/conversions.bash +++ /dev/null @@ -1,159 +0,0 @@ -#!/usr/bin/env bash - -# Copyright ©2017 The Gonum Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# Generate code for blas32. -echo Generating blas32/conv.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv.go -cat blas64/conv.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ -\ ->> blas32/conv.go - -echo Generating blas32/conv_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv_test.go -cat blas64/conv_test.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ -\ ->> blas32/conv_test.go - -echo Generating blas32/conv_symmetric.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv_symmetric.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ -\ ->> blas32/conv_symmetric.go - -echo Generating blas32/conv_symmetric_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > blas32/conv_symmetric_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> float32' \ -\ -| sed -e 's/blas64/blas32/' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ -\ ->> blas32/conv_symmetric_test.go - - -# Generate code for cblas128. -echo Generating cblas128/conv.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv.go -cat blas64/conv.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ -\ ->> cblas128/conv.go - -echo Generating cblas128/conv_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_test.go -cat blas64/conv_test.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's_"math"_math "math/cmplx"_' \ -\ ->> cblas128/conv_test.go - -echo Generating cblas128/conv_symmetric.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_symmetric.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ -\ ->> cblas128/conv_symmetric.go - -echo Generating cblas128/conv_symmetric_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_symmetric_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's_"math"_math "math/cmplx"_' \ -\ ->> cblas128/conv_symmetric_test.go - -echo Generating cblas128/conv_hermitian.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_hermitian.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ -\ ->> cblas128/conv_hermitian.go - -echo Generating cblas128/conv_hermitian_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas128/conv_hermitian_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> complex128' \ -\ -| sed -e 's/blas64/cblas128/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ - -e 's_"math"_math "math/cmplx"_' \ -\ ->> cblas128/conv_hermitian_test.go - - -# Generate code for cblas64. -echo Generating cblas64/conv.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv.go -cat blas64/conv.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ -\ ->> cblas64/conv.go - -echo Generating cblas64/conv_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv_test.go -cat blas64/conv_test.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/cmplx64"_' \ -\ ->> cblas64/conv_test.go - -echo Generating cblas64/conv_hermitian.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv_hermitian.go -cat blas64/conv_symmetric.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ -\ ->> cblas64/conv_hermitian.go - -echo Generating cblas64/conv_hermitian_test.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas”; DO NOT EDIT.\n' > cblas64/conv_hermitian_test.go -cat blas64/conv_symmetric_test.go \ -| gofmt -r 'float64 -> complex64' \ -\ -| sed -e 's/blas64/cblas64/' \ - -e 's/Symmetric/Hermitian/g' \ - -e 's/a symmetric/an Hermitian/g' \ - -e 's/symmetric/hermitian/g' \ - -e 's/Sym/Herm/g' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/cmplx64"_' \ -\ ->> cblas64/conv_hermitian_test.go diff --git a/vendor/gonum.org/v1/gonum/blas/doc.go b/vendor/gonum.org/v1/gonum/blas/doc.go deleted file mode 100644 index ea4b16c90..000000000 --- a/vendor/gonum.org/v1/gonum/blas/doc.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -/* -Package blas provides interfaces for the BLAS linear algebra standard. - -All methods must perform appropriate parameter checking and panic if -provided parameters that do not conform to the requirements specified -by the BLAS standard. - -Quick Reference Guide to the BLAS from http://www.netlib.org/lapack/lug/node145.html - -This version is modified to remove the "order" option. All matrix operations are -on row-order matrices. - -Level 1 BLAS - - dim scalar vector vector scalars 5-element prefixes - struct - - _rotg ( a, b ) S, D - _rotmg( d1, d2, a, b ) S, D - _rot ( n, x, incX, y, incY, c, s ) S, D - _rotm ( n, x, incX, y, incY, param ) S, D - _swap ( n, x, incX, y, incY ) S, D, C, Z - _scal ( n, alpha, x, incX ) S, D, C, Z, Cs, Zd - _copy ( n, x, incX, y, incY ) S, D, C, Z - _axpy ( n, alpha, x, incX, y, incY ) S, D, C, Z - _dot ( n, x, incX, y, incY ) S, D, Ds - _dotu ( n, x, incX, y, incY ) C, Z - _dotc ( n, x, incX, y, incY ) C, Z - __dot ( n, alpha, x, incX, y, incY ) Sds - _nrm2 ( n, x, incX ) S, D, Sc, Dz - _asum ( n, x, incX ) S, D, Sc, Dz - I_amax( n, x, incX ) s, d, c, z - -Level 2 BLAS - - options dim b-width scalar matrix vector scalar vector prefixes - - _gemv ( trans, m, n, alpha, a, lda, x, incX, beta, y, incY ) S, D, C, Z - _gbmv ( trans, m, n, kL, kU, alpha, a, lda, x, incX, beta, y, incY ) S, D, C, Z - _hemv ( uplo, n, alpha, a, lda, x, incX, beta, y, incY ) C, Z - _hbmv ( uplo, n, k, alpha, a, lda, x, incX, beta, y, incY ) C, Z - _hpmv ( uplo, n, alpha, ap, x, incX, beta, y, incY ) C, Z - _symv ( uplo, n, alpha, a, lda, x, incX, beta, y, incY ) S, D - _sbmv ( uplo, n, k, alpha, a, lda, x, incX, beta, y, incY ) S, D - _spmv ( uplo, n, alpha, ap, x, incX, beta, y, incY ) S, D - _trmv ( uplo, trans, diag, n, a, lda, x, incX ) S, D, C, Z - _tbmv ( uplo, trans, diag, n, k, a, lda, x, incX ) S, D, C, Z - _tpmv ( uplo, trans, diag, n, ap, x, incX ) S, D, C, Z - _trsv ( uplo, trans, diag, n, a, lda, x, incX ) S, D, C, Z - _tbsv ( uplo, trans, diag, n, k, a, lda, x, incX ) S, D, C, Z - _tpsv ( uplo, trans, diag, n, ap, x, incX ) S, D, C, Z - - options dim scalar vector vector matrix prefixes - - _ger ( m, n, alpha, x, incX, y, incY, a, lda ) S, D - _geru ( m, n, alpha, x, incX, y, incY, a, lda ) C, Z - _gerc ( m, n, alpha, x, incX, y, incY, a, lda ) C, Z - _her ( uplo, n, alpha, x, incX, a, lda ) C, Z - _hpr ( uplo, n, alpha, x, incX, ap ) C, Z - _her2 ( uplo, n, alpha, x, incX, y, incY, a, lda ) C, Z - _hpr2 ( uplo, n, alpha, x, incX, y, incY, ap ) C, Z - _syr ( uplo, n, alpha, x, incX, a, lda ) S, D - _spr ( uplo, n, alpha, x, incX, ap ) S, D - _syr2 ( uplo, n, alpha, x, incX, y, incY, a, lda ) S, D - _spr2 ( uplo, n, alpha, x, incX, y, incY, ap ) S, D - -Level 3 BLAS - - options dim scalar matrix matrix scalar matrix prefixes - - _gemm ( transA, transB, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc ) S, D, C, Z - _symm ( side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc ) S, D, C, Z - _hemm ( side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc ) C, Z - _syrk ( uplo, trans, n, k, alpha, a, lda, beta, c, ldc ) S, D, C, Z - _herk ( uplo, trans, n, k, alpha, a, lda, beta, c, ldc ) C, Z - _syr2k( uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc ) S, D, C, Z - _her2k( uplo, trans, n, k, alpha, a, lda, b, ldb, beta, c, ldc ) C, Z - _trmm ( side, uplo, transA, diag, m, n, alpha, a, lda, b, ldb ) S, D, C, Z - _trsm ( side, uplo, transA, diag, m, n, alpha, a, lda, b, ldb ) S, D, C, Z - -Meaning of prefixes - - S - float32 C - complex64 - D - float64 Z - complex128 - -Matrix types - - GE - GEneral GB - General Band - SY - SYmmetric SB - Symmetric Band SP - Symmetric Packed - HE - HErmitian HB - Hermitian Band HP - Hermitian Packed - TR - TRiangular TB - Triangular Band TP - Triangular Packed - -Options - - trans = NoTrans, Trans, ConjTrans - uplo = Upper, Lower - diag = Nonunit, Unit - side = Left, Right (A or op(A) on the left, or A or op(A) on the right) - -For real matrices, Trans and ConjTrans have the same meaning. -For Hermitian matrices, trans = Trans is not allowed. -For complex symmetric matrices, trans = ConjTrans is not allowed. -*/ -package blas // import "gonum.org/v1/gonum/blas" diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go b/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go deleted file mode 100644 index ec3fcc61c..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/dgemm.go +++ /dev/null @@ -1,314 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "runtime" - "sync" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Dgemm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C -// C = alpha * A^T * B + beta * C -// C = alpha * A * B^T + beta * C -// C = alpha * A^T * B^T + beta * C -// where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is -// an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or -// B are transposed. -func (Implementation) Dgemm(tA, tB blas.Transpose, m, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - aTrans := tA == blas.Trans || tA == blas.ConjTrans - if aTrans { - if lda < max(1, m) { - panic(badLdA) - } - } else { - if lda < max(1, k) { - panic(badLdA) - } - } - bTrans := tB == blas.Trans || tB == blas.ConjTrans - if bTrans { - if ldb < max(1, k) { - panic(badLdB) - } - } else { - if ldb < max(1, n) { - panic(badLdB) - } - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if aTrans { - if len(a) < (k-1)*lda+m { - panic(shortA) - } - } else { - if len(a) < (m-1)*lda+k { - panic(shortA) - } - } - if bTrans { - if len(b) < (n-1)*ldb+k { - panic(shortB) - } - } else { - if len(b) < (k-1)*ldb+n { - panic(shortB) - } - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - // scale c - if beta != 1 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - } - } - - dgemmParallel(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) -} - -func dgemmParallel(aTrans, bTrans bool, m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // dgemmParallel computes a parallel matrix multiplication by partitioning - // a and b into sub-blocks, and updating c with the multiplication of the sub-block - // In all cases, - // A = [ A_11 A_12 ... A_1j - // A_21 A_22 ... A_2j - // ... - // A_i1 A_i2 ... A_ij] - // - // and same for B. All of the submatrix sizes are blockSize×blockSize except - // at the edges. - // - // In all cases, there is one dimension for each matrix along which - // C must be updated sequentially. - // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (A^T * B) - // Cij = \sum_k Aik Bjk, (A * B^T) - // Cij = \sum_k Aki Bjk, (A^T * B^T) - // - // This code computes one {i, j} block sequentially along the k dimension, - // and computes all of the {i, j} blocks concurrently. This - // partitioning allows Cij to be updated in-place without race-conditions. - // Instead of launching a goroutine for each possible concurrent computation, - // a number of worker goroutines are created and channels are used to pass - // available and completed cases. - // - // http://alexkr.com/docs/matrixmult.pdf is a good reference on matrix-matrix - // multiplies, though this code does not copy matrices to attempt to eliminate - // cache misses. - - maxKLen := k - parBlocks := blocks(m, blockSize) * blocks(n, blockSize) - if parBlocks < minParBlock { - // The matrix multiplication is small in the dimensions where it can be - // computed concurrently. Just do it in serial. - dgemmSerial(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - } - - nWorkers := runtime.GOMAXPROCS(0) - if parBlocks < nWorkers { - nWorkers = parBlocks - } - // There is a tradeoff between the workers having to wait for work - // and a large buffer making operations slow. - buf := buffMul * nWorkers - if buf > parBlocks { - buf = parBlocks - } - - sendChan := make(chan subMul, buf) - - // Launch workers. A worker receives an {i, j} submatrix of c, and computes - // A_ik B_ki (or the transposed version) storing the result in c_ij. When the - // channel is finally closed, it signals to the waitgroup that it has finished - // computing. - var wg sync.WaitGroup - for i := 0; i < nWorkers; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for sub := range sendChan { - i := sub.i - j := sub.j - leni := blockSize - if i+leni > m { - leni = m - i - } - lenj := blockSize - if j+lenj > n { - lenj = n - j - } - - cSub := sliceView64(c, ldc, i, j, leni, lenj) - - // Compute A_ik B_kj for all k - for k := 0; k < maxKLen; k += blockSize { - lenk := blockSize - if k+lenk > maxKLen { - lenk = maxKLen - k - } - var aSub, bSub []float64 - if aTrans { - aSub = sliceView64(a, lda, k, i, lenk, leni) - } else { - aSub = sliceView64(a, lda, i, k, leni, lenk) - } - if bTrans { - bSub = sliceView64(b, ldb, j, k, lenj, lenk) - } else { - bSub = sliceView64(b, ldb, k, j, lenk, lenj) - } - dgemmSerial(aTrans, bTrans, leni, lenj, lenk, aSub, lda, bSub, ldb, cSub, ldc, alpha) - } - } - }() - } - - // Send out all of the {i, j} subblocks for computation. - for i := 0; i < m; i += blockSize { - for j := 0; j < n; j += blockSize { - sendChan <- subMul{ - i: i, - j: j, - } - } - } - close(sendChan) - wg.Wait() -} - -// dgemmSerial is serial matrix multiply -func dgemmSerial(aTrans, bTrans bool, m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - switch { - case !aTrans && !bTrans: - dgemmSerialNotNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && !bTrans: - dgemmSerialTransNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case !aTrans && bTrans: - dgemmSerialNotTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && bTrans: - dgemmSerialTransTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - default: - panic("unreachable") - } -} - -// dgemmSerial where neither a nor b are transposed -func dgemmSerialNotNot(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for l, v := range a[i*lda : i*lda+k] { - tmp := alpha * v - if tmp != 0 { - f64.AxpyUnitary(tmp, b[l*ldb:l*ldb+n], ctmp) - } - } - } -} - -// dgemmSerial where neither a is transposed and b is not -func dgemmSerialTransNot(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - btmp := b[l*ldb : l*ldb+n] - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f64.AxpyUnitary(tmp, btmp, ctmp) - } - } - } -} - -// dgemmSerial where neither a is not transposed and b is -func dgemmSerialNotTrans(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - atmp := a[i*lda : i*lda+k] - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] += alpha * f64.DotUnitary(atmp, b[j*ldb:j*ldb+k]) - } - } -} - -// dgemmSerial where both are transposed -func dgemmSerialTransTrans(m, n, k int, a []float64, lda int, b []float64, ldb int, c []float64, ldc int, alpha float64) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f64.AxpyInc(tmp, b[l:], ctmp, uintptr(n), uintptr(ldb), 1, 0, 0) - } - } - } -} - -func sliceView64(a []float64, lda, i, j, r, c int) []float64 { - return a[i*lda+j : (i+r-1)*lda+j+c] -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/doc.go b/vendor/gonum.org/v1/gonum/blas/gonum/doc.go deleted file mode 100644 index 3f4b6c1d0..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/doc.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Ensure changes made to blas/native are reflected in blas/cgo where relevant. - -/* -Package gonum is a Go implementation of the BLAS API. This implementation -panics when the input arguments are invalid as per the standard, for example -if a vector increment is zero. Note that the treatment of NaN values -is not specified, and differs among the BLAS implementations. -gonum.org/v1/gonum/blas/blas64 provides helpful wrapper functions to the BLAS -interface. The rest of this text describes the layout of the data for the input types. - -Note that in the function documentation, x[i] refers to the i^th element -of the vector, which will be different from the i^th element of the slice if -incX != 1. - -See http://www.netlib.org/lapack/explore-html/d4/de1/_l_i_c_e_n_s_e_source.html -for more license information. - -Vector arguments are effectively strided slices. They have two input arguments, -a number of elements, n, and an increment, incX. The increment specifies the -distance between elements of the vector. The actual Go slice may be longer -than necessary. -The increment may be positive or negative, except in functions with only -a single vector argument where the increment may only be positive. If the increment -is negative, s[0] is the last element in the slice. Note that this is not the same -as counting backward from the end of the slice, as len(s) may be longer than -necessary. So, for example, if n = 5 and incX = 3, the elements of s are - [0 * * 1 * * 2 * * 3 * * 4 * * * ...] -where ∗ elements are never accessed. If incX = -3, the same elements are -accessed, just in reverse order (4, 3, 2, 1, 0). - -Dense matrices are specified by a number of rows, a number of columns, and a stride. -The stride specifies the number of entries in the slice between the first element -of successive rows. The stride must be at least as large as the number of columns -but may be longer. - [a00 ... a0n a0* ... a1stride-1 a21 ... amn am* ... amstride-1] -Thus, dense[i*ld + j] refers to the {i, j}th element of the matrix. - -Symmetric and triangular matrices (non-packed) are stored identically to Dense, -except that only elements in one triangle of the matrix are accessed. - -Packed symmetric and packed triangular matrices are laid out with the entries -condensed such that all of the unreferenced elements are removed. So, the upper triangular -matrix - [ - 1 2 3 - 0 4 5 - 0 0 6 - ] -and the lower-triangular matrix - [ - 1 0 0 - 2 3 0 - 4 5 6 - ] -will both be compacted as [1 2 3 4 5 6]. The (i, j) element of the original -dense matrix can be found at element i*n - (i-1)*i/2 + j for upper triangular, -and at element i * (i+1) /2 + j for lower triangular. - -Banded matrices are laid out in a compact format, constructed by removing the -zeros in the rows and aligning the diagonals. For example, the matrix - [ - 1 2 3 0 0 0 - 4 5 6 7 0 0 - 0 8 9 10 11 0 - 0 0 12 13 14 15 - 0 0 0 16 17 18 - 0 0 0 0 19 20 - ] - -implicitly becomes (∗ entries are never accessed) - [ - * 1 2 3 - 4 5 6 7 - 8 9 10 11 - 12 13 14 15 - 16 17 18 * - 19 20 * * - ] -which is given to the BLAS routine as [∗ 1 2 3 4 ...]. - -See http://www.crest.iu.edu/research/mtl/reference/html/banded.html -for more information -*/ -package gonum // import "gonum.org/v1/gonum/blas/gonum" diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/errors.go b/vendor/gonum.org/v1/gonum/blas/gonum/errors.go deleted file mode 100644 index e98575d0f..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/errors.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -// Panic strings used during parameter checks. -// This list is duplicated in netlib/blas/netlib. Keep in sync. -const ( - zeroIncX = "blas: zero x index increment" - zeroIncY = "blas: zero y index increment" - - mLT0 = "blas: m < 0" - nLT0 = "blas: n < 0" - kLT0 = "blas: k < 0" - kLLT0 = "blas: kL < 0" - kULT0 = "blas: kU < 0" - - badUplo = "blas: illegal triangle" - badTranspose = "blas: illegal transpose" - badDiag = "blas: illegal diagonal" - badSide = "blas: illegal side" - badFlag = "blas: illegal rotm flag" - - badLdA = "blas: bad leading dimension of A" - badLdB = "blas: bad leading dimension of B" - badLdC = "blas: bad leading dimension of C" - - shortX = "blas: insufficient length of x" - shortY = "blas: insufficient length of y" - shortAP = "blas: insufficient length of ap" - shortA = "blas: insufficient length of a" - shortB = "blas: insufficient length of b" - shortC = "blas: insufficient length of c" -) diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go b/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go deleted file mode 100644 index 9b9a1beb0..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/gemv.go +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" - "gonum.org/v1/gonum/internal/asm/f64" -) - -// TODO(Kunde21): Merge these methods back into level2double/level2single when Sgemv assembly kernels are merged into f32. - -// Dgemv computes -// y = alpha * A * x + beta * y if tA = blas.NoTrans -// y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func (Implementation) Dgemv(tA blas.Transpose, m, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - // Set up indexes - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - - // Quick return if possible - if m == 0 || n == 0 { - return - } - - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - // First form y = beta * y - if incY > 0 { - Implementation{}.Dscal(lenY, beta, y, incY) - } else { - Implementation{}.Dscal(lenY, beta, y, -incY) - } - return - } - - // Form y = alpha * A * x + y - if tA == blas.NoTrans { - f64.GemvN(uintptr(m), uintptr(n), alpha, a, uintptr(lda), x, uintptr(incX), beta, y, uintptr(incY)) - return - } - // Cases where a is transposed. - f64.GemvT(uintptr(m), uintptr(n), alpha, a, uintptr(lda), x, uintptr(incX), beta, y, uintptr(incY)) -} - -// Sgemv computes -// y = alpha * A * x + beta * y if tA = blas.NoTrans -// y = alpha * A^T * x + beta * y if tA = blas.Trans or blas.ConjTrans -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sgemv(tA blas.Transpose, m, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // Set up indexes - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - if (incX > 0 && (lenX-1)*incX >= len(x)) || (incX < 0 && (1-lenX)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (lenY-1)*incY >= len(y)) || (incY < 0 && (1-lenY)*incY >= len(y)) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // First form y = beta * y - if incY > 0 { - Implementation{}.Sscal(lenY, beta, y, incY) - } else { - Implementation{}.Sscal(lenY, beta, y, -incY) - } - - if alpha == 0 { - return - } - - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = alpha * A * x + y - if tA == blas.NoTrans { - if incX == 1 && incY == 1 { - for i := 0; i < m; i++ { - y[i] += alpha * f32.DotUnitary(a[lda*i:lda*i+n], x[:n]) - } - return - } - iy := ky - for i := 0; i < m; i++ { - y[iy] += alpha * f32.DotInc(x, a[lda*i:lda*i+n], uintptr(n), uintptr(incX), 1, uintptr(kx), 0) - iy += incY - } - return - } - // Cases where a is transposed. - if incX == 1 && incY == 1 { - for i := 0; i < m; i++ { - tmp := alpha * x[i] - if tmp != 0 { - f32.AxpyUnitaryTo(y, tmp, a[lda*i:lda*i+n], y[:n]) - } - } - return - } - ix := kx - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - if tmp != 0 { - f32.AxpyInc(tmp, a[lda*i:lda*i+n], y, uintptr(n), 1, uintptr(incY), 0, uintptr(ky)) - } - ix += incX - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/gonum.go b/vendor/gonum.org/v1/gonum/blas/gonum/gonum.go deleted file mode 100644 index 8ab8d43e1..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/gonum.go +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:generate ./single_precision.bash - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/internal/math32" -) - -type Implementation struct{} - -// [SD]gemm behavior constants. These are kept here to keep them out of the -// way during single precision code genration. -const ( - blockSize = 64 // b x b matrix - minParBlock = 4 // minimum number of blocks needed to go parallel - buffMul = 4 // how big is the buffer relative to the number of workers -) - -// subMul is a common type shared by [SD]gemm. -type subMul struct { - i, j int // index of block -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func min(a, b int) int { - if a > b { - return b - } - return a -} - -// blocks returns the number of divisions of the dimension length with the given -// block size. -func blocks(dim, bsize int) int { - return (dim + bsize - 1) / bsize -} - -// dcabs1 returns |real(z)|+|imag(z)|. -func dcabs1(z complex128) float64 { - return math.Abs(real(z)) + math.Abs(imag(z)) -} - -// scabs1 returns |real(z)|+|imag(z)|. -func scabs1(z complex64) float32 { - return math32.Abs(real(z)) + math32.Abs(imag(z)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go deleted file mode 100644 index e37bf44dd..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx128.go +++ /dev/null @@ -1,445 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c128" -) - -var _ blas.Complex128Level1 = Implementation{} - -// Dzasum returns the sum of the absolute values of the elements of x -// \sum_i |Re(x[i])| + |Im(x[i])| -// Dzasum returns 0 if incX is negative. -func (Implementation) Dzasum(n int, x []complex128, incX int) float64 { - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - var sum float64 - if incX == 1 { - if len(x) < n { - panic(shortX) - } - for _, v := range x[:n] { - sum += dcabs1(v) - } - return sum - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - for i := 0; i < n; i++ { - v := x[i*incX] - sum += dcabs1(v) - } - return sum -} - -// Dznrm2 computes the Euclidean norm of the complex vector x, -// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). -// This function returns 0 if incX is negative. -func (Implementation) Dznrm2(n int, x []complex128, incX int) float64 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if n < 1 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - var ( - scale float64 - ssq float64 = 1 - ) - if incX == 1 { - for _, v := range x[:n] { - re, im := math.Abs(real(v)), math.Abs(imag(v)) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) - } - for ix := 0; ix < n*incX; ix += incX { - re, im := math.Abs(real(x[ix])), math.Abs(imag(x[ix])) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) -} - -// Izamax returns the index of the first element of x having largest |Re(·)|+|Im(·)|. -// Izamax returns -1 if n is 0 or incX is negative. -func (Implementation) Izamax(n int, x []complex128, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - // Return invalid index. - return -1 - } - if n < 1 { - if n == 0 { - // Return invalid index. - return -1 - } - panic(nLT0) - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - idx := 0 - max := dcabs1(x[0]) - if incX == 1 { - for i, v := range x[1:n] { - absV := dcabs1(v) - if absV > max { - max = absV - idx = i + 1 - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - absV := dcabs1(x[ix]) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Zaxpy adds alpha times x to y: -// y[i] += alpha * x[i] for all i -func (Implementation) Zaxpy(n int, alpha complex128, x []complex128, incX int, y []complex128, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - c128.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (1 - n) * incX - } - if incY < 0 { - iy = (1 - n) * incY - } - c128.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Zcopy copies the vector x to vector y. -func (Implementation) Zcopy(n int, x []complex128, incX int, y []complex128, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Zdotc computes the dot product -// x^H · y -// of two complex vectors x and y. -func (Implementation) Zdotc(n int, x []complex128, incX int, y []complex128, incY int) complex128 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c128.DotcUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c128.DotcInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Zdotu computes the dot product -// x^T · y -// of two complex vectors x and y. -func (Implementation) Zdotu(n int, x []complex128, incX int, y []complex128, incY int) complex128 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c128.DotuUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c128.DotuInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Zdscal scales the vector x by a real scalar alpha. -// Zdscal has no effect if incX < 0. -func (Implementation) Zdscal(n int, alpha float64, x []complex128, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - x = x[:n] - for i, v := range x { - x[i] = complex(alpha*real(v), alpha*imag(v)) - } - return - } - for ix := 0; ix < n*incX; ix += incX { - v := x[ix] - x[ix] = complex(alpha*real(v), alpha*imag(v)) - } -} - -// Zscal scales the vector x by a complex scalar alpha. -// Zscal has no effect if incX < 0. -func (Implementation) Zscal(n int, alpha complex128, x []complex128, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - c128.ScalUnitary(alpha, x[:n]) - return - } - c128.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} - -// Zswap exchanges the elements of two complex vectors x and y. -func (Implementation) Zswap(n int, x []complex128, incX int, y []complex128, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go deleted file mode 100644 index ba192ea59..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1cmplx64.go +++ /dev/null @@ -1,467 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - math "gonum.org/v1/gonum/internal/math32" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c64" -) - -var _ blas.Complex64Level1 = Implementation{} - -// Scasum returns the sum of the absolute values of the elements of x -// \sum_i |Re(x[i])| + |Im(x[i])| -// Scasum returns 0 if incX is negative. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Scasum(n int, x []complex64, incX int) float32 { - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - var sum float32 - if incX == 1 { - if len(x) < n { - panic(shortX) - } - for _, v := range x[:n] { - sum += scabs1(v) - } - return sum - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - for i := 0; i < n; i++ { - v := x[i*incX] - sum += scabs1(v) - } - return sum -} - -// Scnrm2 computes the Euclidean norm of the complex vector x, -// ‖x‖_2 = sqrt(\sum_i x[i] * conj(x[i])). -// This function returns 0 if incX is negative. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Scnrm2(n int, x []complex64, incX int) float32 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if n < 1 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - var ( - scale float32 - ssq float32 = 1 - ) - if incX == 1 { - for _, v := range x[:n] { - re, im := math.Abs(real(v)), math.Abs(imag(v)) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) - } - for ix := 0; ix < n*incX; ix += incX { - re, im := math.Abs(real(x[ix])), math.Abs(imag(x[ix])) - if re != 0 { - if re > scale { - ssq = 1 + ssq*(scale/re)*(scale/re) - scale = re - } else { - ssq += (re / scale) * (re / scale) - } - } - if im != 0 { - if im > scale { - ssq = 1 + ssq*(scale/im)*(scale/im) - scale = im - } else { - ssq += (im / scale) * (im / scale) - } - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(ssq) -} - -// Icamax returns the index of the first element of x having largest |Re(·)|+|Im(·)|. -// Icamax returns -1 if n is 0 or incX is negative. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Icamax(n int, x []complex64, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - // Return invalid index. - return -1 - } - if n < 1 { - if n == 0 { - // Return invalid index. - return -1 - } - panic(nLT0) - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - idx := 0 - max := scabs1(x[0]) - if incX == 1 { - for i, v := range x[1:n] { - absV := scabs1(v) - if absV > max { - max = absV - idx = i + 1 - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - absV := scabs1(x[ix]) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Caxpy adds alpha times x to y: -// y[i] += alpha * x[i] for all i -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Caxpy(n int, alpha complex64, x []complex64, incX int, y []complex64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - c64.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (1 - n) * incX - } - if incY < 0 { - iy = (1 - n) * incY - } - c64.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Ccopy copies the vector x to vector y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ccopy(n int, x []complex64, incX int, y []complex64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Cdotc computes the dot product -// x^H · y -// of two complex vectors x and y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cdotc(n int, x []complex64, incX int, y []complex64, incY int) complex64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c64.DotcUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c64.DotcInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Cdotu computes the dot product -// x^T · y -// of two complex vectors x and y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cdotu(n int, x []complex64, incX int, y []complex64, incY int) complex64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return c64.DotuUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || (n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || (n-1)*incY >= len(y) { - panic(shortY) - } - return c64.DotuInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Csscal scales the vector x by a real scalar alpha. -// Csscal has no effect if incX < 0. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csscal(n int, alpha float32, x []complex64, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - x = x[:n] - for i, v := range x { - x[i] = complex(alpha*real(v), alpha*imag(v)) - } - return - } - for ix := 0; ix < n*incX; ix += incX { - v := x[ix] - x[ix] = complex(alpha*real(v), alpha*imag(v)) - } -} - -// Cscal scales the vector x by a complex scalar alpha. -// Cscal has no effect if incX < 0. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cscal(n int, alpha complex64, x []complex64, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - c64.ScalUnitary(alpha, x[:n]) - return - } - c64.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} - -// Cswap exchanges the elements of two complex vectors x and y. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cswap(n int, x []complex64, incX int, y []complex64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && (n-1)*incX >= len(x)) || (incX < 0 && (1-n)*incX >= len(x)) { - panic(shortX) - } - if (incY > 0 && (n-1)*incY >= len(y)) || (incY < 0 && (1-n)*incY >= len(y)) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go deleted file mode 100644 index ee82083a6..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32.go +++ /dev/null @@ -1,644 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - math "gonum.org/v1/gonum/internal/math32" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -var _ blas.Float32Level1 = Implementation{} - -// Snrm2 computes the Euclidean norm of a vector, -// sqrt(\sum_i x[i] * x[i]). -// This function returns 0 if incX is negative. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Snrm2(n int, x []float32, incX int) float32 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return math.Abs(x[0]) - } - if n == 0 { - return 0 - } - panic(nLT0) - } - var ( - scale float32 = 0 - sumSquares float32 = 1 - ) - if incX == 1 { - x = x[:n] - for _, v := range x { - if v == 0 { - continue - } - absxi := math.Abs(v) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - sumSquares = 1 + sumSquares*(scale/absxi)*(scale/absxi) - scale = absxi - } else { - sumSquares = sumSquares + (absxi/scale)*(absxi/scale) - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) - } - for ix := 0; ix < n*incX; ix += incX { - val := x[ix] - if val == 0 { - continue - } - absxi := math.Abs(val) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - sumSquares = 1 + sumSquares*(scale/absxi)*(scale/absxi) - scale = absxi - } else { - sumSquares = sumSquares + (absxi/scale)*(absxi/scale) - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) -} - -// Sasum computes the sum of the absolute values of the elements of x. -// \sum_i |x[i]| -// Sasum returns 0 if incX is negative. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sasum(n int, x []float32, incX int) float32 { - var sum float32 - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if incX == 1 { - x = x[:n] - for _, v := range x { - sum += math.Abs(v) - } - return sum - } - for i := 0; i < n; i++ { - sum += math.Abs(x[i*incX]) - } - return sum -} - -// Isamax returns the index of an element of x with the largest absolute value. -// If there are multiple such indices the earliest is returned. -// Isamax returns -1 if n == 0. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Isamax(n int, x []float32, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return -1 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return 0 - } - if n == 0 { - return -1 // Netlib returns invalid index when n == 0. - } - panic(nLT0) - } - idx := 0 - max := math.Abs(x[0]) - if incX == 1 { - for i, v := range x[:n] { - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - v := x[ix] - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Sswap exchanges the elements of two vectors. -// x[i], y[i] = y[i], x[i] for all i -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sswap(n int, x []float32, incX int, y []float32, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} - -// Scopy copies the elements of x into the elements of y. -// y[i] = x[i] for all i -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Scopy(n int, x []float32, incX int, y []float32, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Saxpy adds alpha times x to y -// y[i] += alpha * x[i] for all i -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Saxpy(n int, alpha float32, x []float32, incX int, y []float32, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - f32.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - f32.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Srotg computes the plane rotation -// _ _ _ _ _ _ -// | c s | | a | | r | -// | -s c | * | b | = | 0 | -// ‾ ‾ ‾ ‾ ‾ ‾ -// where -// r = ±√(a^2 + b^2) -// c = a/r, the cosine of the plane rotation -// s = b/r, the sine of the plane rotation -// -// NOTE: There is a discrepancy between the reference implementation and the BLAS -// technical manual regarding the sign for r when a or b are zero. -// Srotg agrees with the definition in the manual and other -// common BLAS implementations. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srotg(a, b float32) (c, s, r, z float32) { - if b == 0 && a == 0 { - return 1, 0, a, 0 - } - absA := math.Abs(a) - absB := math.Abs(b) - aGTb := absA > absB - r = math.Hypot(a, b) - if aGTb { - r = math.Copysign(r, a) - } else { - r = math.Copysign(r, b) - } - c = a / r - s = b / r - if aGTb { - z = s - } else if c != 0 { // r == 0 case handled above - z = 1 / c - } else { - z = 1 - } - return -} - -// Srotmg computes the modified Givens rotation. See -// http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html -// for more details. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srotmg(d1, d2, x1, y1 float32) (p blas.SrotmParams, rd1, rd2, rx1 float32) { - // The implementation of Drotmg used here is taken from Hopkins 1997 - // Appendix A: https://doi.org/10.1145/289251.289253 - // with the exception of the gam constants below. - - const ( - gam = 4096.0 - gamsq = gam * gam - rgamsq = 1.0 / gamsq - ) - - if d1 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - if d2 == 0 || y1 == 0 { - p.Flag = blas.Identity - return p, d1, d2, x1 - } - - var h11, h12, h21, h22 float32 - if (d1 == 0 || x1 == 0) && d2 > 0 { - p.Flag = blas.Diagonal - h12 = 1 - h21 = -1 - x1 = y1 - d1, d2 = d2, d1 - } else { - p2 := d2 * y1 - p1 := d1 * x1 - q2 := p2 * y1 - q1 := p1 * x1 - if math.Abs(q1) > math.Abs(q2) { - p.Flag = blas.OffDiagonal - h11 = 1 - h22 = 1 - h21 = -y1 / x1 - h12 = p2 / p1 - u := 1 - h12*h21 - if u <= 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - d1 /= u - d2 /= u - x1 *= u - } else { - if q2 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - p.Flag = blas.Diagonal - h21 = -1 - h12 = 1 - h11 = p1 / p2 - h22 = x1 / y1 - u := 1 + h11*h22 - d1, d2 = d2/u, d1/u - x1 = y1 * u - } - } - - for d1 <= rgamsq && d1 != 0 { - p.Flag = blas.Rescaling - d1 = (d1 * gam) * gam - x1 /= gam - h11 /= gam - h12 /= gam - } - for d1 > gamsq { - p.Flag = blas.Rescaling - d1 = (d1 / gam) / gam - x1 *= gam - h11 *= gam - h12 *= gam - } - - for math.Abs(d2) <= rgamsq && d2 != 0 { - p.Flag = blas.Rescaling - d2 = (d2 * gam) * gam - h21 /= gam - h22 /= gam - } - for math.Abs(d2) > gamsq { - p.Flag = blas.Rescaling - d2 = (d2 / gam) / gam - h21 *= gam - h22 *= gam - } - - switch p.Flag { - case blas.Diagonal: - p.H = [4]float32{0: h11, 3: h22} - case blas.OffDiagonal: - p.H = [4]float32{1: h21, 2: h12} - case blas.Rescaling: - p.H = [4]float32{h11, h21, h12, h22} - default: - panic(badFlag) - } - - return p, d1, d2, x1 -} - -// Srot applies a plane transformation. -// x[i] = c * x[i] + s * y[i] -// y[i] = c * y[i] - s * x[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srot(n int, x []float32, incX int, y []float32, incY int, c float32, s float32) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = c*vx+s*vy, c*vy-s*vx - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = c*vx+s*vy, c*vy-s*vx - ix += incX - iy += incY - } -} - -// Srotm applies the modified Givens rotation to the 2×n matrix. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Srotm(n int, x []float32, incX int, y []float32, incY int, p blas.SrotmParams) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - if p.Flag == blas.Identity { - return - } - - switch p.Flag { - case blas.Rescaling: - h11 := p.H[0] - h12 := p.H[2] - h21 := p.H[1] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx*h11+vy*h12, vx*h21+vy*h22 - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx*h11+vy*h12, vx*h21+vy*h22 - ix += incX - iy += incY - } - case blas.OffDiagonal: - h12 := p.H[2] - h21 := p.H[1] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx+vy*h12, vx*h21+vy - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx+vy*h12, vx*h21+vy - ix += incX - iy += incY - } - case blas.Diagonal: - h11 := p.H[0] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx*h11+vy, -vx+vy*h22 - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx*h11+vy, -vx+vy*h22 - ix += incX - iy += incY - } - } -} - -// Sscal scales x by alpha. -// x[i] *= alpha -// Sscal has no effect if incX < 0. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sscal(n int, alpha float32, x []float32, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - f32.ScalUnitary(alpha, x[:n]) - return - } - f32.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go deleted file mode 100644 index 089e0d8f0..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_dsdot.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Dsdot computes the dot product of the two vectors -// \sum_i x[i]*y[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Dsdot(n int, x []float32, incX int, y []float32, incY int) float64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return f32.DdotUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return f32.DdotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go deleted file mode 100644 index 41c3e7923..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdot.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Sdot computes the dot product of the two vectors -// \sum_i x[i]*y[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sdot(n int, x []float32, incX int, y []float32, incY int) float32 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return f32.DotUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return f32.DotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go deleted file mode 100644 index 69dd8aa1f..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float32_sdsdot.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Sdsdot computes the dot product of the two vectors plus a constant -// alpha + \sum_i x[i]*y[i] -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sdsdot(n int, alpha float32, x []float32, incX int, y []float32, incY int) float32 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return alpha + float32(f32.DdotUnitary(x[:n], y[:n])) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return alpha + float32(f32.DdotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy))) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go deleted file mode 100644 index 2e8ed543a..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64.go +++ /dev/null @@ -1,620 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var _ blas.Float64Level1 = Implementation{} - -// Dnrm2 computes the Euclidean norm of a vector, -// sqrt(\sum_i x[i] * x[i]). -// This function returns 0 if incX is negative. -func (Implementation) Dnrm2(n int, x []float64, incX int) float64 { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return math.Abs(x[0]) - } - if n == 0 { - return 0 - } - panic(nLT0) - } - var ( - scale float64 = 0 - sumSquares float64 = 1 - ) - if incX == 1 { - x = x[:n] - for _, v := range x { - if v == 0 { - continue - } - absxi := math.Abs(v) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - sumSquares = 1 + sumSquares*(scale/absxi)*(scale/absxi) - scale = absxi - } else { - sumSquares = sumSquares + (absxi/scale)*(absxi/scale) - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) - } - for ix := 0; ix < n*incX; ix += incX { - val := x[ix] - if val == 0 { - continue - } - absxi := math.Abs(val) - if math.IsNaN(absxi) { - return math.NaN() - } - if scale < absxi { - sumSquares = 1 + sumSquares*(scale/absxi)*(scale/absxi) - scale = absxi - } else { - sumSquares = sumSquares + (absxi/scale)*(absxi/scale) - } - } - if math.IsInf(scale, 1) { - return math.Inf(1) - } - return scale * math.Sqrt(sumSquares) -} - -// Dasum computes the sum of the absolute values of the elements of x. -// \sum_i |x[i]| -// Dasum returns 0 if incX is negative. -func (Implementation) Dasum(n int, x []float64, incX int) float64 { - var sum float64 - if n < 0 { - panic(nLT0) - } - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return 0 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if incX == 1 { - x = x[:n] - for _, v := range x { - sum += math.Abs(v) - } - return sum - } - for i := 0; i < n; i++ { - sum += math.Abs(x[i*incX]) - } - return sum -} - -// Idamax returns the index of an element of x with the largest absolute value. -// If there are multiple such indices the earliest is returned. -// Idamax returns -1 if n == 0. -func (Implementation) Idamax(n int, x []float64, incX int) int { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return -1 - } - if len(x) <= (n-1)*incX { - panic(shortX) - } - if n < 2 { - if n == 1 { - return 0 - } - if n == 0 { - return -1 // Netlib returns invalid index when n == 0. - } - panic(nLT0) - } - idx := 0 - max := math.Abs(x[0]) - if incX == 1 { - for i, v := range x[:n] { - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - } - return idx - } - ix := incX - for i := 1; i < n; i++ { - v := x[ix] - absV := math.Abs(v) - if absV > max { - max = absV - idx = i - } - ix += incX - } - return idx -} - -// Dswap exchanges the elements of two vectors. -// x[i], y[i] = y[i], x[i] for all i -func (Implementation) Dswap(n int, x []float64, incX int, y []float64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, v := range x { - x[i], y[i] = y[i], v - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - x[ix], y[iy] = y[iy], x[ix] - ix += incX - iy += incY - } -} - -// Dcopy copies the elements of x into the elements of y. -// y[i] = x[i] for all i -func (Implementation) Dcopy(n int, x []float64, incX int, y []float64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - copy(y[:n], x[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - y[iy] = x[ix] - ix += incX - iy += incY - } -} - -// Daxpy adds alpha times x to y -// y[i] += alpha * x[i] for all i -func (Implementation) Daxpy(n int, alpha float64, x []float64, incX int, y []float64, incY int) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if alpha == 0 { - return - } - if incX == 1 && incY == 1 { - f64.AxpyUnitary(alpha, x[:n], y[:n]) - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - f64.AxpyInc(alpha, x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} - -// Drotg computes the plane rotation -// _ _ _ _ _ _ -// | c s | | a | | r | -// | -s c | * | b | = | 0 | -// ‾ ‾ ‾ ‾ ‾ ‾ -// where -// r = ±√(a^2 + b^2) -// c = a/r, the cosine of the plane rotation -// s = b/r, the sine of the plane rotation -// -// NOTE: There is a discrepancy between the reference implementation and the BLAS -// technical manual regarding the sign for r when a or b are zero. -// Drotg agrees with the definition in the manual and other -// common BLAS implementations. -func (Implementation) Drotg(a, b float64) (c, s, r, z float64) { - if b == 0 && a == 0 { - return 1, 0, a, 0 - } - absA := math.Abs(a) - absB := math.Abs(b) - aGTb := absA > absB - r = math.Hypot(a, b) - if aGTb { - r = math.Copysign(r, a) - } else { - r = math.Copysign(r, b) - } - c = a / r - s = b / r - if aGTb { - z = s - } else if c != 0 { // r == 0 case handled above - z = 1 / c - } else { - z = 1 - } - return -} - -// Drotmg computes the modified Givens rotation. See -// http://www.netlib.org/lapack/explore-html/df/deb/drotmg_8f.html -// for more details. -func (Implementation) Drotmg(d1, d2, x1, y1 float64) (p blas.DrotmParams, rd1, rd2, rx1 float64) { - // The implementation of Drotmg used here is taken from Hopkins 1997 - // Appendix A: https://doi.org/10.1145/289251.289253 - // with the exception of the gam constants below. - - const ( - gam = 4096.0 - gamsq = gam * gam - rgamsq = 1.0 / gamsq - ) - - if d1 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - if d2 == 0 || y1 == 0 { - p.Flag = blas.Identity - return p, d1, d2, x1 - } - - var h11, h12, h21, h22 float64 - if (d1 == 0 || x1 == 0) && d2 > 0 { - p.Flag = blas.Diagonal - h12 = 1 - h21 = -1 - x1 = y1 - d1, d2 = d2, d1 - } else { - p2 := d2 * y1 - p1 := d1 * x1 - q2 := p2 * y1 - q1 := p1 * x1 - if math.Abs(q1) > math.Abs(q2) { - p.Flag = blas.OffDiagonal - h11 = 1 - h22 = 1 - h21 = -y1 / x1 - h12 = p2 / p1 - u := 1 - h12*h21 - if u <= 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - d1 /= u - d2 /= u - x1 *= u - } else { - if q2 < 0 { - p.Flag = blas.Rescaling // Error state. - return p, 0, 0, 0 - } - - p.Flag = blas.Diagonal - h21 = -1 - h12 = 1 - h11 = p1 / p2 - h22 = x1 / y1 - u := 1 + h11*h22 - d1, d2 = d2/u, d1/u - x1 = y1 * u - } - } - - for d1 <= rgamsq && d1 != 0 { - p.Flag = blas.Rescaling - d1 = (d1 * gam) * gam - x1 /= gam - h11 /= gam - h12 /= gam - } - for d1 > gamsq { - p.Flag = blas.Rescaling - d1 = (d1 / gam) / gam - x1 *= gam - h11 *= gam - h12 *= gam - } - - for math.Abs(d2) <= rgamsq && d2 != 0 { - p.Flag = blas.Rescaling - d2 = (d2 * gam) * gam - h21 /= gam - h22 /= gam - } - for math.Abs(d2) > gamsq { - p.Flag = blas.Rescaling - d2 = (d2 / gam) / gam - h21 *= gam - h22 *= gam - } - - switch p.Flag { - case blas.Diagonal: - p.H = [4]float64{0: h11, 3: h22} - case blas.OffDiagonal: - p.H = [4]float64{1: h21, 2: h12} - case blas.Rescaling: - p.H = [4]float64{h11, h21, h12, h22} - default: - panic(badFlag) - } - - return p, d1, d2, x1 -} - -// Drot applies a plane transformation. -// x[i] = c * x[i] + s * y[i] -// y[i] = c * y[i] - s * x[i] -func (Implementation) Drot(n int, x []float64, incX int, y []float64, incY int, c float64, s float64) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = c*vx+s*vy, c*vy-s*vx - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = c*vx+s*vy, c*vy-s*vx - ix += incX - iy += incY - } -} - -// Drotm applies the modified Givens rotation to the 2×n matrix. -func (Implementation) Drotm(n int, x []float64, incX int, y []float64, incY int, p blas.DrotmParams) { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return - } - panic(nLT0) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - if p.Flag == blas.Identity { - return - } - - switch p.Flag { - case blas.Rescaling: - h11 := p.H[0] - h12 := p.H[2] - h21 := p.H[1] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx*h11+vy*h12, vx*h21+vy*h22 - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx*h11+vy*h12, vx*h21+vy*h22 - ix += incX - iy += incY - } - case blas.OffDiagonal: - h12 := p.H[2] - h21 := p.H[1] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx+vy*h12, vx*h21+vy - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx+vy*h12, vx*h21+vy - ix += incX - iy += incY - } - case blas.Diagonal: - h11 := p.H[0] - h22 := p.H[3] - if incX == 1 && incY == 1 { - x = x[:n] - for i, vx := range x { - vy := y[i] - x[i], y[i] = vx*h11+vy, -vx+vy*h22 - } - return - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - for i := 0; i < n; i++ { - vx := x[ix] - vy := y[iy] - x[ix], y[iy] = vx*h11+vy, -vx+vy*h22 - ix += incX - iy += incY - } - } -} - -// Dscal scales x by alpha. -// x[i] *= alpha -// Dscal has no effect if incX < 0. -func (Implementation) Dscal(n int, alpha float64, x []float64, incX int) { - if incX < 1 { - if incX == 0 { - panic(zeroIncX) - } - return - } - if n < 1 { - if n == 0 { - return - } - panic(nLT0) - } - if (n-1)*incX >= len(x) { - panic(shortX) - } - if alpha == 0 { - if incX == 1 { - x = x[:n] - for i := range x { - x[i] = 0 - } - return - } - for ix := 0; ix < n*incX; ix += incX { - x[ix] = 0 - } - return - } - if incX == 1 { - f64.ScalUnitary(alpha, x[:n]) - return - } - f64.ScalInc(alpha, x, uintptr(n), uintptr(incX)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go b/vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go deleted file mode 100644 index be87ba13d..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level1float64_ddot.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Ddot computes the dot product of the two vectors -// \sum_i x[i]*y[i] -func (Implementation) Ddot(n int, x []float64, incX int, y []float64, incY int) float64 { - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - if n <= 0 { - if n == 0 { - return 0 - } - panic(nLT0) - } - if incX == 1 && incY == 1 { - if len(x) < n { - panic(shortX) - } - if len(y) < n { - panic(shortY) - } - return f64.DotUnitary(x[:n], y[:n]) - } - var ix, iy int - if incX < 0 { - ix = (-n + 1) * incX - } - if incY < 0 { - iy = (-n + 1) * incY - } - if ix >= len(x) || ix+(n-1)*incX >= len(x) { - panic(shortX) - } - if iy >= len(y) || iy+(n-1)*incY >= len(y) { - panic(shortY) - } - return f64.DotInc(x, y, uintptr(n), uintptr(incX), uintptr(incY), uintptr(ix), uintptr(iy)) -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go deleted file mode 100644 index 03ee328fd..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx128.go +++ /dev/null @@ -1,2906 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math/cmplx" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c128" -) - -var _ blas.Complex128Level2 = Implementation{} - -// Zgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix -// with kL sub-diagonals and kU super-diagonals. -func (Implementation) Zgbmv(trans blas.Transpose, m, n, kL, kU int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - var lenX, lenY int - if trans == blas.NoTrans { - lenX, lenY = n, m - } else { - lenX, lenY = m, n - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c128.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - nRow := min(m, n+kL) - nCol := kL + 1 + kU - switch trans { - case blas.NoTrans: - iy := ky - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) - xtmp := x[off : off+u-l] - var sum complex128 - for j, v := range aRow { - sum += xtmp[j] * v - } - y[iy] += alpha * sum - iy += incY - } - } else { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incX - jx := kx - var sum complex128 - for _, v := range aRow { - sum += x[off+jx] * v - jx += incX - } - y[iy] += alpha * sum - iy += incY - } - } - case blas.Trans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - ix += incX - } - } - case blas.ConjTrans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - ix += incX - } - } - } -} - -// Zgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. -func (Implementation) Zgemv(trans blas.Transpose, m, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - var lenX, lenY int - if trans == blas.NoTrans { - lenX = n - lenY = m - } else { - lenX = m - lenY = n - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c128.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c128.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - switch trans { - default: - // Form y = alpha*A*x + y. - iy := ky - if incX == 1 { - for i := 0; i < m; i++ { - y[iy] += alpha * c128.DotuUnitary(a[i*lda:i*lda+n], x[:n]) - iy += incY - } - return - } - for i := 0; i < m; i++ { - y[iy] += alpha * c128.DotuInc(a[i*lda:i*lda+n], x, uintptr(n), 1, uintptr(incX), 0, uintptr(kx)) - iy += incY - } - return - - case blas.Trans: - // Form y = alpha*A^T*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - c128.AxpyUnitary(alpha*x[ix], a[i*lda:i*lda+n], y[:n]) - ix += incX - } - return - } - for i := 0; i < m; i++ { - c128.AxpyInc(alpha*x[ix], a[i*lda:i*lda+n], y, uintptr(n), 1, uintptr(incY), 0, uintptr(ky)) - ix += incX - } - return - - case blas.ConjTrans: - // Form y = alpha*A^H*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - for j := 0; j < n; j++ { - y[j] += tmp * cmplx.Conj(a[i*lda+j]) - } - ix += incX - } - return - } - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - jy := ky - for j := 0; j < n; j++ { - y[jy] += tmp * cmplx.Conj(a[i*lda+j]) - jy += incY - } - ix += incX - } - return - } -} - -// Zgerc performs the rank-one operation -// A += alpha * x * y^H -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -func (Implementation) Zgerc(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, jy int - if incX < 0 { - kx = (1 - m) * incX - } - if incY < 0 { - jy = (1 - n) * incY - } - for j := 0; j < n; j++ { - if y[jy] != 0 { - tmp := alpha * cmplx.Conj(y[jy]) - c128.AxpyInc(tmp, x, a[j:], uintptr(m), uintptr(incX), uintptr(lda), uintptr(kx), 0) - } - jy += incY - } -} - -// Zgeru performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -func (Implementation) Zgeru(m, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - m) * incX - } - if incY == 1 { - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c128.AxpyUnitary(tmp, y[:n], a[i*lda:i*lda+n]) - } - kx += incX - } - return - } - var jy int - if incY < 0 { - jy = (1 - n) * incY - } - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c128.AxpyInc(tmp, y, a[i*lda:i*lda+n], uintptr(n), uintptr(incY), 1, uintptr(jy), 0) - } - kx += incX - } -} - -// Zhbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian band matrix with k super-diagonals. The imaginary parts of -// the diagonal elements of A are ignored and assumed to be zero. -func (Implementation) Zhbmv(uplo blas.Uplo, n, k int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through a. - switch uplo { - case blas.Upper: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[i] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[i+j] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += sum - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[ix] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jx := incX - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - } - case blas.Lower: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[i] - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[ix] - jx := l * incX - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - ix += incX - iy += incY - } - } - } -} - -// Zhemv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix. The imaginary parts of the diagonal elements of A are -// ignored and assumed to be zero. -func (Implementation) Zhemv(uplo blas.Uplo, n int, alpha complex128, a []complex128, lda int, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through - // the triangular part of A. - - if uplo == blas.Upper { - // Form y when A is stored in upper triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex128 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex128 - jx := ix - jy := iy - for j := i + 1; j < n; j++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } - return - } - - // Form y when A is stored in lower triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex128 - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex128 - jx := kx - jy := ky - for j := 0; j < i; j++ { - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } -} - -// Zher performs the Hermitian rank-one operation -// A += alpha * x * x^H -// where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n -// element vector. On entry, the imaginary parts of the diagonal elements of A -// are ignored and assumed to be zero, on return they will be set to zero. -func (Implementation) Zher(uplo blas.Uplo, n int, alpha float64, x []complex128, incX int, a []complex128, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - jx := ix + incX - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } - return - } - - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - jx := kx - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } -} - -// Zher2 performs the Hermitian rank-two operation -// A += alpha * x * y^H + conj(alpha) * y * x^H -// where alpha is a scalar, x and y are n element vectors and A is an n×n -// Hermitian matrix. On entry, the imaginary parts of the diagonal elements are -// ignored and assumed to be zero. On return they will be set to zero. -func (Implementation) Zher2(uplo blas.Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, a []complex128, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, ky int - var ix, iy int - if incX != 1 || incY != 1 { - if incX < 0 { - kx = (1 - n) * incX - } - if incY < 0 { - ky = (1 - n) * incY - } - ix = kx - iy = ky - } - if uplo == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } - return - } - - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } -} - -// Zhpmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix in packed form. The imaginary parts of the diagonal -// elements of A are ignored and assumed to be zero. -func (Implementation) Zhpmv(uplo blas.Uplo, n int, alpha complex128, ap []complex128, x []complex128, incX int, beta complex128, y []complex128, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] *= beta - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form y when ap contains the upper triangle. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - y[i] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex128 - k := kk + 1 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - y[i] += alpha * tmp2 - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - y[iy] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex128 - jx := ix - jy := iy - for k := kk + 1; k < kk+n-i; k++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - } - y[iy] += alpha * tmp2 - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form y when ap contains the lower triangle. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex128 - k := kk - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - aii := complex(real(ap[kk+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex128 - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(ap[kk+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Zhpr performs the Hermitian rank-1 operation -// A += alpha * x * x^H -// where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix -// in packed form. On entry, the imaginary parts of the diagonal elements are -// assumed to be zero, and on return they are set to zero. -func (Implementation) Zhpr(uplo blas.Uplo, n int, alpha float64, x []complex128, incX int, ap []complex128) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - a := ap[kk+1 : kk+n-i] - x := x[i+1 : n] - for j, v := range x { - a[j] += tmp * cmplx.Conj(v) - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - jx := ix + incX - a := ap[kk+1 : kk+n-i] - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - for j, v := range x[:i] { - a[j] += tmp * cmplx.Conj(v) - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - jx := kx - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - kk += i + 1 - } - } -} - -// Zhpr2 performs the Hermitian rank-2 operation -// A += alpha * x * y^H + conj(alpha) * y * x^H -// where alpha is a complex scalar, x and y are n element vectors, and A is an -// n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts -// of the diagonal elements are assumed to be zero, and on return they are set to zero. -func (Implementation) Zhpr2(uplo blas.Uplo, n int, alpha complex128, x []complex128, incX int, y []complex128, incY int, ap []complex128) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk] = complex(aii, 0) - k := kk + 1 - for j := i + 1; j < n; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for k := kk + 1; k < kk+n-i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - k := kk - for j := 0; j < i; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Ztbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular band matrix, with -// (k+1) diagonals. -func (Implementation) Ztbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[i+j+1] * aij - } - x[i] = xi - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - for j, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[i-kk+j] * aij - } - x[i] = xi - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix -= incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+k] - } - ix += incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda]) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+k]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+k]) - } - ix += incX - } - } - } - } -} - -// Ztbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular band matrix -// with (k+1) diagonals. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Ztbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex128 - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[i+1+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex128 - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex128 - for j, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[i-kk+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex128 - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - ix += incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * aij - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * aij - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * aij - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * aij - jx += incX - } - ix -= incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix -= incX - } - } - } - } -} - -// Ztpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular matrix, supplied in -// packed form. -func (Implementation) Ztpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex128, x []complex128, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - x[i] += c128.DotuUnitary(ap[kk+1:kk+n-i], x[i+1:]) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - x[ix] += c128.DotuInc(ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - kk += n - i - } - } - } else { - // kk points to the beginning of current row in ap. - kk := n*(n+1)/2 - n - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - if i > 0 { - x[i] += c128.DotuUnitary(ap[kk:kk+i], x[:i]) - } - kk -= i - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - if i > 0 { - x[ix] += c128.DotuInc(ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - kk -= i - } - } - } - return - } - - if trans == blas.Trans { - // Form x = A^T*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - c128.AxpyUnitary(xi, ap[kk+1:kk+n-i], x[i+1:n]) - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - c128.AxpyInc(xi, ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if i > 0 { - c128.AxpyUnitary(x[i], ap[kk:kk+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c128.AxpyInc(x[ix], ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - // Form x = A^H*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk]) - } - k := kk + 1 - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(ap[k]) - k++ - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk]) - } - jx := ix + incX - k := kk + 1 - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(ap[k]) - jx += incX - k++ - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i, xi := range x { - for j := 0; j < i; j++ { - x[j] += xi * cmplx.Conj(ap[kk+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk+i]) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - jx := kx - for j := 0; j < i; j++ { - x[jx] += xi * cmplx.Conj(ap[kk+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk+i]) - } - ix += incX - kk += i + 1 - } - } - } -} - -// Ztpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix in -// packed form. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Ztpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex128, x []complex128, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[i] -= c128.DotuUnitary(x[i+1:n], ap[kk+1:kk+n-i]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[ix] -= c128.DotuInc(x, ap[kk+1:kk+n-i], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - kk := 0 - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c128.DotuUnitary(x[:i], ap[kk:kk+i]) - } - if diag == blas.NonUnit { - x[i] /= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c128.DotuInc(x, ap[kk:kk+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(A^T)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= ap[kk] - } - if n-j-1 > 0 { - c128.AxpyUnitary(-x[j], ap[kk+1:kk+n-j], x[j+1:n]) - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= ap[kk] - } - if n-j-1 > 0 { - c128.AxpyInc(-x[jx], ap[kk+1:kk+n-j], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= ap[kk+j] - } - if j > 0 { - c128.AxpyUnitary(-x[j], ap[kk:kk+j], x[:j]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= ap[kk+j] - } - if j > 0 { - c128.AxpyInc(-x[jx], ap[kk:kk+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - kk -= j - } - } - } - return - } - - // Form x = inv(A^H)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk]) - } - xj := x[j] - k := kk + 1 - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(ap[k]) - k++ - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk]) - } - xj := x[jx] - ix := jx + incX - k := kk + 1 - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(ap[k]) - ix += incX - k++ - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(ap[kk+i]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(ap[kk+i]) - ix += incX - } - jx -= incX - kk -= j - } - } - } -} - -// Ztrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans -// where x is a vector, and A is an n×n triangular matrix. -func (Implementation) Ztrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[i] += c128.DotuUnitary(a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[ix] += c128.DotuInc(a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if i > 0 { - x[i] += c128.DotuUnitary(a[i*lda:i*lda+i], x[:i]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if i > 0 { - x[ix] += c128.DotuInc(a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = A^T*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - c128.AxpyUnitary(xi, a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - c128.AxpyInc(xi, a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - c128.AxpyUnitary(x[i], a[i*lda:i*lda+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c128.AxpyInc(x[ix], a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - // Form x = A^H*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(a[i*lda+j]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - jx := ix + incX - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(a[i*lda+j]) - jx += incX - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - x[j] += x[i] * cmplx.Conj(a[i*lda+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - jx := kx - for j := 0; j < i; j++ { - x[jx] += x[ix] * cmplx.Conj(a[i*lda+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - ix += incX - } - } - } -} - -// Ztrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Ztrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex128, lda int, x []complex128, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[i] -= c128.DotuUnitary(x[i+1:n], a[i*lda+i+1:i*lda+n]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[ix] -= c128.DotuInc(x, a[i*lda+i+1:i*lda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c128.DotuUnitary(x[:i], a[i*lda:i*lda+i]) - } - if diag == blas.NonUnit { - x[i] /= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c128.DotuInc(x, a[i*lda:i*lda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(A^T)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - if n-j-1 > 0 { - c128.AxpyUnitary(-x[j], a[j*lda+j+1:j*lda+n], x[j+1:n]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if n-j-1 > 0 { - c128.AxpyInc(-x[jx], a[j*lda+j+1:j*lda+n], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - xj := x[j] - if j > 0 { - c128.AxpyUnitary(-xj, a[j*lda:j*lda+j], x[:j]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if j > 0 { - c128.AxpyInc(-x[jx], a[j*lda:j*lda+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - } - } - } - return - } - - // Form x = inv(A^H)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := jx + incX - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx -= incX - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go deleted file mode 100644 index 10faf8f7d..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2cmplx64.go +++ /dev/null @@ -1,2942 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - cmplx "gonum.org/v1/gonum/internal/cmplx64" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c64" -) - -var _ blas.Complex64Level2 = Implementation{} - -// Cgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n band matrix -// with kL sub-diagonals and kU super-diagonals. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgbmv(trans blas.Transpose, m, n, kL, kU int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - var lenX, lenY int - if trans == blas.NoTrans { - lenX, lenY = n, m - } else { - lenX, lenY = m, n - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c64.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - nRow := min(m, n+kL) - nCol := kL + 1 + kU - switch trans { - case blas.NoTrans: - iy := ky - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) - xtmp := x[off : off+u-l] - var sum complex64 - for j, v := range aRow { - sum += xtmp[j] * v - } - y[iy] += alpha * sum - iy += incY - } - } else { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incX - jx := kx - var sum complex64 - for _, v := range aRow { - sum += x[off+jx] * v - jx += incX - } - y[iy] += alpha * sum - iy += incY - } - } - case blas.Trans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * v - jy += incY - } - ix += incX - } - } - case blas.ConjTrans: - if incX == 1 { - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[i] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - } - } else { - ix := kx - for i := 0; i < nRow; i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - aRow := a[i*lda+l : i*lda+u] - off := max(0, i-kL) * incY - alphaxi := alpha * x[ix] - jy := ky - for _, v := range aRow { - y[off+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - ix += incX - } - } - } -} - -// Cgemv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if trans = blas.NoTrans -// y = alpha * A^T * x + beta * y if trans = blas.Trans -// y = alpha * A^H * x + beta * y if trans = blas.ConjTrans -// where alpha and beta are scalars, x and y are vectors, and A is an m×n dense matrix. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgemv(trans blas.Transpose, m, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - var lenX, lenY int - if trans == blas.NoTrans { - lenX = n - lenY = m - } else { - lenX = m - lenY = n - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx int - if incX < 0 { - kx = (1 - lenX) * incX - } - var ky int - if incY < 0 { - ky = (1 - lenY) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - c64.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - c64.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - switch trans { - default: - // Form y = alpha*A*x + y. - iy := ky - if incX == 1 { - for i := 0; i < m; i++ { - y[iy] += alpha * c64.DotuUnitary(a[i*lda:i*lda+n], x[:n]) - iy += incY - } - return - } - for i := 0; i < m; i++ { - y[iy] += alpha * c64.DotuInc(a[i*lda:i*lda+n], x, uintptr(n), 1, uintptr(incX), 0, uintptr(kx)) - iy += incY - } - return - - case blas.Trans: - // Form y = alpha*A^T*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - c64.AxpyUnitary(alpha*x[ix], a[i*lda:i*lda+n], y[:n]) - ix += incX - } - return - } - for i := 0; i < m; i++ { - c64.AxpyInc(alpha*x[ix], a[i*lda:i*lda+n], y, uintptr(n), 1, uintptr(incY), 0, uintptr(ky)) - ix += incX - } - return - - case blas.ConjTrans: - // Form y = alpha*A^H*x + y. - ix := kx - if incY == 1 { - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - for j := 0; j < n; j++ { - y[j] += tmp * cmplx.Conj(a[i*lda+j]) - } - ix += incX - } - return - } - for i := 0; i < m; i++ { - tmp := alpha * x[ix] - jy := ky - for j := 0; j < n; j++ { - y[jy] += tmp * cmplx.Conj(a[i*lda+j]) - jy += incY - } - ix += incX - } - return - } -} - -// Cgerc performs the rank-one operation -// A += alpha * x * y^H -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgerc(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, jy int - if incX < 0 { - kx = (1 - m) * incX - } - if incY < 0 { - jy = (1 - n) * incY - } - for j := 0; j < n; j++ { - if y[jy] != 0 { - tmp := alpha * cmplx.Conj(y[jy]) - c64.AxpyInc(tmp, x, a[j:], uintptr(m), uintptr(incX), uintptr(lda), uintptr(kx), 0) - } - jy += incY - } -} - -// Cgeru performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, alpha is a scalar, x is an m element vector, -// and y is an n element vector. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgeru(m, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - m) * incX - } - if incY == 1 { - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c64.AxpyUnitary(tmp, y[:n], a[i*lda:i*lda+n]) - } - kx += incX - } - return - } - var jy int - if incY < 0 { - jy = (1 - n) * incY - } - for i := 0; i < m; i++ { - if x[kx] != 0 { - tmp := alpha * x[kx] - c64.AxpyInc(tmp, y, a[i*lda:i*lda+n], uintptr(n), uintptr(incY), 1, uintptr(jy), 0) - } - kx += incX - } -} - -// Chbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian band matrix with k super-diagonals. The imaginary parts of -// the diagonal elements of A are ignored and assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chbmv(uplo blas.Uplo, n, k int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through a. - switch uplo { - case blas.Upper: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[i] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[i+j] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += sum - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - aRow := a[i*lda:] - alphaxi := alpha * x[ix] - sum := alphaxi * complex(real(aRow[0]), 0) - u := min(k+1, n-i) - jx := incX - jy := incY - for j := 1; j < u; j++ { - v := aRow[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - } - case blas.Lower: - iy := ky - if incX == 1 { - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[i] - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - iy += incY - } - } else { - ix := kx - for i := 0; i < n; i++ { - l := max(0, k-i) - alphaxi := alpha * x[ix] - jx := l * incX - jy := l * incY - aRow := a[i*lda:] - for j := l; j < k; j++ { - v := aRow[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += alphaxi * cmplx.Conj(v) - jx += incX - jy += incY - } - y[iy] += alphaxi * complex(real(aRow[k]), 0) - ix += incX - iy += incY - } - } - } -} - -// Chemv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix. The imaginary parts of the diagonal elements of A are -// ignored and assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chemv(uplo blas.Uplo, n int, alpha complex64, a []complex64, lda int, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] = beta * y[iy] - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through - // the triangular part of A. - - if uplo == blas.Upper { - // Form y when A is stored in upper triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex64 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex64 - jx := ix - jy := iy - for j := i + 1; j < n; j++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } - return - } - - // Form y when A is stored in lower triangle. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex64 - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[j] - } - aii := complex(real(a[i*lda+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex64 - jx := kx - jy := ky - for j := 0; j < i; j++ { - y[jy] += tmp1 * cmplx.Conj(a[i*lda+j]) - tmp2 += a[i*lda+j] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(a[i*lda+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - } - } -} - -// Cher performs the Hermitian rank-one operation -// A += alpha * x * x^H -// where A is an n×n Hermitian matrix, alpha is a real scalar, and x is an n -// element vector. On entry, the imaginary parts of the diagonal elements of A -// are ignored and assumed to be zero, on return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cher(uplo blas.Uplo, n int, alpha float32, x []complex64, incX int, a []complex64, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - jx := ix + incX - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } - return - } - - if incX == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 { - tmp := complex(alpha*real(x[i]), alpha*imag(x[i])) - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii+xtmp, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - - ix := kx - for i := 0; i < n; i++ { - if x[ix] != 0 { - tmp := complex(alpha*real(x[ix]), alpha*imag(x[ix])) - jx := kx - for j := 0; j < i; j++ { - a[i*lda+j] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - aii := real(a[i*lda+i]) - xtmp := real(tmp * cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii+xtmp, 0) - - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - } -} - -// Cher2 performs the Hermitian rank-two operation -// A += alpha * x * y^H + conj(alpha) * y * x^H -// where alpha is a scalar, x and y are n element vectors and A is an n×n -// Hermitian matrix. On entry, the imaginary parts of the diagonal elements are -// ignored and assumed to be zero. On return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cher2(uplo blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, a []complex64, lda int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var kx, ky int - var ix, iy int - if incX != 1 || incY != 1 { - if incX < 0 { - kx = (1 - n) * incX - } - if incY < 0 { - ky = (1 - n) * incY - } - ix = kx - iy = ky - } - if uplo == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for j := i + 1; j < n; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } - return - } - - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - } - return - } - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for j := 0; j < i; j++ { - a[i*lda+j] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(a[i*lda+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - a[i*lda+i] = complex(aii, 0) - } else { - aii := real(a[i*lda+i]) - a[i*lda+i] = complex(aii, 0) - } - ix += incX - iy += incY - } -} - -// Chpmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where alpha and beta are scalars, x and y are vectors, and A is an n×n -// Hermitian matrix in packed form. The imaginary parts of the diagonal -// elements of A are ignored and assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chpmv(uplo blas.Uplo, n int, alpha complex64, ap []complex64, x []complex64, incX int, beta complex64, y []complex64, incY int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up the start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // Form y = beta*y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - for i, v := range y[:n] { - y[i] = beta * v - } - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - for i := 0; i < n; i++ { - y[iy] *= beta - iy += incY - } - } - } - } - - if alpha == 0 { - return - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form y when ap contains the upper triangle. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - y[i] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex64 - k := kk + 1 - for j := i + 1; j < n; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - y[i] += alpha * tmp2 - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - y[iy] += tmp1 * complex(real(ap[kk]), 0) - var tmp2 complex64 - jx := ix - jy := iy - for k := kk + 1; k < kk+n-i; k++ { - jx += incX - jy += incY - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - } - y[iy] += alpha * tmp2 - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form y when ap contains the lower triangle. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - tmp1 := alpha * x[i] - var tmp2 complex64 - k := kk - for j := 0; j < i; j++ { - y[j] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[j] - k++ - } - aii := complex(real(ap[kk+i]), 0) - y[i] += tmp1*aii + alpha*tmp2 - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - tmp1 := alpha * x[ix] - var tmp2 complex64 - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - y[jy] += tmp1 * cmplx.Conj(ap[k]) - tmp2 += ap[k] * x[jx] - jx += incX - jy += incY - } - aii := complex(real(ap[kk+i]), 0) - y[iy] += tmp1*aii + alpha*tmp2 - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Chpr performs the Hermitian rank-1 operation -// A += alpha * x * x^H -// where alpha is a real scalar, x is a vector, and A is an n×n hermitian matrix -// in packed form. On entry, the imaginary parts of the diagonal elements are -// assumed to be zero, and on return they are set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chpr(uplo blas.Uplo, n int, alpha float32, x []complex64, incX int, ap []complex64) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - a := ap[kk+1 : kk+n-i] - x := x[i+1 : n] - for j, v := range x { - a[j] += tmp * cmplx.Conj(v) - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - aii := real(ap[kk]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk] = complex(aii, 0) - - tmp := complex(alpha, 0) * xi - jx := ix + incX - a := ap[kk+1 : kk+n-i] - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - for j, v := range x[:i] { - a[j] += tmp * cmplx.Conj(v) - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if xi != 0 { - tmp := complex(alpha, 0) * xi - a := ap[kk : kk+i] - jx := kx - for k := range a { - a[k] += tmp * cmplx.Conj(x[jx]) - jx += incX - } - - aii := real(ap[kk+i]) + alpha*real(cmplx.Conj(xi)*xi) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - kk += i + 1 - } - } -} - -// Chpr2 performs the Hermitian rank-2 operation -// A += alpha * x * y^H + conj(alpha) * y * x^H -// where alpha is a complex scalar, x and y are n element vectors, and A is an -// n×n Hermitian matrix, supplied in packed form. On entry, the imaginary parts -// of the diagonal elements are assumed to be zero, and on return they are set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chpr2(uplo blas.Uplo, n int, alpha complex64, x []complex64, incX int, y []complex64, incY int, ap []complex64) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - // Set up start indices in X and Y. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - var ky int - if incY < 0 { - ky = (1 - n) * incY - } - - // The elements of A are accessed sequentially with one pass through ap. - - var kk int - if uplo == blas.Upper { - // Form A when upper triangle is stored in AP. - // Here, kk points to the current diagonal element in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk] = complex(aii, 0) - k := kk + 1 - for j := i + 1; j < n; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - kk += n - i - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - aii := real(ap[kk]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk] = complex(aii, 0) - jx := ix + incX - jy := iy + incY - for k := kk + 1; k < kk+n-i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - } else { - ap[kk] = complex(real(ap[kk]), 0) - } - ix += incX - iy += incY - kk += n - i - } - } - return - } - - // Form A when lower triangle is stored in AP. - // Here, kk points to the beginning of current row in ap. - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - if x[i] != 0 || y[i] != 0 { - tmp1 := alpha * x[i] - tmp2 := cmplx.Conj(alpha) * y[i] - k := kk - for j := 0; j < i; j++ { - ap[k] += tmp1*cmplx.Conj(y[j]) + tmp2*cmplx.Conj(x[j]) - k++ - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[i])) + real(tmp2*cmplx.Conj(x[i])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - kk += i + 1 - } - } else { - ix := kx - iy := ky - for i := 0; i < n; i++ { - if x[ix] != 0 || y[iy] != 0 { - tmp1 := alpha * x[ix] - tmp2 := cmplx.Conj(alpha) * y[iy] - jx := kx - jy := ky - for k := kk; k < kk+i; k++ { - ap[k] += tmp1*cmplx.Conj(y[jy]) + tmp2*cmplx.Conj(x[jx]) - jx += incX - jy += incY - } - aii := real(ap[kk+i]) + real(tmp1*cmplx.Conj(y[iy])) + real(tmp2*cmplx.Conj(x[ix])) - ap[kk+i] = complex(aii, 0) - } else { - ap[kk+i] = complex(real(ap[kk+i]), 0) - } - ix += incX - iy += incY - kk += i + 1 - } - } -} - -// Ctbmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular band matrix, with -// (k+1) diagonals. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctbmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[i+j+1] * aij - } - x[i] = xi - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda] - } - kk := min(k, n-i-1) - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - for j, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[i-kk+j] * aij - } - x[i] = xi - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - xi *= a[i*lda+k] - } - kk := min(k, i) - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - xi += x[jx] * aij - jx += incX - } - x[ix] = xi - ix -= incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * aij - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * aij - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+k] - } - ix += incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+j+1] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - jx := ix + incX - xi := x[ix] - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda]) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] += xi * cmplx.Conj(aij) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+k]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - jx := ix - kk*incX - xi := x[ix] - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] += xi * cmplx.Conj(aij) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+k]) - } - ix += incX - } - } - } - } -} - -// Ctbsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular band matrix -// with (k+1) diagonals. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctbsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, k int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - switch trans { - case blas.NoTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex64 - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[i+1+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - kk := min(k, n-i-1) - var sum complex64 - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex64 - for j, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[i-kk+j] * aij - } - x[i] -= sum - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - kk := min(k, i) - var sum complex64 - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - sum += x[jx] * aij - jx += incX - } - x[ix] -= sum - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - ix += incX - } - } - } - case blas.Trans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * aij - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= a[i*lda] - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * aij - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * aij - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= a[i*lda+k] - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * aij - jx += incX - } - ix -= incX - } - } - } - case blas.ConjTrans: - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[i] - for j, aij := range a[i*lda+1 : i*lda+kk+1] { - x[i+1+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda]) - } - kk := min(k, n-i-1) - xi := x[ix] - jx := ix + incX - for _, aij := range a[i*lda+1 : i*lda+kk+1] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[i] - for j, aij := range a[i*lda+k-kk : i*lda+k] { - x[i-kk+j] -= xi * cmplx.Conj(aij) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] /= cmplx.Conj(a[i*lda+k]) - } - kk := min(k, i) - xi := x[ix] - jx := ix - kk*incX - for _, aij := range a[i*lda+k-kk : i*lda+k] { - x[jx] -= xi * cmplx.Conj(aij) - jx += incX - } - ix -= incX - } - } - } - } -} - -// Ctpmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans -// where x is an n element vector and A is an n×n triangular matrix, supplied in -// packed form. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctpmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex64, x []complex64, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - x[i] += c64.DotuUnitary(ap[kk+1:kk+n-i], x[i+1:]) - } - kk += n - i - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - x[ix] += c64.DotuInc(ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - kk += n - i - } - } - } else { - // kk points to the beginning of current row in ap. - kk := n*(n+1)/2 - n - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - if i > 0 { - x[i] += c64.DotuUnitary(ap[kk:kk+i], x[:i]) - } - kk -= i - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - if i > 0 { - x[ix] += c64.DotuInc(ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - kk -= i - } - } - } - return - } - - if trans == blas.Trans { - // Form x = A^T*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= ap[kk] - } - if n-i-1 > 0 { - c64.AxpyUnitary(xi, ap[kk+1:kk+n-i], x[i+1:n]) - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= ap[kk] - } - if n-i-1 > 0 { - c64.AxpyInc(xi, ap[kk+1:kk+n-i], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i := range x { - if i > 0 { - c64.AxpyUnitary(x[i], ap[kk:kk+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c64.AxpyInc(x[ix], ap[kk:kk+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - // Form x = A^H*x. - if uplo == blas.Upper { - // kk points to the current diagonal element in ap. - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk]) - } - k := kk + 1 - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(ap[k]) - k++ - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk]) - } - jx := ix + incX - k := kk + 1 - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(ap[k]) - jx += incX - k++ - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - // kk points to the beginning of current row in ap. - kk := 0 - if incX == 1 { - x = x[:n] - for i, xi := range x { - for j := 0; j < i; j++ { - x[j] += xi * cmplx.Conj(ap[kk+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(ap[kk+i]) - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - xi := x[ix] - jx := kx - for j := 0; j < i; j++ { - x[jx] += xi * cmplx.Conj(ap[kk+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(ap[kk+i]) - } - ix += incX - kk += i + 1 - } - } - } -} - -// Ctpsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix in -// packed form. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctpsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, ap []complex64, x []complex64, incX int) { - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through ap. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - kk := n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[i] -= c64.DotuUnitary(x[i+1:n], ap[kk+1:kk+n-i]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - kk -= n - i + 1 - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := ap[kk] - if n-i-1 > 0 { - x[ix] -= c64.DotuInc(x, ap[kk+1:kk+n-i], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - kk -= n - i + 1 - } - } - } else { - kk := 0 - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c64.DotuUnitary(x[:i], ap[kk:kk+i]) - } - if diag == blas.NonUnit { - x[i] /= ap[kk+i] - } - kk += i + 1 - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c64.DotuInc(x, ap[kk:kk+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= ap[kk+i] - } - ix += incX - kk += i + 1 - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(A^T)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= ap[kk] - } - if n-j-1 > 0 { - c64.AxpyUnitary(-x[j], ap[kk+1:kk+n-j], x[j+1:n]) - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= ap[kk] - } - if n-j-1 > 0 { - c64.AxpyInc(-x[jx], ap[kk+1:kk+n-j], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= ap[kk+j] - } - if j > 0 { - c64.AxpyUnitary(-x[j], ap[kk:kk+j], x[:j]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= ap[kk+j] - } - if j > 0 { - c64.AxpyInc(-x[jx], ap[kk:kk+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - kk -= j - } - } - } - return - } - - // Form x = inv(A^H)*x. - if uplo == blas.Upper { - kk := 0 - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk]) - } - xj := x[j] - k := kk + 1 - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(ap[k]) - k++ - } - kk += n - j - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk]) - } - xj := x[jx] - ix := jx + incX - k := kk + 1 - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(ap[k]) - ix += incX - k++ - } - jx += incX - kk += n - j - } - } - } else { - kk := n*(n+1)/2 - n - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(ap[kk+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(ap[kk+i]) - } - kk -= j - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(ap[kk+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(ap[kk+i]) - ix += incX - } - jx -= incX - kk -= j - } - } - } -} - -// Ctrmv performs one of the matrix-vector operations -// x = A * x if trans = blas.NoTrans -// x = A^T * x if trans = blas.Trans -// x = A^H * x if trans = blas.ConjTrans -// where x is a vector, and A is an n×n triangular matrix. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrmv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = A*x. - if uplo == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[i] += c64.DotuUnitary(a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - x[ix] += c64.DotuInc(a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix += incX - } - } - } else { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if i > 0 { - x[i] += c64.DotuUnitary(a[i*lda:i*lda+i], x[:i]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if i > 0 { - x[ix] += c64.DotuInc(a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - ix -= incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = A^T*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - if n-i-1 > 0 { - c64.AxpyUnitary(xi, a[i*lda+i+1:i*lda+n], x[i+1:n]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - if n-i-1 > 0 { - c64.AxpyInc(xi, a[i*lda+i+1:i*lda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(ix+incX)) - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - c64.AxpyUnitary(x[i], a[i*lda:i*lda+i], x[:i]) - } - if diag == blas.NonUnit { - x[i] *= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - c64.AxpyInc(x[ix], a[i*lda:i*lda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - } - if diag == blas.NonUnit { - x[ix] *= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - // Form x = A^H*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - xi := x[i] - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - for j := i + 1; j < n; j++ { - x[j] += xi * cmplx.Conj(a[i*lda+j]) - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - xi := x[ix] - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - jx := ix + incX - for j := i + 1; j < n; j++ { - x[jx] += xi * cmplx.Conj(a[i*lda+j]) - jx += incX - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - x[j] += x[i] * cmplx.Conj(a[i*lda+j]) - } - if diag == blas.NonUnit { - x[i] *= cmplx.Conj(a[i*lda+i]) - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - jx := kx - for j := 0; j < i; j++ { - x[jx] += x[ix] * cmplx.Conj(a[i*lda+j]) - jx += incX - } - if diag == blas.NonUnit { - x[ix] *= cmplx.Conj(a[i*lda+i]) - } - ix += incX - } - } - } -} - -// Ctrsv solves one of the systems of equations -// A * x = b if trans == blas.NoTrans -// A^T * x = b if trans == blas.Trans -// A^H * x = b if trans == blas.ConjTrans -// where b and x are n element vectors and A is an n×n triangular matrix. -// -// On entry, x contains the values of b, and the solution is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrsv(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n int, a []complex64, lda int, x []complex64, incX int) { - switch trans { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch uplo { - default: - panic(badUplo) - case blas.Upper, blas.Lower: - } - switch diag { - default: - panic(badDiag) - case blas.NonUnit, blas.Unit: - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - // Set up start index in X. - var kx int - if incX < 0 { - kx = (1 - n) * incX - } - - // The elements of A are accessed sequentially with one pass through A. - - if trans == blas.NoTrans { - // Form x = inv(A)*x. - if uplo == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[i] -= c64.DotuUnitary(x[i+1:n], a[i*lda+i+1:i*lda+n]) - } - if diag == blas.NonUnit { - x[i] /= aii - } - } - } else { - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - aii := a[i*lda+i] - if n-i-1 > 0 { - x[ix] -= c64.DotuInc(x, a[i*lda+i+1:i*lda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - } - if diag == blas.NonUnit { - x[ix] /= aii - } - ix -= incX - } - } - } else { - if incX == 1 { - for i := 0; i < n; i++ { - if i > 0 { - x[i] -= c64.DotuUnitary(x[:i], a[i*lda:i*lda+i]) - } - if diag == blas.NonUnit { - x[i] /= a[i*lda+i] - } - } - } else { - ix := kx - for i := 0; i < n; i++ { - if i > 0 { - x[ix] -= c64.DotuInc(x, a[i*lda:i*lda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - } - if diag == blas.NonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - } - } - return - } - - if trans == blas.Trans { - // Form x = inv(A^T)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - if n-j-1 > 0 { - c64.AxpyUnitary(-x[j], a[j*lda+j+1:j*lda+n], x[j+1:n]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if n-j-1 > 0 { - c64.AxpyInc(-x[jx], a[j*lda+j+1:j*lda+n], x, uintptr(n-j-1), 1, uintptr(incX), 0, uintptr(jx+incX)) - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= a[j*lda+j] - } - xj := x[j] - if j > 0 { - c64.AxpyUnitary(-xj, a[j*lda:j*lda+j], x[:j]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= a[j*lda+j] - } - if j > 0 { - c64.AxpyInc(-x[jx], a[j*lda:j*lda+j], x, uintptr(j), 1, uintptr(incX), 0, uintptr(kx)) - } - jx -= incX - } - } - } - return - } - - // Form x = inv(A^H)*x. - if uplo == blas.Upper { - if incX == 1 { - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := j + 1; i < n; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx - for j := 0; j < n; j++ { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := jx + incX - for i := j + 1; i < n; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx += incX - } - } - } else { - if incX == 1 { - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[j] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[j] - for i := 0; i < j; i++ { - x[i] -= xj * cmplx.Conj(a[j*lda+i]) - } - } - } else { - jx := kx + (n-1)*incX - for j := n - 1; j >= 0; j-- { - if diag == blas.NonUnit { - x[jx] /= cmplx.Conj(a[j*lda+j]) - } - xj := x[jx] - ix := kx - for i := 0; i < j; i++ { - x[ix] -= xj * cmplx.Conj(a[j*lda+i]) - ix += incX - } - jx -= incX - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go deleted file mode 100644 index 08e1927f7..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2float32.go +++ /dev/null @@ -1,2296 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -var _ blas.Float32Level2 = Implementation{} - -// Sger performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sger(m, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - f32.Ger(uintptr(m), uintptr(n), - alpha, - x, uintptr(incX), - y, uintptr(incY), - a, uintptr(lda)) -} - -// Sgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans -// where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, -// x and y are vectors, and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - // i and j are indices of the compacted banded matrix. - // off is the offset into the dense matrix (off + j = densej) - nCol := kU + 1 + kL - if tA == blas.NoTrans { - iy := ky - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - xtmp := x[off : off+u-l] - var sum float32 - for j, v := range atmp { - sum += xtmp[j] * v - } - y[iy] += sum * alpha - iy += incY - } - return - } - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - jx := kx - var sum float32 - for _, v := range atmp { - sum += x[off*incX+jx] * v - jx += incX - } - y[iy] += sum * alpha - iy += incY - } - return - } - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[i] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - } - return - } - ix := kx - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[ix] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - ix += incX - } -} - -// Strmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - nonUnit := d != blas.Unit - if n == 1 { - if nonUnit { - x[0] *= a[0] - } - return - } - var kx int - if incX <= 0 { - kx = -(n - 1) * incX - } - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp = a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f32.DotUnitary(a[ilda+i+1:ilda+n], x[i+1:n]) - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f32.DotInc(x, a[ilda+i+1:ilda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp += a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f32.DotUnitary(a[ilda:ilda+i], x[:i]) - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float32 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f32.DotInc(x, a[ilda:ilda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - ix -= incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[i] - f32.AxpyUnitary(xi, a[ilda+i+1:ilda+n], x[i+1:n]) - if nonUnit { - x[i] *= a[ilda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[ix] - f32.AxpyInc(xi, a[ilda+i+1:ilda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(kx+(i+1)*incX)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[i] - f32.AxpyUnitary(xi, a[ilda:ilda+i], x[:i]) - if nonUnit { - x[i] *= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[ix] - f32.AxpyInc(xi, a[ilda:ilda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix += incX - } -} - -// Strsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - if n == 1 { - if d == blas.NonUnit { - x[0] /= a[0] - } - return - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - var sum float32 - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := i + j + 1 - sum += x[jv] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - var sum float32 - jx := ix + incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - var sum float32 - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - sum += x[j] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - var sum float32 - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := j + i + 1 - x[jv] -= v * xi - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx + (i+1)*incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - x[j] -= v * xi - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix -= incX - } -} - -// Ssymv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssymv(ul blas.Uplo, n int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * a[0] * x[0] - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := x[i] * a[i*lda+i] - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jp := j + i + 1 - sum += x[jp] * v - y[jy] += xv * v - jy += incY - } - y[iy] += alpha * sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := x[ix] * a[i*lda+i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - jy := ky - xv := alpha * x[i] - atmp := a[i*lda : i*lda+i] - var sum float32 - for j, v := range atmp { - sum += x[j] * v - y[jy] += xv * v - jy += incY - } - sum += x[i] * a[i*lda+i] - sum *= alpha - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xv := alpha * x[ix] - atmp := a[i*lda : i*lda+i] - var sum float32 - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - sum += x[ix] * a[i*lda+i] - sum *= alpha - y[iy] += sum - ix += incX - iy += incY - } -} - -// Stbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonunit := d != blas.Unit - - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float32 - atmp := a[i*lda:] - xtmp := x[i:] - for j := 1; j < u; j++ { - sum += xtmp[j] * atmp[j] - } - if nonunit { - sum += xtmp[0] * atmp[0] - } else { - sum += xtmp[0] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float32 - atmp := a[i*lda:] - jx := incX - for j := 1; j < u; j++ { - sum += x[ix+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[0] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float32 - for j := l; j < k; j++ { - sum += x[i-k+j] * atmp[j] - } - if nonunit { - sum += x[i] * atmp[k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float32 - jx := l * incX - for j := l; j < k; j++ { - sum += x[ix-k*incX+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[k] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float32 - for j := 1; j < u; j++ { - sum += x[i-j] * a[(i-j)*lda+j] - } - if nonunit { - sum += x[i] * a[i*lda] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float32 - jx := incX - for j := 1; j < u; j++ { - sum += x[ix-jx] * a[(i-j)*lda+j] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var sum float32 - for j := 0; j < u; j++ { - sum += x[i+j+1] * a[(i+j+1)*lda+k-j-1] - } - if nonunit { - sum += x[i] * a[i*lda+k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var ( - sum float32 - jx int - ) - for j := 0; j < u; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda+k] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } -} - -// Stpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float32, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xi += v * xtmp[j] - } - x[i] = xi - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset += n - i - ix += incX - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset-i : offset] - for j, v := range atmp { - xi += v * x[j] - } - x[i] = xi - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset -= i + 1 - ix -= incX - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - jx := kx + (i+1)*incX - atmp := ap[offset+1 : offset+n-i] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - offset -= n - i + 1 - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - jx := kx - atmp := ap[offset-i : offset] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - ix += incX - offset += i + 2 - } -} - -// Stbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, -// and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float32, lda int, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - // Form x = A^-1 x. - // Several cases below use subslices for speed improvement. - // The incX != 1 cases usually do not because incX may be negative. - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - atmp := a[i*lda+1:] - xtmp := x[i+1 : i+bands+1] - var sum float32 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - max := k + 1 - if i+max > n { - max = n - i - } - atmp := a[i*lda:] - var ( - jx int - sum float32 - ) - for j := 1; j < max; j++ { - jx += incX - sum += x[ix+jx] * atmp[j] - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[0] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - xtmp := x[i-bands : i] - var sum float32 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= atmp[bands] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - var ( - sum float32 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * atmp[j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[bands] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var sum float32 - for j := 0; j < bands; j++ { - sum += x[i-bands+j] * a[(i-bands+j)*lda+bands-j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var ( - sum float32 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * a[(i-bands+j)*lda+bands-j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda] - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var sum float32 - xtmp := x[i+1 : i+1+bands] - for j, v := range xtmp { - sum += v * a[(i+j+1)*lda+k-j-1] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+k] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var ( - sum float32 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+k] - } - ix -= incX - } -} - -// Ssbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric band matrix with k super-diagonals, x and y are -// vectors, and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssbmv(ul blas.Uplo, n, k int, alpha float32, a []float32, lda int, x []float32, incX int, beta float32, y []float32, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up indexes - lenX := n - lenY := n - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[i] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[i+j] * v - y[iy+jy] += tmp * v - jy += incY - } - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[ix] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jx := incX - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - return - } - - // Casses where a has bands below the diagonal. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[i] - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += tmp * v - jy += incY - } - y[iy] += tmp * atmp[k] - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[ix] - jx := l * incX - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += tmp * atmp[k] - ix += incX - iy += incY - } -} - -// Ssyr performs the symmetric rank-one update -// A += alpha * x * x^T -// where A is an n×n symmetric matrix, and x is a vector. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyr(ul blas.Uplo, n int, alpha float32, x []float32, incX int, a []float32, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda+i : i*lda+n] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += v * tmp - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - jx := ix - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += x[jx] * tmp - jx += incX - } - } - ix += incX - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda:] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += tmp * v - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - atmp := a[i*lda:] - jx := kx - for j := 0; j < i+1; j++ { - atmp[j] += tmp * x[jx] - jx += incX - } - } - ix += incX - } -} - -// Ssyr2 performs the symmetric rank-two update -// A += alpha * x * y^T + alpha * y * x^T -// where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, a []float32, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } -} - -// Stpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Stpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float32, x []float32, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - offset = n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - var sum float32 - for j, v := range atmp { - sum += v * xtmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - var sum float32 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix -= incX - offset -= n - i + 1 - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i : offset] - var sum float32 - for j, v := range atmp { - sum += v * x[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i : offset] - var sum float32 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix += incX - offset += i + 2 - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] -= v * xi - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] -= v * xi - } - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix -= incX - offset -= i + 1 - } -} - -// Sspmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sspmv(ul blas.Uplo, n int, alpha float32, ap []float32, x []float32, incX int, beta float32, y []float32, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f32.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f32.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f32.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * ap[0] * x[0] - return - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := ap[offset] * x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - jy := ky + (i+1)*incY - for j, v := range atmp { - sum += v * xtmp[j] - y[jy] += v * xv - jy += incY - } - y[iy] += alpha * sum - iy += incY - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := ap[offset] * x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - atmp := ap[offset-i : offset] - jy := ky - var sum float32 - for j, v := range atmp { - sum += v * x[j] - y[jy] += v * xv - jy += incY - } - sum += ap[offset] * x[i] - y[iy] += alpha * sum - iy += incY - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - atmp := ap[offset-i : offset] - jx := kx - jy := ky - var sum float32 - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - - sum += ap[offset] * x[ix] - y[iy] += alpha * sum - ix += incX - iy += incY - offset += i + 2 - } -} - -// Sspr performs the symmetric rank-one operation -// A += alpha * x * x^T -// where A is an n×n symmetric matrix in packed format, x is a vector, and -// alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sspr(ul blas.Uplo, n int, alpha float32, x []float32, incX int, ap []float32) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xv := alpha * x[i] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx + i*incX - atmp := ap[offset:] - xv := alpha * x[ix] - for j := 0; j < n-i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xv := alpha * x[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i:] - xv := alpha * x[ix] - for j := 0; j <= i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += i + 2 - } -} - -// Sspr2 performs the symmetric rank-2 update -// A += alpha * x * y^T + alpha * y * x^T -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sspr2(ul blas.Uplo, n int, alpha float32, x []float32, incX int, y []float32, incY int, ap []float32) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xi := x[i] - yi := y[i] - xtmp := x[i:n] - ytmp := y[i:n] - for j, v := range xtmp { - atmp[j] += alpha * (xi*ytmp[j] + v*yi) - } - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - atmp := ap[offset:] - xi := x[ix] - yi := y[iy] - for j := 0; j < n-i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xi := x[i] - yi := y[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += alpha * (xi*y[j] + v*yi) - } - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - atmp := ap[offset-i:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (x[ix]*y[jy] + x[jx]*y[iy]) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += i + 2 - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go deleted file mode 100644 index 261257888..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level2float64.go +++ /dev/null @@ -1,2264 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var _ blas.Float64Level2 = Implementation{} - -// Dger performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func (Implementation) Dger(m, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (m-1)*incX) || (incX < 0 && len(x) <= (1-m)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(m-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - f64.Ger(uintptr(m), uintptr(n), - alpha, - x, uintptr(incX), - y, uintptr(incY), - a, uintptr(lda)) -} - -// Dgbmv performs one of the matrix-vector operations -// y = alpha * A * x + beta * y if tA == blas.NoTrans -// y = alpha * A^T * x + beta * y if tA == blas.Trans or blas.ConjTrans -// where A is an m×n band matrix with kL sub-diagonals and kU super-diagonals, -// x and y are vectors, and alpha and beta are scalars. -func (Implementation) Dgbmv(tA blas.Transpose, m, n, kL, kU int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if kL < 0 { - panic(kLLT0) - } - if kU < 0 { - panic(kULT0) - } - if lda < kL+kU+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(min(m, n+kL)-1)+kL+kU+1 { - panic(shortA) - } - lenX := m - lenY := n - if tA == blas.NoTrans { - lenX = n - lenY = m - } - if (incX > 0 && len(x) <= (lenX-1)*incX) || (incX < 0 && len(x) <= (1-lenX)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (lenY-1)*incY) || (incY < 0 && len(y) <= (1-lenY)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:lenY] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:lenY]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < lenY; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(lenY), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(lenY), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - // i and j are indices of the compacted banded matrix. - // off is the offset into the dense matrix (off + j = densej) - nCol := kU + 1 + kL - if tA == blas.NoTrans { - iy := ky - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - xtmp := x[off : off+u-l] - var sum float64 - for j, v := range atmp { - sum += xtmp[j] * v - } - y[iy] += sum * alpha - iy += incY - } - return - } - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - jx := kx - var sum float64 - for _, v := range atmp { - sum += x[off*incX+jx] * v - jx += incX - } - y[iy] += sum * alpha - iy += incY - } - return - } - if incX == 1 { - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[i] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - } - return - } - ix := kx - for i := 0; i < min(m, n+kL); i++ { - l := max(0, kL-i) - u := min(nCol, n+kL-i) - off := max(0, i-kL) - atmp := a[i*lda+l : i*lda+u] - tmp := alpha * x[ix] - jy := ky - for _, v := range atmp { - y[jy+off*incY] += tmp * v - jy += incY - } - ix += incX - } -} - -// Dtrmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x is a vector. -func (Implementation) Dtrmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - nonUnit := d != blas.Unit - if n == 1 { - if nonUnit { - x[0] *= a[0] - } - return - } - var kx int - if incX <= 0 { - kx = -(n - 1) * incX - } - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp = a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f64.DotUnitary(a[ilda+i+1:ilda+n], x[i+1:n]) - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f64.DotInc(x, a[ilda+i+1:ilda+n], uintptr(n-i-1), uintptr(incX), 1, uintptr(ix+incX), 0) - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp += a[ilda+i] * x[i] - } else { - tmp = x[i] - } - x[i] = tmp + f64.DotUnitary(a[ilda:ilda+i], x[:i]) - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - var tmp float64 - if nonUnit { - tmp = a[ilda+i] * x[ix] - } else { - tmp = x[ix] - } - x[ix] = tmp + f64.DotInc(x, a[ilda:ilda+i], uintptr(i), uintptr(incX), 1, uintptr(kx), 0) - ix -= incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[i] - f64.AxpyUnitary(xi, a[ilda+i+1:ilda+n], x[i+1:n]) - if nonUnit { - x[i] *= a[ilda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - ilda := i * lda - xi := x[ix] - f64.AxpyInc(xi, a[ilda+i+1:ilda+n], x, uintptr(n-i-1), 1, uintptr(incX), 0, uintptr(kx+(i+1)*incX)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[i] - f64.AxpyUnitary(xi, a[ilda:ilda+i], x[:i]) - if nonUnit { - x[i] *= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - ilda := i * lda - xi := x[ix] - f64.AxpyInc(xi, a[ilda:ilda+i], x, uintptr(i), 1, uintptr(incX), 0, uintptr(kx)) - if nonUnit { - x[ix] *= a[ilda+i] - } - ix += incX - } -} - -// Dtrsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Dtrsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - if n == 1 { - if d == blas.NonUnit { - x[0] /= a[0] - } - return - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - var sum float64 - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := i + j + 1 - sum += x[jv] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - var sum float64 - jx := ix + incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - var sum float64 - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - sum += x[j] * v - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+i] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - var sum float64 - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - sum += x[jx] * v - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+i] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jv := j + i + 1 - x[jv] -= v * xi - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx + (i+1)*incX - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= a[i*lda+i] - } - xi := x[i] - atmp := a[i*lda : i*lda+i] - for j, v := range atmp { - x[j] -= v * xi - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= a[i*lda+i] - } - xi := x[ix] - jx := kx - atmp := a[i*lda : i*lda+i] - for _, v := range atmp { - x[jx] -= v * xi - jx += incX - } - ix -= incX - } -} - -// Dsymv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix, x and y are vectors, and alpha and -// beta are scalars. -func (Implementation) Dsymv(ul blas.Uplo, n int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+n { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * a[0] * x[0] - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := x[i] * a[i*lda+i] - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for j, v := range atmp { - jp := j + i + 1 - sum += x[jp] * v - y[jy] += xv * v - jy += incY - } - y[iy] += alpha * sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := x[ix] * a[i*lda+i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - atmp := a[i*lda+i+1 : i*lda+n] - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - jy := ky - xv := alpha * x[i] - atmp := a[i*lda : i*lda+i] - var sum float64 - for j, v := range atmp { - sum += x[j] * v - y[jy] += xv * v - jy += incY - } - sum += x[i] * a[i*lda+i] - sum *= alpha - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xv := alpha * x[ix] - atmp := a[i*lda : i*lda+i] - var sum float64 - for _, v := range atmp { - sum += x[jx] * v - y[jy] += xv * v - jx += incX - jy += incY - } - sum += x[ix] * a[i*lda+i] - sum *= alpha - y[iy] += sum - ix += incX - iy += incY - } -} - -// Dtbmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, and x is a vector. -func (Implementation) Dtbmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonunit := d != blas.Unit - - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float64 - atmp := a[i*lda:] - xtmp := x[i:] - for j := 1; j < u; j++ { - sum += xtmp[j] * atmp[j] - } - if nonunit { - sum += xtmp[0] * atmp[0] - } else { - sum += xtmp[0] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := min(1+k, n-i) - var sum float64 - atmp := a[i*lda:] - jx := incX - for j := 1; j < u; j++ { - sum += x[ix+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[0] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float64 - for j := l; j < k; j++ { - sum += x[i-k+j] * atmp[j] - } - if nonunit { - sum += x[i] * atmp[k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - l := max(0, k-i) - atmp := a[i*lda:] - var sum float64 - jx := l * incX - for j := l; j < k; j++ { - sum += x[ix-k*incX+jx] * atmp[j] - jx += incX - } - if nonunit { - sum += x[ix] * atmp[k] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float64 - for j := 1; j < u; j++ { - sum += x[i-j] * a[(i-j)*lda+j] - } - if nonunit { - sum += x[i] * a[i*lda] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - u := k + 1 - if i < u { - u = i + 1 - } - var sum float64 - jx := incX - for j := 1; j < u; j++ { - sum += x[ix-jx] * a[(i-j)*lda+j] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda] - } else { - sum += x[ix] - } - x[ix] = sum - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var sum float64 - for j := 0; j < u; j++ { - sum += x[i+j+1] * a[(i+j+1)*lda+k-j-1] - } - if nonunit { - sum += x[i] * a[i*lda+k] - } else { - sum += x[i] - } - x[i] = sum - } - return - } - ix := kx - for i := 0; i < n; i++ { - u := k - if i+k >= n { - u = n - i - 1 - } - var ( - sum float64 - jx int - ) - for j := 0; j < u; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - if nonunit { - sum += x[ix] * a[i*lda+k] - } else { - sum += x[ix] - } - x[ix] = sum - ix += incX - } -} - -// Dtpmv performs one of the matrix-vector operations -// x = A * x if tA == blas.NoTrans -// x = A^T * x if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x is a vector. -func (Implementation) Dtpmv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float64, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xi += v * xtmp[j] - } - x[i] = xi - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset += n - i - ix += incX - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - if nonUnit { - xi *= ap[offset] - } - atmp := ap[offset-i : offset] - for j, v := range atmp { - xi += v * x[j] - } - x[i] = xi - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - if nonUnit { - xix *= ap[offset] - } - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - xix += v * x[jx] - jx += incX - } - x[ix] = xix - offset -= i + 1 - ix -= incX - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - xix := x[ix] - jx := kx + (i+1)*incX - atmp := ap[offset+1 : offset+n-i] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - offset -= n - i + 1 - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] += v * xi - } - if nonUnit { - x[i] *= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - xix := x[ix] - jx := kx - atmp := ap[offset-i : offset] - for _, v := range atmp { - x[jx] += v * xix - jx += incX - } - if nonUnit { - x[ix] *= ap[offset] - } - ix += incX - offset += i + 2 - } -} - -// Dtbsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×n triangular band matrix with k+1 diagonals, -// and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Dtbsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n, k int, a []float64, lda int, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - nonUnit := d == blas.NonUnit - // Form x = A^-1 x. - // Several cases below use subslices for speed improvement. - // The incX != 1 cases usually do not because incX may be negative. - if tA == blas.NoTrans { - if ul == blas.Upper { - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - atmp := a[i*lda+1:] - xtmp := x[i+1 : i+bands+1] - var sum float64 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - max := k + 1 - if i+max > n { - max = n - i - } - atmp := a[i*lda:] - var ( - jx int - sum float64 - ) - for j := 1; j < max; j++ { - jx += incX - sum += x[ix+jx] * atmp[j] - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[0] - } - ix -= incX - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - xtmp := x[i-bands : i] - var sum float64 - for j, v := range xtmp { - sum += v * atmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= atmp[bands] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - atmp := a[i*lda+k-bands:] - var ( - sum float64 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * atmp[j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= atmp[bands] - } - ix += incX - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var sum float64 - for j := 0; j < bands; j++ { - sum += x[i-bands+j] * a[(i-bands+j)*lda+bands-j] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda] - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - bands := k - if i-k < 0 { - bands = i - } - var ( - sum float64 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix-bands*incX+jx] * a[(i-bands+j)*lda+bands-j] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda] - } - ix += incX - } - return - } - if incX == 1 { - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var sum float64 - xtmp := x[i+1 : i+1+bands] - for j, v := range xtmp { - sum += v * a[(i+j+1)*lda+k-j-1] - } - x[i] -= sum - if nonUnit { - x[i] /= a[i*lda+k] - } - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - bands := k - if i+bands >= n { - bands = n - i - 1 - } - var ( - sum float64 - jx int - ) - for j := 0; j < bands; j++ { - sum += x[ix+jx+incX] * a[(i+j+1)*lda+k-j-1] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= a[i*lda+k] - } - ix -= incX - } -} - -// Dsbmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric band matrix with k super-diagonals, x and y are -// vectors, and alpha and beta are scalars. -func (Implementation) Dsbmv(ul blas.Uplo, n, k int, alpha float64, a []float64, lda int, x []float64, incX int, beta float64, y []float64, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - if lda < k+1 { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(n-1)+k+1 { - panic(shortA) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up indexes - lenX := n - lenY := n - var kx, ky int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if incY < 0 { - ky = -(lenY - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[i] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[i+j] * v - y[iy+jy] += tmp * v - jy += incY - } - y[iy] += sum - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - atmp := a[i*lda:] - tmp := alpha * x[ix] - sum := tmp * atmp[0] - u := min(k, n-i-1) - jx := incX - jy := incY - for j := 1; j <= u; j++ { - v := atmp[j] - sum += alpha * x[ix+jx] * v - y[iy+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += sum - ix += incX - iy += incY - } - return - } - - // Casses where a has bands below the diagonal. - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[i] - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[i-k+j] - y[iy-k*incY+jy] += tmp * v - jy += incY - } - y[iy] += tmp * atmp[k] - iy += incY - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - l := max(0, k-i) - tmp := alpha * x[ix] - jx := l * incX - jy := l * incY - atmp := a[i*lda:] - for j := l; j < k; j++ { - v := atmp[j] - y[iy] += alpha * v * x[ix-k*incX+jx] - y[iy-k*incY+jy] += tmp * v - jx += incX - jy += incY - } - y[iy] += tmp * atmp[k] - ix += incX - iy += incY - } -} - -// Dsyr performs the symmetric rank-one update -// A += alpha * x * x^T -// where A is an n×n symmetric matrix, and x is a vector. -func (Implementation) Dsyr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, a []float64, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda+i : i*lda+n] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += v * tmp - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - jx := ix - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += x[jx] * tmp - jx += incX - } - } - ix += incX - } - return - } - // Cases where a is lower triangular. - if incX == 1 { - for i := 0; i < n; i++ { - tmp := x[i] * alpha - if tmp != 0 { - atmp := a[i*lda:] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += tmp * v - } - } - } - return - } - ix := kx - for i := 0; i < n; i++ { - tmp := x[ix] * alpha - if tmp != 0 { - atmp := a[i*lda:] - jx := kx - for j := 0; j < i+1; j++ { - atmp[j] += tmp * x[jx] - jx += incX - } - } - ix += incX - } -} - -// Dsyr2 performs the symmetric rank-two update -// A += alpha * x * y^T + alpha * y * x^T -// where A is an n×n symmetric matrix, x and y are vectors, and alpha is a scalar. -func (Implementation) Dsyr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, a []float64, lda int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if lda < max(1, n) { - panic(badLdA) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(a) < lda*(n-1)+n { - panic(shortA) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := i; j < n; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - xi := x[i] - yi := y[i] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[j] + x[j]*yi) - } - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - xi := x[ix] - yi := y[iy] - atmp := a[i*lda:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - } -} - -// Dtpsv solves one of the systems of equations -// A * x = b if tA == blas.NoTrans -// A^T * x = b if tA == blas.Trans or blas.ConjTrans -// where A is an n×n triangular matrix in packed format, and x and b are vectors. -// -// At entry to the function, x contains the values of b, and the result is -// stored in-place into x. -// -// No test for singularity or near-singularity is included in this -// routine. Such tests must be performed before calling this routine. -func (Implementation) Dtpsv(ul blas.Uplo, tA blas.Transpose, d blas.Diag, n int, ap []float64, x []float64, incX int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - - var kx int - if incX < 0 { - kx = -(n - 1) * incX - } - - nonUnit := d == blas.NonUnit - var offset int // Offset is the index of (i,i) - if tA == blas.NoTrans { - if ul == blas.Upper { - offset = n*(n+1)/2 - 1 - if incX == 1 { - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - var sum float64 - for j, v := range atmp { - sum += v * xtmp[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset -= n - i + 1 - } - return - } - ix := kx + (n-1)*incX - for i := n - 1; i >= 0; i-- { - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - var sum float64 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix -= incX - offset -= n - i + 1 - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i : offset] - var sum float64 - for j, v := range atmp { - sum += v * x[j] - } - x[i] -= sum - if nonUnit { - x[i] /= ap[offset] - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i : offset] - var sum float64 - for _, v := range atmp { - sum += v * x[jx] - jx += incX - } - x[ix] -= sum - if nonUnit { - x[ix] /= ap[offset] - } - ix += incX - offset += i + 2 - } - return - } - // Cases where ap is transposed. - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - for j, v := range atmp { - xtmp[j] -= v * xi - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[i] /= ap[offset] - } - xi := x[i] - atmp := ap[offset-i : offset] - for j, v := range atmp { - x[j] -= v * xi - } - offset -= i + 1 - } - return - } - ix := kx + (n-1)*incX - offset = n*(n+1)/2 - 1 - for i := n - 1; i >= 0; i-- { - if nonUnit { - x[ix] /= ap[offset] - } - xix := x[ix] - atmp := ap[offset-i : offset] - jx := kx - for _, v := range atmp { - x[jx] -= v * xix - jx += incX - } - ix -= incX - offset -= i + 1 - } -} - -// Dspmv performs the matrix-vector operation -// y = alpha * A * x + beta * y -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha and beta are scalars. -func (Implementation) Dspmv(ul blas.Uplo, n int, alpha float64, ap []float64, x []float64, incX int, beta float64, y []float64, incY int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - // Set up start points - var kx, ky int - if incX < 0 { - kx = -(n - 1) * incX - } - if incY < 0 { - ky = -(n - 1) * incY - } - - // Form y = beta * y. - if beta != 1 { - if incY == 1 { - if beta == 0 { - for i := range y[:n] { - y[i] = 0 - } - } else { - f64.ScalUnitary(beta, y[:n]) - } - } else { - iy := ky - if beta == 0 { - for i := 0; i < n; i++ { - y[iy] = 0 - iy += incY - } - } else { - if incY > 0 { - f64.ScalInc(beta, y, uintptr(n), uintptr(incY)) - } else { - f64.ScalInc(beta, y, uintptr(n), uintptr(-incY)) - } - } - } - } - - if alpha == 0 { - return - } - - if n == 1 { - y[0] += alpha * ap[0] * x[0] - return - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - sum := ap[offset] * x[i] - atmp := ap[offset+1 : offset+n-i] - xtmp := x[i+1:] - jy := ky + (i+1)*incY - for j, v := range atmp { - sum += v * xtmp[j] - y[jy] += v * xv - jy += incY - } - y[iy] += alpha * sum - iy += incY - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - sum := ap[offset] * x[ix] - atmp := ap[offset+1 : offset+n-i] - jx := kx + (i+1)*incX - jy := ky + (i+1)*incY - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - y[iy] += alpha * sum - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 { - iy := ky - for i := 0; i < n; i++ { - xv := x[i] * alpha - atmp := ap[offset-i : offset] - jy := ky - var sum float64 - for j, v := range atmp { - sum += v * x[j] - y[jy] += v * xv - jy += incY - } - sum += ap[offset] * x[i] - y[iy] += alpha * sum - iy += incY - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - xv := x[ix] * alpha - atmp := ap[offset-i : offset] - jx := kx - jy := ky - var sum float64 - for _, v := range atmp { - sum += v * x[jx] - y[jy] += v * xv - jx += incX - jy += incY - } - - sum += ap[offset] * x[ix] - y[iy] += alpha * sum - ix += incX - iy += incY - offset += i + 2 - } -} - -// Dspr performs the symmetric rank-one operation -// A += alpha * x * x^T -// where A is an n×n symmetric matrix in packed format, x is a vector, and -// alpha is a scalar. -func (Implementation) Dspr(ul blas.Uplo, n int, alpha float64, x []float64, incX int, ap []float64) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - lenX := n - var kx int - if incX < 0 { - kx = -(lenX - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xv := alpha * x[i] - xtmp := x[i:n] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += n - i - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx + i*incX - atmp := ap[offset:] - xv := alpha * x[ix] - for j := 0; j < n-i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += n - i - } - return - } - if incX == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xv := alpha * x[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += xv * v - } - offset += i + 2 - } - return - } - ix := kx - for i := 0; i < n; i++ { - jx := kx - atmp := ap[offset-i:] - xv := alpha * x[ix] - for j := 0; j <= i; j++ { - atmp[j] += xv * x[jx] - jx += incX - } - ix += incX - offset += i + 2 - } -} - -// Dspr2 performs the symmetric rank-2 update -// A += alpha * x * y^T + alpha * y * x^T -// where A is an n×n symmetric matrix in packed format, x and y are vectors, -// and alpha is a scalar. -func (Implementation) Dspr2(ul blas.Uplo, n int, alpha float64, x []float64, incX int, y []float64, incY int, ap []float64) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if n < 0 { - panic(nLT0) - } - if incX == 0 { - panic(zeroIncX) - } - if incY == 0 { - panic(zeroIncY) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if (incX > 0 && len(x) <= (n-1)*incX) || (incX < 0 && len(x) <= (1-n)*incX) { - panic(shortX) - } - if (incY > 0 && len(y) <= (n-1)*incY) || (incY < 0 && len(y) <= (1-n)*incY) { - panic(shortY) - } - if len(ap) < n*(n+1)/2 { - panic(shortAP) - } - - // Quick return if possible. - if alpha == 0 { - return - } - - var ky, kx int - if incY < 0 { - ky = -(n - 1) * incY - } - if incX < 0 { - kx = -(n - 1) * incX - } - var offset int // Offset is the index of (i,i). - if ul == blas.Upper { - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset:] - xi := x[i] - yi := y[i] - xtmp := x[i:n] - ytmp := y[i:n] - for j, v := range xtmp { - atmp[j] += alpha * (xi*ytmp[j] + v*yi) - } - offset += n - i - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx + i*incX - jy := ky + i*incY - atmp := ap[offset:] - xi := x[ix] - yi := y[iy] - for j := 0; j < n-i; j++ { - atmp[j] += alpha * (xi*y[jy] + x[jx]*yi) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += n - i - } - return - } - if incX == 1 && incY == 1 { - for i := 0; i < n; i++ { - atmp := ap[offset-i:] - xi := x[i] - yi := y[i] - xtmp := x[:i+1] - for j, v := range xtmp { - atmp[j] += alpha * (xi*y[j] + v*yi) - } - offset += i + 2 - } - return - } - ix := kx - iy := ky - for i := 0; i < n; i++ { - jx := kx - jy := ky - atmp := ap[offset-i:] - for j := 0; j <= i; j++ { - atmp[j] += alpha * (x[ix]*y[jy] + x[jx]*y[iy]) - jx += incX - jy += incY - } - ix += incX - iy += incY - offset += i + 2 - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go deleted file mode 100644 index e4a2bb5e9..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx128.go +++ /dev/null @@ -1,1715 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math/cmplx" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c128" -) - -var _ blas.Complex128Level3 = Implementation{} - -// Zgemm performs one of the matrix-matrix operations -// C = alpha * op(A) * op(B) + beta * C -// where op(X) is one of -// op(X) = X or op(X) = X^T or op(X) = X^H, -// alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, -// op(B) a k×n matrix and C an m×n matrix. -func (Implementation) Zgemm(tA, tB blas.Transpose, m, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - } - rowA, colA := m, k - if tA != blas.NoTrans { - rowA, colA = k, m - } - if lda < max(1, colA) { - panic(badLdA) - } - rowB, colB := k, n - if tB != blas.NoTrans { - rowB, colB = n, k - } - if ldb < max(1, colB) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(b) < (rowB-1)*ldb+colB { - panic(shortB) - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - } - return - } - - switch tA { - case blas.NoTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A * B + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[l*ldb+j] - } - } - } - case blas.Trans: - // Form C = alpha * A * B^T + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[j*ldb+l] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A * B^H + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * cmplx.Conj(b[j*ldb+l]) - } - } - } - } - case blas.Trans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A^T * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * A^T * B^T + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A^T * B^H + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - case blas.ConjTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A^H * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * A^H * B^T + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A^H * B^H + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex128 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Zhemm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n hermitian matrix and B -// and C are m×n matrices. The imaginary parts of the diagonal elements of A are -// assumed to be zero. -func (Implementation) Zhemm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * complex(real(a[i*lda+i]), 0) - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Zherk performs one of the hermitian rank-k operations -// C = alpha*A*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are real scalars, C is an n×n hermitian matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -func (Implementation) Zherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha float64, a []complex128, lda int, beta float64, c []complex128, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.ConjTrans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c128.DscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c128.DscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - calpha := complex(alpha, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*A^H + beta*C. - cbeta := complex(beta, 0) - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the i-th diagonal element of C. - ci[0] = complex(alpha*real(c128.DotcUnitary(ai, ai)), 0) - // Handle the remaining elements on the i-th row of C. - for jc := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha * c128.DotcUnitary(a[j*lda:j*lda+k], ai) - } - case beta != 1: - cii := calpha*c128.DotcUnitary(ai, ai) + cbeta*ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - default: - cii := calpha*c128.DotcUnitary(ai, ai) + ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the first i-1 elements on the i-th row of C. - for j := range ci[:i] { - ci[j] = calpha * c128.DotcUnitary(a[j*lda:j*lda+k], ai) - } - // Handle the i-th diagonal element of C. - ci[i] = complex(alpha*real(c128.DotcUnitary(ai, ai)), 0) - case beta != 1: - for j, cij := range ci[:i] { - ci[j] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - cii := calpha*c128.DotcUnitary(ai, ai) + cbeta*ci[i] - ci[i] = complex(real(cii), 0) - default: - for j, cij := range ci[:i] { - ci[j] = calpha*c128.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - cii := calpha*c128.DotcUnitary(ai, ai) + ci[i] - ci[i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*A^H*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c128.AxpyUnitary(calpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c128.AxpyUnitary(calpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } - } -} - -// Zher2k performs one of the hermitian rank-2k operations -// C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are scalars with beta real, C is an n×n hermitian matrix -// and A and B are n×k matrices in the first case and k×n matrices in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -func (Implementation) Zher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta float64, c []complex128, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.ConjTrans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c128.DscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c128.DscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - conjalpha := cmplx.Conj(alpha) - cbeta := complex(beta, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i+1 : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - for jc := range ci { - j := i + 1 + jc - ci[jc] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) - } - } else { - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - for jc, cij := range ci { - j := i + 1 + jc - ci[jc] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) - } - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - } else { - for j, cij := range ci { - ci[j] = alpha*c128.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c128.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - cii := alpha*c128.DotcUnitary(bi, ai) + conjalpha*c128.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c128.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda+i:j*lda+n], ci) - } - } - ci[0] = complex(real(ci[0]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c128.DscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c128.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda:j*lda+i+1], ci) - } - } - ci[i] = complex(real(ci[i]), 0) - } - } - } -} - -// Zsymm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n symmetric matrix and B -// and C are m×n matrices. -func (Implementation) Zsymm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * a[k*lda+i] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[k*lda+i] - c128.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex128 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Zsyrk performs one of the symmetric rank-k operations -// C = alpha*A*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -func (Implementation) Zsyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, beta complex128, c []complex128, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.Trans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c128.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*A^T + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - for jc, cij := range ci { - j := i + jc - ci[jc] = beta*cij + alpha*c128.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - for j, cij := range ci { - ci[j] = beta*cij + alpha*c128.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } - } else { - // Form C = alpha*A^T*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Zsyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*B^T + alpha*B*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*B + alpha*B^T*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A and B -// are n×k matrices in the first case and k×n matrices in the second case. -func (Implementation) Zsyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex128, a []complex128, lda int, b []complex128, ldb int, beta complex128, c []complex128, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.Trans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c128.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c128.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*B^T + alpha*B*A^T + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for jc := range ci { - j := i + jc - ci[jc] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for jc, cij := range ci { - j := i + jc - ci[jc] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for j, cij := range ci { - ci[j] = alpha*c128.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c128.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } - } else { - // Form C = alpha*A^T*B + alpha*B^T*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c128.AxpyUnitary(alpha*bji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c128.AxpyUnitary(alpha*aji, b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c128.AxpyUnitary(alpha*bji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Ztrmm performs one of the matrix-matrix operations -// B = alpha * op(A) * B if side == blas.Left, -// B = alpha * B * op(A) if side == blas.Right, -// where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, -// upper or lower triangular matrix and op(A) is one of -// op(A) = A if trans == blas.NoTrans, -// op(A) = A^T if trans == blas.Trans, -// op(A) = A^H if trans == blas.ConjTrans. -func (Implementation) Ztrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - // Quick return if possible. - if alpha == 0 { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] = 0 - } - } - return - } - - noConj := trans != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if trans == blas.NoTrans { - // Form B = alpha*A*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - j := ja + i + 1 - if aij != 0 { - c128.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } else { - for i := m - 1; i >= 0; i-- { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c128.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } - } else { - // Form B = alpha*A^T*B or B = alpha*A^H*B. - if uplo == blas.Upper { - for k := m - 1; k >= 0; k-- { - bk := b[k*ldb : k*ldb+n] - for ja, ajk := range a[k*lda+k+1 : k*lda+m] { - if ajk == 0 { - continue - } - j := k + 1 + ja - if noConj { - c128.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c128.ScalUnitary(akk, bk) - } - } - } else { - for k := 0; k < m; k++ { - bk := b[k*ldb : k*ldb+n] - for j, ajk := range a[k*lda : k*lda+k] { - if ajk == 0 { - continue - } - if noConj { - c128.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c128.ScalUnitary(akk, bk) - } - } - } - } - } else { - if trans == blas.NoTrans { - // Form B = alpha*B*A. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c128.AxpyUnitary(abik, a[k*lda+k+1:k*lda+n], bi[k+1:]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c128.AxpyUnitary(abik, a[k*lda:k*lda+k], bi[:k]) - } - } - } - } else { - // Form B = alpha*B*A^T or B = alpha*B*A^H. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c128.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c128.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - bi[j] = alpha * bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := bi[j] - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c128.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c128.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - } - bi[j] = alpha * bij - } - } - } - } - } -} - -// Ztrsm solves one of the matrix equations -// op(A) * X = alpha * B if side == blas.Left, -// X * op(A) = alpha * B if side == blas.Right, -// where alpha is a scalar, X and B are m×n matrices, A is a unit or -// non-unit, upper or lower triangular matrix and op(A) is one of -// op(A) = A if transA == blas.NoTrans, -// op(A) = A^T if transA == blas.Trans, -// op(A) = A^H if transA == blas.ConjTrans. -// On return the matrix X is overwritten on B. -func (Implementation) Ztrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpose, diag blas.Diag, m, n int, alpha complex128, a []complex128, lda int, b []complex128, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case transA != blas.NoTrans && transA != blas.Trans && transA != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - b[i*ldb+j] = 0 - } - } - return - } - - noConj := transA != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if transA == blas.NoTrans { - // Form B = alpha*inv(A)*B. - if uplo == blas.Upper { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for ka, aik := range a[i*lda+i+1 : i*lda+m] { - k := i + 1 + ka - if aik != 0 { - c128.AxpyUnitary(-aik, b[k*ldb:k*ldb+n], bi) - } - } - if noUnit { - c128.ScalUnitary(1/a[i*lda+i], bi) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c128.AxpyUnitary(-aij, b[j*ldb:j*ldb+n], bi) - } - } - if noUnit { - c128.ScalUnitary(1/a[i*lda+i], bi) - } - } - } - } else { - // Form B = alpha*inv(A^T)*B or B = alpha*inv(A^H)*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c128.ScalUnitary(1/a[i*lda+i], bi) - } else { - c128.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - if aij == 0 { - continue - } - j := i + 1 + ja - if noConj { - c128.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - } - } else { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c128.ScalUnitary(1/a[i*lda+i], bi) - } else { - c128.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for j, aij := range a[i*lda : i*lda+i] { - if aij == 0 { - continue - } - if noConj { - c128.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c128.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - } - } - } - } else { - if transA == blas.NoTrans { - // Form B = alpha*B*inv(A). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for j, bij := range bi { - if bij == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c128.AxpyUnitary(-bi[j], a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c128.ScalUnitary(alpha, bi) - } - for j := n - 1; j >= 0; j-- { - if bi[j] == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c128.AxpyUnitary(-bi[j], a[j*lda:j*lda+j], bi[:j]) - } - } - } - } else { - // Form B = alpha*B*inv(A^T) or B = alpha*B*inv(A^H). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := alpha * bi[j] - if noConj { - bij -= c128.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c128.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - bij *= alpha - if noConj { - bij -= c128.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c128.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go deleted file mode 100644 index 436c54506..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3cmplx64.go +++ /dev/null @@ -1,1735 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - cmplx "gonum.org/v1/gonum/internal/cmplx64" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/c64" -) - -var _ blas.Complex64Level3 = Implementation{} - -// Cgemm performs one of the matrix-matrix operations -// C = alpha * op(A) * op(B) + beta * C -// where op(X) is one of -// op(X) = X or op(X) = X^T or op(X) = X^H, -// alpha and beta are scalars, and A, B and C are matrices, with op(A) an m×k matrix, -// op(B) a k×n matrix and C an m×n matrix. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cgemm(tA, tB blas.Transpose, m, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - } - rowA, colA := m, k - if tA != blas.NoTrans { - rowA, colA = k, m - } - if lda < max(1, colA) { - panic(badLdA) - } - rowB, colB := k, n - if tB != blas.NoTrans { - rowB, colB = n, k - } - if ldb < max(1, colB) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(b) < (rowB-1)*ldb+colB { - panic(shortB) - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - } - return - } - - switch tA { - case blas.NoTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A * B + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[l*ldb+j] - } - } - } - case blas.Trans: - // Form C = alpha * A * B^T + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * b[j*ldb+l] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A * B^H + beta * C. - for i := 0; i < m; i++ { - switch { - case beta == 0: - for j := 0; j < n; j++ { - c[i*ldc+j] = 0 - } - case beta != 1: - for j := 0; j < n; j++ { - c[i*ldc+j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[i*lda+l] - for j := 0; j < n; j++ { - c[i*ldc+j] += tmp * cmplx.Conj(b[j*ldb+l]) - } - } - } - } - case blas.Trans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A^T * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * A^T * B^T + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A^T * B^H + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += a[l*lda+i] * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - case blas.ConjTrans: - switch tB { - case blas.NoTrans: - // Form C = alpha * A^H * B + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[l*ldb+j] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.Trans: - // Form C = alpha * A^H * B^T + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * b[j*ldb+l] - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - case blas.ConjTrans: - // Form C = alpha * A^H * B^H + beta * C. - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - var tmp complex64 - for l := 0; l < k; l++ { - tmp += cmplx.Conj(a[l*lda+i]) * cmplx.Conj(b[j*ldb+l]) - } - if beta == 0 { - c[i*ldc+j] = alpha * tmp - } else { - c[i*ldc+j] = alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Chemm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n hermitian matrix and B -// and C are m×n matrices. The imaginary parts of the diagonal elements of A are -// assumed to be zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Chemm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * complex(real(a[i*lda+i]), 0) - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * cmplx.Conj(a[k*lda+i]) - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * cmplx.Conj(ajk) - } - ajj := complex(real(a[j*lda+j]), 0) - if beta == 0 { - c[i*ldc+j] = abij*ajj + alpha*tmp - } else { - c[i*ldc+j] = abij*ajj + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Cherk performs one of the hermitian rank-k operations -// C = alpha*A*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are real scalars, C is an n×n hermitian matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cherk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha float32, a []complex64, lda int, beta float32, c []complex64, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.ConjTrans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c64.SscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c64.SscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - calpha := complex(alpha, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*A^H + beta*C. - cbeta := complex(beta, 0) - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the i-th diagonal element of C. - ci[0] = complex(alpha*real(c64.DotcUnitary(ai, ai)), 0) - // Handle the remaining elements on the i-th row of C. - for jc := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha * c64.DotcUnitary(a[j*lda:j*lda+k], ai) - } - case beta != 1: - cii := calpha*c64.DotcUnitary(ai, ai) + cbeta*ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - default: - cii := calpha*c64.DotcUnitary(ai, ai) + ci[0] - ci[0] = complex(real(cii), 0) - for jc, cij := range ci[1:] { - j := i + 1 + jc - ci[jc+1] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - switch { - case beta == 0: - // Handle the first i-1 elements on the i-th row of C. - for j := range ci[:i] { - ci[j] = calpha * c64.DotcUnitary(a[j*lda:j*lda+k], ai) - } - // Handle the i-th diagonal element of C. - ci[i] = complex(alpha*real(c64.DotcUnitary(ai, ai)), 0) - case beta != 1: - for j, cij := range ci[:i] { - ci[j] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cbeta*cij - } - cii := calpha*c64.DotcUnitary(ai, ai) + cbeta*ci[i] - ci[i] = complex(real(cii), 0) - default: - for j, cij := range ci[:i] { - ci[j] = calpha*c64.DotcUnitary(a[j*lda:j*lda+k], ai) + cij - } - cii := calpha*c64.DotcUnitary(ai, ai) + ci[i] - ci[i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*A^H*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c64.AxpyUnitary(calpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := cmplx.Conj(a[j*lda+i]) - if aji != 0 { - c64.AxpyUnitary(calpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - c[i*ldc+i] = complex(real(c[i*ldc+i]), 0) - } - } - } -} - -// Cher2k performs one of the hermitian rank-2k operations -// C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C if trans == blas.NoTrans -// C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C if trans == blas.ConjTrans -// where alpha and beta are scalars with beta real, C is an n×n hermitian matrix -// and A and B are n×k matrices in the first case and k×n matrices in the second case. -// -// The imaginary parts of the diagonal elements of C are assumed to be zero, and -// on return they will be set to zero. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Cher2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta float32, c []complex64, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.ConjTrans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ci[0] = complex(beta*real(ci[0]), 0) - if i != n-1 { - c64.SscalUnitary(beta, ci[1:]) - } - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - if i != 0 { - c64.SscalUnitary(beta, ci[:i]) - } - ci[i] = complex(beta*real(ci[i]), 0) - } - } - } - return - } - - conjalpha := cmplx.Conj(alpha) - cbeta := complex(beta, 0) - if trans == blas.NoTrans { - // Form C = alpha*A*B^H + conj(alpha)*B*A^H + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i+1 : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - for jc := range ci { - j := i + 1 + jc - ci[jc] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) - } - } else { - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - for jc, cij := range ci { - j := i + 1 + jc - ci[jc] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) - } - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) - c[i*ldc+i] = complex(real(cii), 0) - } else { - for j, cij := range ci { - ci[j] = alpha*c64.DotcUnitary(b[j*ldb:j*ldb+k], ai) + conjalpha*c64.DotcUnitary(a[j*lda:j*lda+k], bi) + cbeta*cij - } - cii := alpha*c64.DotcUnitary(bi, ai) + conjalpha*c64.DotcUnitary(ai, bi) + cbeta*c[i*ldc+i] - c[i*ldc+i] = complex(real(cii), 0) - } - } - } - } else { - // Form C = alpha*A^H*B + conj(alpha)*B^H*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[0] = complex(real(ci[0]), 0) - default: - ci[0] = complex(real(ci[0]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c64.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda+i:j*lda+n], ci) - } - } - ci[0] = complex(real(ci[0]), 0) - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - c64.SscalUnitary(beta, ci) - ci[i] = complex(real(ci[i]), 0) - default: - ci[i] = complex(real(ci[i]), 0) - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*cmplx.Conj(aji), b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c64.AxpyUnitary(conjalpha*cmplx.Conj(bji), a[j*lda:j*lda+i+1], ci) - } - } - ci[i] = complex(real(ci[i]), 0) - } - } - } -} - -// Csymm performs one of the matrix-matrix operations -// C = alpha*A*B + beta*C if side == blas.Left -// C = alpha*B*A + beta*C if side == blas.Right -// where alpha and beta are scalars, A is an m×m or n×n symmetric matrix and B -// and C are m×n matrices. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csymm(side blas.Side, uplo blas.Uplo, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(na-1)+na { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ci := c[i*ldc : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - return - } - - if side == blas.Left { - // Form C = alpha*A*B + beta*C. - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - bi := b[i*ldb : i*ldb+n] - ci := c[i*ldc : i*ldc+n] - if beta == 0 { - for j, bij := range bi { - ci[j] = atmp * bij - } - } else { - for j, bij := range bi { - ci[j] = atmp*bij + beta*ci[j] - } - } - if uplo == blas.Upper { - for k := 0; k < i; k++ { - atmp = alpha * a[k*lda+i] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } else { - for k := 0; k < i; k++ { - atmp = alpha * a[i*lda+k] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - for k := i + 1; k < m; k++ { - atmp = alpha * a[k*lda+i] - c64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ci) - } - } - } - } else { - // Form C = alpha*B*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - abij := alpha * b[i*ldb+j] - aj := a[j*lda+j+1 : j*lda+n] - bi := b[i*ldb+j+1 : i*ldb+n] - ci := c[i*ldc+j+1 : i*ldc+n] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - abij := alpha * b[i*ldb+j] - aj := a[j*lda : j*lda+j] - bi := b[i*ldb : i*ldb+j] - ci := c[i*ldc : i*ldc+j] - var tmp complex64 - for k, ajk := range aj { - ci[k] += abij * ajk - tmp += bi[k] * ajk - } - if beta == 0 { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp - } else { - c[i*ldc+j] = abij*a[j*lda+j] + alpha*tmp + beta*c[i*ldc+j] - } - } - } - } - } -} - -// Csyrk performs one of the symmetric rank-k operations -// C = alpha*A*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A is -// an n×k matrix in the first case and a k×n matrix in the second case. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csyrk(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, beta complex64, c []complex64, ldc int) { - var rowA, colA int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - rowA, colA = n, k - case blas.Trans: - rowA, colA = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, colA): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (rowA-1)*lda+colA { - panic(shortA) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c64.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*A^T + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - for jc, cij := range ci { - j := i + jc - ci[jc] = beta*cij + alpha*c64.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - for j, cij := range ci { - ci[j] = beta*cij + alpha*c64.DotuUnitary(ai, a[j*lda:j*lda+k]) - } - } - } - } else { - // Form C = alpha*A^T*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Csyr2k performs one of the symmetric rank-2k operations -// C = alpha*A*B^T + alpha*B*A^T + beta*C if trans == blas.NoTrans -// C = alpha*A^T*B + alpha*B^T*A + beta*C if trans == blas.Trans -// where alpha and beta are scalars, C is an n×n symmetric matrix and A and B -// are n×k matrices in the first case and k×n matrices in the second case. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Csyr2k(uplo blas.Uplo, trans blas.Transpose, n, k int, alpha complex64, a []complex64, lda int, b []complex64, ldb int, beta complex64, c []complex64, ldc int) { - var row, col int - switch trans { - default: - panic(badTranspose) - case blas.NoTrans: - row, col = n, k - case blas.Trans: - row, col = k, n - } - switch { - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case lda < max(1, col): - panic(badLdA) - case ldb < max(1, col): - panic(badLdB) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (row-1)*lda+col { - panic(shortA) - } - if len(b) < (row-1)*ldb+col { - panic(shortB) - } - if len(c) < (n-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - if alpha == 0 { - if uplo == blas.Upper { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - c64.ScalUnitary(beta, ci) - } - } - } else { - if beta == 0 { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - for j := range ci { - ci[j] = 0 - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - c64.ScalUnitary(beta, ci) - } - } - } - return - } - - if trans == blas.NoTrans { - // Form C = alpha*A*B^T + alpha*B*A^T + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for jc := range ci { - j := i + jc - ci[jc] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for jc, cij := range ci { - j := i + jc - ci[jc] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - ai := a[i*lda : i*lda+k] - bi := b[i*ldb : i*ldb+k] - if beta == 0 { - for j := range ci { - ci[j] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) - } - } else { - for j, cij := range ci { - ci[j] = alpha*c64.DotuUnitary(ai, b[j*ldb:j*ldb+k]) + alpha*c64.DotuUnitary(bi, a[j*lda:j*lda+k]) + beta*cij - } - } - } - } - } else { - // Form C = alpha*A^T*B + alpha*B^T*A + beta*C. - if uplo == blas.Upper { - for i := 0; i < n; i++ { - ci := c[i*ldc+i : i*ldc+n] - switch { - case beta == 0: - for jc := range ci { - ci[jc] = 0 - } - case beta != 1: - for jc := range ci { - ci[jc] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, b[j*ldb+i:j*ldb+n], ci) - } - if bji != 0 { - c64.AxpyUnitary(alpha*bji, a[j*lda+i:j*lda+n], ci) - } - } - } - } else { - for i := 0; i < n; i++ { - ci := c[i*ldc : i*ldc+i+1] - switch { - case beta == 0: - for j := range ci { - ci[j] = 0 - } - case beta != 1: - for j := range ci { - ci[j] *= beta - } - } - for j := 0; j < k; j++ { - aji := a[j*lda+i] - bji := b[j*ldb+i] - if aji != 0 { - c64.AxpyUnitary(alpha*aji, b[j*ldb:j*ldb+i+1], ci) - } - if bji != 0 { - c64.AxpyUnitary(alpha*bji, a[j*lda:j*lda+i+1], ci) - } - } - } - } - } -} - -// Ctrmm performs one of the matrix-matrix operations -// B = alpha * op(A) * B if side == blas.Left, -// B = alpha * B * op(A) if side == blas.Right, -// where alpha is a scalar, B is an m×n matrix, A is a unit, or non-unit, -// upper or lower triangular matrix and op(A) is one of -// op(A) = A if trans == blas.NoTrans, -// op(A) = A^T if trans == blas.Trans, -// op(A) = A^H if trans == blas.ConjTrans. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrmm(side blas.Side, uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - // Quick return if possible. - if alpha == 0 { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] = 0 - } - } - return - } - - noConj := trans != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if trans == blas.NoTrans { - // Form B = alpha*A*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - j := ja + i + 1 - if aij != 0 { - c64.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } else { - for i := m - 1; i >= 0; i-- { - aii := alpha - if noUnit { - aii *= a[i*lda+i] - } - bi := b[i*ldb : i*ldb+n] - for j := range bi { - bi[j] *= aii - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c64.AxpyUnitary(alpha*aij, b[j*ldb:j*ldb+n], bi) - } - } - } - } - } else { - // Form B = alpha*A^T*B or B = alpha*A^H*B. - if uplo == blas.Upper { - for k := m - 1; k >= 0; k-- { - bk := b[k*ldb : k*ldb+n] - for ja, ajk := range a[k*lda+k+1 : k*lda+m] { - if ajk == 0 { - continue - } - j := k + 1 + ja - if noConj { - c64.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c64.ScalUnitary(akk, bk) - } - } - } else { - for k := 0; k < m; k++ { - bk := b[k*ldb : k*ldb+n] - for j, ajk := range a[k*lda : k*lda+k] { - if ajk == 0 { - continue - } - if noConj { - c64.AxpyUnitary(alpha*ajk, bk, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(alpha*cmplx.Conj(ajk), bk, b[j*ldb:j*ldb+n]) - } - } - akk := alpha - if noUnit { - if noConj { - akk *= a[k*lda+k] - } else { - akk *= cmplx.Conj(a[k*lda+k]) - } - } - if akk != 1 { - c64.ScalUnitary(akk, bk) - } - } - } - } - } else { - if trans == blas.NoTrans { - // Form B = alpha*B*A. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c64.AxpyUnitary(abik, a[k*lda+k+1:k*lda+n], bi[k+1:]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - abik := alpha * bi[k] - if abik == 0 { - continue - } - bi[k] = abik - if noUnit { - bi[k] *= a[k*lda+k] - } - c64.AxpyUnitary(abik, a[k*lda:k*lda+k], bi[:k]) - } - } - } - } else { - // Form B = alpha*B*A^T or B = alpha*B*A^H. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c64.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c64.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - bi[j] = alpha * bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := bi[j] - if noConj { - if noUnit { - bij *= a[j*lda+j] - } - bij += c64.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - } else { - if noUnit { - bij *= cmplx.Conj(a[j*lda+j]) - } - bij += c64.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - } - bi[j] = alpha * bij - } - } - } - } - } -} - -// Ctrsm solves one of the matrix equations -// op(A) * X = alpha * B if side == blas.Left, -// X * op(A) = alpha * B if side == blas.Right, -// where alpha is a scalar, X and B are m×n matrices, A is a unit or -// non-unit, upper or lower triangular matrix and op(A) is one of -// op(A) = A if transA == blas.NoTrans, -// op(A) = A^T if transA == blas.Trans, -// op(A) = A^H if transA == blas.ConjTrans. -// On return the matrix X is overwritten on B. -// -// Complex64 implementations are autogenerated and not directly tested. -func (Implementation) Ctrsm(side blas.Side, uplo blas.Uplo, transA blas.Transpose, diag blas.Diag, m, n int, alpha complex64, a []complex64, lda int, b []complex64, ldb int) { - na := m - if side == blas.Right { - na = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case uplo != blas.Lower && uplo != blas.Upper: - panic(badUplo) - case transA != blas.NoTrans && transA != blas.Trans && transA != blas.ConjTrans: - panic(badTranspose) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, na): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < (na-1)*lda+na { - panic(shortA) - } - if len(b) < (m-1)*ldb+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - b[i*ldb+j] = 0 - } - } - return - } - - noConj := transA != blas.ConjTrans - noUnit := diag == blas.NonUnit - if side == blas.Left { - if transA == blas.NoTrans { - // Form B = alpha*inv(A)*B. - if uplo == blas.Upper { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for ka, aik := range a[i*lda+i+1 : i*lda+m] { - k := i + 1 + ka - if aik != 0 { - c64.AxpyUnitary(-aik, b[k*ldb:k*ldb+n], bi) - } - } - if noUnit { - c64.ScalUnitary(1/a[i*lda+i], bi) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for j, aij := range a[i*lda : i*lda+i] { - if aij != 0 { - c64.AxpyUnitary(-aij, b[j*ldb:j*ldb+n], bi) - } - } - if noUnit { - c64.ScalUnitary(1/a[i*lda+i], bi) - } - } - } - } else { - // Form B = alpha*inv(A^T)*B or B = alpha*inv(A^H)*B. - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c64.ScalUnitary(1/a[i*lda+i], bi) - } else { - c64.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for ja, aij := range a[i*lda+i+1 : i*lda+m] { - if aij == 0 { - continue - } - j := i + 1 + ja - if noConj { - c64.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - } - } else { - for i := m - 1; i >= 0; i-- { - bi := b[i*ldb : i*ldb+n] - if noUnit { - if noConj { - c64.ScalUnitary(1/a[i*lda+i], bi) - } else { - c64.ScalUnitary(1/cmplx.Conj(a[i*lda+i]), bi) - } - } - for j, aij := range a[i*lda : i*lda+i] { - if aij == 0 { - continue - } - if noConj { - c64.AxpyUnitary(-aij, bi, b[j*ldb:j*ldb+n]) - } else { - c64.AxpyUnitary(-cmplx.Conj(aij), bi, b[j*ldb:j*ldb+n]) - } - } - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - } - } - } - } else { - if transA == blas.NoTrans { - // Form B = alpha*B*inv(A). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for j, bij := range bi { - if bij == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c64.AxpyUnitary(-bi[j], a[j*lda+j+1:j*lda+n], bi[j+1:n]) - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - if alpha != 1 { - c64.ScalUnitary(alpha, bi) - } - for j := n - 1; j >= 0; j-- { - if bi[j] == 0 { - continue - } - if noUnit { - bi[j] /= a[j*lda+j] - } - c64.AxpyUnitary(-bi[j], a[j*lda:j*lda+j], bi[:j]) - } - } - } - } else { - // Form B = alpha*B*inv(A^T) or B = alpha*B*inv(A^H). - if uplo == blas.Upper { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - bij := alpha * bi[j] - if noConj { - bij -= c64.DotuUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c64.DotcUnitary(a[j*lda+j+1:j*lda+n], bi[j+1:n]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } else { - for i := 0; i < m; i++ { - bi := b[i*ldb : i*ldb+n] - for j, bij := range bi { - bij *= alpha - if noConj { - bij -= c64.DotuUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= a[j*lda+j] - } - } else { - bij -= c64.DotcUnitary(a[j*lda:j*lda+j], bi[:j]) - if noUnit { - bij /= cmplx.Conj(a[j*lda+j]) - } - } - bi[j] = bij - } - } - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go deleted file mode 100644 index 13c4a792e..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3float32.go +++ /dev/null @@ -1,876 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -var _ blas.Float32Level3 = Implementation{} - -// Strsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left -// A^T * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right -// X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a -// scalar. -// -// At entry to the function, X contains the values of B, and the result is -// stored in-place into X. -// -// No check is made that A is invertible. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := m - 1; i >= 0; i-- { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for ka, va := range a[i*lda+i+1 : i*lda+m] { - if va != 0 { - k := ka + i + 1 - f32.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f32.ScalUnitary(tmp, btmp) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f32.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f32.ScalUnitary(tmp, btmp) - } - } - return - } - // Cases where a is transposed - if ul == blas.Upper { - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f32.ScalUnitary(tmp, btmpk) - } - for ia, va := range a[k*lda+k+1 : k*lda+m] { - if va != 0 { - i := ia + k + 1 - f32.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f32.ScalUnitary(alpha, btmpk) - } - } - return - } - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f32.ScalUnitary(tmp, btmpk) - } - for i, va := range a[k*lda : k*lda+k] { - if va != 0 { - f32.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f32.ScalUnitary(alpha, btmpk) - } - } - return - } - // Cases where a is to the right of X. - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for k, vb := range btmp { - if vb == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f32.AxpyUnitary(-btmp[k], a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f32.ScalUnitary(alpha, btmp) - } - for k := n - 1; k >= 0; k-- { - if btmp[k] == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f32.AxpyUnitary(-btmp[k], a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := alpha*btmp[j] - f32.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := 0; j < n; j++ { - tmp := alpha*btmp[j] - f32.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } -} - -// Ssymm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C if side == blas.Left -// C = alpha * B * A + beta * C if side == blas.Right -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha -// is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssymm(s blas.Side, ul blas.Uplo, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - if s != blas.Right && s != blas.Left { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] *= beta - } - } - return - } - - isUpper := ul == blas.Upper - if s == blas.Left { - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - btmp := b[i*ldb : i*ldb+n] - ctmp := c[i*ldc : i*ldc+n] - for j, v := range btmp { - ctmp[j] *= beta - ctmp[j] += atmp * v - } - - for k := 0; k < i; k++ { - var atmp float32 - if isUpper { - atmp = a[k*lda+i] - } else { - atmp = a[i*lda+k] - } - atmp *= alpha - f32.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - for k := i + 1; k < m; k++ { - var atmp float32 - if isUpper { - atmp = a[i*lda+k] - } else { - atmp = a[k*lda+i] - } - atmp *= alpha - f32.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - } - return - } - if isUpper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - tmp := alpha * b[i*ldb+j] - var tmp2 float32 - atmp := a[j*lda+j+1 : j*lda+n] - btmp := b[i*ldb+j+1 : i*ldb+n] - ctmp := c[i*ldc+j+1 : i*ldc+n] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } - return - } - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - tmp := alpha * b[i*ldb+j] - var tmp2 float32 - atmp := a[j*lda : j*lda+j] - btmp := b[i*ldb : i*ldb+j] - ctmp := c[i*ldc : i*ldc+j] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } -} - -// Ssyrk performs one of the symmetric rank-k operations -// C = alpha * A * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and -// beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float32, a []float32, lda int, beta float32, c []float32, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for jc := range ctmp { - j := jc + i - ctmp[jc] = alpha * f32.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } else { - for jc, vc := range ctmp { - j := jc + i - ctmp[jc] = vc*beta + alpha*f32.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for j := range ctmp { - ctmp[j] = alpha * f32.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } else { - for j, vc := range ctmp { - ctmp[j] = vc*beta + alpha*f32.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta == 0 { - for j := range ctmp { - ctmp[j] = 0 - } - } else if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f32.AxpyUnitary(tmp, a[l*lda+i:l*lda+n], ctmp) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f32.AxpyUnitary(tmp, a[l*lda:l*lda+i+1], ctmp) - } - } - } -} - -// Ssyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * B^T + alpha * B * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * B + alpha * B^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and -// alpha and beta are scalars. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Ssyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldb < max(1, col) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(b) < ldb*(row-1)+col { - panic(shortB) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc+i : i*ldc+n] - for jc := range ctmp { - j := i + jc - var tmp1, tmp2 float32 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[jc] *= beta - ctmp[jc] += alpha * (tmp1 + tmp2) - } - } - return - } - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc : i*ldc+i+1] - for j := 0; j <= i; j++ { - var tmp1, tmp2 float32 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[j] *= beta - ctmp[j] += alpha * (tmp1 + tmp2) - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb+i : l*ldb+n] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda+i : l*lda+n] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb : l*ldb+i+1] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda : l*lda+i+1] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } -} - -// Strmm performs one of the matrix-matrix operations -// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left -// B = alpha * A^T * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// B = alpha * B * A if tA == blas.NoTrans and side == blas.Right -// B = alpha * B * A^T if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Strmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float32, a []float32, lda int, b []float32, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f32.ScalUnitary(tmp, btmp) - for ka, va := range a[i*lda+i+1 : i*lda+m] { - k := ka + i + 1 - if va != 0 { - f32.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - for i := m - 1; i >= 0; i-- { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f32.ScalUnitary(tmp, btmp) - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f32.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - for ia, va := range a[k*lda+k+1 : k*lda+m] { - i := ia + k + 1 - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f32.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f32.ScalUnitary(tmp, btmpk) - } - } - return - } - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - for i, va := range a[k*lda : k*lda+k] { - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f32.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f32.ScalUnitary(tmp, btmpk) - } - } - return - } - // Cases where a is on the right - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f32.AxpyUnitary(tmp, a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f32.AxpyUnitary(tmp, a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j, vb := range btmp { - tmp := vb - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f32.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:n]) - btmp[j] = alpha * tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := btmp[j] - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f32.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - btmp[j] = alpha * tmp - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go b/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go deleted file mode 100644 index 9eebd9069..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/level3float64.go +++ /dev/null @@ -1,864 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var _ blas.Float64Level3 = Implementation{} - -// Dtrsm solves one of the matrix equations -// A * X = alpha * B if tA == blas.NoTrans and side == blas.Left -// A^T * X = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// X * A = alpha * B if tA == blas.NoTrans and side == blas.Right -// X * A^T = alpha * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, X and B are m×n matrices, and alpha is a -// scalar. -// -// At entry to the function, X contains the values of B, and the result is -// stored in-place into X. -// -// No check is made that A is invertible. -func (Implementation) Dtrsm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := m - 1; i >= 0; i-- { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for ka, va := range a[i*lda+i+1 : i*lda+m] { - if va != 0 { - k := ka + i + 1 - f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f64.ScalUnitary(tmp, btmp) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f64.AxpyUnitary(-va, b[k*ldb:k*ldb+n], btmp) - } - } - if nonUnit { - tmp := 1 / a[i*lda+i] - f64.ScalUnitary(tmp, btmp) - } - } - return - } - // Cases where a is transposed - if ul == blas.Upper { - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f64.ScalUnitary(tmp, btmpk) - } - for ia, va := range a[k*lda+k+1 : k*lda+m] { - if va != 0 { - i := ia + k + 1 - f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f64.ScalUnitary(alpha, btmpk) - } - } - return - } - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - if nonUnit { - tmp := 1 / a[k*lda+k] - f64.ScalUnitary(tmp, btmpk) - } - for i, va := range a[k*lda : k*lda+k] { - if va != 0 { - f64.AxpyUnitary(-va, btmpk, b[i*ldb:i*ldb+n]) - } - } - if alpha != 1 { - f64.ScalUnitary(alpha, btmpk) - } - } - return - } - // Cases where a is to the right of X. - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for k, vb := range btmp { - if vb == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f64.AxpyUnitary(-btmp[k], a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - if alpha != 1 { - f64.ScalUnitary(alpha, btmp) - } - for k := n - 1; k >= 0; k-- { - if btmp[k] == 0 { - continue - } - if nonUnit { - btmp[k] /= a[k*lda+k] - } - f64.AxpyUnitary(-btmp[k], a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := alpha*btmp[j] - f64.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := 0; j < n; j++ { - tmp := alpha*btmp[j] - f64.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - if nonUnit { - tmp /= a[j*lda+j] - } - btmp[j] = tmp - } - } -} - -// Dsymm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C if side == blas.Left -// C = alpha * B * A + beta * C if side == blas.Right -// where A is an n×n or m×m symmetric matrix, B and C are m×n matrices, and alpha -// is a scalar. -func (Implementation) Dsymm(s blas.Side, ul blas.Uplo, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - if s != blas.Right && s != blas.Left { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - if len(c) < ldc*(m-1)+n { - panic(shortC) - } - - // Quick return if possible. - if alpha == 0 && beta == 1 { - return - } - - if alpha == 0 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] *= beta - } - } - return - } - - isUpper := ul == blas.Upper - if s == blas.Left { - for i := 0; i < m; i++ { - atmp := alpha * a[i*lda+i] - btmp := b[i*ldb : i*ldb+n] - ctmp := c[i*ldc : i*ldc+n] - for j, v := range btmp { - ctmp[j] *= beta - ctmp[j] += atmp * v - } - - for k := 0; k < i; k++ { - var atmp float64 - if isUpper { - atmp = a[k*lda+i] - } else { - atmp = a[i*lda+k] - } - atmp *= alpha - f64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - for k := i + 1; k < m; k++ { - var atmp float64 - if isUpper { - atmp = a[i*lda+k] - } else { - atmp = a[k*lda+i] - } - atmp *= alpha - f64.AxpyUnitary(atmp, b[k*ldb:k*ldb+n], ctmp) - } - } - return - } - if isUpper { - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - tmp := alpha * b[i*ldb+j] - var tmp2 float64 - atmp := a[j*lda+j+1 : j*lda+n] - btmp := b[i*ldb+j+1 : i*ldb+n] - ctmp := c[i*ldc+j+1 : i*ldc+n] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } - return - } - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - tmp := alpha * b[i*ldb+j] - var tmp2 float64 - atmp := a[j*lda : j*lda+j] - btmp := b[i*ldb : i*ldb+j] - ctmp := c[i*ldc : i*ldc+j] - for k, v := range atmp { - ctmp[k] += tmp * v - tmp2 += btmp[k] * v - } - c[i*ldc+j] *= beta - c[i*ldc+j] += tmp*a[j*lda+j] + alpha*tmp2 - } - } -} - -// Dsyrk performs one of the symmetric rank-k operations -// C = alpha * A * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A is an n×k or k×n matrix, C is an n×n symmetric matrix, and alpha and -// beta are scalars. -func (Implementation) Dsyrk(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, beta float64, c []float64, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for jc := range ctmp { - j := jc + i - ctmp[jc] = alpha * f64.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } else { - for jc, vc := range ctmp { - j := jc + i - ctmp[jc] = vc*beta + alpha*f64.DotUnitary(atmp, a[j*lda:j*lda+k]) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - atmp := a[i*lda : i*lda+k] - if beta == 0 { - for j := range ctmp { - ctmp[j] = alpha * f64.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } else { - for j, vc := range ctmp { - ctmp[j] = vc*beta + alpha*f64.DotUnitary(a[j*lda:j*lda+k], atmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta == 0 { - for j := range ctmp { - ctmp[j] = 0 - } - } else if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f64.AxpyUnitary(tmp, a[l*lda+i:l*lda+n], ctmp) - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp := alpha * a[l*lda+i] - if tmp != 0 { - f64.AxpyUnitary(tmp, a[l*lda:l*lda+i+1], ctmp) - } - } - } -} - -// Dsyr2k performs one of the symmetric rank 2k operations -// C = alpha * A * B^T + alpha * B * A^T + beta * C if tA == blas.NoTrans -// C = alpha * A^T * B + alpha * B^T * A + beta * C if tA == blas.Trans or tA == blas.ConjTrans -// where A and B are n×k or k×n matrices, C is an n×n symmetric matrix, and -// alpha and beta are scalars. -func (Implementation) Dsyr2k(ul blas.Uplo, tA blas.Transpose, n, k int, alpha float64, a []float64, lda int, b []float64, ldb int, beta float64, c []float64, ldc int) { - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.Trans && tA != blas.NoTrans && tA != blas.ConjTrans { - panic(badTranspose) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - row, col := k, n - if tA == blas.NoTrans { - row, col = n, k - } - if lda < max(1, col) { - panic(badLdA) - } - if ldb < max(1, col) { - panic(badLdB) - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(row-1)+col { - panic(shortA) - } - if len(b) < ldb*(row-1)+col { - panic(shortB) - } - if len(c) < ldc*(n-1)+n { - panic(shortC) - } - - if alpha == 0 { - if beta == 0 { - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] = 0 - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - for j := range ctmp { - ctmp[j] *= beta - } - } - return - } - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc+i : i*ldc+n] - for jc := range ctmp { - j := i + jc - var tmp1, tmp2 float64 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[jc] *= beta - ctmp[jc] += alpha * (tmp1 + tmp2) - } - } - return - } - for i := 0; i < n; i++ { - atmp := a[i*lda : i*lda+k] - btmp := b[i*ldb : i*ldb+k] - ctmp := c[i*ldc : i*ldc+i+1] - for j := 0; j <= i; j++ { - var tmp1, tmp2 float64 - binner := b[j*ldb : j*ldb+k] - for l, v := range a[j*lda : j*lda+k] { - tmp1 += v * btmp[l] - tmp2 += atmp[l] * binner[l] - } - ctmp[j] *= beta - ctmp[j] += alpha * (tmp1 + tmp2) - } - } - return - } - if ul == blas.Upper { - for i := 0; i < n; i++ { - ctmp := c[i*ldc+i : i*ldc+n] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb+i : l*ldb+n] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda+i : l*lda+n] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } - return - } - for i := 0; i < n; i++ { - ctmp := c[i*ldc : i*ldc+i+1] - if beta != 1 { - for j := range ctmp { - ctmp[j] *= beta - } - } - for l := 0; l < k; l++ { - tmp1 := alpha * b[l*ldb+i] - tmp2 := alpha * a[l*lda+i] - btmp := b[l*ldb : l*ldb+i+1] - if tmp1 != 0 || tmp2 != 0 { - for j, v := range a[l*lda : l*lda+i+1] { - ctmp[j] += v*tmp1 + btmp[j]*tmp2 - } - } - } - } -} - -// Dtrmm performs one of the matrix-matrix operations -// B = alpha * A * B if tA == blas.NoTrans and side == blas.Left -// B = alpha * A^T * B if tA == blas.Trans or blas.ConjTrans, and side == blas.Left -// B = alpha * B * A if tA == blas.NoTrans and side == blas.Right -// B = alpha * B * A^T if tA == blas.Trans or blas.ConjTrans, and side == blas.Right -// where A is an n×n or m×m triangular matrix, B is an m×n matrix, and alpha is a scalar. -func (Implementation) Dtrmm(s blas.Side, ul blas.Uplo, tA blas.Transpose, d blas.Diag, m, n int, alpha float64, a []float64, lda int, b []float64, ldb int) { - if s != blas.Left && s != blas.Right { - panic(badSide) - } - if ul != blas.Lower && ul != blas.Upper { - panic(badUplo) - } - if tA != blas.NoTrans && tA != blas.Trans && tA != blas.ConjTrans { - panic(badTranspose) - } - if d != blas.NonUnit && d != blas.Unit { - panic(badDiag) - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - k := n - if s == blas.Left { - k = m - } - if lda < max(1, k) { - panic(badLdA) - } - if ldb < max(1, n) { - panic(badLdB) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if len(a) < lda*(k-1)+k { - panic(shortA) - } - if len(b) < ldb*(m-1)+n { - panic(shortB) - } - - if alpha == 0 { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := range btmp { - btmp[j] = 0 - } - } - return - } - - nonUnit := d == blas.NonUnit - if s == blas.Left { - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f64.ScalUnitary(tmp, btmp) - for ka, va := range a[i*lda+i+1 : i*lda+m] { - k := ka + i + 1 - if va != 0 { - f64.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - for i := m - 1; i >= 0; i-- { - tmp := alpha - if nonUnit { - tmp *= a[i*lda+i] - } - btmp := b[i*ldb : i*ldb+n] - f64.ScalUnitary(tmp, btmp) - for k, va := range a[i*lda : i*lda+i] { - if va != 0 { - f64.AxpyUnitary(alpha*va, b[k*ldb:k*ldb+n], btmp) - } - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for k := m - 1; k >= 0; k-- { - btmpk := b[k*ldb : k*ldb+n] - for ia, va := range a[k*lda+k+1 : k*lda+m] { - i := ia + k + 1 - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f64.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f64.ScalUnitary(tmp, btmpk) - } - } - return - } - for k := 0; k < m; k++ { - btmpk := b[k*ldb : k*ldb+n] - for i, va := range a[k*lda : k*lda+k] { - btmp := b[i*ldb : i*ldb+n] - if va != 0 { - f64.AxpyUnitary(alpha*va, btmpk, btmp) - } - } - tmp := alpha - if nonUnit { - tmp *= a[k*lda+k] - } - if tmp != 1 { - f64.ScalUnitary(tmp, btmpk) - } - } - return - } - // Cases where a is on the right - if tA == blas.NoTrans { - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := n - 1; k >= 0; k-- { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f64.AxpyUnitary(tmp, a[k*lda+k+1:k*lda+n], btmp[k+1:n]) - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for k := 0; k < n; k++ { - tmp := alpha * btmp[k] - if tmp == 0 { - continue - } - btmp[k] = tmp - if nonUnit { - btmp[k] *= a[k*lda+k] - } - f64.AxpyUnitary(tmp, a[k*lda:k*lda+k], btmp[:k]) - } - } - return - } - // Cases where a is transposed. - if ul == blas.Upper { - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j, vb := range btmp { - tmp := vb - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f64.DotUnitary(a[j*lda+j+1:j*lda+n], btmp[j+1:n]) - btmp[j] = alpha * tmp - } - } - return - } - for i := 0; i < m; i++ { - btmp := b[i*ldb : i*ldb+n] - for j := n - 1; j >= 0; j-- { - tmp := btmp[j] - if nonUnit { - tmp *= a[j*lda+j] - } - tmp += f64.DotUnitary(a[j*lda:j*lda+j], btmp[:j]) - btmp[j] = alpha * tmp - } - } -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go b/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go deleted file mode 100644 index e868a1050..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/sgemm.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT. - -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "runtime" - "sync" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/internal/asm/f32" -) - -// Sgemm performs one of the matrix-matrix operations -// C = alpha * A * B + beta * C -// C = alpha * A^T * B + beta * C -// C = alpha * A * B^T + beta * C -// C = alpha * A^T * B^T + beta * C -// where A is an m×k or k×m dense matrix, B is an n×k or k×n dense matrix, C is -// an m×n matrix, and alpha and beta are scalars. tA and tB specify whether A or -// B are transposed. -// -// Float32 implementations are autogenerated and not directly tested. -func (Implementation) Sgemm(tA, tB blas.Transpose, m, n, k int, alpha float32, a []float32, lda int, b []float32, ldb int, beta float32, c []float32, ldc int) { - switch tA { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - switch tB { - default: - panic(badTranspose) - case blas.NoTrans, blas.Trans, blas.ConjTrans: - } - if m < 0 { - panic(mLT0) - } - if n < 0 { - panic(nLT0) - } - if k < 0 { - panic(kLT0) - } - aTrans := tA == blas.Trans || tA == blas.ConjTrans - if aTrans { - if lda < max(1, m) { - panic(badLdA) - } - } else { - if lda < max(1, k) { - panic(badLdA) - } - } - bTrans := tB == blas.Trans || tB == blas.ConjTrans - if bTrans { - if ldb < max(1, k) { - panic(badLdB) - } - } else { - if ldb < max(1, n) { - panic(badLdB) - } - } - if ldc < max(1, n) { - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - // For zero matrix size the following slice length checks are trivially satisfied. - if aTrans { - if len(a) < (k-1)*lda+m { - panic(shortA) - } - } else { - if len(a) < (m-1)*lda+k { - panic(shortA) - } - } - if bTrans { - if len(b) < (n-1)*ldb+k { - panic(shortB) - } - } else { - if len(b) < (k-1)*ldb+n { - panic(shortB) - } - } - if len(c) < (m-1)*ldc+n { - panic(shortC) - } - - // Quick return if possible. - if (alpha == 0 || k == 0) && beta == 1 { - return - } - - // scale c - if beta != 1 { - if beta == 0 { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] = 0 - } - } - } else { - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for j := range ctmp { - ctmp[j] *= beta - } - } - } - } - - sgemmParallel(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) -} - -func sgemmParallel(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // dgemmParallel computes a parallel matrix multiplication by partitioning - // a and b into sub-blocks, and updating c with the multiplication of the sub-block - // In all cases, - // A = [ A_11 A_12 ... A_1j - // A_21 A_22 ... A_2j - // ... - // A_i1 A_i2 ... A_ij] - // - // and same for B. All of the submatrix sizes are blockSize×blockSize except - // at the edges. - // - // In all cases, there is one dimension for each matrix along which - // C must be updated sequentially. - // Cij = \sum_k Aik Bki, (A * B) - // Cij = \sum_k Aki Bkj, (A^T * B) - // Cij = \sum_k Aik Bjk, (A * B^T) - // Cij = \sum_k Aki Bjk, (A^T * B^T) - // - // This code computes one {i, j} block sequentially along the k dimension, - // and computes all of the {i, j} blocks concurrently. This - // partitioning allows Cij to be updated in-place without race-conditions. - // Instead of launching a goroutine for each possible concurrent computation, - // a number of worker goroutines are created and channels are used to pass - // available and completed cases. - // - // http://alexkr.com/docs/matrixmult.pdf is a good reference on matrix-matrix - // multiplies, though this code does not copy matrices to attempt to eliminate - // cache misses. - - maxKLen := k - parBlocks := blocks(m, blockSize) * blocks(n, blockSize) - if parBlocks < minParBlock { - // The matrix multiplication is small in the dimensions where it can be - // computed concurrently. Just do it in serial. - sgemmSerial(aTrans, bTrans, m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - } - - nWorkers := runtime.GOMAXPROCS(0) - if parBlocks < nWorkers { - nWorkers = parBlocks - } - // There is a tradeoff between the workers having to wait for work - // and a large buffer making operations slow. - buf := buffMul * nWorkers - if buf > parBlocks { - buf = parBlocks - } - - sendChan := make(chan subMul, buf) - - // Launch workers. A worker receives an {i, j} submatrix of c, and computes - // A_ik B_ki (or the transposed version) storing the result in c_ij. When the - // channel is finally closed, it signals to the waitgroup that it has finished - // computing. - var wg sync.WaitGroup - for i := 0; i < nWorkers; i++ { - wg.Add(1) - go func() { - defer wg.Done() - for sub := range sendChan { - i := sub.i - j := sub.j - leni := blockSize - if i+leni > m { - leni = m - i - } - lenj := blockSize - if j+lenj > n { - lenj = n - j - } - - cSub := sliceView32(c, ldc, i, j, leni, lenj) - - // Compute A_ik B_kj for all k - for k := 0; k < maxKLen; k += blockSize { - lenk := blockSize - if k+lenk > maxKLen { - lenk = maxKLen - k - } - var aSub, bSub []float32 - if aTrans { - aSub = sliceView32(a, lda, k, i, lenk, leni) - } else { - aSub = sliceView32(a, lda, i, k, leni, lenk) - } - if bTrans { - bSub = sliceView32(b, ldb, j, k, lenj, lenk) - } else { - bSub = sliceView32(b, ldb, k, j, lenk, lenj) - } - sgemmSerial(aTrans, bTrans, leni, lenj, lenk, aSub, lda, bSub, ldb, cSub, ldc, alpha) - } - } - }() - } - - // Send out all of the {i, j} subblocks for computation. - for i := 0; i < m; i += blockSize { - for j := 0; j < n; j += blockSize { - sendChan <- subMul{ - i: i, - j: j, - } - } - } - close(sendChan) - wg.Wait() -} - -// sgemmSerial is serial matrix multiply -func sgemmSerial(aTrans, bTrans bool, m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - switch { - case !aTrans && !bTrans: - sgemmSerialNotNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && !bTrans: - sgemmSerialTransNot(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case !aTrans && bTrans: - sgemmSerialNotTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - case aTrans && bTrans: - sgemmSerialTransTrans(m, n, k, a, lda, b, ldb, c, ldc, alpha) - return - default: - panic("unreachable") - } -} - -// sgemmSerial where neither a nor b are transposed -func sgemmSerialNotNot(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - ctmp := c[i*ldc : i*ldc+n] - for l, v := range a[i*lda : i*lda+k] { - tmp := alpha * v - if tmp != 0 { - f32.AxpyUnitary(tmp, b[l*ldb:l*ldb+n], ctmp) - } - } - } -} - -// sgemmSerial where neither a is transposed and b is not -func sgemmSerialTransNot(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - btmp := b[l*ldb : l*ldb+n] - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f32.AxpyUnitary(tmp, btmp, ctmp) - } - } - } -} - -// sgemmSerial where neither a is not transposed and b is -func sgemmSerialNotTrans(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for i := 0; i < m; i++ { - atmp := a[i*lda : i*lda+k] - ctmp := c[i*ldc : i*ldc+n] - for j := 0; j < n; j++ { - ctmp[j] += alpha * f32.DotUnitary(atmp, b[j*ldb:j*ldb+k]) - } - } -} - -// sgemmSerial where both are transposed -func sgemmSerialTransTrans(m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int, alpha float32) { - // This style is used instead of the literal [i*stride +j]) is used because - // approximately 5 times faster as of go 1.3. - for l := 0; l < k; l++ { - for i, v := range a[l*lda : l*lda+m] { - tmp := alpha * v - if tmp != 0 { - ctmp := c[i*ldc : i*ldc+n] - f32.AxpyInc(tmp, b[l:], ctmp, uintptr(n), uintptr(ldb), 1, 0, 0) - } - } - } -} - -func sliceView32(a []float32, lda, i, j, r, c int) []float32 { - return a[i*lda+j : (i+r-1)*lda+j+c] -} diff --git a/vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash b/vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash deleted file mode 100644 index 53db63a7f..000000000 --- a/vendor/gonum.org/v1/gonum/blas/gonum/single_precision.bash +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env bash - -# Copyright ©2015 The Gonum Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -WARNINGF32='//\ -// Float32 implementations are autogenerated and not directly tested.\ -' -WARNINGC64='//\ -// Complex64 implementations are autogenerated and not directly tested.\ -' - -# Level1 routines. - -echo Generating level1float32.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32.go -cat level1float64.go \ -| gofmt -r 'blas.Float64Level1 -> blas.Float32Level1' \ -\ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'blas.DrotmParams -> blas.SrotmParams' \ -\ -| gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -| gofmt -r 'f64.ScalInc -> f32.ScalInc' \ -| gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e "s_^\(func (Implementation) \)Id\(.*\)\$_$WARNINGF32\1Is\2_" \ - -e 's_^// Id_// Is_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ ->> level1float32.go - -echo Generating level1cmplx64.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1cmplx64.go -cat level1cmplx128.go \ -| gofmt -r 'blas.Complex128Level1 -> blas.Complex64Level1' \ -\ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'complex128 -> complex64' \ -\ -| gofmt -r 'c128.AxpyInc -> c64.AxpyInc' \ -| gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \ -| gofmt -r 'c128.DotcInc -> c64.DotcInc' \ -| gofmt -r 'c128.DotcUnitary -> c64.DotcUnitary' \ -| gofmt -r 'c128.DotuInc -> c64.DotuInc' \ -| gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \ -| gofmt -r 'c128.ScalInc -> c64.ScalInc' \ -| gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \ -| gofmt -r 'dcabs1 -> scabs1' \ -\ -| sed -e "s_^\(func (Implementation) \)Zdot\(.*\)\$_$WARNINGC64\1Cdot\2_" \ - -e 's_^// Zdot_// Cdot_' \ - -e "s_^\(func (Implementation) \)Zdscal\(.*\)\$_$WARNINGC64\1Csscal\2_" \ - -e 's_^// Zdscal_// Csscal_' \ - -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \ - -e 's_^// Z_// C_' \ - -e "s_^\(func (Implementation) \)Iz\(.*\)\$_$WARNINGC64\1Ic\2_" \ - -e 's_^// Iz_// Ic_' \ - -e "s_^\(func (Implementation) \)Dz\(.*\)\$_$WARNINGC64\1Sc\2_" \ - -e 's_^// Dz_// Sc_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/c128"_"gonum.org/v1/gonum/internal/asm/c64"_' \ - -e 's_"math"_math "gonum.org/v1/gonum/internal/math32"_' \ ->> level1cmplx64.go - -echo Generating level1float32_sdot.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_sdot.go -cat level1float64_ddot.go \ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.DotInc -> f32.DotInc' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level1float32_sdot.go - -echo Generating level1float32_dsdot.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_dsdot.go -cat level1float64_ddot.go \ -| gofmt -r '[]float64 -> []float32' \ -\ -| gofmt -r 'f64.DotInc -> f32.DdotInc' \ -| gofmt -r 'f64.DotUnitary -> f32.DdotUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1Ds\2_" \ - -e 's_^// D_// Ds_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level1float32_dsdot.go - -echo Generating level1float32_sdsdot.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level1float32_sdsdot.go -cat level1float64_ddot.go \ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.DotInc(x, y, f(n), f(incX), f(incY), f(ix), f(iy)) -> alpha + float32(f32.DdotInc(x, y, f(n), f(incX), f(incY), f(ix), f(iy)))' \ -| gofmt -r 'f64.DotUnitary(a, b) -> alpha + float32(f32.DdotUnitary(a, b))' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1Sds\2_" \ - -e 's_^// D\(.*\)$_// Sds\1 plus a constant_' \ - -e 's_\\sum_alpha + \\sum_' \ - -e 's/n int/n int, alpha float32/' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level1float32_sdsdot.go - - -# Level2 routines. - -echo Generating level2float32.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level2float32.go -cat level2float64.go \ -| gofmt -r 'blas.Float64Level2 -> blas.Float32Level2' \ -\ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \ -| gofmt -r 'f64.AxpyIncTo -> f32.AxpyIncTo' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.AxpyUnitaryTo -> f32.AxpyUnitaryTo' \ -| gofmt -r 'f64.DotInc -> f32.DotInc' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -| gofmt -r 'f64.ScalInc -> f32.ScalInc' \ -| gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \ -| gofmt -r 'f64.Ger -> f32.Ger' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level2float32.go - -echo Generating level2cmplx64.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level2cmplx64.go -cat level2cmplx128.go \ -| gofmt -r 'blas.Complex128Level2 -> blas.Complex64Level2' \ -\ -| gofmt -r 'complex128 -> complex64' \ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'c128.AxpyInc -> c64.AxpyInc' \ -| gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \ -| gofmt -r 'c128.DotuInc -> c64.DotuInc' \ -| gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \ -| gofmt -r 'c128.ScalInc -> c64.ScalInc' \ -| gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \ - -e 's_^// Z_// C_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/c128"_"gonum.org/v1/gonum/internal/asm/c64"_' \ - -e 's_"math/cmplx"_cmplx "gonum.org/v1/gonum/internal/cmplx64"_' \ ->> level2cmplx64.go - -# Level3 routines. - -echo Generating level3float32.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level3float32.go -cat level3float64.go \ -| gofmt -r 'blas.Float64Level3 -> blas.Float32Level3' \ -\ -| gofmt -r 'float64 -> float32' \ -\ -| gofmt -r 'f64.AxpyUnitaryTo -> f32.AxpyUnitaryTo' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -| gofmt -r 'f64.ScalUnitary -> f32.ScalUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> level3float32.go - -echo Generating sgemm.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > sgemm.go -cat dgemm.go \ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'sliceView64 -> sliceView32' \ -\ -| gofmt -r 'dgemmParallel -> sgemmParallel' \ -| gofmt -r 'computeNumBlocks64 -> computeNumBlocks32' \ -| gofmt -r 'dgemmSerial -> sgemmSerial' \ -| gofmt -r 'dgemmSerialNotNot -> sgemmSerialNotNot' \ -| gofmt -r 'dgemmSerialTransNot -> sgemmSerialTransNot' \ -| gofmt -r 'dgemmSerialNotTrans -> sgemmSerialNotTrans' \ -| gofmt -r 'dgemmSerialTransTrans -> sgemmSerialTransTrans' \ -\ -| gofmt -r 'f64.AxpyInc -> f32.AxpyInc' \ -| gofmt -r 'f64.AxpyUnitary -> f32.AxpyUnitary' \ -| gofmt -r 'f64.DotUnitary -> f32.DotUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)D\(.*\)\$_$WARNINGF32\1S\2_" \ - -e 's_^// D_// S_' \ - -e 's_^// d_// s_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/f64"_"gonum.org/v1/gonum/internal/asm/f32"_' \ ->> sgemm.go - -echo Generating level3cmplx64.go -echo -e '// Code generated by "go generate gonum.org/v1/gonum/blas/gonum”; DO NOT EDIT.\n' > level3cmplx64.go -cat level3cmplx128.go \ -| gofmt -r 'blas.Complex128Level3 -> blas.Complex64Level3' \ -\ -| gofmt -r 'float64 -> float32' \ -| gofmt -r 'complex128 -> complex64' \ -\ -| gofmt -r 'c128.ScalUnitary -> c64.ScalUnitary' \ -| gofmt -r 'c128.DscalUnitary -> c64.SscalUnitary' \ -| gofmt -r 'c128.DotcUnitary -> c64.DotcUnitary' \ -| gofmt -r 'c128.AxpyUnitary -> c64.AxpyUnitary' \ -| gofmt -r 'c128.DotuUnitary -> c64.DotuUnitary' \ -\ -| sed -e "s_^\(func (Implementation) \)Z\(.*\)\$_$WARNINGC64\1C\2_" \ - -e 's_^// Z_// C_' \ - -e 's_"gonum.org/v1/gonum/internal/asm/c128"_"gonum.org/v1/gonum/internal/asm/c64"_' \ - -e 's_"math/cmplx"_cmplx "gonum.org/v1/gonum/internal/cmplx64"_' \ ->> level3cmplx64.go diff --git a/vendor/gonum.org/v1/gonum/floats/README.md b/vendor/gonum.org/v1/gonum/floats/README.md deleted file mode 100644 index ee867bb7b..000000000 --- a/vendor/gonum.org/v1/gonum/floats/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Gonum floats [![GoDoc](https://godoc.org/gonum.org/v1/gonum/floats?status.svg)](https://godoc.org/gonum.org/v1/gonum/floats) - -Package floats provides a set of helper routines for dealing with slices of float64. -The functions avoid allocations to allow for use within tight loops without garbage collection overhead. diff --git a/vendor/gonum.org/v1/gonum/floats/doc.go b/vendor/gonum.org/v1/gonum/floats/doc.go deleted file mode 100644 index bfe05c191..000000000 --- a/vendor/gonum.org/v1/gonum/floats/doc.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package floats provides a set of helper routines for dealing with slices -// of float64. The functions avoid allocations to allow for use within tight -// loops without garbage collection overhead. -// -// The convention used is that when a slice is being modified in place, it has -// the name dst. -package floats // import "gonum.org/v1/gonum/floats" diff --git a/vendor/gonum.org/v1/gonum/floats/floats.go b/vendor/gonum.org/v1/gonum/floats/floats.go deleted file mode 100644 index ae004a621..000000000 --- a/vendor/gonum.org/v1/gonum/floats/floats.go +++ /dev/null @@ -1,933 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this code is governed by a BSD-style -// license that can be found in the LICENSE file - -package floats - -import ( - "errors" - "math" - "sort" - "strconv" - - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Add adds, element-wise, the elements of s and dst, and stores in dst. -// Panics if the lengths of dst and s do not match. -func Add(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: length of the slices do not match") - } - f64.AxpyUnitaryTo(dst, 1, s, dst) -} - -// AddTo adds, element-wise, the elements of s and t and -// stores the result in dst. Panics if the lengths of s, t and dst do not match. -func AddTo(dst, s, t []float64) []float64 { - if len(s) != len(t) { - panic("floats: length of adders do not match") - } - if len(dst) != len(s) { - panic("floats: length of destination does not match length of adder") - } - f64.AxpyUnitaryTo(dst, 1, s, t) - return dst -} - -// AddConst adds the scalar c to all of the values in dst. -func AddConst(c float64, dst []float64) { - f64.AddConst(c, dst) -} - -// AddScaled performs dst = dst + alpha * s. -// It panics if the lengths of dst and s are not equal. -func AddScaled(dst []float64, alpha float64, s []float64) { - if len(dst) != len(s) { - panic("floats: length of destination and source to not match") - } - f64.AxpyUnitaryTo(dst, alpha, s, dst) -} - -// AddScaledTo performs dst = y + alpha * s, where alpha is a scalar, -// and dst, y and s are all slices. -// It panics if the lengths of dst, y, and s are not equal. -// -// At the return of the function, dst[i] = y[i] + alpha * s[i] -func AddScaledTo(dst, y []float64, alpha float64, s []float64) []float64 { - if len(dst) != len(s) || len(dst) != len(y) { - panic("floats: lengths of slices do not match") - } - f64.AxpyUnitaryTo(dst, alpha, s, y) - return dst -} - -// argsort is a helper that implements sort.Interface, as used by -// Argsort. -type argsort struct { - s []float64 - inds []int -} - -func (a argsort) Len() int { - return len(a.s) -} - -func (a argsort) Less(i, j int) bool { - return a.s[i] < a.s[j] -} - -func (a argsort) Swap(i, j int) { - a.s[i], a.s[j] = a.s[j], a.s[i] - a.inds[i], a.inds[j] = a.inds[j], a.inds[i] -} - -// Argsort sorts the elements of dst while tracking their original order. -// At the conclusion of Argsort, dst will contain the original elements of dst -// but sorted in increasing order, and inds will contain the original position -// of the elements in the slice such that dst[i] = origDst[inds[i]]. -// It panics if the lengths of dst and inds do not match. -func Argsort(dst []float64, inds []int) { - if len(dst) != len(inds) { - panic("floats: length of inds does not match length of slice") - } - for i := range dst { - inds[i] = i - } - - a := argsort{s: dst, inds: inds} - sort.Sort(a) -} - -// Count applies the function f to every element of s and returns the number -// of times the function returned true. -func Count(f func(float64) bool, s []float64) int { - var n int - for _, val := range s { - if f(val) { - n++ - } - } - return n -} - -// CumProd finds the cumulative product of the first i elements in -// s and puts them in place into the ith element of the -// destination dst. A panic will occur if the lengths of arguments -// do not match. -// -// At the return of the function, dst[i] = s[i] * s[i-1] * s[i-2] * ... -func CumProd(dst, s []float64) []float64 { - if len(dst) != len(s) { - panic("floats: length of destination does not match length of the source") - } - if len(dst) == 0 { - return dst - } - return f64.CumProd(dst, s) -} - -// CumSum finds the cumulative sum of the first i elements in -// s and puts them in place into the ith element of the -// destination dst. A panic will occur if the lengths of arguments -// do not match. -// -// At the return of the function, dst[i] = s[i] + s[i-1] + s[i-2] + ... -func CumSum(dst, s []float64) []float64 { - if len(dst) != len(s) { - panic("floats: length of destination does not match length of the source") - } - if len(dst) == 0 { - return dst - } - return f64.CumSum(dst, s) -} - -// Distance computes the L-norm of s - t. See Norm for special cases. -// A panic will occur if the lengths of s and t do not match. -func Distance(s, t []float64, L float64) float64 { - if len(s) != len(t) { - panic("floats: slice lengths do not match") - } - if len(s) == 0 { - return 0 - } - var norm float64 - if L == 2 { - for i, v := range s { - diff := t[i] - v - norm = math.Hypot(norm, diff) - } - return norm - } - if L == 1 { - for i, v := range s { - norm += math.Abs(t[i] - v) - } - return norm - } - if math.IsInf(L, 1) { - for i, v := range s { - absDiff := math.Abs(t[i] - v) - if absDiff > norm { - norm = absDiff - } - } - return norm - } - for i, v := range s { - norm += math.Pow(math.Abs(t[i]-v), L) - } - return math.Pow(norm, 1/L) -} - -// Div performs element-wise division dst / s -// and stores the value in dst. It panics if the -// lengths of s and t are not equal. -func Div(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: slice lengths do not match") - } - f64.Div(dst, s) -} - -// DivTo performs element-wise division s / t -// and stores the value in dst. It panics if the -// lengths of s, t, and dst are not equal. -func DivTo(dst, s, t []float64) []float64 { - if len(s) != len(t) || len(dst) != len(t) { - panic("floats: slice lengths do not match") - } - return f64.DivTo(dst, s, t) -} - -// Dot computes the dot product of s1 and s2, i.e. -// sum_{i = 1}^N s1[i]*s2[i]. -// A panic will occur if lengths of arguments do not match. -func Dot(s1, s2 []float64) float64 { - if len(s1) != len(s2) { - panic("floats: lengths of the slices do not match") - } - return f64.DotUnitary(s1, s2) -} - -// Equal returns true if the slices have equal lengths and -// all elements are numerically identical. -func Equal(s1, s2 []float64) bool { - if len(s1) != len(s2) { - return false - } - for i, val := range s1 { - if s2[i] != val { - return false - } - } - return true -} - -// EqualApprox returns true if the slices have equal lengths and -// all element pairs have an absolute tolerance less than tol or a -// relative tolerance less than tol. -func EqualApprox(s1, s2 []float64, tol float64) bool { - if len(s1) != len(s2) { - return false - } - for i, a := range s1 { - if !EqualWithinAbsOrRel(a, s2[i], tol, tol) { - return false - } - } - return true -} - -// EqualFunc returns true if the slices have the same lengths -// and the function returns true for all element pairs. -func EqualFunc(s1, s2 []float64, f func(float64, float64) bool) bool { - if len(s1) != len(s2) { - return false - } - for i, val := range s1 { - if !f(val, s2[i]) { - return false - } - } - return true -} - -// EqualWithinAbs returns true if a and b have an absolute -// difference of less than tol. -func EqualWithinAbs(a, b, tol float64) bool { - return a == b || math.Abs(a-b) <= tol -} - -const minNormalFloat64 = 2.2250738585072014e-308 - -// EqualWithinRel returns true if the difference between a and b -// is not greater than tol times the greater value. -func EqualWithinRel(a, b, tol float64) bool { - if a == b { - return true - } - delta := math.Abs(a - b) - if delta <= minNormalFloat64 { - return delta <= tol*minNormalFloat64 - } - // We depend on the division in this relationship to identify - // infinities (we rely on the NaN to fail the test) otherwise - // we compare Infs of the same sign and evaluate Infs as equal - // independent of sign. - return delta/math.Max(math.Abs(a), math.Abs(b)) <= tol -} - -// EqualWithinAbsOrRel returns true if a and b are equal to within -// the absolute tolerance. -func EqualWithinAbsOrRel(a, b, absTol, relTol float64) bool { - if EqualWithinAbs(a, b, absTol) { - return true - } - return EqualWithinRel(a, b, relTol) -} - -// EqualWithinULP returns true if a and b are equal to within -// the specified number of floating point units in the last place. -func EqualWithinULP(a, b float64, ulp uint) bool { - if a == b { - return true - } - if math.IsNaN(a) || math.IsNaN(b) { - return false - } - if math.Signbit(a) != math.Signbit(b) { - return math.Float64bits(math.Abs(a))+math.Float64bits(math.Abs(b)) <= uint64(ulp) - } - return ulpDiff(math.Float64bits(a), math.Float64bits(b)) <= uint64(ulp) -} - -func ulpDiff(a, b uint64) uint64 { - if a > b { - return a - b - } - return b - a -} - -// EqualLengths returns true if all of the slices have equal length, -// and false otherwise. Returns true if there are no input slices. -func EqualLengths(slices ...[]float64) bool { - // This length check is needed: http://play.golang.org/p/sdty6YiLhM - if len(slices) == 0 { - return true - } - l := len(slices[0]) - for i := 1; i < len(slices); i++ { - if len(slices[i]) != l { - return false - } - } - return true -} - -// Find applies f to every element of s and returns the indices of the first -// k elements for which the f returns true, or all such elements -// if k < 0. -// Find will reslice inds to have 0 length, and will append -// found indices to inds. -// If k > 0 and there are fewer than k elements in s satisfying f, -// all of the found elements will be returned along with an error. -// At the return of the function, the input inds will be in an undetermined state. -func Find(inds []int, f func(float64) bool, s []float64, k int) ([]int, error) { - // inds is also returned to allow for calling with nil - - // Reslice inds to have zero length - inds = inds[:0] - - // If zero elements requested, can just return - if k == 0 { - return inds, nil - } - - // If k < 0, return all of the found indices - if k < 0 { - for i, val := range s { - if f(val) { - inds = append(inds, i) - } - } - return inds, nil - } - - // Otherwise, find the first k elements - nFound := 0 - for i, val := range s { - if f(val) { - inds = append(inds, i) - nFound++ - if nFound == k { - return inds, nil - } - } - } - // Finished iterating over the loop, which means k elements were not found - return inds, errors.New("floats: insufficient elements found") -} - -// HasNaN returns true if the slice s has any values that are NaN and false -// otherwise. -func HasNaN(s []float64) bool { - for _, v := range s { - if math.IsNaN(v) { - return true - } - } - return false -} - -// LogSpan returns a set of n equally spaced points in log space between, -// l and u where N is equal to len(dst). The first element of the -// resulting dst will be l and the final element of dst will be u. -// Panics if len(dst) < 2 -// Note that this call will return NaNs if either l or u are negative, and -// will return all zeros if l or u is zero. -// Also returns the mutated slice dst, so that it can be used in range, like: -// -// for i, x := range LogSpan(dst, l, u) { ... } -func LogSpan(dst []float64, l, u float64) []float64 { - Span(dst, math.Log(l), math.Log(u)) - for i := range dst { - dst[i] = math.Exp(dst[i]) - } - return dst -} - -// LogSumExp returns the log of the sum of the exponentials of the values in s. -// Panics if s is an empty slice. -func LogSumExp(s []float64) float64 { - // Want to do this in a numerically stable way which avoids - // overflow and underflow - // First, find the maximum value in the slice. - maxval := Max(s) - if math.IsInf(maxval, 0) { - // If it's infinity either way, the logsumexp will be infinity as well - // returning now avoids NaNs - return maxval - } - var lse float64 - // Compute the sumexp part - for _, val := range s { - lse += math.Exp(val - maxval) - } - // Take the log and add back on the constant taken out - return math.Log(lse) + maxval -} - -// Max returns the maximum value in the input slice. If the slice is empty, Max will panic. -func Max(s []float64) float64 { - return s[MaxIdx(s)] -} - -// MaxIdx returns the index of the maximum value in the input slice. If several -// entries have the maximum value, the first such index is returned. If the slice -// is empty, MaxIdx will panic. -func MaxIdx(s []float64) int { - if len(s) == 0 { - panic("floats: zero slice length") - } - max := math.NaN() - var ind int - for i, v := range s { - if math.IsNaN(v) { - continue - } - if v > max || math.IsNaN(max) { - max = v - ind = i - } - } - return ind -} - -// Min returns the maximum value in the input slice. If the slice is empty, Min will panic. -func Min(s []float64) float64 { - return s[MinIdx(s)] -} - -// MinIdx returns the index of the minimum value in the input slice. If several -// entries have the maximum value, the first such index is returned. If the slice -// is empty, MinIdx will panic. -func MinIdx(s []float64) int { - if len(s) == 0 { - panic("floats: zero slice length") - } - min := math.NaN() - var ind int - for i, v := range s { - if math.IsNaN(v) { - continue - } - if v < min || math.IsNaN(min) { - min = v - ind = i - } - } - return ind -} - -// Mul performs element-wise multiplication between dst -// and s and stores the value in dst. Panics if the -// lengths of s and t are not equal. -func Mul(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: slice lengths do not match") - } - for i, val := range s { - dst[i] *= val - } -} - -// MulTo performs element-wise multiplication between s -// and t and stores the value in dst. Panics if the -// lengths of s, t, and dst are not equal. -func MulTo(dst, s, t []float64) []float64 { - if len(s) != len(t) || len(dst) != len(t) { - panic("floats: slice lengths do not match") - } - for i, val := range t { - dst[i] = val * s[i] - } - return dst -} - -const ( - nanBits = 0x7ff8000000000000 - nanMask = 0xfff8000000000000 -) - -// NaNWith returns an IEEE 754 "quiet not-a-number" value with the -// payload specified in the low 51 bits of payload. -// The NaN returned by math.NaN has a bit pattern equal to NaNWith(1). -func NaNWith(payload uint64) float64 { - return math.Float64frombits(nanBits | (payload &^ nanMask)) -} - -// NaNPayload returns the lowest 51 bits payload of an IEEE 754 "quiet -// not-a-number". For values of f other than quiet-NaN, NaNPayload -// returns zero and false. -func NaNPayload(f float64) (payload uint64, ok bool) { - b := math.Float64bits(f) - if b&nanBits != nanBits { - return 0, false - } - return b &^ nanMask, true -} - -// NearestIdx returns the index of the element in s -// whose value is nearest to v. If several such -// elements exist, the lowest index is returned. -// NearestIdx panics if len(s) == 0. -func NearestIdx(s []float64, v float64) int { - if len(s) == 0 { - panic("floats: zero length slice") - } - switch { - case math.IsNaN(v): - return 0 - case math.IsInf(v, 1): - return MaxIdx(s) - case math.IsInf(v, -1): - return MinIdx(s) - } - var ind int - dist := math.NaN() - for i, val := range s { - newDist := math.Abs(v - val) - // A NaN distance will not be closer. - if math.IsNaN(newDist) { - continue - } - if newDist < dist || math.IsNaN(dist) { - dist = newDist - ind = i - } - } - return ind -} - -// NearestIdxForSpan return the index of a hypothetical vector created -// by Span with length n and bounds l and u whose value is closest -// to v. That is, NearestIdxForSpan(n, l, u, v) is equivalent to -// Nearest(Span(make([]float64, n),l,u),v) without an allocation. -// NearestIdxForSpan panics if n is less than two. -func NearestIdxForSpan(n int, l, u float64, v float64) int { - if n <= 1 { - panic("floats: span must have length >1") - } - if math.IsNaN(v) { - return 0 - } - - // Special cases for Inf and NaN. - switch { - case math.IsNaN(l) && !math.IsNaN(u): - return n - 1 - case math.IsNaN(u): - return 0 - case math.IsInf(l, 0) && math.IsInf(u, 0): - if l == u { - return 0 - } - if n%2 == 1 { - if !math.IsInf(v, 0) { - return n / 2 - } - if math.Copysign(1, v) == math.Copysign(1, l) { - return 0 - } - return n/2 + 1 - } - if math.Copysign(1, v) == math.Copysign(1, l) { - return 0 - } - return n / 2 - case math.IsInf(l, 0): - if v == l { - return 0 - } - return n - 1 - case math.IsInf(u, 0): - if v == u { - return n - 1 - } - return 0 - case math.IsInf(v, -1): - if l <= u { - return 0 - } - return n - 1 - case math.IsInf(v, 1): - if u <= l { - return 0 - } - return n - 1 - } - - // Special cases for v outside (l, u) and (u, l). - switch { - case l < u: - if v <= l { - return 0 - } - if v >= u { - return n - 1 - } - case l > u: - if v >= l { - return 0 - } - if v <= u { - return n - 1 - } - default: - return 0 - } - - // Can't guarantee anything about exactly halfway between - // because of floating point weirdness. - return int((float64(n)-1)/(u-l)*(v-l) + 0.5) -} - -// Norm returns the L norm of the slice S, defined as -// (sum_{i=1}^N s[i]^L)^{1/L} -// Special cases: -// L = math.Inf(1) gives the maximum absolute value. -// Does not correctly compute the zero norm (use Count). -func Norm(s []float64, L float64) float64 { - // Should this complain if L is not positive? - // Should this be done in log space for better numerical stability? - // would be more cost - // maybe only if L is high? - if len(s) == 0 { - return 0 - } - if L == 2 { - twoNorm := math.Abs(s[0]) - for i := 1; i < len(s); i++ { - twoNorm = math.Hypot(twoNorm, s[i]) - } - return twoNorm - } - var norm float64 - if L == 1 { - for _, val := range s { - norm += math.Abs(val) - } - return norm - } - if math.IsInf(L, 1) { - for _, val := range s { - norm = math.Max(norm, math.Abs(val)) - } - return norm - } - for _, val := range s { - norm += math.Pow(math.Abs(val), L) - } - return math.Pow(norm, 1/L) -} - -// ParseWithNA converts the string s to a float64 in v. -// If s equals missing, w is returned as 0, otherwise 1. -func ParseWithNA(s, missing string) (v, w float64, err error) { - if s == missing { - return 0, 0, nil - } - v, err = strconv.ParseFloat(s, 64) - if err == nil { - w = 1 - } - return v, w, err -} - -// Prod returns the product of the elements of the slice. -// Returns 1 if len(s) = 0. -func Prod(s []float64) float64 { - prod := 1.0 - for _, val := range s { - prod *= val - } - return prod -} - -// Reverse reverses the order of elements in the slice. -func Reverse(s []float64) { - for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 { - s[i], s[j] = s[j], s[i] - } -} - -// Round returns the half away from zero rounded value of x with prec precision. -// -// Special cases are: -// Round(±0) = +0 -// Round(±Inf) = ±Inf -// Round(NaN) = NaN -func Round(x float64, prec int) float64 { - if x == 0 { - // Make sure zero is returned - // without the negative bit set. - return 0 - } - // Fast path for positive precision on integers. - if prec >= 0 && x == math.Trunc(x) { - return x - } - pow := math.Pow10(prec) - intermed := x * pow - if math.IsInf(intermed, 0) { - return x - } - if x < 0 { - x = math.Ceil(intermed - 0.5) - } else { - x = math.Floor(intermed + 0.5) - } - - if x == 0 { - return 0 - } - - return x / pow -} - -// RoundEven returns the half even rounded value of x with prec precision. -// -// Special cases are: -// RoundEven(±0) = +0 -// RoundEven(±Inf) = ±Inf -// RoundEven(NaN) = NaN -func RoundEven(x float64, prec int) float64 { - if x == 0 { - // Make sure zero is returned - // without the negative bit set. - return 0 - } - // Fast path for positive precision on integers. - if prec >= 0 && x == math.Trunc(x) { - return x - } - pow := math.Pow10(prec) - intermed := x * pow - if math.IsInf(intermed, 0) { - return x - } - if isHalfway(intermed) { - correction, _ := math.Modf(math.Mod(intermed, 2)) - intermed += correction - if intermed > 0 { - x = math.Floor(intermed) - } else { - x = math.Ceil(intermed) - } - } else { - if x < 0 { - x = math.Ceil(intermed - 0.5) - } else { - x = math.Floor(intermed + 0.5) - } - } - - if x == 0 { - return 0 - } - - return x / pow -} - -func isHalfway(x float64) bool { - _, frac := math.Modf(x) - frac = math.Abs(frac) - return frac == 0.5 || (math.Nextafter(frac, math.Inf(-1)) < 0.5 && math.Nextafter(frac, math.Inf(1)) > 0.5) -} - -// Same returns true if the input slices have the same length and the all elements -// have the same value with NaN treated as the same. -func Same(s, t []float64) bool { - if len(s) != len(t) { - return false - } - for i, v := range s { - w := t[i] - if v != w && !(math.IsNaN(v) && math.IsNaN(w)) { - return false - } - } - return true -} - -// Scale multiplies every element in dst by the scalar c. -func Scale(c float64, dst []float64) { - if len(dst) > 0 { - f64.ScalUnitary(c, dst) - } -} - -// ScaleTo multiplies the elements in s by c and stores the result in dst. -func ScaleTo(dst []float64, c float64, s []float64) []float64 { - if len(dst) != len(s) { - panic("floats: lengths of slices do not match") - } - if len(dst) > 0 { - f64.ScalUnitaryTo(dst, c, s) - } - return dst -} - -// Span returns a set of N equally spaced points between l and u, where N -// is equal to the length of the destination. The first element of the destination -// is l, the final element of the destination is u. -// -// Panics if len(dst) < 2. -// -// Span also returns the mutated slice dst, so that it can be used in range expressions, -// like: -// -// for i, x := range Span(dst, l, u) { ... } -func Span(dst []float64, l, u float64) []float64 { - n := len(dst) - if n < 2 { - panic("floats: destination must have length >1") - } - - // Special cases for Inf and NaN. - switch { - case math.IsNaN(l): - for i := range dst[:len(dst)-1] { - dst[i] = math.NaN() - } - dst[len(dst)-1] = u - return dst - case math.IsNaN(u): - for i := range dst[1:] { - dst[i+1] = math.NaN() - } - dst[0] = l - return dst - case math.IsInf(l, 0) && math.IsInf(u, 0): - for i := range dst[:len(dst)/2] { - dst[i] = l - dst[len(dst)-i-1] = u - } - if len(dst)%2 == 1 { - if l != u { - dst[len(dst)/2] = 0 - } else { - dst[len(dst)/2] = l - } - } - return dst - case math.IsInf(l, 0): - for i := range dst[:len(dst)-1] { - dst[i] = l - } - dst[len(dst)-1] = u - return dst - case math.IsInf(u, 0): - for i := range dst[1:] { - dst[i+1] = u - } - dst[0] = l - return dst - } - - step := (u - l) / float64(n-1) - for i := range dst { - dst[i] = l + step*float64(i) - } - return dst -} - -// Sub subtracts, element-wise, the elements of s from dst. Panics if -// the lengths of dst and s do not match. -func Sub(dst, s []float64) { - if len(dst) != len(s) { - panic("floats: length of the slices do not match") - } - f64.AxpyUnitaryTo(dst, -1, s, dst) -} - -// SubTo subtracts, element-wise, the elements of t from s and -// stores the result in dst. Panics if the lengths of s, t and dst do not match. -func SubTo(dst, s, t []float64) []float64 { - if len(s) != len(t) { - panic("floats: length of subtractor and subtractee do not match") - } - if len(dst) != len(s) { - panic("floats: length of destination does not match length of subtractor") - } - f64.AxpyUnitaryTo(dst, -1, t, s) - return dst -} - -// Sum returns the sum of the elements of the slice. -func Sum(s []float64) float64 { - return f64.Sum(s) -} - -// Within returns the first index i where s[i] <= v < s[i+1]. Within panics if: -// - len(s) < 2 -// - s is not sorted -func Within(s []float64, v float64) int { - if len(s) < 2 { - panic("floats: slice length less than 2") - } - if !sort.Float64sAreSorted(s) { - panic("floats: input slice not sorted") - } - if v < s[0] || v >= s[len(s)-1] || math.IsNaN(v) { - return -1 - } - for i, f := range s[1:] { - if v < f { - return i - } - } - return -1 -} diff --git a/vendor/gonum.org/v1/gonum/graph/.gitignore b/vendor/gonum.org/v1/gonum/graph/.gitignore deleted file mode 100644 index 86e0d2404..000000000 --- a/vendor/gonum.org/v1/gonum/graph/.gitignore +++ /dev/null @@ -1 +0,0 @@ -test.out \ No newline at end of file diff --git a/vendor/gonum.org/v1/gonum/graph/README.md b/vendor/gonum.org/v1/gonum/graph/README.md deleted file mode 100644 index f0a9505ed..000000000 --- a/vendor/gonum.org/v1/gonum/graph/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Gonum graph [![GoDoc](https://godoc.org/gonum.org/v1/gonum/graph?status.svg)](https://godoc.org/gonum.org/v1/gonum/graph) - -This is a generalized graph package for the Go language. diff --git a/vendor/gonum.org/v1/gonum/graph/doc.go b/vendor/gonum.org/v1/gonum/graph/doc.go deleted file mode 100644 index 7eedd09ce..000000000 --- a/vendor/gonum.org/v1/gonum/graph/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package graph defines graph interfaces. -// -// Routines to test contract compliance by user implemented graph types -// are available in gonum.org/v1/gonum/graph/testgraph. -package graph // import "gonum.org/v1/gonum/graph" diff --git a/vendor/gonum.org/v1/gonum/graph/graph.go b/vendor/gonum.org/v1/gonum/graph/graph.go deleted file mode 100644 index c973583d8..000000000 --- a/vendor/gonum.org/v1/gonum/graph/graph.go +++ /dev/null @@ -1,282 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package graph - -// Node is a graph node. It returns a graph-unique integer ID. -type Node interface { - ID() int64 -} - -// Edge is a graph edge. In directed graphs, the direction of the -// edge is given from -> to, otherwise the edge is semantically -// unordered. -type Edge interface { - // From returns the from node of the edge. - From() Node - - // To returns the to node of the edge. - To() Node - - // ReversedEdge returns an edge that has - // the end points of the receiver swapped. - ReversedEdge() Edge -} - -// WeightedEdge is a weighted graph edge. In directed graphs, the direction -// of the edge is given from -> to, otherwise the edge is semantically -// unordered. -type WeightedEdge interface { - Edge - Weight() float64 -} - -// Graph is a generalized graph. -type Graph interface { - // Node returns the node with the given ID if it exists - // in the graph, and nil otherwise. - Node(id int64) Node - - // Nodes returns all the nodes in the graph. - // - // Nodes must not return nil. - Nodes() Nodes - - // From returns all nodes that can be reached directly - // from the node with the given ID. - // - // From must not return nil. - From(id int64) Nodes - - // HasEdgeBetween returns whether an edge exists between - // nodes with IDs xid and yid without considering direction. - HasEdgeBetween(xid, yid int64) bool - - // Edge returns the edge from u to v, with IDs uid and vid, - // if such an edge exists and nil otherwise. The node v - // must be directly reachable from u as defined by the - // From method. - Edge(uid, vid int64) Edge -} - -// Weighted is a weighted graph. -type Weighted interface { - Graph - - // WeightedEdge returns the weighted edge from u to v - // with IDs uid and vid if such an edge exists and - // nil otherwise. The node v must be directly - // reachable from u as defined by the From method. - WeightedEdge(uid, vid int64) WeightedEdge - - // Weight returns the weight for the edge between - // x and y with IDs xid and yid if Edge(xid, yid) - // returns a non-nil Edge. - // If x and y are the same node or there is no - // joining edge between the two nodes the weight - // value returned is implementation dependent. - // Weight returns true if an edge exists between - // x and y or if x and y have the same ID, false - // otherwise. - Weight(xid, yid int64) (w float64, ok bool) -} - -// Undirected is an undirected graph. -type Undirected interface { - Graph - - // EdgeBetween returns the edge between nodes x and y - // with IDs xid and yid. - EdgeBetween(xid, yid int64) Edge -} - -// WeightedUndirected is a weighted undirected graph. -type WeightedUndirected interface { - Weighted - - // WeightedEdgeBetween returns the edge between nodes - // x and y with IDs xid and yid. - WeightedEdgeBetween(xid, yid int64) WeightedEdge -} - -// Directed is a directed graph. -type Directed interface { - Graph - - // HasEdgeFromTo returns whether an edge exists - // in the graph from u to v with IDs uid and vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// WeightedDirected is a weighted directed graph. -type WeightedDirected interface { - Weighted - - // HasEdgeFromTo returns whether an edge exists - // in the graph from u to v with the IDs uid and - // vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// NodeAdder is an interface for adding arbitrary nodes to a graph. -type NodeAdder interface { - // NewNode returns a new Node with a unique - // arbitrary ID. - NewNode() Node - - // AddNode adds a node to the graph. AddNode panics if - // the added node ID matches an existing node ID. - AddNode(Node) -} - -// NodeRemover is an interface for removing nodes from a graph. -type NodeRemover interface { - // RemoveNode removes the node with the given ID - // from the graph, as well as any edges attached - // to it. If the node is not in the graph it is - // a no-op. - RemoveNode(id int64) -} - -// EdgeAdder is an interface for adding edges to a graph. -type EdgeAdder interface { - // NewEdge returns a new Edge from the source to the destination node. - NewEdge(from, to Node) Edge - - // SetEdge adds an edge from one node to another. - // If the graph supports node addition the nodes - // will be added if they do not exist, otherwise - // SetEdge will panic. - // The behavior of an EdgeAdder when the IDs - // returned by e.From() and e.To() are equal is - // implementation-dependent. - // Whether e, e.From() and e.To() are stored - // within the graph is implementation dependent. - SetEdge(e Edge) -} - -// WeightedEdgeAdder is an interface for adding edges to a graph. -type WeightedEdgeAdder interface { - // NewWeightedEdge returns a new WeightedEdge from - // the source to the destination node. - NewWeightedEdge(from, to Node, weight float64) WeightedEdge - - // SetWeightedEdge adds an edge from one node to - // another. If the graph supports node addition - // the nodes will be added if they do not exist, - // otherwise SetWeightedEdge will panic. - // The behavior of a WeightedEdgeAdder when the IDs - // returned by e.From() and e.To() are equal is - // implementation-dependent. - // Whether e, e.From() and e.To() are stored - // within the graph is implementation dependent. - SetWeightedEdge(e WeightedEdge) -} - -// EdgeRemover is an interface for removing nodes from a graph. -type EdgeRemover interface { - // RemoveEdge removes the edge with the given end - // IDs, leaving the terminal nodes. If the edge - // does not exist it is a no-op. - RemoveEdge(fid, tid int64) -} - -// Builder is a graph that can have nodes and edges added. -type Builder interface { - NodeAdder - EdgeAdder -} - -// WeightedBuilder is a graph that can have nodes and weighted edges added. -type WeightedBuilder interface { - NodeAdder - WeightedEdgeAdder -} - -// UndirectedBuilder is an undirected graph builder. -type UndirectedBuilder interface { - Undirected - Builder -} - -// UndirectedWeightedBuilder is an undirected weighted graph builder. -type UndirectedWeightedBuilder interface { - Undirected - WeightedBuilder -} - -// DirectedBuilder is a directed graph builder. -type DirectedBuilder interface { - Directed - Builder -} - -// DirectedWeightedBuilder is a directed weighted graph builder. -type DirectedWeightedBuilder interface { - Directed - WeightedBuilder -} - -// Copy copies nodes and edges as undirected edges from the source to the destination -// without first clearing the destination. Copy will panic if a node ID in the source -// graph matches a node ID in the destination. -// -// If the source is undirected and the destination is directed both directions will -// be present in the destination after the copy is complete. -func Copy(dst Builder, src Graph) { - nodes := src.Nodes() - for nodes.Next() { - dst.AddNode(nodes.Node()) - } - nodes.Reset() - for nodes.Next() { - u := nodes.Node() - uid := u.ID() - to := src.From(uid) - for to.Next() { - v := to.Node() - dst.SetEdge(src.Edge(uid, v.ID())) - } - } -} - -// CopyWeighted copies nodes and edges as undirected edges from the source to the destination -// without first clearing the destination. Copy will panic if a node ID in the source -// graph matches a node ID in the destination. -// -// If the source is undirected and the destination is directed both directions will -// be present in the destination after the copy is complete. -// -// If the source is a directed graph, the destination is undirected, and a fundamental -// cycle exists with two nodes where the edge weights differ, the resulting destination -// graph's edge weight between those nodes is undefined. If there is a defined function -// to resolve such conflicts, an UndirectWeighted may be used to do this. -func CopyWeighted(dst WeightedBuilder, src Weighted) { - nodes := src.Nodes() - for nodes.Next() { - dst.AddNode(nodes.Node()) - } - nodes.Reset() - for nodes.Next() { - u := nodes.Node() - uid := u.ID() - to := src.From(uid) - for to.Next() { - v := to.Node() - dst.SetWeightedEdge(src.WeightedEdge(uid, v.ID())) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go b/vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go deleted file mode 100644 index 88d1cb80a..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/linear/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package linear provides common linear data structures. -package linear // import "gonum.org/v1/gonum/graph/internal/linear" diff --git a/vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go b/vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go deleted file mode 100644 index 62e19db6a..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/linear/linear.go +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package linear - -import ( - "gonum.org/v1/gonum/graph" -) - -// NodeStack implements a LIFO stack of graph.Node. -type NodeStack []graph.Node - -// Len returns the number of graph.Nodes on the stack. -func (s *NodeStack) Len() int { return len(*s) } - -// Pop returns the last graph.Node on the stack and removes it -// from the stack. -func (s *NodeStack) Pop() graph.Node { - v := *s - v, n := v[:len(v)-1], v[len(v)-1] - *s = v - return n -} - -// Push adds the node n to the stack at the last position. -func (s *NodeStack) Push(n graph.Node) { *s = append(*s, n) } - -// NodeQueue implements a FIFO queue. -type NodeQueue struct { - head int - data []graph.Node -} - -// Len returns the number of graph.Nodes in the queue. -func (q *NodeQueue) Len() int { return len(q.data) - q.head } - -// Enqueue adds the node n to the back of the queue. -func (q *NodeQueue) Enqueue(n graph.Node) { - if len(q.data) == cap(q.data) && q.head > 0 { - l := q.Len() - copy(q.data, q.data[q.head:]) - q.head = 0 - q.data = append(q.data[:l], n) - } else { - q.data = append(q.data, n) - } -} - -// Dequeue returns the graph.Node at the front of the queue and -// removes it from the queue. -func (q *NodeQueue) Dequeue() graph.Node { - if q.Len() == 0 { - panic("queue: empty queue") - } - - var n graph.Node - n, q.data[q.head] = q.data[q.head], nil - q.head++ - - if q.Len() == 0 { - q.head = 0 - q.data = q.data[:0] - } - - return n -} - -// Reset clears the queue for reuse. -func (q *NodeQueue) Reset() { - q.head = 0 - q.data = q.data[:0] -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go b/vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go deleted file mode 100644 index 563df6f2e..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/ordered/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ordered provides common sort ordering types. -package ordered // import "gonum.org/v1/gonum/graph/internal/ordered" diff --git a/vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go b/vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go deleted file mode 100644 index a7250d1f3..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/ordered/sort.go +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ordered - -import "gonum.org/v1/gonum/graph" - -// ByID implements the sort.Interface sorting a slice of graph.Node -// by ID. -type ByID []graph.Node - -func (n ByID) Len() int { return len(n) } -func (n ByID) Less(i, j int) bool { return n[i].ID() < n[j].ID() } -func (n ByID) Swap(i, j int) { n[i], n[j] = n[j], n[i] } - -// BySliceValues implements the sort.Interface sorting a slice of -// []int64 lexically by the values of the []int64. -type BySliceValues [][]int64 - -func (c BySliceValues) Len() int { return len(c) } -func (c BySliceValues) Less(i, j int) bool { - a, b := c[i], c[j] - l := len(a) - if len(b) < l { - l = len(b) - } - for k, v := range a[:l] { - if v < b[k] { - return true - } - if v > b[k] { - return false - } - } - return len(a) < len(b) -} -func (c BySliceValues) Swap(i, j int) { c[i], c[j] = c[j], c[i] } - -// BySliceIDs implements the sort.Interface sorting a slice of -// []graph.Node lexically by the IDs of the []graph.Node. -type BySliceIDs [][]graph.Node - -func (c BySliceIDs) Len() int { return len(c) } -func (c BySliceIDs) Less(i, j int) bool { - a, b := c[i], c[j] - l := len(a) - if len(b) < l { - l = len(b) - } - for k, v := range a[:l] { - if v.ID() < b[k].ID() { - return true - } - if v.ID() > b[k].ID() { - return false - } - } - return len(a) < len(b) -} -func (c BySliceIDs) Swap(i, j int) { c[i], c[j] = c[j], c[i] } - -// Int64s implements the sort.Interface sorting a slice of -// int64. -type Int64s []int64 - -func (s Int64s) Len() int { return len(s) } -func (s Int64s) Less(i, j int) bool { return s[i] < s[j] } -func (s Int64s) Swap(i, j int) { s[i], s[j] = s[j], s[i] } - -// Reverse reverses the order of nodes. -func Reverse(nodes []graph.Node) { - for i, j := 0, len(nodes)-1; i < j; i, j = i+1, j-1 { - nodes[i], nodes[j] = nodes[j], nodes[i] - } -} - -// LinesByIDs implements the sort.Interface sorting a slice of graph.LinesByIDs -// lexically by the From IDs, then by the To IDs, finally by the Line IDs. -type LinesByIDs []graph.Line - -func (n LinesByIDs) Len() int { return len(n) } -func (n LinesByIDs) Less(i, j int) bool { - a, b := n[i], n[j] - if a.From().ID() != b.From().ID() { - return a.From().ID() < b.From().ID() - } - if a.To().ID() != b.To().ID() { - return a.To().ID() < b.To().ID() - } - return n[i].ID() < n[j].ID() -} -func (n LinesByIDs) Swap(i, j int) { n[i], n[j] = n[j], n[i] } diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/doc.go b/vendor/gonum.org/v1/gonum/graph/internal/set/doc.go deleted file mode 100644 index 86f2afc4e..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package set provides integer and graph.Node sets. -package set // import "gonum.org/v1/gonum/graph/internal/set" diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/same.go b/vendor/gonum.org/v1/gonum/graph/internal/set/same.go deleted file mode 100644 index f95a4e128..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/same.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !appengine,!safe - -package set - -import "unsafe" - -// same determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use unsafe to get -// the maps' pointer values to compare. -func same(a, b Nodes) bool { - return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b)) -} - -// intsSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use unsafe to get -// the maps' pointer values to compare. -func intsSame(a, b Ints) bool { - return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b)) -} - -// int64sSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use unsafe to get -// the maps' pointer values to compare. -func int64sSame(a, b Int64s) bool { - return *(*uintptr)(unsafe.Pointer(&a)) == *(*uintptr)(unsafe.Pointer(&b)) -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go b/vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go deleted file mode 100644 index 4ff4f4ed2..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/same_appengine.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine safe - -package set - -import "reflect" - -// same determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use reflect to get -// the maps' pointer values to compare. -func same(a, b Nodes) bool { - return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() -} - -// intsSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use reflect to get -// the maps' pointer values to compare. -func intsSame(a, b Ints) bool { - return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() -} - -// int64sSame determines whether two sets are backed by the same store. In the -// current implementation using hash maps it makes use of the fact that -// hash maps are passed as a pointer to a runtime Hmap struct. A map is -// not seen by the runtime as a pointer though, so we use reflect to get -// the maps' pointer values to compare. -func int64sSame(a, b Int64s) bool { - return reflect.ValueOf(a).Pointer() == reflect.ValueOf(b).Pointer() -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/set/set.go b/vendor/gonum.org/v1/gonum/graph/internal/set/set.go deleted file mode 100644 index 0506b8e97..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/set/set.go +++ /dev/null @@ -1,228 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package set - -import "gonum.org/v1/gonum/graph" - -// Ints is a set of int identifiers. -type Ints map[int]struct{} - -// The simple accessor methods for Ints are provided to allow ease of -// implementation change should the need arise. - -// Add inserts an element into the set. -func (s Ints) Add(e int) { - s[e] = struct{}{} -} - -// Has reports the existence of the element in the set. -func (s Ints) Has(e int) bool { - _, ok := s[e] - return ok -} - -// Remove deletes the specified element from the set. -func (s Ints) Remove(e int) { - delete(s, e) -} - -// Count reports the number of elements stored in the set. -func (s Ints) Count() int { - return len(s) -} - -// IntsEqual reports set equality between the parameters. Sets are equal if -// and only if they have the same elements. -func IntsEqual(a, b Ints) bool { - if intsSame(a, b) { - return true - } - - if len(a) != len(b) { - return false - } - - for e := range a { - if _, ok := b[e]; !ok { - return false - } - } - - return true -} - -// Int64s is a set of int64 identifiers. -type Int64s map[int64]struct{} - -// The simple accessor methods for Ints are provided to allow ease of -// implementation change should the need arise. - -// Add inserts an element into the set. -func (s Int64s) Add(e int64) { - s[e] = struct{}{} -} - -// Has reports the existence of the element in the set. -func (s Int64s) Has(e int64) bool { - _, ok := s[e] - return ok -} - -// Remove deletes the specified element from the set. -func (s Int64s) Remove(e int64) { - delete(s, e) -} - -// Count reports the number of elements stored in the set. -func (s Int64s) Count() int { - return len(s) -} - -// Int64sEqual reports set equality between the parameters. Sets are equal if -// and only if they have the same elements. -func Int64sEqual(a, b Int64s) bool { - if int64sSame(a, b) { - return true - } - - if len(a) != len(b) { - return false - } - - for e := range a { - if _, ok := b[e]; !ok { - return false - } - } - - return true -} - -// Nodes is a set of nodes keyed in their integer identifiers. -type Nodes map[int64]graph.Node - -// NewNodes returns a new Nodes. -func NewNodes() Nodes { - return make(Nodes) -} - -// NewNodes returns a new Nodes with the given size hint, n. -func NewNodesSize(n int) Nodes { - return make(Nodes, n) -} - -// The simple accessor methods for Nodes are provided to allow ease of -// implementation change should the need arise. - -// Add inserts an element into the set. -func (s Nodes) Add(n graph.Node) { - s[n.ID()] = n -} - -// Remove deletes the specified element from the set. -func (s Nodes) Remove(e graph.Node) { - delete(s, e.ID()) -} - -// Count returns the number of element in the set. -func (s Nodes) Count() int { - return len(s) -} - -// Has reports the existence of the elements in the set. -func (s Nodes) Has(n graph.Node) bool { - _, ok := s[n.ID()] - return ok -} - -// CloneNodes returns a clone of src. -func CloneNodes(src Nodes) Nodes { - dst := make(Nodes, len(src)) - for e, n := range src { - dst[e] = n - } - return dst -} - -// Equal reports set equality between the parameters. Sets are equal if -// and only if they have the same elements. -func Equal(a, b Nodes) bool { - if same(a, b) { - return true - } - - if len(a) != len(b) { - return false - } - - for e := range a { - if _, ok := b[e]; !ok { - return false - } - } - - return true -} - -// UnionOfNodes returns the union of a and b. -// -// The union of two sets, a and b, is the set containing all the -// elements of each, for instance: -// -// {a,b,c} UNION {d,e,f} = {a,b,c,d,e,f} -// -// Since sets may not have repetition, unions of two sets that overlap -// do not contain repeat elements, that is: -// -// {a,b,c} UNION {b,c,d} = {a,b,c,d} -// -func UnionOfNodes(a, b Nodes) Nodes { - if same(a, b) { - return CloneNodes(a) - } - - dst := make(Nodes) - for e, n := range a { - dst[e] = n - } - for e, n := range b { - dst[e] = n - } - - return dst -} - -// IntersectionOfNodes returns the intersection of a and b. -// -// The intersection of two sets, a and b, is the set containing all -// the elements shared between the two sets, for instance: -// -// {a,b,c} INTERSECT {b,c,d} = {b,c} -// -// The intersection between a set and itself is itself, and thus -// effectively a copy operation: -// -// {a,b,c} INTERSECT {a,b,c} = {a,b,c} -// -// The intersection between two sets that share no elements is the empty -// set: -// -// {a,b,c} INTERSECT {d,e,f} = {} -// -func IntersectionOfNodes(a, b Nodes) Nodes { - if same(a, b) { - return CloneNodes(a) - } - dst := make(Nodes) - if len(a) > len(b) { - a, b = b, a - } - for e, n := range a { - if _, ok := b[e]; ok { - dst[e] = n - } - } - return dst -} diff --git a/vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go b/vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go deleted file mode 100644 index 5f503c13d..000000000 --- a/vendor/gonum.org/v1/gonum/graph/internal/uid/uid.go +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package uid implements unique ID provision for graphs. -package uid - -import "gonum.org/v1/gonum/graph/internal/set" - -// Max is the maximum value of int64. -const Max = int64(^uint64(0) >> 1) - -// Set implements available ID storage. -type Set struct { - maxID int64 - used, free set.Int64s -} - -// NewSet returns a new Set. The returned value should not be passed except by pointer. -func NewSet() Set { - return Set{maxID: -1, used: make(set.Int64s), free: make(set.Int64s)} -} - -// NewID returns a new unique ID. The ID returned is not considered used -// until passed in a call to use. -func (s *Set) NewID() int64 { - for id := range s.free { - return id - } - if s.maxID != Max { - return s.maxID + 1 - } - for id := int64(0); id <= s.maxID+1; id++ { - if !s.used.Has(id) { - return id - } - } - panic("unreachable") -} - -// Use adds the id to the used IDs in the Set. -func (s *Set) Use(id int64) { - s.used.Add(id) - s.free.Remove(id) - if id > s.maxID { - s.maxID = id - } -} - -// Release frees the id for reuse. -func (s *Set) Release(id int64) { - s.free.Add(id) - s.used.Remove(id) -} diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/doc.go b/vendor/gonum.org/v1/gonum/graph/iterator/doc.go deleted file mode 100644 index 0983bc7c3..000000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package iterator provides node, edge and line iterators. -// -// The iterators provided satisfy the graph.Nodes, graph.Edges and -// graph.Lines interfaces. -package iterator diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/edges.go b/vendor/gonum.org/v1/gonum/graph/iterator/edges.go deleted file mode 100644 index 21ef0433e..000000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/edges.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package iterator - -import "gonum.org/v1/gonum/graph" - -// OrderedEdges implements the graph.Edges and graph.EdgeSlicer interfaces. -// The iteration order of OrderedEdges is the order of edges passed to -// NewEdgeIterator. -type OrderedEdges struct { - idx int - edges []graph.Edge -} - -// NewOrderedEdges returns an OrderedEdges initialized with the provided edges. -func NewOrderedEdges(edges []graph.Edge) *OrderedEdges { - return &OrderedEdges{idx: -1, edges: edges} -} - -// Len returns the remaining number of edges to be iterated over. -func (e *OrderedEdges) Len() int { - if e.idx >= len(e.edges) { - return 0 - } - if e.idx <= 0 { - return len(e.edges) - } - return len(e.edges[e.idx:]) -} - -// Next returns whether the next call of Edge will return a valid edge. -func (e *OrderedEdges) Next() bool { - if uint(e.idx)+1 < uint(len(e.edges)) { - e.idx++ - return true - } - e.idx = len(e.edges) - return false -} - -// Edge returns the current edge of the iterator. Next must have been -// called prior to a call to Edge. -func (e *OrderedEdges) Edge() graph.Edge { - if e.idx >= len(e.edges) || e.idx < 0 { - return nil - } - return e.edges[e.idx] -} - -// EdgeSlice returns all the remaining edges in the iterator and advances -// the iterator. -func (e *OrderedEdges) EdgeSlice() []graph.Edge { - if e.idx >= len(e.edges) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.edges) - return e.edges[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedEdges) Reset() { - e.idx = -1 -} - -// OrderedWeightedEdges implements the graph.Edges and graph.EdgeSlicer interfaces. -// The iteration order of OrderedWeightedEdges is the order of edges passed to -// NewEdgeIterator. -type OrderedWeightedEdges struct { - idx int - edges []graph.WeightedEdge -} - -// NewOrderedWeightedEdges returns an OrderedWeightedEdges initialized with the provided edges. -func NewOrderedWeightedEdges(edges []graph.WeightedEdge) *OrderedWeightedEdges { - return &OrderedWeightedEdges{idx: -1, edges: edges} -} - -// Len returns the remaining number of edges to be iterated over. -func (e *OrderedWeightedEdges) Len() int { - if e.idx >= len(e.edges) { - return 0 - } - if e.idx <= 0 { - return len(e.edges) - } - return len(e.edges[e.idx:]) -} - -// Next returns whether the next call of WeightedEdge will return a valid edge. -func (e *OrderedWeightedEdges) Next() bool { - if uint(e.idx)+1 < uint(len(e.edges)) { - e.idx++ - return true - } - e.idx = len(e.edges) - return false -} - -// WeightedEdge returns the current edge of the iterator. Next must have been -// called prior to a call to WeightedEdge. -func (e *OrderedWeightedEdges) WeightedEdge() graph.WeightedEdge { - if e.idx >= len(e.edges) || e.idx < 0 { - return nil - } - return e.edges[e.idx] -} - -// WeightedEdgeSlice returns all the remaining edges in the iterator and advances -// the iterator. -func (e *OrderedWeightedEdges) WeightedEdgeSlice() []graph.WeightedEdge { - if e.idx >= len(e.edges) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.edges) - return e.edges[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedWeightedEdges) Reset() { - e.idx = -1 -} diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/lines.go b/vendor/gonum.org/v1/gonum/graph/iterator/lines.go deleted file mode 100644 index ed655df01..000000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/lines.go +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package iterator - -import "gonum.org/v1/gonum/graph" - -// OrderedLines implements the graph.Lines and graph.LineSlicer interfaces. -// The iteration order of OrderedLines is the order of lines passed to -// NewLineIterator. -type OrderedLines struct { - idx int - lines []graph.Line -} - -// NewOrderedLines returns an OrderedLines initialized with the provided lines. -func NewOrderedLines(lines []graph.Line) *OrderedLines { - return &OrderedLines{idx: -1, lines: lines} -} - -// Len returns the remaining number of lines to be iterated over. -func (e *OrderedLines) Len() int { - if e.idx >= len(e.lines) { - return 0 - } - if e.idx <= 0 { - return len(e.lines) - } - return len(e.lines[e.idx:]) -} - -// Next returns whether the next call of Line will return a valid line. -func (e *OrderedLines) Next() bool { - if uint(e.idx)+1 < uint(len(e.lines)) { - e.idx++ - return true - } - e.idx = len(e.lines) - return false -} - -// Line returns the current line of the iterator. Next must have been -// called prior to a call to Line. -func (e *OrderedLines) Line() graph.Line { - if e.idx >= len(e.lines) || e.idx < 0 { - return nil - } - return e.lines[e.idx] -} - -// LineSlice returns all the remaining lines in the iterator and advances -// the iterator. -func (e *OrderedLines) LineSlice() []graph.Line { - if e.idx >= len(e.lines) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.lines) - return e.lines[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedLines) Reset() { - e.idx = -1 -} - -// OrderedWeightedLines implements the graph.Lines and graph.LineSlicer interfaces. -// The iteration order of OrderedWeightedLines is the order of lines passed to -// NewLineIterator. -type OrderedWeightedLines struct { - idx int - lines []graph.WeightedLine -} - -// NewWeightedLineIterator returns an OrderedWeightedLines initialized with the provided lines. -func NewOrderedWeightedLines(lines []graph.WeightedLine) *OrderedWeightedLines { - return &OrderedWeightedLines{idx: -1, lines: lines} -} - -// Len returns the remaining number of lines to be iterated over. -func (e *OrderedWeightedLines) Len() int { - if e.idx >= len(e.lines) { - return 0 - } - if e.idx <= 0 { - return len(e.lines) - } - return len(e.lines[e.idx:]) -} - -// Next returns whether the next call of WeightedLine will return a valid line. -func (e *OrderedWeightedLines) Next() bool { - if uint(e.idx)+1 < uint(len(e.lines)) { - e.idx++ - return true - } - e.idx = len(e.lines) - return false -} - -// WeightedLine returns the current line of the iterator. Next must have been -// called prior to a call to WeightedLine. -func (e *OrderedWeightedLines) WeightedLine() graph.WeightedLine { - if e.idx >= len(e.lines) || e.idx < 0 { - return nil - } - return e.lines[e.idx] -} - -// WeightedLineSlice returns all the remaining lines in the iterator and advances -// the iterator. -func (e *OrderedWeightedLines) WeightedLineSlice() []graph.WeightedLine { - if e.idx >= len(e.lines) { - return nil - } - idx := e.idx - if idx == -1 { - idx = 0 - } - e.idx = len(e.lines) - return e.lines[idx:] -} - -// Reset returns the iterator to its initial state. -func (e *OrderedWeightedLines) Reset() { - e.idx = -1 -} diff --git a/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go b/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go deleted file mode 100644 index 952dd770f..000000000 --- a/vendor/gonum.org/v1/gonum/graph/iterator/nodes.go +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package iterator - -import "gonum.org/v1/gonum/graph" - -// OrderedNodes implements the graph.Nodes and graph.NodeSlicer interfaces. -// The iteration order of OrderedNodes is the order of nodes passed to -// NewNodeIterator. -type OrderedNodes struct { - idx int - nodes []graph.Node -} - -// NewOrderedNodes returns a OrderedNodes initialized with the provided nodes. -func NewOrderedNodes(nodes []graph.Node) *OrderedNodes { - return &OrderedNodes{idx: -1, nodes: nodes} -} - -// Len returns the remaining number of nodes to be iterated over. -func (n *OrderedNodes) Len() int { - if n.idx >= len(n.nodes) { - return 0 - } - if n.idx <= 0 { - return len(n.nodes) - } - return len(n.nodes[n.idx:]) -} - -// Next returns whether the next call of Node will return a valid node. -func (n *OrderedNodes) Next() bool { - if uint(n.idx)+1 < uint(len(n.nodes)) { - n.idx++ - return true - } - n.idx = len(n.nodes) - return false -} - -// Node returns the current node of the iterator. Next must have been -// called prior to a call to Node. -func (n *OrderedNodes) Node() graph.Node { - if n.idx >= len(n.nodes) || n.idx < 0 { - return nil - } - return n.nodes[n.idx] -} - -// NodeSlice returns all the remaining nodes in the iterator and advances -// the iterator. -func (n *OrderedNodes) NodeSlice() []graph.Node { - if n.idx >= len(n.nodes) { - return nil - } - idx := n.idx - if idx == -1 { - idx = 0 - } - n.idx = len(n.nodes) - return n.nodes[idx:] -} - -// Reset returns the iterator to its initial state. -func (n *OrderedNodes) Reset() { - n.idx = -1 -} - -// ImplicitNodes implements the graph.Nodes interface for a set of nodes over -// a contiguous ID range. -type ImplicitNodes struct { - beg, end int - curr int - newNode func(id int) graph.Node -} - -// NewImplicitNodes returns a new implicit node iterator spanning nodes in [beg,end). -// The provided new func maps the id to a graph.Node. NewImplicitNodes will panic -// if beg is greater than end. -func NewImplicitNodes(beg, end int, new func(id int) graph.Node) *ImplicitNodes { - if beg > end { - panic("iterator: invalid range") - } - return &ImplicitNodes{beg: beg, end: end, curr: beg - 1, newNode: new} -} - -// Len returns the remaining number of nodes to be iterated over. -func (n *ImplicitNodes) Len() int { - return n.end - n.curr - 1 -} - -// Next returns whether the next call of Node will return a valid node. -func (n *ImplicitNodes) Next() bool { - if n.curr == n.end { - return false - } - n.curr++ - return n.curr < n.end -} - -// Node returns the current node of the iterator. Next must have been -// called prior to a call to Node. -func (n *ImplicitNodes) Node() graph.Node { - if n.Len() == -1 || n.curr < n.beg { - return nil - } - return n.newNode(n.curr) -} - -// Reset returns the iterator to its initial state. -func (n *ImplicitNodes) Reset() { - n.curr = n.beg - 1 -} - -// NodeSlice returns all the remaining nodes in the iterator and advances -// the iterator. -func (n *ImplicitNodes) NodeSlice() []graph.Node { - nodes := make([]graph.Node, 0, n.Len()) - for n.curr++; n.curr < n.end; n.curr++ { - nodes = append(nodes, n.newNode(n.curr)) - } - return nodes -} diff --git a/vendor/gonum.org/v1/gonum/graph/multigraph.go b/vendor/gonum.org/v1/gonum/graph/multigraph.go deleted file mode 100644 index 038a3d515..000000000 --- a/vendor/gonum.org/v1/gonum/graph/multigraph.go +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package graph - -// Line is an edge in a multigraph. A Line returns an ID that must -// distinguish Lines sharing Node end points. -type Line interface { - // From returns the from node of the edge. - From() Node - - // To returns the to node of the edge. - To() Node - - // ReversedLine returns a line that has the - // end points of the receiver swapped. - ReversedLine() Line - - // ID returns the unique ID for the Line. - ID() int64 -} - -// WeightedLine is a weighted multigraph edge. -type WeightedLine interface { - Line - Weight() float64 -} - -// Multigraph is a generalized multigraph. -type Multigraph interface { - // Node returns the node with the given ID if it exists - // in the multigraph, and nil otherwise. - Node(id int64) Node - - // Nodes returns all the nodes in the multigraph. - // - // Nodes must not return nil. - Nodes() Nodes - - // From returns all nodes that can be reached directly - // from the node with the given ID. - // - // From must not return nil. - From(id int64) Nodes - - // HasEdgeBetween returns whether an edge exists between - // nodes with IDs xid and yid without considering direction. - HasEdgeBetween(xid, yid int64) bool - - // Lines returns the lines from u to v, with IDs uid and - // vid, if any such lines exist and nil otherwise. The - // node v must be directly reachable from u as defined by - // the From method. - // - // Lines must not return nil. - Lines(uid, vid int64) Lines -} - -// WeightedMultigraph is a weighted multigraph. -type WeightedMultigraph interface { - Multigraph - - // WeightedLines returns the weighted lines from u to v - // with IDs uid and vid if any such lines exist and nil - // otherwise. The node v must be directly reachable - // from u as defined by the From method. - // - // WeightedLines must not return nil. - WeightedLines(uid, vid int64) WeightedLines -} - -// UndirectedMultigraph is an undirected multigraph. -type UndirectedMultigraph interface { - Multigraph - - // LinesBetween returns the lines between nodes x and y - // with IDs xid and yid. - // - // LinesBetween must not return nil. - LinesBetween(xid, yid int64) Lines -} - -// WeightedUndirectedMultigraph is a weighted undirected multigraph. -type WeightedUndirectedMultigraph interface { - WeightedMultigraph - - // WeightedLinesBetween returns the lines between nodes - // x and y with IDs xid and yid. - // - // WeightedLinesBetween must not return nil. - WeightedLinesBetween(xid, yid int64) WeightedLines -} - -// DirectedMultigraph is a directed multigraph. -type DirectedMultigraph interface { - Multigraph - - // HasEdgeFromTo returns whether an edge exists - // in the multigraph from u to v with IDs uid - // and vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// WeightedDirectedMultigraph is a weighted directed multigraph. -type WeightedDirectedMultigraph interface { - WeightedMultigraph - - // HasEdgeFromTo returns whether an edge exists - // in the multigraph from u to v with IDs uid - // and vid. - HasEdgeFromTo(uid, vid int64) bool - - // To returns all nodes that can reach directly - // to the node with the given ID. - // - // To must not return nil. - To(id int64) Nodes -} - -// LineAdder is an interface for adding lines to a multigraph. -type LineAdder interface { - // NewLine returns a new Line from the source to the destination node. - NewLine(from, to Node) Line - - // SetLine adds a Line from one node to another. - // If the multigraph supports node addition the nodes - // will be added if they do not exist, otherwise - // SetLine will panic. - // Whether l, l.From() and l.To() are stored - // within the graph is implementation dependent. - SetLine(l Line) -} - -// WeightedLineAdder is an interface for adding lines to a multigraph. -type WeightedLineAdder interface { - // NewWeightedLine returns a new WeightedLine from - // the source to the destination node. - NewWeightedLine(from, to Node, weight float64) WeightedLine - - // SetWeightedLine adds a weighted line from one node - // to another. If the multigraph supports node addition - // the nodes will be added if they do not exist, - // otherwise SetWeightedLine will panic. - // Whether l, l.From() and l.To() are stored - // within the graph is implementation dependent. - SetWeightedLine(l WeightedLine) -} - -// LineRemover is an interface for removing lines from a multigraph. -type LineRemover interface { - // RemoveLine removes the line with the given end - // and line IDs, leaving the terminal nodes. If - // the line does not exist it is a no-op. - RemoveLine(fid, tid, id int64) -} - -// MultigraphBuilder is a multigraph that can have nodes and lines added. -type MultigraphBuilder interface { - NodeAdder - LineAdder -} - -// WeightedMultigraphBuilder is a multigraph that can have nodes and weighted lines added. -type WeightedMultigraphBuilder interface { - NodeAdder - WeightedLineAdder -} - -// UndirectedMultgraphBuilder is an undirected multigraph builder. -type UndirectedMultigraphBuilder interface { - UndirectedMultigraph - MultigraphBuilder -} - -// UndirectedWeightedMultigraphBuilder is an undirected weighted multigraph builder. -type UndirectedWeightedMultigraphBuilder interface { - UndirectedMultigraph - WeightedMultigraphBuilder -} - -// DirectedMultigraphBuilder is a directed multigraph builder. -type DirectedMultigraphBuilder interface { - DirectedMultigraph - MultigraphBuilder -} - -// DirectedWeightedMultigraphBuilder is a directed weighted multigraph builder. -type DirectedWeightedMultigraphBuilder interface { - DirectedMultigraph - WeightedMultigraphBuilder -} diff --git a/vendor/gonum.org/v1/gonum/graph/nodes_edges.go b/vendor/gonum.org/v1/gonum/graph/nodes_edges.go deleted file mode 100644 index 3d5dae1fa..000000000 --- a/vendor/gonum.org/v1/gonum/graph/nodes_edges.go +++ /dev/null @@ -1,300 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package graph - -// Iterator is an item iterator. -type Iterator interface { - // Next advances the iterator and returns whether - // the next call to the item method will return a - // non-nil item. - // - // Next should be called prior to any call to the - // iterator's item retrieval method after the - // iterator has been obtained or reset. - // - // The order of iteration is implementation - // dependent. - Next() bool - - // Len returns the number of items remaining in the - // iterator. - // - // If the number of items in the iterator is unknown, - // too large to materialize or too costly to calculate - // then Len may return a negative value. - // In this case the consuming function must be able - // to operate on the items of the iterator directly - // without materializing the items into a slice. - // The magnitude of a negative length has - // implementation-dependent semantics. - Len() int - - // Reset returns the iterator to its start position. - Reset() -} - -// Nodes is a Node iterator. -type Nodes interface { - Iterator - - // Node returns the current Node from the iterator. - Node() Node -} - -// NodeSlicer wraps the NodeSlice method. -type NodeSlicer interface { - // NodeSlice returns the set of nodes remaining - // to be iterated by a Nodes iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - NodeSlice() []Node -} - -// NodesOf returns it.Len() nodes from it. If it is a NodeSlicer, the NodeSlice method -// is used to obtain the nodes. It is safe to pass a nil Nodes to NodesOf. -// -// If the Nodes has an indeterminate length, NodesOf will panic. -func NodesOf(it Nodes) []Node { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called NodesOf on indeterminate iterator") - } - switch it := it.(type) { - case NodeSlicer: - return it.NodeSlice() - } - n := make([]Node, 0, len) - for it.Next() { - n = append(n, it.Node()) - } - return n -} - -// Edges is an Edge iterator. -type Edges interface { - Iterator - - // Edge returns the current Edge from the iterator. - Edge() Edge -} - -// EdgeSlicer wraps the EdgeSlice method. -type EdgeSlicer interface { - // EdgeSlice returns the set of edges remaining - // to be iterated by an Edges iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - EdgeSlice() []Edge -} - -// EdgesOf returns it.Len() nodes from it. If it is an EdgeSlicer, the EdgeSlice method is used -// to obtain the edges. It is safe to pass a nil Edges to EdgesOf. -// -// If the Edges has an indeterminate length, EdgesOf will panic. -func EdgesOf(it Edges) []Edge { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called EdgesOf on indeterminate iterator") - } - switch it := it.(type) { - case EdgeSlicer: - return it.EdgeSlice() - } - e := make([]Edge, 0, len) - for it.Next() { - e = append(e, it.Edge()) - } - return e -} - -// WeightedEdges is a WeightedEdge iterator. -type WeightedEdges interface { - Iterator - - // Edge returns the current Edge from the iterator. - WeightedEdge() WeightedEdge -} - -// WeightedEdgeSlicer wraps the WeightedEdgeSlice method. -type WeightedEdgeSlicer interface { - // EdgeSlice returns the set of edges remaining - // to be iterated by an Edges iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - WeightedEdgeSlice() []WeightedEdge -} - -// WeightedEdgesOf returns it.Len() weighted edge from it. If it is a WeightedEdgeSlicer, the -// WeightedEdgeSlice method is used to obtain the edges. It is safe to pass a nil WeightedEdges -// to WeightedEdgesOf. -// -// If the WeightedEdges has an indeterminate length, WeightedEdgesOf will panic. -func WeightedEdgesOf(it WeightedEdges) []WeightedEdge { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called WeightedEdgesOf on indeterminate iterator") - } - switch it := it.(type) { - case WeightedEdgeSlicer: - return it.WeightedEdgeSlice() - } - e := make([]WeightedEdge, 0, len) - for it.Next() { - e = append(e, it.WeightedEdge()) - } - return e -} - -// Lines is a Line iterator. -type Lines interface { - Iterator - - // Line returns the current Line from the iterator. - Line() Line -} - -// LineSlicer wraps the LineSlice method. -type LineSlicer interface { - // LineSlice returns the set of lines remaining - // to be iterated by an Lines iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - LineSlice() []Line -} - -// LinesOf returns it.Len() nodes from it. If it is a LineSlicer, the LineSlice method is used -// to obtain the lines. It is safe to pass a nil Lines to LinesOf. -// -// If the Lines has an indeterminate length, LinesOf will panic. -func LinesOf(it Lines) []Line { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called LinesOf on indeterminate iterator") - } - switch it := it.(type) { - case LineSlicer: - return it.LineSlice() - } - l := make([]Line, 0, len) - for it.Next() { - l = append(l, it.Line()) - } - return l -} - -// WeightedLines is a WeightedLine iterator. -type WeightedLines interface { - Iterator - - // Line returns the current Line from the iterator. - WeightedLine() WeightedLine -} - -// WeightedLineSlicer wraps the WeightedLineSlice method. -type WeightedLineSlicer interface { - // LineSlice returns the set of lines remaining - // to be iterated by an Lines iterator. - // The holder of the iterator may arbitrarily - // change elements in the returned slice, but - // those changes may be reflected to other - // iterators. - WeightedLineSlice() []WeightedLine -} - -// WeightedLinesOf returns it.Len() weighted line from it. If it is a WeightedLineSlicer, the -// WeightedLineSlice method is used to obtain the lines. It is safe to pass a nil WeightedLines -// to WeightedLinesOf. -// -// If the WeightedLines has an indeterminate length, WeightedLinesOf will panic. -func WeightedLinesOf(it WeightedLines) []WeightedLine { - if it == nil { - return nil - } - len := it.Len() - switch { - case len == 0: - return nil - case len < 0: - panic("graph: called WeightedLinesOf on indeterminate iterator") - } - switch it := it.(type) { - case WeightedLineSlicer: - return it.WeightedLineSlice() - } - l := make([]WeightedLine, 0, len) - for it.Next() { - l = append(l, it.WeightedLine()) - } - return l -} - -// Empty is an empty set of nodes, edges or lines. It should be used when -// a graph returns a zero-length Iterator. Empty implements the slicer -// interfaces for nodes, edges and lines, returning nil for each of these. -const Empty = nothing - -var ( - _ Iterator = Empty - _ Nodes = Empty - _ NodeSlicer = Empty - _ Edges = Empty - _ EdgeSlicer = Empty - _ WeightedEdges = Empty - _ WeightedEdgeSlicer = Empty - _ Lines = Empty - _ LineSlicer = Empty - _ WeightedLines = Empty - _ WeightedLineSlicer = Empty -) - -const nothing = empty(true) - -type empty bool - -func (empty) Next() bool { return false } -func (empty) Len() int { return 0 } -func (empty) Reset() {} -func (empty) Node() Node { return nil } -func (empty) NodeSlice() []Node { return nil } -func (empty) Edge() Edge { return nil } -func (empty) EdgeSlice() []Edge { return nil } -func (empty) WeightedEdge() WeightedEdge { return nil } -func (empty) WeightedEdgeSlice() []WeightedEdge { return nil } -func (empty) Line() Line { return nil } -func (empty) LineSlice() []Line { return nil } -func (empty) WeightedLine() WeightedLine { return nil } -func (empty) WeightedLineSlice() []WeightedLine { return nil } diff --git a/vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go b/vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go deleted file mode 100644 index 3daca9ade..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/dense_directed_matrix.go +++ /dev/null @@ -1,301 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/iterator" - "gonum.org/v1/gonum/mat" -) - -var ( - dm *DirectedMatrix - - _ graph.Graph = dm - _ graph.Directed = dm - _ edgeSetter = dm - _ weightedEdgeSetter = dm -) - -// DirectedMatrix represents a directed graph using an adjacency -// matrix such that all IDs are in a contiguous block from 0 to n-1. -// Edges are stored implicitly as an edge weight, so edges stored in -// the graph are not recoverable. -type DirectedMatrix struct { - mat *mat.Dense - nodes []graph.Node - - self float64 - absent float64 -} - -// NewDirectedMatrix creates a directed dense graph with n nodes. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewDirectedMatrix(n int, init, self, absent float64) *DirectedMatrix { - matrix := make([]float64, n*n) - if init != 0 { - for i := range matrix { - matrix[i] = init - } - } - for i := 0; i < len(matrix); i += n + 1 { - matrix[i] = self - } - return &DirectedMatrix{ - mat: mat.NewDense(n, n, matrix), - self: self, - absent: absent, - } -} - -// NewDirectedMatrixFrom creates a directed dense graph with the given nodes. -// The IDs of the nodes must be contiguous from 0 to len(nodes)-1, but may -// be in any order. If IDs are not contiguous NewDirectedMatrixFrom will panic. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewDirectedMatrixFrom(nodes []graph.Node, init, self, absent float64) *DirectedMatrix { - sort.Sort(ordered.ByID(nodes)) - for i, n := range nodes { - if int64(i) != n.ID() { - panic("simple: non-contiguous node IDs") - } - } - g := NewDirectedMatrix(len(nodes), init, self, absent) - g.nodes = nodes - return g -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *DirectedMatrix) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdge(uid, vid) -} - -// Edges returns all the edges in the graph. -func (g *DirectedMatrix) Edges() graph.Edges { - var edges []graph.Edge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := 0; j < r; j++ { - if i == j { - continue - } - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *DirectedMatrix) From(id int64) graph.Nodes { - if !g.has(id) { - return graph.Empty - } - var nodes []graph.Node - _, c := g.mat.Dims() - for j := 0; j < c; j++ { - if int64(j) == id { - continue - } - // id is not greater than maximum int by this point. - if !isSame(g.mat.At(int(id), j), g.absent) { - nodes = append(nodes, g.Node(int64(j))) - } - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y without -// considering direction. -func (g *DirectedMatrix) HasEdgeBetween(xid, yid int64) bool { - if !g.has(xid) { - return false - } - if !g.has(yid) { - return false - } - // xid and yid are not greater than maximum int by this point. - return xid != yid && (!isSame(g.mat.At(int(xid), int(yid)), g.absent) || !isSame(g.mat.At(int(yid), int(xid)), g.absent)) -} - -// HasEdgeFromTo returns whether an edge exists in the graph from u to v. -func (g *DirectedMatrix) HasEdgeFromTo(uid, vid int64) bool { - if !g.has(uid) { - return false - } - if !g.has(vid) { - return false - } - // uid and vid are not greater than maximum int by this point. - return uid != vid && !isSame(g.mat.At(int(uid), int(vid)), g.absent) -} - -// Matrix returns the mat.Matrix representation of the graph. The orientation -// of the matrix is such that the matrix entry at G_{ij} is the weight of the edge -// from node i to node j. -func (g *DirectedMatrix) Matrix() mat.Matrix { - // Prevent alteration of dimensions of the returned matrix. - m := *g.mat - return &m -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *DirectedMatrix) Node(id int64) graph.Node { - if !g.has(id) { - return nil - } - if g.nodes == nil { - return Node(id) - } - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *DirectedMatrix) Nodes() graph.Nodes { - if g.nodes != nil { - nodes := make([]graph.Node, len(g.nodes)) - copy(nodes, g.nodes) - return iterator.NewOrderedNodes(nodes) - } - r, _ := g.mat.Dims() - // Matrix graphs must have at least one node. - return iterator.NewImplicitNodes(0, r, newSimpleNode) -} - -// RemoveEdge removes the edge with the given end point nodes from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *DirectedMatrix) RemoveEdge(fid, tid int64) { - if !g.has(fid) { - return - } - if !g.has(tid) { - return - } - // fid and tid are not greater than maximum int by this point. - g.mat.Set(int(fid), int(tid), g.absent) -} - -// SetEdge sets e, an edge from one node to another with unit weight. If the ends of the edge -// are not in g or the edge is a self loop, SetEdge panics. SetEdge will store the nodes of -// e in the graph if it was initialized with NewDirectedMatrixFrom. -func (g *DirectedMatrix) SetEdge(e graph.Edge) { - g.setWeightedEdge(e, 1) -} - -// SetWeightedEdge sets e, an edge from one node to another. If the ends of the edge are not in g -// or the edge is a self loop, SetWeightedEdge panics. SetWeightedEdge will store the nodes of -// e in the graph if it was initialized with NewDirectedMatrixFrom. -func (g *DirectedMatrix) SetWeightedEdge(e graph.WeightedEdge) { - g.setWeightedEdge(e, e.Weight()) -} - -func (g *DirectedMatrix) setWeightedEdge(e graph.Edge, weight float64) { - from := e.From() - fid := from.ID() - to := e.To() - tid := to.ID() - if fid == tid { - panic("simple: set illegal edge") - } - if int64(int(fid)) != fid { - panic("simple: unavailable from node ID for dense graph") - } - if int64(int(tid)) != tid { - panic("simple: unavailable to node ID for dense graph") - } - if g.nodes != nil { - g.nodes[fid] = from - g.nodes[tid] = to - } - // fid and tid are not greater than maximum int by this point. - g.mat.Set(int(fid), int(tid), weight) -} - -// To returns all nodes in g that can reach directly to n. -func (g *DirectedMatrix) To(id int64) graph.Nodes { - if !g.has(id) { - return graph.Empty - } - var nodes []graph.Node - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - if int64(i) == id { - continue - } - // id is not greater than maximum int by this point. - if !isSame(g.mat.At(i, int(id)), g.absent) { - nodes = append(nodes, g.Node(int64(i))) - } - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *DirectedMatrix) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if g.HasEdgeFromTo(xid, yid) { - // xid and yid are not greater than maximum int by this point. - return g.mat.At(int(xid), int(yid)), true - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *DirectedMatrix) WeightedEdge(uid, vid int64) graph.WeightedEdge { - if g.HasEdgeFromTo(uid, vid) { - // xid and yid are not greater than maximum int by this point. - return WeightedEdge{F: g.Node(uid), T: g.Node(vid), W: g.mat.At(int(uid), int(vid))} - } - return nil -} - -// WeightedEdges returns all the edges in the graph. -func (g *DirectedMatrix) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := 0; j < r; j++ { - if i == j { - continue - } - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} - -func (g *DirectedMatrix) has(id int64) bool { - r, _ := g.mat.Dims() - return 0 <= id && id < int64(r) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go b/vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go deleted file mode 100644 index f51debb4f..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/dense_undirected_matrix.go +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/iterator" - "gonum.org/v1/gonum/mat" -) - -var ( - um *UndirectedMatrix - - _ graph.Graph = um - _ graph.Undirected = um - _ edgeSetter = um - _ weightedEdgeSetter = um -) - -// UndirectedMatrix represents an undirected graph using an adjacency -// matrix such that all IDs are in a contiguous block from 0 to n-1. -// Edges are stored implicitly as an edge weight, so edges stored in -// the graph are not recoverable. -type UndirectedMatrix struct { - mat *mat.SymDense - nodes []graph.Node - - self float64 - absent float64 -} - -// NewUndirectedMatrix creates an undirected dense graph with n nodes. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewUndirectedMatrix(n int, init, self, absent float64) *UndirectedMatrix { - matrix := make([]float64, n*n) - if init != 0 { - for i := range matrix { - matrix[i] = init - } - } - for i := 0; i < len(matrix); i += n + 1 { - matrix[i] = self - } - return &UndirectedMatrix{ - mat: mat.NewSymDense(n, matrix), - self: self, - absent: absent, - } -} - -// NewUndirectedMatrixFrom creates an undirected dense graph with the given nodes. -// The IDs of the nodes must be contiguous from 0 to len(nodes)-1, but may -// be in any order. If IDs are not contiguous NewUndirectedMatrixFrom will panic. -// All edges are initialized with the weight given by init. The self parameter -// specifies the cost of self connection, and absent specifies the weight -// returned for absent edges. -func NewUndirectedMatrixFrom(nodes []graph.Node, init, self, absent float64) *UndirectedMatrix { - sort.Sort(ordered.ByID(nodes)) - for i, n := range nodes { - if int64(i) != n.ID() { - panic("simple: non-contiguous node IDs") - } - } - g := NewUndirectedMatrix(len(nodes), init, self, absent) - g.nodes = nodes - return g -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *UndirectedMatrix) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. -func (g *UndirectedMatrix) EdgeBetween(uid, vid int64) graph.Edge { - return g.WeightedEdgeBetween(uid, vid) -} - -// Edges returns all the edges in the graph. -func (g *UndirectedMatrix) Edges() graph.Edges { - var edges []graph.Edge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := i + 1; j < r; j++ { - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *UndirectedMatrix) From(id int64) graph.Nodes { - if !g.has(id) { - return graph.Empty - } - var nodes []graph.Node - r := g.mat.Symmetric() - for i := 0; i < r; i++ { - if int64(i) == id { - continue - } - // id is not greater than maximum int by this point. - if !isSame(g.mat.At(int(id), i), g.absent) { - nodes = append(nodes, g.Node(int64(i))) - } - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g *UndirectedMatrix) HasEdgeBetween(uid, vid int64) bool { - if !g.has(uid) { - return false - } - if !g.has(vid) { - return false - } - // uid and vid are not greater than maximum int by this point. - return uid != vid && !isSame(g.mat.At(int(uid), int(vid)), g.absent) -} - -// Matrix returns the mat.Matrix representation of the graph. -func (g *UndirectedMatrix) Matrix() mat.Matrix { - // Prevent alteration of dimensions of the returned matrix. - m := *g.mat - return &m -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *UndirectedMatrix) Node(id int64) graph.Node { - if !g.has(id) { - return nil - } - if g.nodes == nil { - return Node(id) - } - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *UndirectedMatrix) Nodes() graph.Nodes { - if g.nodes != nil { - nodes := make([]graph.Node, len(g.nodes)) - copy(nodes, g.nodes) - return iterator.NewOrderedNodes(nodes) - } - r := g.mat.Symmetric() - // Matrix graphs must have at least one node. - return iterator.NewImplicitNodes(0, r, newSimpleNode) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *UndirectedMatrix) RemoveEdge(fid, tid int64) { - if !g.has(fid) { - return - } - if !g.has(tid) { - return - } - // fid and tid are not greater than maximum int by this point. - g.mat.SetSym(int(fid), int(tid), g.absent) -} - -// SetEdge sets e, an edge from one node to another with unit weight. If the ends of the edge are -// not in g or the edge is a self loop, SetEdge panics. SetEdge will store the nodes of -// e in the graph if it was initialized with NewUndirectedMatrixFrom. -func (g *UndirectedMatrix) SetEdge(e graph.Edge) { - g.setWeightedEdge(e, 1) -} - -// SetWeightedEdge sets e, an edge from one node to another. If the ends of the edge are not in g -// or the edge is a self loop, SetWeightedEdge panics. SetWeightedEdge will store the nodes of -// e in the graph if it was initialized with NewUndirectedMatrixFrom. -func (g *UndirectedMatrix) SetWeightedEdge(e graph.WeightedEdge) { - g.setWeightedEdge(e, e.Weight()) -} - -func (g *UndirectedMatrix) setWeightedEdge(e graph.Edge, weight float64) { - from := e.From() - fid := from.ID() - to := e.To() - tid := to.ID() - if fid == tid { - panic("simple: set illegal edge") - } - if int64(int(fid)) != fid { - panic("simple: unavailable from node ID for dense graph") - } - if int64(int(tid)) != tid { - panic("simple: unavailable to node ID for dense graph") - } - if g.nodes != nil { - g.nodes[fid] = from - g.nodes[tid] = to - } - // fid and tid are not greater than maximum int by this point. - g.mat.SetSym(int(fid), int(tid), weight) -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *UndirectedMatrix) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if g.HasEdgeBetween(xid, yid) { - // xid and yid are not greater than maximum int by this point. - return g.mat.At(int(xid), int(yid)), true - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *UndirectedMatrix) WeightedEdge(uid, vid int64) graph.WeightedEdge { - return g.WeightedEdgeBetween(uid, vid) -} - -// WeightedEdgeBetween returns the weighted edge between nodes x and y. -func (g *UndirectedMatrix) WeightedEdgeBetween(uid, vid int64) graph.WeightedEdge { - if g.HasEdgeBetween(uid, vid) { - // uid and vid are not greater than maximum int by this point. - return WeightedEdge{F: g.Node(uid), T: g.Node(vid), W: g.mat.At(int(uid), int(vid))} - } - return nil -} - -// WeightedEdges returns all the edges in the graph. -func (g *UndirectedMatrix) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - r, _ := g.mat.Dims() - for i := 0; i < r; i++ { - for j := i + 1; j < r; j++ { - if w := g.mat.At(i, j); !isSame(w, g.absent) { - edges = append(edges, WeightedEdge{F: g.Node(int64(i)), T: g.Node(int64(j)), W: w}) - } - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} - -func (g *UndirectedMatrix) has(id int64) bool { - r := g.mat.Symmetric() - return 0 <= id && id < int64(r) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/directed.go b/vendor/gonum.org/v1/gonum/graph/simple/directed.go deleted file mode 100644 index f19efbd0a..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/directed.go +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - dg *DirectedGraph - - _ graph.Graph = dg - _ graph.Directed = dg - _ graph.NodeAdder = dg - _ graph.NodeRemover = dg - _ graph.EdgeAdder = dg - _ graph.EdgeRemover = dg -) - -// DirectedGraph implements a generalized directed graph. -type DirectedGraph struct { - nodes map[int64]graph.Node - from map[int64]map[int64]graph.Edge - to map[int64]map[int64]graph.Edge - - nodeIDs uid.Set -} - -// NewDirectedGraph returns a DirectedGraph. -func NewDirectedGraph() *DirectedGraph { - return &DirectedGraph{ - nodes: make(map[int64]graph.Node), - from: make(map[int64]map[int64]graph.Edge), - to: make(map[int64]map[int64]graph.Edge), - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *DirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.from[n.ID()] = make(map[int64]graph.Edge) - g.to[n.ID()] = make(map[int64]graph.Edge) - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *DirectedGraph) Edge(uid, vid int64) graph.Edge { - edge, ok := g.from[uid][vid] - if !ok { - return nil - } - return edge -} - -// Edges returns all the edges in the graph. -func (g *DirectedGraph) Edges() graph.Edges { - var edges []graph.Edge - for _, u := range g.nodes { - for _, e := range g.from[u.ID()] { - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *DirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { - return graph.Empty - } - - from := make([]graph.Node, len(g.from[id])) - i := 0 - for vid := range g.from[id] { - from[i] = g.nodes[vid] - i++ - } - if len(from) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(from) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y without -// considering direction. -func (g *DirectedGraph) HasEdgeBetween(xid, yid int64) bool { - if _, ok := g.from[xid][yid]; ok { - return true - } - _, ok := g.from[yid][xid] - return ok -} - -// HasEdgeFromTo returns whether an edge exists in the graph from u to v. -func (g *DirectedGraph) HasEdgeFromTo(uid, vid int64) bool { - if _, ok := g.from[uid][vid]; !ok { - return false - } - return true -} - -// NewEdge returns a new Edge from the source to the destination node. -func (g *DirectedGraph) NewEdge(from, to graph.Node) graph.Edge { - return &Edge{F: from, T: to} -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *DirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *DirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *DirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *DirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.from[fid], tid) - delete(g.to[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *DirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.from[id] { - delete(g.to[from], id) - } - delete(g.from, id) - - for to := range g.to[id] { - delete(g.from[to], id) - } - delete(g.to, id) - - g.nodeIDs.Release(id) -} - -// SetEdge adds e, an edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *DirectedGraph) SetEdge(e graph.Edge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - g.from[fid][tid] = e - g.to[tid][fid] = e -} - -// To returns all nodes in g that can reach directly to n. -func (g *DirectedGraph) To(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { - return graph.Empty - } - - to := make([]graph.Node, len(g.to[id])) - i := 0 - for uid := range g.to[id] { - to[i] = g.nodes[uid] - i++ - } - if len(to) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(to) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/doc.go b/vendor/gonum.org/v1/gonum/graph/simple/doc.go deleted file mode 100644 index dc3f24c54..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/doc.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package simple provides a suite of simple graph implementations satisfying -// the gonum/graph interfaces. -// -// All types in simple return the graph.Empty value for empty iterators. -package simple // import "gonum.org/v1/gonum/graph/simple" diff --git a/vendor/gonum.org/v1/gonum/graph/simple/simple.go b/vendor/gonum.org/v1/gonum/graph/simple/simple.go deleted file mode 100644 index 3b4576587..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/simple.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "math" - - "gonum.org/v1/gonum/graph" -) - -// Node is a simple graph node. -type Node int64 - -// ID returns the ID number of the node. -func (n Node) ID() int64 { - return int64(n) -} - -func newSimpleNode(id int) graph.Node { - return Node(id) -} - -// Edge is a simple graph edge. -type Edge struct { - F, T graph.Node -} - -// From returns the from-node of the edge. -func (e Edge) From() graph.Node { return e.F } - -// To returns the to-node of the edge. -func (e Edge) To() graph.Node { return e.T } - -// ReversedLine returns a new Edge with the F and T fields -// swapped. -func (e Edge) ReversedEdge() graph.Edge { return Edge{F: e.T, T: e.F} } - -// WeightedEdge is a simple weighted graph edge. -type WeightedEdge struct { - F, T graph.Node - W float64 -} - -// From returns the from-node of the edge. -func (e WeightedEdge) From() graph.Node { return e.F } - -// To returns the to-node of the edge. -func (e WeightedEdge) To() graph.Node { return e.T } - -// ReversedLine returns a new Edge with the F and T fields -// swapped. The weight of the new Edge is the same as -// the weight of the receiver. -func (e WeightedEdge) ReversedEdge() graph.Edge { return WeightedEdge{F: e.T, T: e.F, W: e.W} } - -// Weight returns the weight of the edge. -func (e WeightedEdge) Weight() float64 { return e.W } - -// isSame returns whether two float64 values are the same where NaN values -// are equalable. -func isSame(a, b float64) bool { - return a == b || (math.IsNaN(a) && math.IsNaN(b)) -} - -type edgeSetter interface { - SetEdge(e graph.Edge) -} - -type weightedEdgeSetter interface { - SetWeightedEdge(e graph.WeightedEdge) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/undirected.go b/vendor/gonum.org/v1/gonum/graph/simple/undirected.go deleted file mode 100644 index 841a8e380..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/undirected.go +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - ug *UndirectedGraph - - _ graph.Graph = ug - _ graph.Undirected = ug - _ graph.NodeAdder = ug - _ graph.NodeRemover = ug - _ graph.EdgeAdder = ug - _ graph.EdgeRemover = ug -) - -// UndirectedGraph implements a generalized undirected graph. -type UndirectedGraph struct { - nodes map[int64]graph.Node - edges map[int64]map[int64]graph.Edge - - nodeIDs uid.Set -} - -// NewUndirectedGraph returns an UndirectedGraph. -func NewUndirectedGraph() *UndirectedGraph { - return &UndirectedGraph{ - nodes: make(map[int64]graph.Node), - edges: make(map[int64]map[int64]graph.Edge), - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *UndirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.edges[n.ID()] = make(map[int64]graph.Edge) - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *UndirectedGraph) Edge(uid, vid int64) graph.Edge { - return g.EdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. -func (g *UndirectedGraph) EdgeBetween(xid, yid int64) graph.Edge { - edge, ok := g.edges[xid][yid] - if !ok { - return nil - } - if edge.From().ID() == xid { - return edge - } - return edge.ReversedEdge() -} - -// Edges returns all the edges in the graph. -func (g *UndirectedGraph) Edges() graph.Edges { - if len(g.edges) == 0 { - return graph.Empty - } - var edges []graph.Edge - seen := make(map[[2]int64]struct{}) - for _, u := range g.edges { - for _, e := range u { - uid := e.From().ID() - vid := e.To().ID() - if _, ok := seen[[2]int64{uid, vid}]; ok { - continue - } - seen[[2]int64{uid, vid}] = struct{}{} - seen[[2]int64{vid, uid}] = struct{}{} - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *UndirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.nodes[id]; !ok { - return graph.Empty - } - - nodes := make([]graph.Node, len(g.edges[id])) - i := 0 - for from := range g.edges[id] { - nodes[i] = g.nodes[from] - i++ - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g *UndirectedGraph) HasEdgeBetween(xid, yid int64) bool { - _, ok := g.edges[xid][yid] - return ok -} - -// NewEdge returns a new Edge from the source to the destination node. -func (g *UndirectedGraph) NewEdge(from, to graph.Node) graph.Edge { - return &Edge{F: from, T: to} -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *UndirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *UndirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *UndirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end IDs from the graph, leaving the terminal nodes. -// If the edge does not exist it is a no-op. -func (g *UndirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.edges[fid], tid) - delete(g.edges[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *UndirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.edges[id] { - delete(g.edges[from], id) - } - delete(g.edges, id) - - g.nodeIDs.Release(id) -} - -// SetEdge adds e, an edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *UndirectedGraph) SetEdge(e graph.Edge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - g.edges[fid][tid] = e - g.edges[tid][fid] = e -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go b/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go deleted file mode 100644 index 92bd2842f..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/weighted_directed.go +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - wdg *WeightedDirectedGraph - - _ graph.Graph = wdg - _ graph.Weighted = wdg - _ graph.Directed = wdg - _ graph.WeightedDirected = wdg - _ graph.NodeAdder = wdg - _ graph.NodeRemover = wdg - _ graph.WeightedEdgeAdder = wdg - _ graph.EdgeRemover = wdg -) - -// WeightedDirectedGraph implements a generalized weighted directed graph. -type WeightedDirectedGraph struct { - nodes map[int64]graph.Node - from map[int64]map[int64]graph.WeightedEdge - to map[int64]map[int64]graph.WeightedEdge - - self, absent float64 - - nodeIDs uid.Set -} - -// NewWeightedDirectedGraph returns a WeightedDirectedGraph with the specified self and absent -// edge weight values. -func NewWeightedDirectedGraph(self, absent float64) *WeightedDirectedGraph { - return &WeightedDirectedGraph{ - nodes: make(map[int64]graph.Node), - from: make(map[int64]map[int64]graph.WeightedEdge), - to: make(map[int64]map[int64]graph.WeightedEdge), - - self: self, - absent: absent, - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *WeightedDirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.from[n.ID()] = make(map[int64]graph.WeightedEdge) - g.to[n.ID()] = make(map[int64]graph.WeightedEdge) - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedDirectedGraph) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdge(uid, vid) -} - -// Edges returns all the edges in the graph. -func (g *WeightedDirectedGraph) Edges() graph.Edges { - var edges []graph.Edge - for _, u := range g.nodes { - for _, e := range g.from[u.ID()] { - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *WeightedDirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { - return graph.Empty - } - - from := make([]graph.Node, len(g.from[id])) - i := 0 - for vid := range g.from[id] { - from[i] = g.nodes[vid] - i++ - } - if len(from) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(from) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y without -// considering direction. -func (g *WeightedDirectedGraph) HasEdgeBetween(xid, yid int64) bool { - if _, ok := g.from[xid][yid]; ok { - return true - } - _, ok := g.from[yid][xid] - return ok -} - -// HasEdgeFromTo returns whether an edge exists in the graph from u to v. -func (g *WeightedDirectedGraph) HasEdgeFromTo(uid, vid int64) bool { - if _, ok := g.from[uid][vid]; !ok { - return false - } - return true -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *WeightedDirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// NewWeightedEdge returns a new weighted edge from the source to the destination node. -func (g *WeightedDirectedGraph) NewWeightedEdge(from, to graph.Node, weight float64) graph.WeightedEdge { - return &WeightedEdge{F: from, T: to, W: weight} -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *WeightedDirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *WeightedDirectedGraph) Nodes() graph.Nodes { - if len(g.from) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *WeightedDirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.from[fid], tid) - delete(g.to[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *WeightedDirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.from[id] { - delete(g.to[from], id) - } - delete(g.from, id) - - for to := range g.to[id] { - delete(g.from[to], id) - } - delete(g.to, id) - - g.nodeIDs.Release(id) -} - -// SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *WeightedDirectedGraph) SetWeightedEdge(e graph.WeightedEdge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - g.from[fid][tid] = e - g.to[tid][fid] = e -} - -// To returns all nodes in g that can reach directly to n. -func (g *WeightedDirectedGraph) To(id int64) graph.Nodes { - if _, ok := g.from[id]; !ok { - return graph.Empty - } - - to := make([]graph.Node, len(g.to[id])) - i := 0 - for uid := range g.to[id] { - to[i] = g.nodes[uid] - i++ - } - if len(to) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(to) -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *WeightedDirectedGraph) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if to, ok := g.from[xid]; ok { - if e, ok := to[yid]; ok { - return e.Weight(), true - } - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedDirectedGraph) WeightedEdge(uid, vid int64) graph.WeightedEdge { - edge, ok := g.from[uid][vid] - if !ok { - return nil - } - return edge -} - -// WeightedEdges returns all the weighted edges in the graph. -func (g *WeightedDirectedGraph) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - for _, u := range g.nodes { - for _, e := range g.from[u.ID()] { - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} diff --git a/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go b/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go deleted file mode 100644 index 593257683..000000000 --- a/vendor/gonum.org/v1/gonum/graph/simple/weighted_undirected.go +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package simple - -import ( - "fmt" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/uid" - "gonum.org/v1/gonum/graph/iterator" -) - -var ( - wug *WeightedUndirectedGraph - - _ graph.Graph = wug - _ graph.Weighted = wug - _ graph.Undirected = wug - _ graph.WeightedUndirected = wug - _ graph.NodeAdder = wug - _ graph.NodeRemover = wug - _ graph.WeightedEdgeAdder = wug - _ graph.EdgeRemover = wug -) - -// WeightedUndirectedGraph implements a generalized weighted undirected graph. -type WeightedUndirectedGraph struct { - nodes map[int64]graph.Node - edges map[int64]map[int64]graph.WeightedEdge - - self, absent float64 - - nodeIDs uid.Set -} - -// NewWeightedUndirectedGraph returns an WeightedUndirectedGraph with the specified self and absent -// edge weight values. -func NewWeightedUndirectedGraph(self, absent float64) *WeightedUndirectedGraph { - return &WeightedUndirectedGraph{ - nodes: make(map[int64]graph.Node), - edges: make(map[int64]map[int64]graph.WeightedEdge), - - self: self, - absent: absent, - - nodeIDs: uid.NewSet(), - } -} - -// AddNode adds n to the graph. It panics if the added node ID matches an existing node ID. -func (g *WeightedUndirectedGraph) AddNode(n graph.Node) { - if _, exists := g.nodes[n.ID()]; exists { - panic(fmt.Sprintf("simple: node ID collision: %d", n.ID())) - } - g.nodes[n.ID()] = n - g.edges[n.ID()] = make(map[int64]graph.WeightedEdge) - g.nodeIDs.Use(n.ID()) -} - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedUndirectedGraph) Edge(uid, vid int64) graph.Edge { - return g.WeightedEdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. -func (g *WeightedUndirectedGraph) EdgeBetween(xid, yid int64) graph.Edge { - return g.WeightedEdgeBetween(xid, yid) -} - -// Edges returns all the edges in the graph. -func (g *WeightedUndirectedGraph) Edges() graph.Edges { - if len(g.edges) == 0 { - return graph.Empty - } - var edges []graph.Edge - seen := make(map[[2]int64]struct{}) - for _, u := range g.edges { - for _, e := range u { - uid := e.From().ID() - vid := e.To().ID() - if _, ok := seen[[2]int64{uid, vid}]; ok { - continue - } - seen[[2]int64{uid, vid}] = struct{}{} - seen[[2]int64{vid, uid}] = struct{}{} - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedEdges(edges) -} - -// From returns all nodes in g that can be reached directly from n. -func (g *WeightedUndirectedGraph) From(id int64) graph.Nodes { - if _, ok := g.nodes[id]; !ok { - return graph.Empty - } - - nodes := make([]graph.Node, len(g.edges[id])) - i := 0 - for from := range g.edges[id] { - nodes[i] = g.nodes[from] - i++ - } - if len(nodes) == 0 { - return graph.Empty - } - return iterator.NewOrderedNodes(nodes) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g *WeightedUndirectedGraph) HasEdgeBetween(xid, yid int64) bool { - _, ok := g.edges[xid][yid] - return ok -} - -// NewNode returns a new unique Node to be added to g. The Node's ID does -// not become valid in g until the Node is added to g. -func (g *WeightedUndirectedGraph) NewNode() graph.Node { - if len(g.nodes) == 0 { - return Node(0) - } - if int64(len(g.nodes)) == uid.Max { - panic("simple: cannot allocate node: no slot") - } - return Node(g.nodeIDs.NewID()) -} - -// NewWeightedEdge returns a new weighted edge from the source to the destination node. -func (g *WeightedUndirectedGraph) NewWeightedEdge(from, to graph.Node, weight float64) graph.WeightedEdge { - return &WeightedEdge{F: from, T: to, W: weight} -} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g *WeightedUndirectedGraph) Node(id int64) graph.Node { - return g.nodes[id] -} - -// Nodes returns all the nodes in the graph. -func (g *WeightedUndirectedGraph) Nodes() graph.Nodes { - if len(g.nodes) == 0 { - return graph.Empty - } - nodes := make([]graph.Node, len(g.nodes)) - i := 0 - for _, n := range g.nodes { - nodes[i] = n - i++ - } - return iterator.NewOrderedNodes(nodes) -} - -// RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal -// nodes. If the edge does not exist it is a no-op. -func (g *WeightedUndirectedGraph) RemoveEdge(fid, tid int64) { - if _, ok := g.nodes[fid]; !ok { - return - } - if _, ok := g.nodes[tid]; !ok { - return - } - - delete(g.edges[fid], tid) - delete(g.edges[tid], fid) -} - -// RemoveNode removes the node with the given ID from the graph, as well as any edges attached -// to it. If the node is not in the graph it is a no-op. -func (g *WeightedUndirectedGraph) RemoveNode(id int64) { - if _, ok := g.nodes[id]; !ok { - return - } - delete(g.nodes, id) - - for from := range g.edges[id] { - delete(g.edges[from], id) - } - delete(g.edges, id) - - g.nodeIDs.Release(id) -} - -// SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added -// and are set to the nodes of the edge otherwise. -// It will panic if the IDs of the e.From and e.To are equal. -func (g *WeightedUndirectedGraph) SetWeightedEdge(e graph.WeightedEdge) { - var ( - from = e.From() - fid = from.ID() - to = e.To() - tid = to.ID() - ) - - if fid == tid { - panic("simple: adding self edge") - } - - if _, ok := g.nodes[fid]; !ok { - g.AddNode(from) - } else { - g.nodes[fid] = from - } - if _, ok := g.nodes[tid]; !ok { - g.AddNode(to) - } else { - g.nodes[tid] = to - } - - g.edges[fid][tid] = e - g.edges[tid][fid] = e -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node or there is no joining edge between the two nodes the weight -// value returned is either the graph's absent or self value. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g *WeightedUndirectedGraph) Weight(xid, yid int64) (w float64, ok bool) { - if xid == yid { - return g.self, true - } - if n, ok := g.edges[xid]; ok { - if e, ok := n[yid]; ok { - return e.Weight(), true - } - } - return g.absent, false -} - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -func (g *WeightedUndirectedGraph) WeightedEdge(uid, vid int64) graph.WeightedEdge { - return g.WeightedEdgeBetween(uid, vid) -} - -// WeightedEdgeBetween returns the weighted edge between nodes x and y. -func (g *WeightedUndirectedGraph) WeightedEdgeBetween(xid, yid int64) graph.WeightedEdge { - edge, ok := g.edges[xid][yid] - if !ok { - return nil - } - if edge.From().ID() == xid { - return edge - } - return edge.ReversedEdge().(graph.WeightedEdge) -} - -// WeightedEdges returns all the weighted edges in the graph. -func (g *WeightedUndirectedGraph) WeightedEdges() graph.WeightedEdges { - var edges []graph.WeightedEdge - seen := make(map[[2]int64]struct{}) - for _, u := range g.edges { - for _, e := range u { - uid := e.From().ID() - vid := e.To().ID() - if _, ok := seen[[2]int64{uid, vid}]; ok { - continue - } - seen[[2]int64{uid, vid}] = struct{}{} - seen[[2]int64{vid, uid}] = struct{}{} - edges = append(edges, e) - } - } - if len(edges) == 0 { - return graph.Empty - } - return iterator.NewOrderedWeightedEdges(edges) -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go b/vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go deleted file mode 100644 index 83fdb5bdf..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/bron_kerbosch.go +++ /dev/null @@ -1,250 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package topo - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" -) - -// DegeneracyOrdering returns the degeneracy ordering and the k-cores of -// the undirected graph g. -func DegeneracyOrdering(g graph.Undirected) (order []graph.Node, cores [][]graph.Node) { - order, offsets := degeneracyOrdering(g) - - ordered.Reverse(order) - cores = make([][]graph.Node, len(offsets)) - offset := len(order) - for i, n := range offsets { - cores[i] = order[offset-n : offset] - offset -= n - } - return order, cores -} - -// KCore returns the k-core of the undirected graph g with nodes in an -// optimal ordering for the coloring number. -func KCore(k int, g graph.Undirected) []graph.Node { - order, offsets := degeneracyOrdering(g) - - var offset int - for _, n := range offsets[:k] { - offset += n - } - core := make([]graph.Node, len(order)-offset) - copy(core, order[offset:]) - return core -} - -// degeneracyOrdering is the common code for DegeneracyOrdering and KCore. It -// returns l, the nodes of g in optimal ordering for coloring number and -// s, a set of relative offsets into l for each k-core, where k is an index -// into s. -func degeneracyOrdering(g graph.Undirected) (l []graph.Node, s []int) { - nodes := graph.NodesOf(g.Nodes()) - - // The algorithm used here is essentially as described at - // http://en.wikipedia.org/w/index.php?title=Degeneracy_%28graph_theory%29&oldid=640308710 - - // Initialize an output list L in return parameters. - - // Compute a number d_v for each vertex v in G, - // the number of neighbors of v that are not already in L. - // Initially, these numbers are just the degrees of the vertices. - dv := make(map[int64]int, len(nodes)) - var ( - maxDegree int - neighbours = make(map[int64][]graph.Node) - ) - for _, n := range nodes { - id := n.ID() - adj := graph.NodesOf(g.From(id)) - neighbours[id] = adj - dv[id] = len(adj) - if len(adj) > maxDegree { - maxDegree = len(adj) - } - } - - // Initialize an array D such that D[i] contains a list of the - // vertices v that are not already in L for which d_v = i. - d := make([][]graph.Node, maxDegree+1) - for _, n := range nodes { - deg := dv[n.ID()] - d[deg] = append(d[deg], n) - } - - // Initialize k to 0. - k := 0 - // Repeat n times: - s = []int{0} - for range nodes { - // Scan the array cells D[0], D[1], ... until - // finding an i for which D[i] is nonempty. - var ( - i int - di []graph.Node - ) - for i, di = range d { - if len(di) != 0 { - break - } - } - - // Set k to max(k,i). - if i > k { - k = i - s = append(s, make([]int, k-len(s)+1)...) - } - - // Select a vertex v from D[i]. Add v to the - // beginning of L and remove it from D[i]. - var v graph.Node - v, d[i] = di[len(di)-1], di[:len(di)-1] - l = append(l, v) - s[k]++ - delete(dv, v.ID()) - - // For each neighbor w of v not already in L, - // subtract one from d_w and move w to the - // cell of D corresponding to the new value of d_w. - for _, w := range neighbours[v.ID()] { - dw, ok := dv[w.ID()] - if !ok { - continue - } - for i, n := range d[dw] { - if n.ID() == w.ID() { - d[dw][i], d[dw] = d[dw][len(d[dw])-1], d[dw][:len(d[dw])-1] - dw-- - d[dw] = append(d[dw], w) - break - } - } - dv[w.ID()] = dw - } - } - - return l, s -} - -// BronKerbosch returns the set of maximal cliques of the undirected graph g. -func BronKerbosch(g graph.Undirected) [][]graph.Node { - nodes := graph.NodesOf(g.Nodes()) - - // The algorithm used here is essentially BronKerbosch3 as described at - // http://en.wikipedia.org/w/index.php?title=Bron%E2%80%93Kerbosch_algorithm&oldid=656805858 - - p := set.NewNodesSize(len(nodes)) - for _, n := range nodes { - p.Add(n) - } - x := set.NewNodes() - var bk bronKerbosch - order, _ := degeneracyOrdering(g) - ordered.Reverse(order) - for _, v := range order { - neighbours := graph.NodesOf(g.From(v.ID())) - nv := set.NewNodesSize(len(neighbours)) - for _, n := range neighbours { - nv.Add(n) - } - bk.maximalCliquePivot(g, []graph.Node{v}, set.IntersectionOfNodes(p, nv), set.IntersectionOfNodes(x, nv)) - p.Remove(v) - x.Add(v) - } - return bk -} - -type bronKerbosch [][]graph.Node - -func (bk *bronKerbosch) maximalCliquePivot(g graph.Undirected, r []graph.Node, p, x set.Nodes) { - if len(p) == 0 && len(x) == 0 { - *bk = append(*bk, r) - return - } - - neighbours := bk.choosePivotFrom(g, p, x) - nu := set.NewNodesSize(len(neighbours)) - for _, n := range neighbours { - nu.Add(n) - } - for _, v := range p { - if nu.Has(v) { - continue - } - vid := v.ID() - neighbours := graph.NodesOf(g.From(vid)) - nv := set.NewNodesSize(len(neighbours)) - for _, n := range neighbours { - nv.Add(n) - } - - var found bool - for _, n := range r { - if n.ID() == vid { - found = true - break - } - } - var sr []graph.Node - if !found { - sr = append(r[:len(r):len(r)], v) - } - - bk.maximalCliquePivot(g, sr, set.IntersectionOfNodes(p, nv), set.IntersectionOfNodes(x, nv)) - p.Remove(v) - x.Add(v) - } -} - -func (*bronKerbosch) choosePivotFrom(g graph.Undirected, p, x set.Nodes) (neighbors []graph.Node) { - // TODO(kortschak): Investigate the impact of pivot choice that maximises - // |p ⋂ neighbours(u)| as a function of input size. Until then, leave as - // compile time option. - if !tomitaTanakaTakahashi { - for _, n := range p { - return graph.NodesOf(g.From(n.ID())) - } - for _, n := range x { - return graph.NodesOf(g.From(n.ID())) - } - panic("bronKerbosch: empty set") - } - - var ( - max = -1 - pivot graph.Node - ) - maxNeighbors := func(s set.Nodes) { - outer: - for _, u := range s { - nb := graph.NodesOf(g.From(u.ID())) - c := len(nb) - if c <= max { - continue - } - for n := range nb { - if _, ok := p[int64(n)]; ok { - continue - } - c-- - if c <= max { - continue outer - } - } - max = c - pivot = u - neighbors = nb - } - } - maxNeighbors(p) - maxNeighbors(x) - if pivot == nil { - panic("bronKerbosch: empty set") - } - return neighbors -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go b/vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go deleted file mode 100644 index 28f1b96ee..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/clique_graph.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package topo - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" -) - -// Builder is a pure topological graph construction type. -type Builder interface { - AddNode(graph.Node) - SetEdge(graph.Edge) -} - -// CliqueGraph builds the clique graph of g in dst using Clique and CliqueGraphEdge -// nodes and edges. The nodes returned by calls to Nodes on the nodes and edges of -// the constructed graph are the cliques and the common nodes between cliques -// respectively. The dst graph is not cleared. -func CliqueGraph(dst Builder, g graph.Undirected) { - cliques := BronKerbosch(g) - - // Construct a consistent view of cliques in g. Sorting costs - // us a little, but not as much as the cliques themselves. - for _, c := range cliques { - sort.Sort(ordered.ByID(c)) - } - sort.Sort(ordered.BySliceIDs(cliques)) - - cliqueNodes := make(cliqueNodeSets, len(cliques)) - for id, c := range cliques { - s := set.NewNodesSize(len(c)) - for _, n := range c { - s.Add(n) - } - ns := &nodeSet{Clique: Clique{id: int64(id), nodes: c}, nodes: s} - dst.AddNode(ns.Clique) - for _, n := range c { - nid := n.ID() - cliqueNodes[nid] = append(cliqueNodes[nid], ns) - } - } - - for _, cliques := range cliqueNodes { - for i, uc := range cliques { - for _, vc := range cliques[i+1:] { - // Retain the nodes that contribute to the - // edge between the cliques. - var edgeNodes []graph.Node - switch 1 { - case len(uc.Clique.nodes): - edgeNodes = []graph.Node{uc.Clique.nodes[0]} - case len(vc.Clique.nodes): - edgeNodes = []graph.Node{vc.Clique.nodes[0]} - default: - for _, n := range set.IntersectionOfNodes(uc.nodes, vc.nodes) { - edgeNodes = append(edgeNodes, n) - } - sort.Sort(ordered.ByID(edgeNodes)) - } - - dst.SetEdge(CliqueGraphEdge{from: uc.Clique, to: vc.Clique, nodes: edgeNodes}) - } - } - } -} - -type cliqueNodeSets map[int64][]*nodeSet - -type nodeSet struct { - Clique - nodes set.Nodes -} - -// Clique is a node in a clique graph. -type Clique struct { - id int64 - nodes []graph.Node -} - -// ID returns the node ID. -func (n Clique) ID() int64 { return n.id } - -// Nodes returns the nodes in the clique. -func (n Clique) Nodes() []graph.Node { return n.nodes } - -// CliqueGraphEdge is an edge in a clique graph. -type CliqueGraphEdge struct { - from, to Clique - nodes []graph.Node -} - -// From returns the from node of the edge. -func (e CliqueGraphEdge) From() graph.Node { return e.from } - -// To returns the to node of the edge. -func (e CliqueGraphEdge) To() graph.Node { return e.to } - -// ReversedEdge returns a new CliqueGraphEdge with -// the edge end points swapped. The nodes of the -// new edge are shared with the receiver. -func (e CliqueGraphEdge) ReversedEdge() graph.Edge { e.from, e.to = e.to, e.from; return e } - -// Nodes returns the common nodes in the cliques of the underlying graph -// corresponding to the from and to nodes in the clique graph. -func (e CliqueGraphEdge) Nodes() []graph.Node { return e.nodes } diff --git a/vendor/gonum.org/v1/gonum/graph/topo/doc.go b/vendor/gonum.org/v1/gonum/graph/topo/doc.go deleted file mode 100644 index cbcdff1e7..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package topo provides graph topology analysis functions. -package topo // import "gonum.org/v1/gonum/graph/topo" diff --git a/vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go b/vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go deleted file mode 100644 index 8a78ba2f3..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/johnson_cycles.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package topo - -import ( - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" - "gonum.org/v1/gonum/graph/iterator" -) - -// johnson implements Johnson's "Finding all the elementary -// circuits of a directed graph" algorithm. SIAM J. Comput. 4(1):1975. -// -// Comments in the johnson methods are kept in sync with the comments -// and labels from the paper. -type johnson struct { - adjacent johnsonGraph // SCC adjacency list. - b []set.Ints // Johnson's "B-list". - blocked []bool - s int - - stack []graph.Node - - result [][]graph.Node -} - -// DirectedCyclesIn returns the set of elementary cycles in the graph g. -func DirectedCyclesIn(g graph.Directed) [][]graph.Node { - jg := johnsonGraphFrom(g) - j := johnson{ - adjacent: jg, - b: make([]set.Ints, len(jg.orig)), - blocked: make([]bool, len(jg.orig)), - } - - // len(j.nodes) is the order of g. - for j.s < len(j.adjacent.orig)-1 { - // We use the previous SCC adjacency to reduce the work needed. - sccs := TarjanSCC(j.adjacent.subgraph(j.s)) - // A_k = adjacency structure of strong component K with least - // vertex in subgraph of G induced by {s, s+1, ... ,n}. - j.adjacent = j.adjacent.sccSubGraph(sccs, 2) // Only allow SCCs with >= 2 vertices. - if j.adjacent.order() == 0 { - break - } - - // s = least vertex in V_k - if s := j.adjacent.leastVertexIndex(); s < j.s { - j.s = s - } - for i, v := range j.adjacent.orig { - if !j.adjacent.nodes.Has(v.ID()) { - continue - } - if len(j.adjacent.succ[v.ID()]) > 0 { - j.blocked[i] = false - j.b[i] = make(set.Ints) - } - } - //L3: - _ = j.circuit(j.s) - j.s++ - } - - return j.result -} - -// circuit is the CIRCUIT sub-procedure in the paper. -func (j *johnson) circuit(v int) bool { - f := false - n := j.adjacent.orig[v] - j.stack = append(j.stack, n) - j.blocked[v] = true - - //L1: - for w := range j.adjacent.succ[n.ID()] { - w := j.adjacent.indexOf(w) - if w == j.s { - // Output circuit composed of stack followed by s. - r := make([]graph.Node, len(j.stack)+1) - copy(r, j.stack) - r[len(r)-1] = j.adjacent.orig[j.s] - j.result = append(j.result, r) - f = true - } else if !j.blocked[w] { - if j.circuit(w) { - f = true - } - } - } - - //L2: - if f { - j.unblock(v) - } else { - for w := range j.adjacent.succ[n.ID()] { - j.b[j.adjacent.indexOf(w)].Add(v) - } - } - j.stack = j.stack[:len(j.stack)-1] - - return f -} - -// unblock is the UNBLOCK sub-procedure in the paper. -func (j *johnson) unblock(u int) { - j.blocked[u] = false - for w := range j.b[u] { - j.b[u].Remove(w) - if j.blocked[w] { - j.unblock(w) - } - } -} - -// johnsonGraph is an edge list representation of a graph with helpers -// necessary for Johnson's algorithm -type johnsonGraph struct { - // Keep the original graph nodes and a - // look-up to into the non-sparse - // collection of potentially sparse IDs. - orig []graph.Node - index map[int64]int - - nodes set.Int64s - succ map[int64]set.Int64s -} - -// johnsonGraphFrom returns a deep copy of the graph g. -func johnsonGraphFrom(g graph.Directed) johnsonGraph { - nodes := graph.NodesOf(g.Nodes()) - sort.Sort(ordered.ByID(nodes)) - c := johnsonGraph{ - orig: nodes, - index: make(map[int64]int, len(nodes)), - - nodes: make(set.Int64s, len(nodes)), - succ: make(map[int64]set.Int64s), - } - for i, u := range nodes { - uid := u.ID() - c.index[uid] = i - for _, v := range graph.NodesOf(g.From(uid)) { - if c.succ[uid] == nil { - c.succ[uid] = make(set.Int64s) - c.nodes.Add(uid) - } - c.nodes.Add(v.ID()) - c.succ[uid].Add(v.ID()) - } - } - return c -} - -// order returns the order of the graph. -func (g johnsonGraph) order() int { return g.nodes.Count() } - -// indexOf returns the index of the retained node for the given node ID. -func (g johnsonGraph) indexOf(id int64) int { - return g.index[id] -} - -// leastVertexIndex returns the index into orig of the least vertex. -func (g johnsonGraph) leastVertexIndex() int { - for _, v := range g.orig { - if g.nodes.Has(v.ID()) { - return g.indexOf(v.ID()) - } - } - panic("johnsonCycles: empty set") -} - -// subgraph returns a subgraph of g induced by {s, s+1, ... , n}. The -// subgraph is destructively generated in g. -func (g johnsonGraph) subgraph(s int) johnsonGraph { - sn := g.orig[s].ID() - for u, e := range g.succ { - if u < sn { - g.nodes.Remove(u) - delete(g.succ, u) - continue - } - for v := range e { - if v < sn { - g.succ[u].Remove(v) - } - } - } - return g -} - -// sccSubGraph returns the graph of the tarjan's strongly connected -// components with each SCC containing at least min vertices. -// sccSubGraph returns nil if there is no SCC with at least min -// members. -func (g johnsonGraph) sccSubGraph(sccs [][]graph.Node, min int) johnsonGraph { - if len(g.nodes) == 0 { - g.nodes = nil - g.succ = nil - return g - } - sub := johnsonGraph{ - orig: g.orig, - index: g.index, - nodes: make(set.Int64s), - succ: make(map[int64]set.Int64s), - } - - var n int - for _, scc := range sccs { - if len(scc) < min { - continue - } - n++ - for _, u := range scc { - for _, v := range scc { - if _, ok := g.succ[u.ID()][v.ID()]; ok { - if sub.succ[u.ID()] == nil { - sub.succ[u.ID()] = make(set.Int64s) - sub.nodes.Add(u.ID()) - } - sub.nodes.Add(v.ID()) - sub.succ[u.ID()].Add(v.ID()) - } - } - } - } - if n == 0 { - g.nodes = nil - g.succ = nil - return g - } - - return sub -} - -// Nodes is required to satisfy Tarjan. -func (g johnsonGraph) Nodes() graph.Nodes { - n := make([]graph.Node, 0, len(g.nodes)) - for id := range g.nodes { - n = append(n, johnsonGraphNode(id)) - } - return iterator.NewOrderedNodes(n) -} - -// Successors is required to satisfy Tarjan. -func (g johnsonGraph) From(id int64) graph.Nodes { - adj := g.succ[id] - if len(adj) == 0 { - return graph.Empty - } - succ := make([]graph.Node, 0, len(adj)) - for id := range adj { - succ = append(succ, johnsonGraphNode(id)) - } - return iterator.NewOrderedNodes(succ) -} - -func (johnsonGraph) Has(int64) bool { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) Node(int64) graph.Node { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) HasEdgeBetween(_, _ int64) bool { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) Edge(_, _ int64) graph.Edge { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) HasEdgeFromTo(_, _ int64) bool { - panic("topo: unintended use of johnsonGraph") -} -func (johnsonGraph) To(int64) graph.Nodes { - panic("topo: unintended use of johnsonGraph") -} - -type johnsonGraphNode int64 - -func (n johnsonGraphNode) ID() int64 { return int64(n) } diff --git a/vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go b/vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go deleted file mode 100644 index 36171d6fe..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/non_tomita_choice.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !tomita - -package topo - -const tomitaTanakaTakahashi = false diff --git a/vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go b/vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go deleted file mode 100644 index 44b362a6f..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/paton_cycles.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package topo - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/linear" - "gonum.org/v1/gonum/graph/internal/set" -) - -// UndirectedCyclesIn returns a set of cycles that forms a cycle basis in the graph g. -// Any cycle in g can be constructed as a symmetric difference of its elements. -func UndirectedCyclesIn(g graph.Undirected) [][]graph.Node { - // From "An algorithm for finding a fundamental set of cycles of a graph" - // https://doi.org/10.1145/363219.363232 - - var cycles [][]graph.Node - done := make(set.Int64s) - var tree linear.NodeStack - nodes := g.Nodes() - for nodes.Next() { - n := nodes.Node() - id := n.ID() - if done.Has(id) { - continue - } - done.Add(id) - - tree = tree[:0] - tree.Push(n) - from := sets{id: set.Int64s{}} - to := map[int64]graph.Node{id: n} - - for tree.Len() != 0 { - u := tree.Pop() - uid := u.ID() - adj := from[uid] - for _, v := range graph.NodesOf(g.From(uid)) { - vid := v.ID() - switch { - case uid == vid: - cycles = append(cycles, []graph.Node{u}) - case !from.has(vid): - done.Add(vid) - to[vid] = u - tree.Push(v) - from.add(uid, vid) - case !adj.Has(vid): - c := []graph.Node{v, u} - adj := from[vid] - p := to[uid] - for !adj.Has(p.ID()) { - c = append(c, p) - p = to[p.ID()] - } - c = append(c, p, c[0]) - cycles = append(cycles, c) - adj.Add(uid) - } - } - } - } - - return cycles -} - -type sets map[int64]set.Int64s - -func (s sets) add(uid, vid int64) { - e, ok := s[vid] - if !ok { - e = make(set.Int64s) - s[vid] = e - } - e.Add(uid) -} - -func (s sets) has(uid int64) bool { - _, ok := s[uid] - return ok -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/tarjan.go b/vendor/gonum.org/v1/gonum/graph/topo/tarjan.go deleted file mode 100644 index 647129275..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/tarjan.go +++ /dev/null @@ -1,199 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package topo - -import ( - "fmt" - "sort" - - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/ordered" - "gonum.org/v1/gonum/graph/internal/set" -) - -// Unorderable is an error containing sets of unorderable graph.Nodes. -type Unorderable [][]graph.Node - -// Error satisfies the error interface. -func (e Unorderable) Error() string { - const maxNodes = 10 - var n int - for _, c := range e { - n += len(c) - } - if n > maxNodes { - // Don't return errors that are too long. - return fmt.Sprintf("topo: no topological ordering: %d nodes in %d cyclic components", n, len(e)) - } - return fmt.Sprintf("topo: no topological ordering: cyclic components: %v", [][]graph.Node(e)) -} - -func lexical(nodes []graph.Node) { sort.Sort(ordered.ByID(nodes)) } - -// Sort performs a topological sort of the directed graph g returning the 'from' to 'to' -// sort order. If a topological ordering is not possible, an Unorderable error is returned -// listing cyclic components in g with each cyclic component's members sorted by ID. When -// an Unorderable error is returned, each cyclic component's topological position within -// the sorted nodes is marked with a nil graph.Node. -func Sort(g graph.Directed) (sorted []graph.Node, err error) { - sccs := TarjanSCC(g) - return sortedFrom(sccs, lexical) -} - -// SortStabilized performs a topological sort of the directed graph g returning the 'from' -// to 'to' sort order, or the order defined by the in place order sort function where there -// is no unambiguous topological ordering. If a topological ordering is not possible, an -// Unorderable error is returned listing cyclic components in g with each cyclic component's -// members sorted by the provided order function. If order is nil, nodes are ordered lexically -// by node ID. When an Unorderable error is returned, each cyclic component's topological -// position within the sorted nodes is marked with a nil graph.Node. -func SortStabilized(g graph.Directed, order func([]graph.Node)) (sorted []graph.Node, err error) { - if order == nil { - order = lexical - } - sccs := tarjanSCCstabilized(g, order) - return sortedFrom(sccs, order) -} - -func sortedFrom(sccs [][]graph.Node, order func([]graph.Node)) ([]graph.Node, error) { - sorted := make([]graph.Node, 0, len(sccs)) - var sc Unorderable - for _, s := range sccs { - if len(s) != 1 { - order(s) - sc = append(sc, s) - sorted = append(sorted, nil) - continue - } - sorted = append(sorted, s[0]) - } - var err error - if sc != nil { - for i, j := 0, len(sc)-1; i < j; i, j = i+1, j-1 { - sc[i], sc[j] = sc[j], sc[i] - } - err = sc - } - ordered.Reverse(sorted) - return sorted, err -} - -// TarjanSCC returns the strongly connected components of the graph g using Tarjan's algorithm. -// -// A strongly connected component of a graph is a set of vertices where it's possible to reach any -// vertex in the set from any other (meaning there's a cycle between them.) -// -// Generally speaking, a directed graph where the number of strongly connected components is equal -// to the number of nodes is acyclic, unless you count reflexive edges as a cycle (which requires -// only a little extra testing.) -// -func TarjanSCC(g graph.Directed) [][]graph.Node { - return tarjanSCCstabilized(g, nil) -} - -func tarjanSCCstabilized(g graph.Directed, order func([]graph.Node)) [][]graph.Node { - nodes := graph.NodesOf(g.Nodes()) - var succ func(id int64) []graph.Node - if order == nil { - succ = func(id int64) []graph.Node { - return graph.NodesOf(g.From(id)) - } - } else { - order(nodes) - ordered.Reverse(nodes) - - succ = func(id int64) []graph.Node { - to := graph.NodesOf(g.From(id)) - order(to) - ordered.Reverse(to) - return to - } - } - - t := tarjan{ - succ: succ, - - indexTable: make(map[int64]int, len(nodes)), - lowLink: make(map[int64]int, len(nodes)), - onStack: make(set.Int64s), - } - for _, v := range nodes { - if t.indexTable[v.ID()] == 0 { - t.strongconnect(v) - } - } - return t.sccs -} - -// tarjan implements Tarjan's strongly connected component finding -// algorithm. The implementation is from the pseudocode at -// -// http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm?oldid=642744644 -// -type tarjan struct { - succ func(id int64) []graph.Node - - index int - indexTable map[int64]int - lowLink map[int64]int - onStack set.Int64s - - stack []graph.Node - - sccs [][]graph.Node -} - -// strongconnect is the strongconnect function described in the -// wikipedia article. -func (t *tarjan) strongconnect(v graph.Node) { - vID := v.ID() - - // Set the depth index for v to the smallest unused index. - t.index++ - t.indexTable[vID] = t.index - t.lowLink[vID] = t.index - t.stack = append(t.stack, v) - t.onStack.Add(vID) - - // Consider successors of v. - for _, w := range t.succ(vID) { - wID := w.ID() - if t.indexTable[wID] == 0 { - // Successor w has not yet been visited; recur on it. - t.strongconnect(w) - t.lowLink[vID] = min(t.lowLink[vID], t.lowLink[wID]) - } else if t.onStack.Has(wID) { - // Successor w is in stack s and hence in the current SCC. - t.lowLink[vID] = min(t.lowLink[vID], t.indexTable[wID]) - } - } - - // If v is a root node, pop the stack and generate an SCC. - if t.lowLink[vID] == t.indexTable[vID] { - // Start a new strongly connected component. - var ( - scc []graph.Node - w graph.Node - ) - for { - w, t.stack = t.stack[len(t.stack)-1], t.stack[:len(t.stack)-1] - t.onStack.Remove(w.ID()) - // Add w to current strongly connected component. - scc = append(scc, w) - if w.ID() == vID { - break - } - } - // Output the current strongly connected component. - t.sccs = append(t.sccs, scc) - } -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} diff --git a/vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go b/vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go deleted file mode 100644 index f85a0d6c0..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/tomita_choice.go +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build tomita - -package topo - -const tomitaTanakaTakahashi = true diff --git a/vendor/gonum.org/v1/gonum/graph/topo/topo.go b/vendor/gonum.org/v1/gonum/graph/topo/topo.go deleted file mode 100644 index bece61a6c..000000000 --- a/vendor/gonum.org/v1/gonum/graph/topo/topo.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package topo - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/traverse" -) - -// IsPathIn returns whether path is a path in g. -// -// As special cases, IsPathIn returns true for a zero length path or for -// a path of length 1 when the node in path exists in the graph. -func IsPathIn(g graph.Graph, path []graph.Node) bool { - switch len(path) { - case 0: - return true - case 1: - return g.Node(path[0].ID()) != nil - default: - var canReach func(uid, vid int64) bool - switch g := g.(type) { - case graph.Directed: - canReach = g.HasEdgeFromTo - default: - canReach = g.HasEdgeBetween - } - - for i, u := range path[:len(path)-1] { - if !canReach(u.ID(), path[i+1].ID()) { - return false - } - } - return true - } -} - -// PathExistsIn returns whether there is a path in g starting at from extending -// to to. -// -// PathExistsIn exists as a helper function. If many tests for path existence -// are being performed, other approaches will be more efficient. -func PathExistsIn(g graph.Graph, from, to graph.Node) bool { - var t traverse.BreadthFirst - return t.Walk(g, from, func(n graph.Node, _ int) bool { return n.ID() == to.ID() }) != nil -} - -// ConnectedComponents returns the connected components of the undirected graph g. -func ConnectedComponents(g graph.Undirected) [][]graph.Node { - var ( - w traverse.DepthFirst - c []graph.Node - cc [][]graph.Node - ) - during := func(n graph.Node) { - c = append(c, n) - } - after := func() { - cc = append(cc, []graph.Node(nil)) - cc[len(cc)-1] = append(cc[len(cc)-1], c...) - c = c[:0] - } - w.WalkAll(g, nil, after, during) - - return cc -} diff --git a/vendor/gonum.org/v1/gonum/graph/traverse/doc.go b/vendor/gonum.org/v1/gonum/graph/traverse/doc.go deleted file mode 100644 index dc98bbf43..000000000 --- a/vendor/gonum.org/v1/gonum/graph/traverse/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package traverse provides basic graph traversal primitives. -package traverse // import "gonum.org/v1/gonum/graph/traverse" diff --git a/vendor/gonum.org/v1/gonum/graph/traverse/traverse.go b/vendor/gonum.org/v1/gonum/graph/traverse/traverse.go deleted file mode 100644 index 125b16114..000000000 --- a/vendor/gonum.org/v1/gonum/graph/traverse/traverse.go +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package traverse - -import ( - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/internal/linear" - "gonum.org/v1/gonum/graph/internal/set" -) - -var _ Graph = graph.Graph(nil) - -// Graph is the subset of graph.Graph necessary for graph traversal. -type Graph interface { - // From returns all nodes that can be reached directly - // from the node with the given ID. - From(id int64) graph.Nodes - - // Edge returns the edge from u to v, with IDs uid and vid, - // if such an edge exists and nil otherwise. The node v - // must be directly reachable from u as defined by - // the From method. - Edge(uid, vid int64) graph.Edge -} - -// BreadthFirst implements stateful breadth-first graph traversal. -type BreadthFirst struct { - // Visit is called on all nodes on their first visit. - Visit func(graph.Node) - - // Traverse is called on all edges that may be traversed - // during the walk. This includes edges that would hop to - // an already visited node. - // - // The value returned by Traverse determines whether - // an edge can be traversed during the walk. - Traverse func(graph.Edge) bool - - queue linear.NodeQueue - visited set.Int64s -} - -// Walk performs a breadth-first traversal of the graph g starting from the given node, -// depending on the Traverse field and the until parameter if they are non-nil. -// The traversal follows edges for which Traverse(edge) is true and returns the first node -// for which until(node, depth) is true. During the traversal, if the Visit field is -// non-nil, it is called with each node the first time it is visited. -func (b *BreadthFirst) Walk(g Graph, from graph.Node, until func(n graph.Node, d int) bool) graph.Node { - if b.visited == nil { - b.visited = make(set.Int64s) - } - b.queue.Enqueue(from) - if b.Visit != nil && !b.visited.Has(from.ID()) { - b.Visit(from) - } - b.visited.Add(from.ID()) - - var ( - depth int - children int - untilNext = 1 - ) - for b.queue.Len() > 0 { - t := b.queue.Dequeue() - if until != nil && until(t, depth) { - return t - } - tid := t.ID() - to := g.From(tid) - for to.Next() { - n := to.Node() - nid := n.ID() - if b.Traverse != nil && !b.Traverse(g.Edge(tid, nid)) { - continue - } - if b.visited.Has(nid) { - continue - } - if b.Visit != nil { - b.Visit(n) - } - b.visited.Add(nid) - children++ - b.queue.Enqueue(n) - } - if untilNext--; untilNext == 0 { - depth++ - untilNext = children - children = 0 - } - } - - return nil -} - -// WalkAll calls Walk for each unvisited node of the graph g using edges independent -// of their direction. The functions before and after are called prior to commencing -// and after completing each walk if they are non-nil respectively. The function -// during is called on each node as it is traversed. -func (b *BreadthFirst) WalkAll(g graph.Undirected, before, after func(), during func(graph.Node)) { - b.Reset() - nodes := g.Nodes() - for nodes.Next() { - from := nodes.Node() - if b.Visited(from) { - continue - } - if before != nil { - before() - } - b.Walk(g, from, func(n graph.Node, _ int) bool { - if during != nil { - during(n) - } - return false - }) - if after != nil { - after() - } - } -} - -// Visited returned whether the node n was visited during a traverse. -func (b *BreadthFirst) Visited(n graph.Node) bool { - return b.visited.Has(n.ID()) -} - -// Reset resets the state of the traverser for reuse. -func (b *BreadthFirst) Reset() { - b.queue.Reset() - b.visited = nil -} - -// DepthFirst implements stateful depth-first graph traversal. -type DepthFirst struct { - // Visit is called on all nodes on their first visit. - Visit func(graph.Node) - - // Traverse is called on all edges that may be traversed - // during the walk. This includes edges that would hop to - // an already visited node. - // - // The value returned by Traverse determines whether an - // edge can be traversed during the walk. - Traverse func(graph.Edge) bool - - stack linear.NodeStack - visited set.Int64s -} - -// Walk performs a depth-first traversal of the graph g starting from the given node, -// depending on the Traverse field and the until parameter if they are non-nil. -// The traversal follows edges for which Traverse(edge) is true and returns the first node -// for which until(node) is true. During the traversal, if the Visit field is non-nil, it -// is called with each node the first time it is visited. -func (d *DepthFirst) Walk(g Graph, from graph.Node, until func(graph.Node) bool) graph.Node { - if d.visited == nil { - d.visited = make(set.Int64s) - } - d.stack.Push(from) - if d.Visit != nil && !d.visited.Has(from.ID()) { - d.Visit(from) - } - d.visited.Add(from.ID()) - - for d.stack.Len() > 0 { - t := d.stack.Pop() - if until != nil && until(t) { - return t - } - tid := t.ID() - to := g.From(tid) - for to.Next() { - n := to.Node() - nid := n.ID() - if d.Traverse != nil && !d.Traverse(g.Edge(tid, nid)) { - continue - } - if d.visited.Has(nid) { - continue - } - if d.Visit != nil { - d.Visit(n) - } - d.visited.Add(nid) - d.stack.Push(n) - } - } - - return nil -} - -// WalkAll calls Walk for each unvisited node of the graph g using edges independent -// of their direction. The functions before and after are called prior to commencing -// and after completing each walk if they are non-nil respectively. The function -// during is called on each node as it is traversed. -func (d *DepthFirst) WalkAll(g graph.Undirected, before, after func(), during func(graph.Node)) { - d.Reset() - nodes := g.Nodes() - for nodes.Next() { - from := nodes.Node() - if d.Visited(from) { - continue - } - if before != nil { - before() - } - d.Walk(g, from, func(n graph.Node) bool { - if during != nil { - during(n) - } - return false - }) - if after != nil { - after() - } - } -} - -// Visited returned whether the node n was visited during a traverse. -func (d *DepthFirst) Visited(n graph.Node) bool { - return d.visited.Has(n.ID()) -} - -// Reset resets the state of the traverser for reuse. -func (d *DepthFirst) Reset() { - d.stack = d.stack[:0] - d.visited = nil -} diff --git a/vendor/gonum.org/v1/gonum/graph/undirect.go b/vendor/gonum.org/v1/gonum/graph/undirect.go deleted file mode 100644 index 07ce64a06..000000000 --- a/vendor/gonum.org/v1/gonum/graph/undirect.go +++ /dev/null @@ -1,270 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package graph - -// Undirect converts a directed graph to an undirected graph. -type Undirect struct { - G Directed -} - -var _ Undirected = Undirect{} - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g Undirect) Node(id int64) Node { return g.G.Node(id) } - -// Nodes returns all the nodes in the graph. -func (g Undirect) Nodes() Nodes { return g.G.Nodes() } - -// From returns all nodes in g that can be reached directly from u. -func (g Undirect) From(uid int64) Nodes { - return newNodeFilterIterator(g.G.From(uid), g.G.To(uid)) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g Undirect) HasEdgeBetween(xid, yid int64) bool { return g.G.HasEdgeBetween(xid, yid) } - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -// If an edge exists, the Edge returned is an EdgePair. The weight of -// the edge is determined by applying the Merge func to the weights of the -// edges between u and v. -func (g Undirect) Edge(uid, vid int64) Edge { return g.EdgeBetween(uid, vid) } - -// EdgeBetween returns the edge between nodes x and y. If an edge exists, the -// Edge returned is an EdgePair. The weight of the edge is determined by -// applying the Merge func to the weights of edges between x and y. -func (g Undirect) EdgeBetween(xid, yid int64) Edge { - fe := g.G.Edge(xid, yid) - re := g.G.Edge(yid, xid) - if fe == nil && re == nil { - return nil - } - - return EdgePair{fe, re} -} - -// UndirectWeighted converts a directed weighted graph to an undirected weighted graph, -// resolving edge weight conflicts. -type UndirectWeighted struct { - G WeightedDirected - - // Absent is the value used to - // represent absent edge weights - // passed to Merge if the reverse - // edge is present. - Absent float64 - - // Merge defines how discordant edge - // weights in G are resolved. A merge - // is performed if at least one edge - // exists between the nodes being - // considered. The edges corresponding - // to the two weights are also passed, - // in the same order. - // The order of weight parameters - // passed to Merge is not defined, so - // the function should be commutative. - // If Merge is nil, the arithmetic - // mean is used to merge weights. - Merge func(x, y float64, xe, ye Edge) float64 -} - -var ( - _ Undirected = UndirectWeighted{} - _ WeightedUndirected = UndirectWeighted{} -) - -// Node returns the node with the given ID if it exists in the graph, -// and nil otherwise. -func (g UndirectWeighted) Node(id int64) Node { return g.G.Node(id) } - -// Nodes returns all the nodes in the graph. -func (g UndirectWeighted) Nodes() Nodes { return g.G.Nodes() } - -// From returns all nodes in g that can be reached directly from u. -func (g UndirectWeighted) From(uid int64) Nodes { - return newNodeFilterIterator(g.G.From(uid), g.G.To(uid)) -} - -// HasEdgeBetween returns whether an edge exists between nodes x and y. -func (g UndirectWeighted) HasEdgeBetween(xid, yid int64) bool { return g.G.HasEdgeBetween(xid, yid) } - -// Edge returns the edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -// If an edge exists, the Edge returned is an EdgePair. The weight of -// the edge is determined by applying the Merge func to the weights of the -// edges between u and v. -func (g UndirectWeighted) Edge(uid, vid int64) Edge { return g.WeightedEdgeBetween(uid, vid) } - -// WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. -// The node v must be directly reachable from u as defined by the From method. -// If an edge exists, the Edge returned is an EdgePair. The weight of -// the edge is determined by applying the Merge func to the weights of the -// edges between u and v. -func (g UndirectWeighted) WeightedEdge(uid, vid int64) WeightedEdge { - return g.WeightedEdgeBetween(uid, vid) -} - -// EdgeBetween returns the edge between nodes x and y. If an edge exists, the -// Edge returned is an EdgePair. The weight of the edge is determined by -// applying the Merge func to the weights of edges between x and y. -func (g UndirectWeighted) EdgeBetween(xid, yid int64) Edge { - return g.WeightedEdgeBetween(xid, yid) -} - -// WeightedEdgeBetween returns the weighted edge between nodes x and y. If an edge exists, the -// Edge returned is an EdgePair. The weight of the edge is determined by -// applying the Merge func to the weights of edges between x and y. -func (g UndirectWeighted) WeightedEdgeBetween(xid, yid int64) WeightedEdge { - fe := g.G.Edge(xid, yid) - re := g.G.Edge(yid, xid) - if fe == nil && re == nil { - return nil - } - - f, ok := g.G.Weight(xid, yid) - if !ok { - f = g.Absent - } - r, ok := g.G.Weight(yid, xid) - if !ok { - r = g.Absent - } - - var w float64 - if g.Merge == nil { - w = (f + r) / 2 - } else { - w = g.Merge(f, r, fe, re) - } - return WeightedEdgePair{EdgePair: [2]Edge{fe, re}, W: w} -} - -// Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. -// If x and y are the same node the internal node weight is returned. If there is no joining -// edge between the two nodes the weight value returned is zero. Weight returns true if an edge -// exists between x and y or if x and y have the same ID, false otherwise. -func (g UndirectWeighted) Weight(xid, yid int64) (w float64, ok bool) { - fe := g.G.Edge(xid, yid) - re := g.G.Edge(yid, xid) - - f, fOk := g.G.Weight(xid, yid) - if !fOk { - f = g.Absent - } - r, rOK := g.G.Weight(yid, xid) - if !rOK { - r = g.Absent - } - ok = fOk || rOK - - if g.Merge == nil { - return (f + r) / 2, ok - } - return g.Merge(f, r, fe, re), ok -} - -// EdgePair is an opposed pair of directed edges. -type EdgePair [2]Edge - -// From returns the from node of the first non-nil edge, or nil. -func (e EdgePair) From() Node { - if e[0] != nil { - return e[0].From() - } else if e[1] != nil { - return e[1].From() - } - return nil -} - -// To returns the to node of the first non-nil edge, or nil. -func (e EdgePair) To() Node { - if e[0] != nil { - return e[0].To() - } else if e[1] != nil { - return e[1].To() - } - return nil -} - -// ReversedEdge returns a new Edge with the end point of the -// edges in the pair swapped. -func (e EdgePair) ReversedEdge() Edge { - if e[0] != nil { - e[0] = e[0].ReversedEdge() - } - if e[1] != nil { - e[1] = e[1].ReversedEdge() - } - return e -} - -// WeightedEdgePair is an opposed pair of directed edges. -type WeightedEdgePair struct { - EdgePair - W float64 -} - -// ReversedEdge returns a new Edge with the end point of the -// edges in the pair swapped. -func (e WeightedEdgePair) ReversedEdge() Edge { - e.EdgePair = e.EdgePair.ReversedEdge().(EdgePair) - return e -} - -// Weight returns the merged edge weights of the two edges. -func (e WeightedEdgePair) Weight() float64 { return e.W } - -// nodeFilterIterator combines two Nodes to produce a single stream of -// unique nodes. -type nodeFilterIterator struct { - a, b Nodes - - // unique indicates the node in b with the key ID is unique. - unique map[int64]bool -} - -func newNodeFilterIterator(a, b Nodes) *nodeFilterIterator { - n := nodeFilterIterator{a: a, b: b, unique: make(map[int64]bool)} - for n.b.Next() { - n.unique[n.b.Node().ID()] = true - } - n.b.Reset() - for n.a.Next() { - n.unique[n.a.Node().ID()] = false - } - n.a.Reset() - return &n -} - -func (n *nodeFilterIterator) Len() int { - return len(n.unique) -} - -func (n *nodeFilterIterator) Next() bool { - n.Len() - if n.a.Next() { - return true - } - for n.b.Next() { - if n.unique[n.b.Node().ID()] { - return true - } - } - return false -} - -func (n *nodeFilterIterator) Node() Node { - if n.a.Len() != 0 { - return n.a.Node() - } - return n.b.Node() -} - -func (n *nodeFilterIterator) Reset() { - n.a.Reset() - n.b.Reset() -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s deleted file mode 100644 index 0a4c14c29..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyinc_amd64.s +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SI // SI = &x - MOVQ y_base+40(FP), DI // DI = &y - MOVQ n+64(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+88(FP), R8 // R8 = ix // Load the first index - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ iy+96(FP), R9 // R9 = iy - SHLQ $4, R9 // R9 *= sizeof(complex128) - LEAQ (SI)(R8*1), SI // SI = &(x[ix]) - LEAQ (DI)(R9*1), DI // DI = &(y[iy]) - MOVQ DI, DX // DX = DI // Separate Read/Write pointers - MOVQ incX+72(FP), R8 // R8 = incX - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ incY+80(FP), R9 // R9 = iy - SHLQ $4, R9 // R9 *= sizeof(complex128) - MOVUPS alpha+0(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS (SI)(R8*1), X4 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVUPS (SI), X6 - MOVUPS (SI)(R8*1), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX), X3 - ADDPD (DX)(R9*1), X5 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDPD (DX), X7 - ADDPD (DX)(R9*1), X9 - MOVUPS X3, (DI) // dst[i] = X_(i+1) - MOVUPS X5, (DI)(R9*1) - LEAQ (DI)(R9*2), DI - MOVUPS X7, (DI) - MOVUPS X9, (DI)(R9*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R9*2), DI // DI = &(DI[incY*2]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DI), X3 - MOVUPS X3, (DI) // y[i] = X_i - ADDQ R8, SI // SI = &(SI[incX]) - ADDQ R9, DI // DI = &(DI[incY]) - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s deleted file mode 100644 index cb57f4bed..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyincto_amd64.s +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+56(FP), SI // SI = &x - MOVQ y_base+80(FP), DX // DX = &y - MOVQ n+104(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+128(FP), R8 // R8 = ix // Load the first index - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ iy+136(FP), R9 // R9 = iy - SHLQ $4, R9 // R9 *= sizeof(complex128) - MOVQ idst+32(FP), R10 // R10 = idst - SHLQ $4, R10 // R10 *= sizeof(complex128) - LEAQ (SI)(R8*1), SI // SI = &(x[ix]) - LEAQ (DX)(R9*1), DX // DX = &(y[iy]) - LEAQ (DI)(R10*1), DI // DI = &(dst[idst]) - MOVQ incX+112(FP), R8 // R8 = incX - SHLQ $4, R8 // R8 *= sizeof(complex128) - MOVQ incY+120(FP), R9 // R9 = incY - SHLQ $4, R9 // R9 *= sizeof(complex128) - MOVQ incDst+24(FP), R10 // R10 = incDst - SHLQ $4, R10 // R10 *= sizeof(complex128) - MOVUPS alpha+40(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS (SI)(R8*1), X4 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - - MOVUPS (SI), X6 - MOVUPS (SI)(R8*1), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX), X3 - ADDPD (DX)(R9*1), X5 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDPD (DX), X7 - ADDPD (DX)(R9*1), X9 - MOVUPS X3, (DI) // dst[i] = X_(i+1) - MOVUPS X5, (DI)(R10*1) - LEAQ (DI)(R10*2), DI - MOVUPS X7, (DI) - MOVUPS X9, (DI)(R10*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst*2]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: // do { - MOVUPS (SI), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX), X3 - MOVUPS X3, (DI) // y[i] X_(i+1) - ADDQ R8, SI // SI += incX - ADDQ R9, DX // DX += incY - ADDQ R10, DI // DI += incDst - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s deleted file mode 100644 index f1fddce71..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitary_amd64.s +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitary(alpha complex128, x, y []complex128) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SI // SI = &x - MOVQ y_base+40(FP), DI // DI = &y - MOVQ x_len+24(FP), CX // CX = min( len(x), len(y) ) - CMPQ y_len+48(FP), CX - CMOVQLE y_len+48(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - PXOR X0, X0 // Clear work registers and cache-align loop - PXOR X1, X1 - MOVUPS alpha+0(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: // do { - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS 16(SI)(AX*8), X4 - MOVUPS 32(SI)(AX*8), X6 - MOVUPS 48(SI)(AX*8), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DI)(AX*8), X3 - ADDPD 16(DI)(AX*8), X5 - ADDPD 32(DI)(AX*8), X7 - ADDPD 48(DI)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX - JNZ caxy_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // do { - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DI)(AX*8), X3 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - ADDQ $2, AX // i += 2 - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s deleted file mode 100644 index b80015fda..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/axpyunitaryto_amd64.s +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVDDUP X2, X3 -#define MOVDDUP_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xDA -// MOVDDUP X4, X5 -#define MOVDDUP_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xEC -// MOVDDUP X6, X7 -#define MOVDDUP_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0x12; BYTE $0xFE -// MOVDDUP X8, X9 -#define MOVDDUP_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC8 - -// ADDSUBPD X2, X3 -#define ADDSUBPD_X2_X3 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA -// ADDSUBPD X4, X5 -#define ADDSUBPD_X4_X5 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC -// ADDSUBPD X6, X7 -#define ADDSUBPD_X6_X7 BYTE $0x66; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE -// ADDSUBPD X8, X9 -#define ADDSUBPD_X8_X9 BYTE $0x66; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitaryTo(dst []complex128, alpha complex64, x, y []complex128) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+40(FP), SI // SI = &x - MOVQ y_base+64(FP), DX // DX = &y - MOVQ x_len+48(FP), CX // CX = min( len(x), len(y), len(dst) ) - CMPQ y_len+72(FP), CX - CMOVQLE y_len+72(FP), CX - CMPQ dst_len+8(FP), CX - CMOVQLE dst_len+8(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - MOVUPS alpha+24(FP), X0 // X0 = { imag(a), real(a) } - MOVAPS X0, X1 - SHUFPD $0x1, X1, X1 // X1 = { real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: // do { - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS 16(SI)(AX*8), X4 - MOVUPS 32(SI)(AX*8), X6 - MOVUPS 48(SI)(AX*8), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 // Load and duplicate imag elements (xi, xi) - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 // duplicate real elements (xr, xr) - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X1, X2 - MULPD X0, X3 - MULPD X11, X4 - MULPD X10, X5 - MULPD X1, X6 - MULPD X0, X7 - MULPD X11, X8 - MULPD X10, X9 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX)(AX*8), X3 - ADDPD 16(DX)(AX*8), X5 - ADDPD 32(DX)(AX*8), X7 - ADDPD 48(DX)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX - JNZ caxy_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // Same calculation, but read in values to avoid trampling memory - MOVUPS (SI)(AX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD X1, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X0, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - // X_(i+1) = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - ADDPD (DX)(AX*8), X3 - MOVUPS X3, (DI)(AX*8) // y[i] = X_(i+1) - ADDQ $2, AX // i += 2 - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go deleted file mode 100644 index 8802ff138..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package c128 provides complex128 vector primitives. -package c128 // import "gonum.org/v1/gonum/internal/asm/c128" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s deleted file mode 100644 index 301d294fa..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcinc_amd64.s +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR__X3 LONG $0x1E120FF2 // MOVDDUP (SI), X3 -#define MOVDDUP_XPTR_INCX__X5 LONG $0x120F42F2; WORD $0x062C // MOVDDUP (SI)(R8*1), X5 -#define MOVDDUP_XPTR_INCX_2__X7 LONG $0x120F42F2; WORD $0x463C // MOVDDUP (SI)(R8*2), X7 -#define MOVDDUP_XPTR_INCx3X__X9 LONG $0x120F46F2; WORD $0x0E0C // MOVDDUP (SI)(R9*1), X9 - -#define MOVDDUP_8_XPTR__X2 LONG $0x56120FF2; BYTE $0x08 // MOVDDUP 8(SI), X2 -#define MOVDDUP_8_XPTR_INCX__X4 LONG $0x120F42F2; WORD $0x0664; BYTE $0x08 // MOVDDUP 8(SI)(R8*1), X4 -#define MOVDDUP_8_XPTR_INCX_2__X6 LONG $0x120F42F2; WORD $0x4674; BYTE $0x08 // MOVDDUP 8(SI)(R8*2), X6 -#define MOVDDUP_8_XPTR_INCx3X__X8 LONG $0x120F46F2; WORD $0x0E44; BYTE $0x08 // MOVDDUP 8(SI)(R9*1), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) -TEXT ·DotcInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ n+48(FP), LEN // LEN = n - PXOR SUM, SUM // SUM = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ ix+72(FP), INC_X // INC_X = ix * sizeof(complex128) - SHLQ $4, INC_X - MOVQ iy+80(FP), INC_Y // INC_Y = iy * sizeof(complex128) - SHLQ $4, INC_Y - LEAQ (X_PTR)(INC_X*1), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*1), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX - SHLQ $4, INC_X // INC_X *= sizeof(complex128) - MOVQ incY+64(FP), INC_Y // INC_Y = incY - SHLQ $4, INC_Y // INC_Y *= sizeof(complex128) - MOVSD $(-1.0), NEG1 - SHUFPD $0, NEG1, NEG1 // { -1, -1 } - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = n % 4 - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ dot_tail // if n <= 4 { goto dot_tail } - MOVAPS NEG1, P_NEG1 // Copy NEG1 to P_NEG1 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = 3 * incX * sizeof(complex128) - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = 3 * incY * sizeof(complex128) - -dot_loop: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_XPTR_INCX__X5 - MOVDDUP_XPTR_INCX_2__X7 - MOVDDUP_XPTR_INCx3X__X9 - - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_8_XPTR_INCX__X4 - MOVDDUP_8_XPTR_INCX_2__X6 - MOVDDUP_8_XPTR_INCx3X__X8 - - // X_i = { -imag(x[i]), -imag(x[i]) } - MULPD NEG1, X2 - MULPD P_NEG1, X4 - MULPD NEG1, X6 - MULPD P_NEG1, X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR), X10 - MOVUPS (Y_PTR)(INC_Y*1), X11 - MOVUPS (Y_PTR)(INC_Y*2), X12 - MOVUPS (Y_PTR)(INCx3_Y*1), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - ADDPD P_SUM, SUM // sum += psum - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD NEG1, X2 // X_i = { -imag(x[i]) , -imag(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // sum += result[i] - ADDQ INC_X, X_PTR // X_PTR += incX - ADDQ INC_Y, Y_PTR // Y_PTR += incY - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVUPS SUM, sum+88(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s deleted file mode 100644 index 1db7e156d..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotcunitary_amd64.s +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR_IDX_8__X3 LONG $0x1C120FF2; BYTE $0xC6 // MOVDDUP (SI)(AX*8), X3 -#define MOVDDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF2; WORD $0x10C6 // MOVDDUP 16(SI)(AX*8), X5 -#define MOVDDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF2; WORD $0x20C6 // MOVDDUP 32(SI)(AX*8), X7 -#define MOVDDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F2; WORD $0xC64C; BYTE $0x30 // MOVDDUP 48(SI)(AX*8), X9 - -#define MOVDDUP_XPTR_IIDX_8__X2 LONG $0x14120FF2; BYTE $0xD6 // MOVDDUP (SI)(DX*8), X2 -#define MOVDDUP_16_XPTR_IIDX_8__X4 LONG $0x64120FF2; WORD $0x10D6 // MOVDDUP 16(SI)(DX*8), X4 -#define MOVDDUP_32_XPTR_IIDX_8__X6 LONG $0x74120FF2; WORD $0x20D6 // MOVDDUP 32(SI)(DX*8), X6 -#define MOVDDUP_48_XPTR_IIDX_8__X8 LONG $0x120F44F2; WORD $0xD644; BYTE $0x30 // MOVDDUP 48(SI)(DX*8), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcUnitary(x, y []complex128) (sum complex128) -TEXT ·DotcUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - PXOR SUM, SUM // sum = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - XORPS P_SUM, P_SUM // psum = 0 - MOVSD $(-1.0), NEG1 - SHUFPD $0, NEG1, NEG1 // { -1, -1 } - XORQ IDX, IDX // i := 0 - MOVQ $1, I_IDX // j := 1 - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = floor( TAIL / 4 ) - SHRQ $2, LEN // LEN = TAIL % 4 - JZ dot_tail // if LEN == 0 { goto dot_tail } - - MOVAPS NEG1, P_NEG1 // Copy NEG1 to P_NEG1 for pipelining - -dot_loop: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_16_XPTR_IDX_8__X5 - MOVDDUP_32_XPTR_IDX_8__X7 - MOVDDUP_48_XPTR_IDX_8__X9 - - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_16_XPTR_IIDX_8__X4 - MOVDDUP_32_XPTR_IIDX_8__X6 - MOVDDUP_48_XPTR_IIDX_8__X8 - - // X_i = { -imag(x[i]), -imag(x[i]) } - MULPD NEG1, X2 - MULPD P_NEG1, X4 - MULPD NEG1, X6 - MULPD P_NEG1, X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - ADDQ $8, I_IDX // I_IDX += 8 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - ADDPD P_SUM, SUM // sum += psum - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i]) , real(x[i]) } - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]) , imag(x[i]) } - MULPD NEG1, X2 // X_i = { -imag(x[i]) , -imag(x[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // SUM += result[i] - ADDQ $2, IDX // IDX += 2 - ADDQ $2, I_IDX // I_IDX += 2 - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVUPS SUM, sum+48(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s deleted file mode 100644 index 386467fcb..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuinc_amd64.s +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR__X3 LONG $0x1E120FF2 // MOVDDUP (SI), X3 -#define MOVDDUP_XPTR_INCX__X5 LONG $0x120F42F2; WORD $0x062C // MOVDDUP (SI)(R8*1), X5 -#define MOVDDUP_XPTR_INCX_2__X7 LONG $0x120F42F2; WORD $0x463C // MOVDDUP (SI)(R8*2), X7 -#define MOVDDUP_XPTR_INCx3X__X9 LONG $0x120F46F2; WORD $0x0E0C // MOVDDUP (SI)(R9*1), X9 - -#define MOVDDUP_8_XPTR__X2 LONG $0x56120FF2; BYTE $0x08 // MOVDDUP 8(SI), X2 -#define MOVDDUP_8_XPTR_INCX__X4 LONG $0x120F42F2; WORD $0x0664; BYTE $0x08 // MOVDDUP 8(SI)(R8*1), X4 -#define MOVDDUP_8_XPTR_INCX_2__X6 LONG $0x120F42F2; WORD $0x4674; BYTE $0x08 // MOVDDUP 8(SI)(R8*2), X6 -#define MOVDDUP_8_XPTR_INCx3X__X8 LONG $0x120F46F2; WORD $0x0E44; BYTE $0x08 // MOVDDUP 8(SI)(R9*1), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 - -// func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) -TEXT ·DotuInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ n+48(FP), LEN // LEN = n - PXOR SUM, SUM // sum = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - MOVQ ix+72(FP), INC_X // INC_X = ix * sizeof(complex128) - SHLQ $4, INC_X - MOVQ iy+80(FP), INC_Y // INC_Y = iy * sizeof(complex128) - SHLQ $4, INC_Y - LEAQ (X_PTR)(INC_X*1), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*1), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX - SHLQ $4, INC_X // INC_X *= sizeof(complex128) - MOVQ incY+64(FP), INC_Y // INC_Y = incY - SHLQ $4, INC_Y // INC_Y *= sizeof(complex128) - MOVQ LEN, TAIL - ANDQ $3, TAIL // LEN = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dot_tail // if LEN <= 4 { goto dot_tail } - PXOR P_SUM, P_SUM // psum = 0 - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = 3 * incX * sizeof(complex128) - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = 3 * incY * sizeof(complex128) - -dot_loop: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_XPTR_INCX__X5 - MOVDDUP_XPTR_INCX_2__X7 - MOVDDUP_XPTR_INCx3X__X9 - - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_8_XPTR_INCX__X4 - MOVDDUP_8_XPTR_INCX_2__X6 - MOVDDUP_8_XPTR_INCx3X__X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR), X10 - MOVUPS (Y_PTR)(INC_Y*1), X11 - MOVUPS (Y_PTR)(INC_Y*2), X12 - MOVUPS (Y_PTR)(INCx3_Y*1), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - - DECQ LEN - JNZ dot_loop // } while --BX > 0 - ADDPD P_SUM, SUM // sum += psum - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_8_XPTR__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // sum += result[i] - ADDQ INC_X, X_PTR // X_PTR += incX - ADDQ INC_Y, Y_PTR // Y_PTR += incY - DECQ TAIL // --TAIL - JNZ dot_tail // } while TAIL > 0 - -dot_end: - MOVUPS SUM, sum+88(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s deleted file mode 100644 index d0d507cdc..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dotuunitary_amd64.s +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_XPTR_IDX_8__X3 LONG $0x1C120FF2; BYTE $0xC6 // MOVDDUP (SI)(AX*8), X3 -#define MOVDDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF2; WORD $0x10C6 // MOVDDUP 16(SI)(AX*8), X5 -#define MOVDDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF2; WORD $0x20C6 // MOVDDUP 32(SI)(AX*8), X7 -#define MOVDDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F2; WORD $0xC64C; BYTE $0x30 // MOVDDUP 48(SI)(AX*8), X9 - -#define MOVDDUP_XPTR_IIDX_8__X2 LONG $0x14120FF2; BYTE $0xD6 // MOVDDUP (SI)(DX*8), X2 -#define MOVDDUP_16_XPTR_IIDX_8__X4 LONG $0x64120FF2; WORD $0x10D6 // MOVDDUP 16(SI)(DX*8), X4 -#define MOVDDUP_32_XPTR_IIDX_8__X6 LONG $0x74120FF2; WORD $0x20D6 // MOVDDUP 32(SI)(DX*8), X6 -#define MOVDDUP_48_XPTR_IIDX_8__X8 LONG $0x120F44F2; WORD $0xD644; BYTE $0x30 // MOVDDUP 48(SI)(DX*8), X8 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX - -// func DotuUnitary(x, y []complex128) (sum complex128) -TEXT ·DotuUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - PXOR SUM, SUM // SUM = 0 - CMPQ LEN, $0 // if LEN == 0 { return } - JE dot_end - PXOR P_SUM, P_SUM // P_SUM = 0 - XORQ IDX, IDX // IDX = 0 - MOVQ $1, DX // j = 1 - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = floor( LEN / 4 ) - SHRQ $2, LEN // LEN = LEN % 4 - JZ dot_tail // if LEN == 0 { goto dot_tail } - -dot_loop: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_16_XPTR_IDX_8__X5 - MOVDDUP_32_XPTR_IDX_8__X7 - MOVDDUP_48_XPTR_IDX_8__X9 - - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]), imag(x[i]) } - MOVDDUP_16_XPTR_IIDX_8__X4 - MOVDDUP_32_XPTR_IIDX_8__X6 - MOVDDUP_48_XPTR_IIDX_8__X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPD X10, X3 - MULPD X11, X5 - MULPD X12, X7 - MULPD X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPD $0x1, X10, X10 - SHUFPD $0x1, X11, X11 - SHUFPD $0x1, X12, X12 - SHUFPD $0x1, X13, X13 - - // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPD X10, X2 - MULPD X11, X4 - MULPD X12, X6 - MULPD X13, X8 - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - // psum += result[i] - ADDPD X3, SUM - ADDPD X5, P_SUM - ADDPD X7, SUM - ADDPD X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - ADDQ $8, I_IDX // I_IDX += 8 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - ADDPD P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVDDUP_XPTR_IDX_8__X3 // X_(i+1) = { real(x[i] , real(x[i]) } - MOVDDUP_XPTR_IIDX_8__X2 // X_i = { imag(x[i]) , imag(x[i]) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]) , real(y[i]) } - MULPD X10, X3 // X_(i+1) = { imag(a) * real(x[i]), real(a) * real(x[i]) } - SHUFPD $0x1, X10, X10 // X_j = { real(y[i]) , imag(y[i]) } - MULPD X10, X2 // X_i = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDPD X3, SUM // psum += result[i] - ADDQ $2, IDX // IDX += 2 - ADDQ $2, I_IDX // I_IDX += 2 - DECQ TAIL // --TAIL - JNZ dot_tail // } while TAIL > 0 - -dot_end: - MOVUPS SUM, sum+48(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s deleted file mode 100644 index 40d5851a6..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalinc_amd64.s +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define TAIL BX -#define INC R9 -#define INC3 R10 -#define ALPHA X0 -#define ALPHA_2 X1 - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // MOVDDUP 8(SP), X0 - -// func DscalInc(alpha float64, x []complex128, n, inc uintptr) -TEXT ·DscalInc(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SRC // SRC = &x - MOVQ n+32(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE dscal_end - - MOVDDUP_ALPHA // ALPHA = alpha - MOVQ inc+40(FP), INC // INC = inc - SHLQ $4, INC // INC = INC * sizeof(complex128) - LEAQ (INC)(INC*2), INC3 // INC3 = 3 * INC - MOVUPS ALPHA, ALPHA_2 // Copy ALPHA and ALPHA_2 for pipelining - MOVQ LEN, TAIL // TAIL = LEN - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ dscal_tail // if LEN == 0 { goto dscal_tail } - -dscal_loop: // do { - MOVUPS (SRC), X2 // X_i = x[i] - MOVUPS (SRC)(INC*1), X3 - MOVUPS (SRC)(INC*2), X4 - MOVUPS (SRC)(INC3*1), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (DST) // x[i] = X_i - MOVUPS X3, (DST)(INC*1) - MOVUPS X4, (DST)(INC*2) - MOVUPS X5, (DST)(INC3*1) - - LEAQ (SRC)(INC*4), SRC // SRC += INC*4 - DECQ LEN - JNZ dscal_loop // } while --LEN > 0 - -dscal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JE dscal_end // if TAIL == 0 { return } - -dscal_tail_loop: // do { - MOVUPS (SRC), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (DST) // x[i] = X_i - ADDQ INC, SRC // SRC += INC - DECQ TAIL - JNZ dscal_tail_loop // } while --TAIL > 0 - -dscal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s deleted file mode 100644 index cbc0768aa..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/dscalunitary_amd64.s +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define IDX AX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // MOVDDUP 8(SP), X0 - -// func DscalUnitary(alpha float64, x []complex128) -TEXT ·DscalUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SRC // SRC = &x - MOVQ x_len+16(FP), LEN // LEN = len(x) - CMPQ LEN, $0 // if LEN == 0 { return } - JE dscal_end - - MOVDDUP_ALPHA // ALPHA = alpha - XORQ IDX, IDX // IDX = 0 - MOVUPS ALPHA, ALPHA_2 // Copy ALPHA to ALPHA_2 for pipelining - MOVQ LEN, TAIL // TAIL = LEN - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ dscal_tail // if LEN == 0 { goto dscal_tail } - -dscal_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(SRC)(IDX*8), X3 - MOVUPS 32(SRC)(IDX*8), X4 - MOVUPS 48(SRC)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (DST)(IDX*8) // x[i] = X_i - MOVUPS X3, 16(DST)(IDX*8) - MOVUPS X4, 32(DST)(IDX*8) - MOVUPS X5, 48(DST)(IDX*8) - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dscal_loop // } while --LEN > 0 - -dscal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JZ dscal_end // if TAIL == 0 { return } - -dscal_tail_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (DST)(IDX*8) // x[i] = X_i - ADDQ $2, IDX // IDX += 2 - DECQ TAIL - JNZ dscal_tail_loop // } while --TAIL > 0 - -dscal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go deleted file mode 100644 index 47a80e50c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scal.go +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package c128 - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []complex128, alpha complex128, x []complex128) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []complex128, incDst uintptr, alpha complex128, x []complex128, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s deleted file mode 100644 index 7b807b3a4..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalUnitary_amd64.s +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define IDX AX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_C X1 -#define ALPHA2 X10 -#define ALPHA_C2 X11 - -#define MOVDDUP_X2_X3 LONG $0xDA120FF2 // MOVDDUP X2, X3 -#define MOVDDUP_X4_X5 LONG $0xEC120FF2 // MOVDDUP X4, X5 -#define MOVDDUP_X6_X7 LONG $0xFE120FF2 // MOVDDUP X6, X7 -#define MOVDDUP_X8_X9 LONG $0x120F45F2; BYTE $0xC8 // MOVDDUP X8, X9 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -// func ScalUnitary(alpha complex128, x []complex128) -TEXT ·ScalUnitary(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SRC // SRC = &x - MOVQ x_len+24(FP), LEN // LEN = len(x) - CMPQ LEN, $0 // if LEN == 0 { return } - JE scal_end - - MOVUPS alpha+0(FP), ALPHA // ALPHA = { imag(alpha), real(alpha) } - MOVAPS ALPHA, ALPHA_C - SHUFPD $0x1, ALPHA_C, ALPHA_C // ALPHA_C = { real(alpha), imag(alpha) } - - XORQ IDX, IDX // IDX = 0 - MOVAPS ALPHA, ALPHA2 // Copy ALPHA and ALPHA_C for pipelining - MOVAPS ALPHA_C, ALPHA_C2 - MOVQ LEN, TAIL - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ scal_tail // if BX == 0 { goto scal_tail } - -scal_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS 16(SRC)(IDX*8), X4 - MOVUPS 32(SRC)(IDX*8), X6 - MOVUPS 48(SRC)(IDX*8), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - MULPD ALPHA_C, X2 - MULPD ALPHA, X3 - MULPD ALPHA_C2, X4 - MULPD ALPHA2, X5 - MULPD ALPHA_C, X6 - MULPD ALPHA, X7 - MULPD ALPHA_C2, X8 - MULPD ALPHA2, X9 - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - MOVUPS X3, (DST)(IDX*8) // x[i] = X_(i+1) - MOVUPS X5, 16(DST)(IDX*8) - MOVUPS X7, 32(DST)(IDX*8) - MOVUPS X9, 48(DST)(IDX*8) - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ scal_loop // } while --LEN > 0 - -scal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JZ scal_end // if TAIL == 0 { return } - -scal_tail_loop: // do { - MOVUPS (SRC)(IDX*8), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD ALPHA_C, X2 // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - MULPD ALPHA, X3 // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - MOVUPS X3, (DST)(IDX*8) // x[i] = X_(i+1) - ADDQ $2, IDX // IDX += 2 - DECQ TAIL - JNZ scal_tail_loop // } while --LEN > 0 - -scal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s deleted file mode 100644 index 7857c1554..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/scalinc_amd64.s +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SRC SI -#define DST SI -#define LEN CX -#define TAIL BX -#define INC R9 -#define INC3 R10 -#define ALPHA X0 -#define ALPHA_C X1 -#define ALPHA2 X10 -#define ALPHA_C2 X11 - -#define MOVDDUP_X2_X3 LONG $0xDA120FF2 // MOVDDUP X2, X3 -#define MOVDDUP_X4_X5 LONG $0xEC120FF2 // MOVDDUP X4, X5 -#define MOVDDUP_X6_X7 LONG $0xFE120FF2 // MOVDDUP X6, X7 -#define MOVDDUP_X8_X9 LONG $0x120F45F2; BYTE $0xC8 // MOVDDUP X8, X9 - -#define ADDSUBPD_X2_X3 LONG $0xDAD00F66 // ADDSUBPD X2, X3 -#define ADDSUBPD_X4_X5 LONG $0xECD00F66 // ADDSUBPD X4, X5 -#define ADDSUBPD_X6_X7 LONG $0xFED00F66 // ADDSUBPD X6, X7 -#define ADDSUBPD_X8_X9 LONG $0xD00F4566; BYTE $0xC8 // ADDSUBPD X8, X9 - -// func ScalInc(alpha complex128, x []complex128, n, inc uintptr) -TEXT ·ScalInc(SB), NOSPLIT, $0 - MOVQ x_base+16(FP), SRC // SRC = &x - MOVQ n+40(FP), LEN // LEN = len(x) - CMPQ LEN, $0 - JE scal_end // if LEN == 0 { return } - - MOVQ inc+48(FP), INC // INC = inc - SHLQ $4, INC // INC = INC * sizeof(complex128) - LEAQ (INC)(INC*2), INC3 // INC3 = 3 * INC - - MOVUPS alpha+0(FP), ALPHA // ALPHA = { imag(alpha), real(alpha) } - MOVAPS ALPHA, ALPHA_C - SHUFPD $0x1, ALPHA_C, ALPHA_C // ALPHA_C = { real(alpha), imag(alpha) } - - MOVAPS ALPHA, ALPHA2 // Copy ALPHA and ALPHA_C for pipelining - MOVAPS ALPHA_C, ALPHA_C2 - MOVQ LEN, TAIL - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ scal_tail // if BX == 0 { goto scal_tail } - -scal_loop: // do { - MOVUPS (SRC), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVUPS (SRC)(INC*1), X4 - MOVUPS (SRC)(INC*2), X6 - MOVUPS (SRC)(INC3*1), X8 - - // X_(i+1) = { real(x[i], real(x[i]) } - MOVDDUP_X2_X3 - MOVDDUP_X4_X5 - MOVDDUP_X6_X7 - MOVDDUP_X8_X9 - - // X_i = { imag(x[i]), imag(x[i]) } - SHUFPD $0x3, X2, X2 - SHUFPD $0x3, X4, X4 - SHUFPD $0x3, X6, X6 - SHUFPD $0x3, X8, X8 - - // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - MULPD ALPHA_C, X2 - MULPD ALPHA, X3 - MULPD ALPHA_C2, X4 - MULPD ALPHA2, X5 - MULPD ALPHA_C, X6 - MULPD ALPHA, X7 - MULPD ALPHA_C2, X8 - MULPD ALPHA2, X9 - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - ADDSUBPD_X4_X5 - ADDSUBPD_X6_X7 - ADDSUBPD_X8_X9 - - MOVUPS X3, (DST) // x[i] = X_(i+1) - MOVUPS X5, (DST)(INC*1) - MOVUPS X7, (DST)(INC*2) - MOVUPS X9, (DST)(INC3*1) - - LEAQ (SRC)(INC*4), SRC // SRC = &(SRC[inc*4]) - DECQ LEN - JNZ scal_loop // } while --BX > 0 - -scal_tail: - ANDQ $3, TAIL // TAIL = TAIL % 4 - JE scal_end // if TAIL == 0 { return } - -scal_tail_loop: // do { - MOVUPS (SRC), X2 // X_i = { imag(x[i]), real(x[i]) } - MOVDDUP_X2_X3 // X_(i+1) = { real(x[i], real(x[i]) } - SHUFPD $0x3, X2, X2 // X_i = { imag(x[i]), imag(x[i]) } - MULPD ALPHA_C, X2 // X_i = { real(ALPHA) * imag(x[i]), imag(ALPHA) * imag(x[i]) } - MULPD ALPHA, X3 // X_(i+1) = { imag(ALPHA) * real(x[i]), real(ALPHA) * real(x[i]) } - - // X_(i+1) = { - // imag(result[i]): imag(ALPHA)*real(x[i]) + real(ALPHA)*imag(x[i]), - // real(result[i]): real(ALPHA)*real(x[i]) - imag(ALPHA)*imag(x[i]) - // } - ADDSUBPD_X2_X3 - - MOVUPS X3, (DST) // x[i] = X_i - ADDQ INC, SRC // SRC = &(SRC[incX]) - DECQ TAIL - JNZ scal_tail_loop // } while --TAIL > 0 - -scal_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go deleted file mode 100644 index ad6b23ca4..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_amd64.go +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package c128 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex128, x, y []complex128) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex128, alpha complex128, x, y []complex128) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) - -// DscalUnitary is -// for i, v := range x { -// x[i] = complex(real(v)*alpha, imag(v)*alpha) -// } -func DscalUnitary(alpha float64, x []complex128) - -// DscalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) -// ix += inc -// } -func DscalInc(alpha float64, x []complex128, n, inc uintptr) - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha complex128, x []complex128, n, inc uintptr) - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha complex128, x []complex128) - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * cmplx.Conj(v) -// } -// return sum -func DotcUnitary(x, y []complex128) (sum complex128) - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * cmplx.Conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex128) (sum complex128) - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go deleted file mode 100644 index 6313e571c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c128/stubs_noasm.go +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package c128 - -import "math/cmplx" - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex128, x, y []complex128) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex128, alpha complex128, x, y []complex128) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex128, incDst, idst uintptr, alpha complex128, x, y []complex128, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} - -// DscalUnitary is -// for i, v := range x { -// x[i] = complex(real(v)*alpha, imag(v)*alpha) -// } -func DscalUnitary(alpha float64, x []complex128) { - for i, v := range x { - x[i] = complex(real(v)*alpha, imag(v)*alpha) - } -} - -// DscalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) -// ix += inc -// } -func DscalInc(alpha float64, x []complex128, n, inc uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) - ix += inc - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha complex128, x []complex128, n, inc uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += inc - } -} - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha complex128, x []complex128) { - for i := range x { - x[i] *= alpha - } -} - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * cmplx.Conj(v) -// } -// return sum -func DotcUnitary(x, y []complex128) (sum complex128) { - for i, v := range x { - sum += y[i] * cmplx.Conj(v) - } - return sum -} - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * cmplx.Conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) { - for i := 0; i < int(n); i++ { - sum += y[iy] * cmplx.Conj(x[ix]) - ix += incX - iy += incY - } - return sum -} - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex128) (sum complex128) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex128, n, incX, incY, ix, iy uintptr) (sum complex128) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s deleted file mode 100644 index 841415dbc..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyinc_amd64.s +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ n+56(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+80(FP), R8 // R8 = ix - MOVQ iy+88(FP), R9 // R9 = iy - LEAQ (SI)(R8*8), SI // SI = &(x[ix]) - LEAQ (DI)(R9*8), DI // DI = &(y[iy]) - MOVQ DI, DX // DX = DI // Read/Write pointers - MOVQ incX+64(FP), R8 // R8 = incX - SHLQ $3, R8 // R8 *= sizeof(complex64) - MOVQ incY+72(FP), R9 // R9 = incY - SHLQ $3, R9 // R9 *= sizeof(complex64) - MOVSD alpha+0(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { 0, 0, real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVSD (SI), X3 // X_i = { imag(x[i+1]), real(x[i+1]) } - MOVSD (SI)(R8*1), X5 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSD (SI), X7 - MOVSD (SI)(R8*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DX), X2 - MOVSD (DX)(R9*1), X4 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - MOVSD (DX), X6 - MOVSD (DX)(R9*1), X8 - ADDPS X2, X3 - ADDPS X4, X5 - ADDPS X6, X7 - ADDPS X8, X9 - - MOVSD X3, (DI) // y[i] = X_i - MOVSD X5, (DI)(R9*1) - LEAQ (DI)(R9*2), DI // DI = &(DI[incDst]) - MOVSD X7, (DI) - MOVSD X9, (DI)(R9*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R9*2), DI // DI = &(DI[incDst]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: // do { - MOVSD (SI), X3 // X_i = { imag(x[i+1]), real(x[i+1]) } - MOVSHDUP_X3_X2 // X_(i-1) = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 // X_i = { imag(x[i]), imag(x[i]) } - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 // (ai*x1r+ar*x1i, ar*x1r-ai*x1i) - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DI), X4 - ADDPS X4, X3 - MOVSD X3, (DI) // y[i] = X_i - ADDQ R8, SI // SI += incX - ADDQ R9, DI // DI += incY - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s deleted file mode 100644 index 5c5228dc2..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyincto_amd64.s +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyIncTo(dst []complex64, incDst, idst uintptr, alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+48(FP), SI // SI = &x - MOVQ y_base+72(FP), DX // DX = &y - MOVQ n+96(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JE axpyi_end - MOVQ ix+120(FP), R8 // Load the first index - MOVQ iy+128(FP), R9 - MOVQ idst+32(FP), R10 - LEAQ (SI)(R8*8), SI // SI = &(x[ix]) - LEAQ (DX)(R9*8), DX // DX = &(y[iy]) - LEAQ (DI)(R10*8), DI // DI = &(dst[idst]) - MOVQ incX+104(FP), R8 // Incrementors*8 for easy iteration (ADDQ) - SHLQ $3, R8 - MOVQ incY+112(FP), R9 - SHLQ $3, R9 - MOVQ incDst+24(FP), R10 - SHLQ $3, R10 - MOVSD alpha+40(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { 0, 0, real(a), imag(a) } - MOVAPS X0, X10 // Copy X0 and X1 for pipelining - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $3, CX // CX = n % 4 - SHRQ $2, BX // BX = floor( n / 4 ) - JZ axpyi_tail // if BX == 0 { goto axpyi_tail } - -axpyi_loop: // do { - MOVSD (SI), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSD (SI)(R8*1), X5 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSD (SI), X7 - MOVSD (SI)(R8*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DX), X2 - MOVSD (DX)(R9*1), X4 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - MOVSD (DX), X6 - MOVSD (DX)(R9*1), X8 - ADDPS X2, X3 - ADDPS X4, X5 - ADDPS X6, X7 - ADDPS X8, X9 - - MOVSD X3, (DI) // y[i] = X_i - MOVSD X5, (DI)(R10*1) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst]) - MOVSD X7, (DI) - MOVSD X9, (DI)(R10*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst]) - DECQ BX - JNZ axpyi_loop // } while --BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE axpyi_end - -axpyi_tail: - MOVSD (SI), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X1, X2 - MULPS X0, X3 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // } - ADDSUBPS_X2_X3 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]) } - MOVSD (DX), X4 - ADDPS X4, X3 - MOVSD X3, (DI) // y[i] = X_i - ADDQ R8, SI // SI += incX - ADDQ R9, DX // DX += incY - ADDQ R10, DI // DI += incDst - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s deleted file mode 100644 index ae744a490..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitary_amd64.s +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitary(alpha complex64, x, y []complex64) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ x_len+16(FP), CX // CX = min( len(x), len(y) ) - CMPQ y_len+40(FP), CX - CMOVQLE y_len+40(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - PXOR X0, X0 // Clear work registers and cache-align loop - PXOR X1, X1 - MOVSD alpha+0(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - SHUFPD $0, X0, X0 // X0 = { imag(a), real(a), imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { real(a), imag(a), real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVQ DI, BX // Align on 16-byte boundary for ADDPS - ANDQ $15, BX // BX = &y & 15 - JZ caxy_no_trim // if BX == 0 { goto caxy_no_trim } - - // Trim first value in unaligned buffer - XORPS X2, X2 // Clear work registers and cache-align loop - XORPS X3, X3 - XORPS X4, X4 - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DI)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // y[i] = X3 - INCQ AX // i++ - DECQ CX // --CX - JZ caxy_end // if CX == 0 { return } - -caxy_no_trim: - MOVAPS X0, X10 // Copy X0 and X1 for pipelineing - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $7, CX // CX = n % 8 - SHRQ $3, BX // BX = floor( n / 8 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: // do { - // X_i = { imag(x[i]), real(x[i]), imag(x[i+1]), real(x[i+1]) } - MOVUPS (SI)(AX*8), X3 - MOVUPS 16(SI)(AX*8), X5 - MOVUPS 32(SI)(AX*8), X7 - MOVUPS 48(SI)(AX*8), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]), - // imag(a) * real(x[i+1]), real(a) * real(x[i+1]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]), - // real(a) * imag(x[i+1]), imag(a) * imag(x[i+1]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // imag(result[i+1]): imag(a)*real(x[i+1]) + real(a)*imag(x[i+1]), - // real(result[i+1]): real(a)*real(x[i+1]) - imag(a)*imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]), - // imag(result[i+1]) + imag(y[i+1]), real(result[i+1]) + real(y[i+1]) } - ADDPS (DI)(AX*8), X3 - ADDPS 16(DI)(AX*8), X5 - ADDPS 32(DI)(AX*8), X7 - ADDPS 48(DI)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i:i+1] = X_i - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX // --BX - JNZ caxy_loop // } while BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // do { - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DI)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // y[i] = X3 - INCQ AX // ++i - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s deleted file mode 100644 index a5d702092..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/axpyunitaryto_amd64.s +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// MOVSHDUP X3, X2 -#define MOVSHDUP_X3_X2 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xD3 -// MOVSLDUP X3, X3 -#define MOVSLDUP_X3_X3 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xDB -// ADDSUBPS X2, X3 -#define ADDSUBPS_X2_X3 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xDA - -// MOVSHDUP X5, X4 -#define MOVSHDUP_X5_X4 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xE5 -// MOVSLDUP X5, X5 -#define MOVSLDUP_X5_X5 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xED -// ADDSUBPS X4, X5 -#define ADDSUBPS_X4_X5 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xEC - -// MOVSHDUP X7, X6 -#define MOVSHDUP_X7_X6 BYTE $0xF3; BYTE $0x0F; BYTE $0x16; BYTE $0xF7 -// MOVSLDUP X7, X7 -#define MOVSLDUP_X7_X7 BYTE $0xF3; BYTE $0x0F; BYTE $0x12; BYTE $0xFF -// ADDSUBPS X6, X7 -#define ADDSUBPS_X6_X7 BYTE $0xF2; BYTE $0x0F; BYTE $0xD0; BYTE $0xFE - -// MOVSHDUP X9, X8 -#define MOVSHDUP_X9_X8 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x16; BYTE $0xC1 -// MOVSLDUP X9, X9 -#define MOVSLDUP_X9_X9 BYTE $0xF3; BYTE $0x45; BYTE $0x0F; BYTE $0x12; BYTE $0xC9 -// ADDSUBPS X8, X9 -#define ADDSUBPS_X8_X9 BYTE $0xF2; BYTE $0x45; BYTE $0x0F; BYTE $0xD0; BYTE $0xC8 - -// func AxpyUnitaryTo(dst []complex64, alpha complex64, x, y []complex64) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+32(FP), SI // SI = &x - MOVQ y_base+56(FP), DX // DX = &y - MOVQ x_len+40(FP), CX - CMPQ y_len+64(FP), CX // CX = min( len(x), len(y), len(dst) ) - CMOVQLE y_len+64(FP), CX - CMPQ dst_len+8(FP), CX - CMOVQLE dst_len+8(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - MOVSD alpha+24(FP), X0 // X0 = { 0, 0, imag(a), real(a) } - SHUFPD $0, X0, X0 // X0 = { imag(a), real(a), imag(a), real(a) } - MOVAPS X0, X1 - SHUFPS $0x11, X1, X1 // X1 = { real(a), imag(a), real(a), imag(a) } - XORQ AX, AX // i = 0 - MOVQ DX, BX // Align on 16-byte boundary for ADDPS - ANDQ $15, BX // BX = &y & 15 - JZ caxy_no_trim // if BX == 0 { goto caxy_no_trim } - - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DX)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // dst[i] = X3 - INCQ AX // i++ - DECQ CX // --CX - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_no_trim: - MOVAPS X0, X10 // Copy X0 and X1 for pipelineing - MOVAPS X1, X11 - MOVQ CX, BX - ANDQ $7, CX // CX = n % 8 - SHRQ $3, BX // BX = floor( n / 8 ) - JZ caxy_tail // if BX == 0 { goto caxy_tail } - -caxy_loop: - // X_i = { imag(x[i]), real(x[i]), imag(x[i+1]), real(x[i+1]) } - MOVUPS (SI)(AX*8), X3 - MOVUPS 16(SI)(AX*8), X5 - MOVUPS 32(SI)(AX*8), X7 - MOVUPS 48(SI)(AX*8), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_i = { imag(a) * real(x[i]), real(a) * real(x[i]), - // imag(a) * real(x[i+1]), real(a) * real(x[i+1]) } - // X_(i-1) = { real(a) * imag(x[i]), imag(a) * imag(x[i]), - // real(a) * imag(x[i+1]), imag(a) * imag(x[i+1]) } - MULPS X1, X2 - MULPS X0, X3 - MULPS X11, X4 - MULPS X10, X5 - MULPS X1, X6 - MULPS X0, X7 - MULPS X11, X8 - MULPS X10, X9 - - // X_i = { - // imag(result[i]): imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(result[i]): real(a)*real(x[i]) - imag(a)*imag(x[i]), - // imag(result[i+1]): imag(a)*real(x[i+1]) + real(a)*imag(x[i+1]), - // real(result[i+1]): real(a)*real(x[i+1]) - imag(a)*imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // X_i = { imag(result[i]) + imag(y[i]), real(result[i]) + real(y[i]), - // imag(result[i+1]) + imag(y[i+1]), real(result[i+1]) + real(y[i+1]) } - ADDPS (DX)(AX*8), X3 - ADDPS 16(DX)(AX*8), X5 - ADDPS 32(DX)(AX*8), X7 - ADDPS 48(DX)(AX*8), X9 - MOVUPS X3, (DI)(AX*8) // y[i:i+1] = X_i - MOVUPS X5, 16(DI)(AX*8) - MOVUPS X7, 32(DI)(AX*8) - MOVUPS X9, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - DECQ BX // --BX - JNZ caxy_loop // } while BX > 0 - CMPQ CX, $0 // if CX == 0 { return } - JE caxy_end - -caxy_tail: // do { - MOVSD (SI)(AX*8), X3 // X3 = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X2 = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X3 = { real(x[i]), real(x[i]) } - MULPS X1, X2 // X2 = { real(a) * imag(x[i]), imag(a) * imag(x[i]) } - MULPS X0, X3 // X3 = { imag(a) * real(x[i]), real(a) * real(x[i]) } - - // X3 = { imag(a)*real(x[i]) + real(a)*imag(x[i]), - // real(a)*real(x[i]) - imag(a)*imag(x[i]) } - ADDSUBPS_X2_X3 - MOVSD (DX)(AX*8), X4 // X3 += y[i] - ADDPS X4, X3 - MOVSD X3, (DI)(AX*8) // y[i] = X3 - INCQ AX // ++i - LOOP caxy_tail // } while --CX > 0 - -caxy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go deleted file mode 100644 index 910e1e5c7..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/conj.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package c64 - -func conj(c complex64) complex64 { return complex(real(c), -imag(c)) } diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go deleted file mode 100644 index 35f1b2a26..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package c64 provides complex64 vector primitives. -package c64 // import "gonum.org/v1/gonum/internal/asm/c64" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s deleted file mode 100644 index 87de31d32..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcinc_amd64.s +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSHDUP_X5_X4 LONG $0xE5160FF3 // MOVSHDUP X5, X4 -#define MOVSHDUP_X7_X6 LONG $0xF7160FF3 // MOVSHDUP X7, X6 -#define MOVSHDUP_X9_X8 LONG $0x160F45F3; BYTE $0xC1 // MOVSHDUP X9, X8 - -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 -#define MOVSLDUP_X5_X5 LONG $0xED120FF3 // MOVSLDUP X5, X5 -#define MOVSLDUP_X7_X7 LONG $0xFF120FF3 // MOVSLDUP X7, X7 -#define MOVSLDUP_X9_X9 LONG $0x120F45F3; BYTE $0xC9 // MOVSLDUP X9, X9 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) -TEXT ·DotcInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ n+48(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotc_end - MOVQ ix+72(FP), INC_X - MOVQ iy+80(FP), INC_Y - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX * sizeof(complex64) - SHLQ $3, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y = incY * sizeof(complex64) - SHLQ $3, INC_Y - MOVSS $(-1.0), NEG1 - SHUFPS $0, NEG1, NEG1 // { -1, -1, -1, -1 } - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dotc_tail // if LEN == 0 { goto dotc_tail } - - MOVUPS NEG1, P_NEG1 // Copy NEG1 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dotc_loop: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSD (X_PTR)(INC_X*1), X5 - MOVSD (X_PTR)(INC_X*2), X7 - MOVSD (X_PTR)(INCx3_X*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_(i-1) = { -imag(x[i]), -imag(x[i]) } - MULPS NEG1, X2 - MULPS P_NEG1, X4 - MULPS NEG1, X6 - MULPS P_NEG1, X8 - - // X_j = { imag(y[i]), real(y[i]) } - MOVSD (Y_PTR), X10 - MOVSD (Y_PTR)(INC_Y*1), X11 - MOVSD (Y_PTR)(INC_Y*2), X12 - MOVSD (Y_PTR)(INCx3_Y*1), X13 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]) } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y*4]) - - DECQ LEN - JNZ dotc_loop // } while --LEN > 0 - - ADDPS P_SUM, SUM // SUM = { P_SUM + SUM } - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotc_end - -dotc_tail: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - ADDPS X3, SUM // SUM += X_i - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dotc_tail // } while --TAIL > 0 - -dotc_end: - MOVSD SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s deleted file mode 100644 index d53479ca4..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotcunitary_amd64.s +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSLDUP_XPTR_IDX_8__X3 LONG $0x1C120FF3; BYTE $0xC6 // MOVSLDUP (SI)(AX*8), X3 -#define MOVSLDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF3; WORD $0x10C6 // MOVSLDUP 16(SI)(AX*8), X5 -#define MOVSLDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF3; WORD $0x20C6 // MOVSLDUP 32(SI)(AX*8), X7 -#define MOVSLDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F3; WORD $0xC64C; BYTE $0x30 // MOVSLDUP 48(SI)(AX*8), X9 - -#define MOVSHDUP_XPTR_IDX_8__X2 LONG $0x14160FF3; BYTE $0xC6 // MOVSHDUP (SI)(AX*8), X2 -#define MOVSHDUP_16_XPTR_IDX_8__X4 LONG $0x64160FF3; WORD $0x10C6 // MOVSHDUP 16(SI)(AX*8), X4 -#define MOVSHDUP_32_XPTR_IDX_8__X6 LONG $0x74160FF3; WORD $0x20C6 // MOVSHDUP 32(SI)(AX*8), X6 -#define MOVSHDUP_48_XPTR_IDX_8__X8 LONG $0x160F44F3; WORD $0xC644; BYTE $0x30 // MOVSHDUP 48(SI)(AX*8), X8 - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotcUnitary(x, y []complex64) (sum complex64) -TEXT ·DotcUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotc_end - XORQ IDX, IDX // i = 0 - MOVSS $(-1.0), NEG1 - SHUFPS $0, NEG1, NEG1 // { -1, -1, -1, -1 } - - MOVQ X_PTR, DX - ANDQ $15, DX // DX = &x & 15 - JZ dotc_aligned // if DX == 0 { goto dotc_aligned } - - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - MOVAPS X3, SUM // SUM = X_i - INCQ IDX // IDX++ - DECQ LEN // LEN-- - JZ dotc_ret // if LEN == 0 { goto dotc_ret } - -dotc_aligned: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ dotc_tail // if LEN == 0 { return } - MOVUPS NEG1, P_NEG1 // Copy NEG1 for pipelining - -dotc_loop: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_16_XPTR_IDX_8__X5 - MOVSLDUP_32_XPTR_IDX_8__X7 - MOVSLDUP_48_XPTR_IDX_8__X9 - - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i+1]), imag(x[i+1]) } - MOVSHDUP_16_XPTR_IDX_8__X4 - MOVSHDUP_32_XPTR_IDX_8__X6 - MOVSHDUP_48_XPTR_IDX_8__X8 - - // X_j = { imag(y[i]), real(y[i]), imag(y[i+1]), real(y[i+1]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_(i-1) = { -imag(x[i]), -imag(x[i]), -imag(x[i]+1), -imag(x[i]+1) } - MULPS NEG1, X2 - MULPS P_NEG1, X4 - MULPS NEG1, X6 - MULPS P_NEG1, X8 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]), - // imag(y[i+1]) * real(x[i+1]), real(y[i+1]) * real(x[i+1]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]), real(y[i+1]), imag(y[i+1]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]), - // real(y[i+1]) * imag(x[i+1]), imag(y[i+1]) * imag(x[i+1]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]), - // imag(result[i+1]): imag(y[i+1]) * real(x[i+1]) + real(y[i+1]) * imag(x[i+1]), - // real(result[i+1]): real(y[i+1]) * real(x[i+1]) - imag(y[i+1]) * imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dotc_loop // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotc_end - -dotc_tail: - MOVQ TAIL, LEN - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ dotc_tail_one // if LEN == 0 { goto dotc_tail_one } - -dotc_tail_two: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0xB1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - - ADDQ $2, IDX // IDX += 2 - DECQ LEN - JNZ dotc_tail_two // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - ANDQ $1, TAIL - JZ dotc_end - -dotc_tail_one: - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS NEG1, X2 // X_(i-1) = { -imag(x[i]), imag(x[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - -dotc_end: - ADDPS P_SUM, SUM // SUM = { P_SUM[0] + SUM[0] } - MOVHLPS P_SUM, P_SUM // P_SUM = { P_SUM[1], P_SUM[1] } - ADDPS P_SUM, SUM // SUM = { P_SUM[1] + SUM[0] } - -dotc_ret: - MOVSD SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s deleted file mode 100644 index bdee59bec..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuinc_amd64.s +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSHDUP_X5_X4 LONG $0xE5160FF3 // MOVSHDUP X5, X4 -#define MOVSHDUP_X7_X6 LONG $0xF7160FF3 // MOVSHDUP X7, X6 -#define MOVSHDUP_X9_X8 LONG $0x160F45F3; BYTE $0xC1 // MOVSHDUP X9, X8 - -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 -#define MOVSLDUP_X5_X5 LONG $0xED120FF3 // MOVSLDUP X5, X5 -#define MOVSLDUP_X7_X7 LONG $0xFF120FF3 // MOVSLDUP X7, X7 -#define MOVSLDUP_X9_X9 LONG $0x120F45F3; BYTE $0xC9 // MOVSLDUP X9, X9 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define INC_X R8 -#define INCx3_X R9 -#define INC_Y R10 -#define INCx3_Y R11 - -// func DotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) -TEXT ·DotuInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ n+48(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotu_end - MOVQ ix+72(FP), INC_X - MOVQ iy+80(FP), INC_Y - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(X_PTR[ix]) - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(Y_PTR[iy]) - MOVQ incX+56(FP), INC_X // INC_X = incX * sizeof(complex64) - SHLQ $3, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y = incY * sizeof(complex64) - SHLQ $3, INC_Y - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dotu_tail // if TAIL == 0 { goto dotu_tail } - - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dotu_loop: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSD (X_PTR)(INC_X*1), X5 - MOVSD (X_PTR)(INC_X*2), X7 - MOVSD (X_PTR)(INCx3_X*1), X9 - - // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSHDUP_X3_X2 - MOVSHDUP_X5_X4 - MOVSHDUP_X7_X6 - MOVSHDUP_X9_X8 - - // X_i = { real(x[i]), real(x[i]) } - MOVSLDUP_X3_X3 - MOVSLDUP_X5_X5 - MOVSLDUP_X7_X7 - MOVSLDUP_X9_X9 - - // X_j = { imag(y[i]), real(y[i]) } - MOVSD (Y_PTR), X10 - MOVSD (Y_PTR)(INC_Y*1), X11 - MOVSD (Y_PTR)(INC_Y*2), X12 - MOVSD (Y_PTR)(INCx3_Y*1), X13 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]) } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y*4]) - - DECQ LEN - JNZ dotu_loop // } while --LEN > 0 - - ADDPS P_SUM, SUM // SUM = { P_SUM + SUM } - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotu_end - -dotu_tail: // do { - MOVSD (X_PTR), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVUPS (Y_PTR), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - ADDPS X3, SUM // SUM += X_i - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dotu_tail // } while --TAIL > 0 - -dotu_end: - MOVSD SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s deleted file mode 100644 index dce83a467..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/dotuunitary_amd64.s +++ /dev/null @@ -1,197 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVSLDUP_XPTR_IDX_8__X3 LONG $0x1C120FF3; BYTE $0xC6 // MOVSLDUP (SI)(AX*8), X3 -#define MOVSLDUP_16_XPTR_IDX_8__X5 LONG $0x6C120FF3; WORD $0x10C6 // MOVSLDUP 16(SI)(AX*8), X5 -#define MOVSLDUP_32_XPTR_IDX_8__X7 LONG $0x7C120FF3; WORD $0x20C6 // MOVSLDUP 32(SI)(AX*8), X7 -#define MOVSLDUP_48_XPTR_IDX_8__X9 LONG $0x120F44F3; WORD $0xC64C; BYTE $0x30 // MOVSLDUP 48(SI)(AX*8), X9 - -#define MOVSHDUP_XPTR_IDX_8__X2 LONG $0x14160FF3; BYTE $0xC6 // MOVSHDUP (SI)(AX*8), X2 -#define MOVSHDUP_16_XPTR_IDX_8__X4 LONG $0x64160FF3; WORD $0x10C6 // MOVSHDUP 16(SI)(AX*8), X4 -#define MOVSHDUP_32_XPTR_IDX_8__X6 LONG $0x74160FF3; WORD $0x20C6 // MOVSHDUP 32(SI)(AX*8), X6 -#define MOVSHDUP_48_XPTR_IDX_8__X8 LONG $0x160F44F3; WORD $0xC644; BYTE $0x30 // MOVSHDUP 48(SI)(AX*8), X8 - -#define MOVSHDUP_X3_X2 LONG $0xD3160FF3 // MOVSHDUP X3, X2 -#define MOVSLDUP_X3_X3 LONG $0xDB120FF3 // MOVSLDUP X3, X3 - -#define ADDSUBPS_X2_X3 LONG $0xDAD00FF2 // ADDSUBPS X2, X3 -#define ADDSUBPS_X4_X5 LONG $0xECD00FF2 // ADDSUBPS X4, X5 -#define ADDSUBPS_X6_X7 LONG $0xFED00FF2 // ADDSUBPS X6, X7 -#define ADDSUBPS_X8_X9 LONG $0xD00F45F2; BYTE $0xC8 // ADDSUBPS X8, X9 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define SUM X0 -#define P_SUM X1 -#define IDX AX -#define I_IDX DX -#define NEG1 X15 -#define P_NEG1 X14 - -// func DotuUnitary(x, y []complex64) (sum complex64) -TEXT ·DotuUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - PXOR P_SUM, P_SUM // P_SUM = 0 - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return } - JE dotu_end - XORQ IDX, IDX // IDX = 0 - - MOVQ X_PTR, DX - ANDQ $15, DX // DX = &x & 15 - JZ dotu_aligned // if DX == 0 { goto dotu_aligned } - - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - MOVAPS X3, SUM // SUM = X_i - INCQ IDX // IDX++ - DECQ LEN // LEN-- - JZ dotu_end // if LEN == 0 { goto dotu_end } - -dotu_aligned: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ dotu_tail // if LEN == 0 { goto dotu_tail } - PXOR P_SUM, P_SUM - -dotu_loop: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSLDUP_16_XPTR_IDX_8__X5 - MOVSLDUP_32_XPTR_IDX_8__X7 - MOVSLDUP_48_XPTR_IDX_8__X9 - - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVSHDUP_16_XPTR_IDX_8__X4 - MOVSHDUP_32_XPTR_IDX_8__X6 - MOVSHDUP_48_XPTR_IDX_8__X8 - - // X_j = { imag(y[i]), real(y[i]), imag(y[i+1]), real(y[i+1]) } - MOVUPS (Y_PTR)(IDX*8), X10 - MOVUPS 16(Y_PTR)(IDX*8), X11 - MOVUPS 32(Y_PTR)(IDX*8), X12 - MOVUPS 48(Y_PTR)(IDX*8), X13 - - // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]), - // imag(y[i+1]) * real(x[i+1]), real(y[i+1]) * real(x[i+1]) } - MULPS X10, X3 - MULPS X11, X5 - MULPS X12, X7 - MULPS X13, X9 - - // X_j = { real(y[i]), imag(y[i]), real(y[i+1]), imag(y[i+1]) } - SHUFPS $0xB1, X10, X10 - SHUFPS $0xB1, X11, X11 - SHUFPS $0xB1, X12, X12 - SHUFPS $0xB1, X13, X13 - - // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]), - // real(y[i+1]) * imag(x[i+1]), imag(y[i+1]) * imag(x[i+1]) } - MULPS X10, X2 - MULPS X11, X4 - MULPS X12, X6 - MULPS X13, X8 - - // X_i = { - // imag(result[i]): imag(y[i]) * real(x[i]) + real(y[i]) * imag(x[i]), - // real(result[i]): real(y[i]) * real(x[i]) - imag(y[i]) * imag(x[i]), - // imag(result[i+1]): imag(y[i+1]) * real(x[i+1]) + real(y[i+1]) * imag(x[i+1]), - // real(result[i+1]): real(y[i+1]) * real(x[i+1]) - imag(y[i+1]) * imag(x[i+1]), - // } - ADDSUBPS_X2_X3 - ADDSUBPS_X4_X5 - ADDSUBPS_X6_X7 - ADDSUBPS_X8_X9 - - // SUM += X_i - ADDPS X3, SUM - ADDPS X5, P_SUM - ADDPS X7, SUM - ADDPS X9, P_SUM - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dotu_loop // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dotu_end - -dotu_tail: - MOVQ TAIL, LEN - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ dotu_tail_one // if LEN == 0 { goto dotc_tail_one } - -dotu_tail_two: // do { - MOVSLDUP_XPTR_IDX_8__X3 // X_i = { real(x[i]), real(x[i]), real(x[i+1]), real(x[i+1]) } - MOVSHDUP_XPTR_IDX_8__X2 // X_(i-1) = { imag(x[i]), imag(x[i]), imag(x[i]+1), imag(x[i]+1) } - MOVUPS (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0xB1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - - ADDQ $2, IDX // IDX += 2 - DECQ LEN - JNZ dotu_tail_two // } while --LEN > 0 - - ADDPS SUM, P_SUM // P_SUM = { P_SUM[1] + SUM[1], P_SUM[0] + SUM[0] } - XORPS SUM, SUM // SUM = 0 - - ANDQ $1, TAIL - JZ dotu_end - -dotu_tail_one: - MOVSD (X_PTR)(IDX*8), X3 // X_i = { imag(x[i]), real(x[i]) } - MOVSHDUP_X3_X2 // X_(i-1) = { imag(x[i]), imag(x[i]) } - MOVSLDUP_X3_X3 // X_i = { real(x[i]), real(x[i]) } - MOVSD (Y_PTR)(IDX*8), X10 // X_j = { imag(y[i]), real(y[i]) } - MULPS X10, X3 // X_i = { imag(y[i]) * real(x[i]), real(y[i]) * real(x[i]) } - SHUFPS $0x1, X10, X10 // X_j = { real(y[i]), imag(y[i]) } - MULPS X10, X2 // X_(i-1) = { real(y[i]) * imag(x[i]), imag(y[i]) * imag(x[i]) } - - // X_i = { - // imag(result[i]): imag(y[i])*real(x[i]) + real(y[i])*imag(x[i]), - // real(result[i]): real(y[i])*real(x[i]) - imag(y[i])*imag(x[i]) } - ADDSUBPS_X2_X3 - - ADDPS X3, SUM // SUM += X_i - -dotu_end: - ADDPS P_SUM, SUM // SUM = { P_SUM[0] + SUM[0] } - MOVHLPS P_SUM, P_SUM // P_SUM = { P_SUM[1], P_SUM[1] } - ADDPS P_SUM, SUM // SUM = { P_SUM[1] + SUM[0] } - -dotu_ret: - MOVSD SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go deleted file mode 100644 index a84def876..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/scal.go +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package c64 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha complex64, x []complex64) { - for i := range x { - x[i] *= alpha - } -} - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []complex64, alpha complex64, x []complex64) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha complex64, x []complex64, n, incX uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += incX - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []complex64, incDst uintptr, alpha complex64, x []complex64, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} - -// SscalUnitary is -// for i, v := range x { -// x[i] = complex(real(v)*alpha, imag(v)*alpha) -// } -func SscalUnitary(alpha float32, x []complex64) { - for i, v := range x { - x[i] = complex(real(v)*alpha, imag(v)*alpha) - } -} - -// SscalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) -// ix += inc -// } -func SscalInc(alpha float32, x []complex64, n, inc uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] = complex(real(x[ix])*alpha, imag(x[ix])*alpha) - ix += inc - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go deleted file mode 100644 index 3e12d6bcd..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_amd64.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package c64 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex64, x, y []complex64) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex64, alpha complex64, x, y []complex64) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex64, incDst, idst uintptr, alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * conj(v) -// } -// return sum -func DotcUnitary(x, y []complex64) (sum complex64) - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex64) (sum complex64) - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go deleted file mode 100644 index 411afcb2a..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/c64/stubs_noasm.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package c64 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha complex64, x, y []complex64) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []complex64, alpha complex64, x, y []complex64) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []complex64, incDst, idst uintptr, alpha complex64, x, y []complex64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} - -// DotcUnitary is -// for i, v := range x { -// sum += y[i] * conj(v) -// } -// return sum -func DotcUnitary(x, y []complex64) (sum complex64) { - for i, v := range x { - sum += y[i] * conj(v) - } - return sum -} - -// DotcInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * conj(x[ix]) -// ix += incX -// iy += incY -// } -// return sum -func DotcInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) { - for i := 0; i < int(n); i++ { - sum += y[iy] * conj(x[ix]) - ix += incX - iy += incY - } - return sum -} - -// DotuUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotuUnitary(x, y []complex64) (sum complex64) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotuInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotuInc(x, y []complex64, n, incX, incY, ix, iy uintptr) (sum complex64) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s deleted file mode 100644 index 2d167c08f..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyinc_amd64.s +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ n+56(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JLE axpyi_end - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ ix+80(FP), R8 // R8 = ix - MOVQ iy+88(FP), R9 // R9 = iy - LEAQ (SI)(R8*4), SI // SI = &(x[ix]) - LEAQ (DI)(R9*4), DI // DI = &(y[iy]) - MOVQ DI, DX // DX = DI Read Pointer for y - MOVQ incX+64(FP), R8 // R8 = incX - SHLQ $2, R8 // R8 *= sizeof(float32) - MOVQ incY+72(FP), R9 // R9 = incY - SHLQ $2, R9 // R9 *= sizeof(float32) - MOVSS alpha+0(FP), X0 // X0 = alpha - MOVSS X0, X1 // X1 = X0 // for pipelining - MOVQ CX, BX - ANDQ $3, BX // BX = n % 4 - SHRQ $2, CX // CX = floor( n / 4 ) - JZ axpyi_tail_start // if CX == 0 { goto axpyi_tail_start } - -axpyi_loop: // Loop unrolled 4x do { - MOVSS (SI), X2 // X_i = x[i] - MOVSS (SI)(R8*1), X3 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSS (SI), X4 - MOVSS (SI)(R8*1), X5 - MULSS X1, X2 // X_i *= a - MULSS X0, X3 - MULSS X1, X4 - MULSS X0, X5 - ADDSS (DX), X2 // X_i += y[i] - ADDSS (DX)(R9*1), X3 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDSS (DX), X4 - ADDSS (DX)(R9*1), X5 - MOVSS X2, (DI) // y[i] = X_i - MOVSS X3, (DI)(R9*1) - LEAQ (DI)(R9*2), DI // DI = &(DI[incY*2]) - MOVSS X4, (DI) - MOVSS X5, (DI)(R9*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) // Increment addresses - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R9*2), DI // DI = &(DI[incY*2]) - LOOP axpyi_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpyi_end - -axpyi_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -axpyi_tail: // do { - MOVSS (SI), X2 // X2 = x[i] - MULSS X1, X2 // X2 *= a - ADDSS (DI), X2 // X2 += y[i] - MOVSS X2, (DI) // y[i] = X2 - ADDQ R8, SI // SI = &(SI[incX]) - ADDQ R9, DI // DI = &(DI[incY]) - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s deleted file mode 100644 index b79f9926c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyincto_amd64.s +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ n+96(FP), CX // CX = n - CMPQ CX, $0 // if n==0 { return } - JLE axpyi_end - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+48(FP), SI // SI = &x - MOVQ y_base+72(FP), DX // DX = &y - MOVQ ix+120(FP), R8 // R8 = ix // Load the first index - MOVQ iy+128(FP), R9 // R9 = iy - MOVQ idst+32(FP), R10 // R10 = idst - LEAQ (SI)(R8*4), SI // SI = &(x[ix]) - LEAQ (DX)(R9*4), DX // DX = &(y[iy]) - LEAQ (DI)(R10*4), DI // DI = &(dst[idst]) - MOVQ incX+104(FP), R8 // R8 = incX - SHLQ $2, R8 // R8 *= sizeof(float32) - MOVQ incY+112(FP), R9 // R9 = incY - SHLQ $2, R9 // R9 *= sizeof(float32) - MOVQ incDst+24(FP), R10 // R10 = incDst - SHLQ $2, R10 // R10 *= sizeof(float32) - MOVSS alpha+40(FP), X0 // X0 = alpha - MOVSS X0, X1 // X1 = X0 // for pipelining - MOVQ CX, BX - ANDQ $3, BX // BX = n % 4 - SHRQ $2, CX // CX = floor( n / 4 ) - JZ axpyi_tail_start // if CX == 0 { goto axpyi_tail_start } - -axpyi_loop: // Loop unrolled 4x do { - MOVSS (SI), X2 // X_i = x[i] - MOVSS (SI)(R8*1), X3 - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) - MOVSS (SI), X4 - MOVSS (SI)(R8*1), X5 - MULSS X1, X2 // X_i *= a - MULSS X0, X3 - MULSS X1, X4 - MULSS X0, X5 - ADDSS (DX), X2 // X_i += y[i] - ADDSS (DX)(R9*1), X3 - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - ADDSS (DX), X4 - ADDSS (DX)(R9*1), X5 - MOVSS X2, (DI) // dst[i] = X_i - MOVSS X3, (DI)(R10*1) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst*2]) - MOVSS X4, (DI) - MOVSS X5, (DI)(R10*1) - LEAQ (SI)(R8*2), SI // SI = &(SI[incX*2]) // Increment addresses - LEAQ (DX)(R9*2), DX // DX = &(DX[incY*2]) - LEAQ (DI)(R10*2), DI // DI = &(DI[incDst*2]) - LOOP axpyi_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpyi_end - -axpyi_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -axpyi_tail: // do { - MOVSS (SI), X2 // X2 = x[i] - MULSS X1, X2 // X2 *= a - ADDSS (DX), X2 // X2 += y[i] - MOVSS X2, (DI) // dst[i] = X2 - ADDQ R8, SI // SI = &(SI[incX]) - ADDQ R9, DX // DX = &(DX[incY]) - ADDQ R10, DI // DI = &(DI[incY]) - LOOP axpyi_tail // } while --CX > 0 - -axpyi_end: - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s deleted file mode 100644 index 97df90a07..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitary_amd64.s +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyUnitary(alpha float32, x, y []float32) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ y_base+32(FP), DI // DI = &y - MOVQ x_len+16(FP), BX // BX = min( len(x), len(y) ) - CMPQ y_len+40(FP), BX - CMOVQLE y_len+40(FP), BX - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - MOVSS alpha+0(FP), X0 - SHUFPS $0, X0, X0 // X0 = { a, a, a, a } - XORQ AX, AX // i = 0 - PXOR X2, X2 // 2 NOP instructions (PXOR) to align - PXOR X3, X3 // loop to cache line - MOVQ DI, CX - ANDQ $0xF, CX // Align on 16-byte boundary for ADDPS - JZ axpy_no_trim // if CX == 0 { goto axpy_no_trim } - - XORQ $0xF, CX // CX = 4 - floor( BX % 16 / 4 ) - INCQ CX - SHRQ $2, CX - -axpy_align: // Trim first value(s) in unaligned buffer do { - MOVSS (SI)(AX*4), X2 // X2 = x[i] - MULSS X0, X2 // X2 *= a - ADDSS (DI)(AX*4), X2 // X2 += y[i] - MOVSS X2, (DI)(AX*4) // y[i] = X2 - INCQ AX // i++ - DECQ BX - JZ axpy_end // if --BX == 0 { return } - LOOP axpy_align // } while --CX > 0 - -axpy_no_trim: - MOVUPS X0, X1 // Copy X0 to X1 for pipelining - MOVQ BX, CX - ANDQ $0xF, BX // BX = len % 16 - SHRQ $4, CX // CX = int( len / 16 ) - JZ axpy_tail4_start // if CX == 0 { return } - -axpy_loop: // Loop unrolled 16x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i:i+4] - MOVUPS 16(SI)(AX*4), X3 - MOVUPS 32(SI)(AX*4), X4 - MOVUPS 48(SI)(AX*4), X5 - MULPS X0, X2 // X2 *= a - MULPS X1, X3 - MULPS X0, X4 - MULPS X1, X5 - ADDPS (DI)(AX*4), X2 // X2 += y[i:i+4] - ADDPS 16(DI)(AX*4), X3 - ADDPS 32(DI)(AX*4), X4 - ADDPS 48(DI)(AX*4), X5 - MOVUPS X2, (DI)(AX*4) // dst[i:i+4] = X2 - MOVUPS X3, 16(DI)(AX*4) - MOVUPS X4, 32(DI)(AX*4) - MOVUPS X5, 48(DI)(AX*4) - ADDQ $16, AX // i += 16 - LOOP axpy_loop // while (--CX) > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - -axpy_tail4_start: // Reset loop counter for 4-wide tail loop - MOVQ BX, CX // CX = floor( BX / 4 ) - SHRQ $2, CX - JZ axpy_tail_start // if CX == 0 { goto axpy_tail_start } - -axpy_tail4: // Loop unrolled 4x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i] - MULPS X0, X2 // X2 *= a - ADDPS (DI)(AX*4), X2 // X2 += y[i] - MOVUPS X2, (DI)(AX*4) // y[i] = X2 - ADDQ $4, AX // i += 4 - LOOP axpy_tail4 // } while --CX > 0 - -axpy_tail_start: // Reset loop counter for 1-wide tail loop - MOVQ BX, CX // CX = BX % 4 - ANDQ $3, CX - JZ axpy_end // if CX == 0 { return } - -axpy_tail: - MOVSS (SI)(AX*4), X1 // X1 = x[i] - MULSS X0, X1 // X1 *= a - ADDSS (DI)(AX*4), X1 // X1 += y[i] - MOVSS X1, (DI)(AX*4) // y[i] = X1 - INCQ AX // i++ - LOOP axpy_tail // } while --CX > 0 - -axpy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s deleted file mode 100644 index a826ca312..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/axpyunitaryto_amd64.s +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ x_base+32(FP), SI // SI = &x - MOVQ y_base+56(FP), DX // DX = &y - MOVQ x_len+40(FP), BX // BX = min( len(x), len(y), len(dst) ) - CMPQ y_len+64(FP), BX - CMOVQLE y_len+64(FP), BX - CMPQ dst_len+8(FP), BX - CMOVQLE dst_len+8(FP), BX - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - MOVSS alpha+24(FP), X0 - SHUFPS $0, X0, X0 // X0 = { a, a, a, a, } - XORQ AX, AX // i = 0 - MOVQ DX, CX - ANDQ $0xF, CX // Align on 16-byte boundary for ADDPS - JZ axpy_no_trim // if CX == 0 { goto axpy_no_trim } - - XORQ $0xF, CX // CX = 4 - floor ( B % 16 / 4 ) - INCQ CX - SHRQ $2, CX - -axpy_align: // Trim first value(s) in unaligned buffer do { - MOVSS (SI)(AX*4), X2 // X2 = x[i] - MULSS X0, X2 // X2 *= a - ADDSS (DX)(AX*4), X2 // X2 += y[i] - MOVSS X2, (DI)(AX*4) // y[i] = X2 - INCQ AX // i++ - DECQ BX - JZ axpy_end // if --BX == 0 { return } - LOOP axpy_align // } while --CX > 0 - -axpy_no_trim: - MOVUPS X0, X1 // Copy X0 to X1 for pipelining - MOVQ BX, CX - ANDQ $0xF, BX // BX = len % 16 - SHRQ $4, CX // CX = floor( len / 16 ) - JZ axpy_tail4_start // if CX == 0 { return } - -axpy_loop: // Loop unrolled 16x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i:i+4] - MOVUPS 16(SI)(AX*4), X3 - MOVUPS 32(SI)(AX*4), X4 - MOVUPS 48(SI)(AX*4), X5 - MULPS X0, X2 // X2 *= a - MULPS X1, X3 - MULPS X0, X4 - MULPS X1, X5 - ADDPS (DX)(AX*4), X2 // X2 += y[i:i+4] - ADDPS 16(DX)(AX*4), X3 - ADDPS 32(DX)(AX*4), X4 - ADDPS 48(DX)(AX*4), X5 - MOVUPS X2, (DI)(AX*4) // dst[i:i+4] = X2 - MOVUPS X3, 16(DI)(AX*4) - MOVUPS X4, 32(DI)(AX*4) - MOVUPS X5, 48(DI)(AX*4) - ADDQ $16, AX // i += 16 - LOOP axpy_loop // while (--CX) > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE axpy_end - -axpy_tail4_start: // Reset loop counter for 4-wide tail loop - MOVQ BX, CX // CX = floor( BX / 4 ) - SHRQ $2, CX - JZ axpy_tail_start // if CX == 0 { goto axpy_tail_start } - -axpy_tail4: // Loop unrolled 4x do { - MOVUPS (SI)(AX*4), X2 // X2 = x[i] - MULPS X0, X2 // X2 *= a - ADDPS (DX)(AX*4), X2 // X2 += y[i] - MOVUPS X2, (DI)(AX*4) // y[i] = X2 - ADDQ $4, AX // i += 4 - LOOP axpy_tail4 // } while --CX > 0 - -axpy_tail_start: // Reset loop counter for 1-wide tail loop - MOVQ BX, CX // CX = BX % 4 - ANDQ $3, CX - JZ axpy_end // if CX == 0 { return } - -axpy_tail: - MOVSS (SI)(AX*4), X1 // X1 = x[i] - MULSS X0, X1 // X1 *= a - ADDSS (DX)(AX*4), X1 // X1 += y[i] - MOVSS X1, (DI)(AX*4) // y[i] = X1 - INCQ AX // i++ - LOOP axpy_tail // } while --CX > 0 - -axpy_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s deleted file mode 100644 index 4518e0495..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotinc_amd64.s +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R10 -#define INC_Y R9 -#define INCx3_Y R11 -#define SUM X0 -#define P_SUM X1 - -// func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) -TEXT ·DdotInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ n+48(FP), LEN // LEN = n - PXOR SUM, SUM // SUM = 0 - CMPQ LEN, $0 - JE dot_end - - MOVQ ix+72(FP), INC_X // INC_X = ix - MOVQ iy+80(FP), INC_Y // INC_Y = iy - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(x[ix]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(y[iy]) - - MOVQ incX+56(FP), INC_X // INC_X = incX * sizeof(float32) - SHLQ $2, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y = incY * sizeof(float32) - SHLQ $2, INC_Y - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dot_tail // if LEN == 0 { goto dot_tail } - - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dot_loop: // Loop unrolled 4x do { - CVTSS2SD (X_PTR), X2 // X_i = x[i:i+1] - CVTSS2SD (X_PTR)(INC_X*1), X3 - CVTSS2SD (X_PTR)(INC_X*2), X4 - CVTSS2SD (X_PTR)(INCx3_X*1), X5 - - CVTSS2SD (Y_PTR), X6 // X_j = y[i:i+1] - CVTSS2SD (Y_PTR)(INC_Y*1), X7 - CVTSS2SD (Y_PTR)(INC_Y*2), X8 - CVTSS2SD (Y_PTR)(INCx3_Y*1), X9 - - MULSD X6, X2 // X_i *= X_j - MULSD X7, X3 - MULSD X8, X4 - MULSD X9, X5 - - ADDSD X2, SUM // SUM += X_i - ADDSD X3, P_SUM - ADDSD X4, SUM - ADDSD X5, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X * 4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y * 4]) - - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDSD P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - CVTSS2SD (X_PTR), X2 // X2 = x[i] - CVTSS2SD (Y_PTR), X3 // X2 *= y[i] - MULSD X3, X2 - ADDSD X2, SUM // SUM += X2 - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVSD SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s deleted file mode 100644 index 231cbd3bf..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ddotunitary_amd64.s +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define HADDPD_SUM_SUM LONG $0xC07C0F66 // @ HADDPD X0, X0 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define IDX AX -#define SUM X0 -#define P_SUM X1 - -// func DdotUnitary(x, y []float32) (sum float32) -TEXT ·DdotUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - PXOR SUM, SUM // psum = 0 - CMPQ LEN, $0 - JE dot_end - - XORQ IDX, IDX - MOVQ Y_PTR, DX - ANDQ $0xF, DX // Align on 16-byte boundary for ADDPS - JZ dot_no_trim // if DX == 0 { goto dot_no_trim } - - SUBQ $16, DX - -dot_align: // Trim first value(s) in unaligned buffer do { - CVTSS2SD (X_PTR)(IDX*4), X2 // X2 = float64(x[i]) - CVTSS2SD (Y_PTR)(IDX*4), X3 // X3 = float64(y[i]) - MULSD X3, X2 - ADDSD X2, SUM // SUM += X2 - INCQ IDX // IDX++ - DECQ LEN - JZ dot_end // if --TAIL == 0 { return } - ADDQ $4, DX - JNZ dot_align // } while --LEN > 0 - -dot_no_trim: - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - MOVQ LEN, TAIL - ANDQ $0x7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ dot_tail_start // if LEN == 0 { goto dot_tail_start } - -dot_loop: // Loop unrolled 8x do { - CVTPS2PD (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - CVTPS2PD 8(X_PTR)(IDX*4), X3 - CVTPS2PD 16(X_PTR)(IDX*4), X4 - CVTPS2PD 24(X_PTR)(IDX*4), X5 - - CVTPS2PD (Y_PTR)(IDX*4), X6 // X_j = y[i:i+1] - CVTPS2PD 8(Y_PTR)(IDX*4), X7 - CVTPS2PD 16(Y_PTR)(IDX*4), X8 - CVTPS2PD 24(Y_PTR)(IDX*4), X9 - - MULPD X6, X2 // X_i *= X_j - MULPD X7, X3 - MULPD X8, X4 - MULPD X9, X5 - - ADDPD X2, SUM // SUM += X_i - ADDPD X3, P_SUM - ADDPD X4, SUM - ADDPD X5, P_SUM - - ADDQ $8, IDX // IDX += 8 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDPD P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail_start: - MOVQ TAIL, LEN - SHRQ $1, LEN - JZ dot_tail_one - -dot_tail_two: - CVTPS2PD (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - CVTPS2PD (Y_PTR)(IDX*4), X6 // X_j = y[i:i+1] - MULPD X6, X2 // X_i *= X_j - ADDPD X2, SUM // SUM += X_i - ADDQ $2, IDX // IDX += 2 - DECQ LEN - JNZ dot_tail_two // } while --LEN > 0 - - ANDQ $1, TAIL - JZ dot_end - -dot_tail_one: - CVTSS2SD (X_PTR)(IDX*4), X2 // X2 = float64(x[i]) - CVTSS2SD (Y_PTR)(IDX*4), X3 // X3 = float64(y[i]) - MULSD X3, X2 // X2 *= X3 - ADDSD X2, SUM // SUM += X2 - -dot_end: - HADDPD_SUM_SUM // SUM = \sum{ SUM[i] } - MOVSD SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go deleted file mode 100644 index 408847a69..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package f32 provides float32 vector primitives. -package f32 // import "gonum.org/v1/gonum/internal/asm/f32" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s deleted file mode 100644 index 4d36b289c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotinc_amd64.s +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R10 -#define INC_Y R9 -#define INCx3_Y R11 -#define SUM X0 -#define P_SUM X1 - -// func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) -TEXT ·DotInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - MOVQ n+48(FP), LEN // LEN = n - CMPQ LEN, $0 - JE dot_end - - MOVQ ix+72(FP), INC_X // INC_X = ix - MOVQ iy+80(FP), INC_Y // INC_Y = iy - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(x[ix]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(y[iy]) - - MOVQ incX+56(FP), INC_X // INC_X := incX * sizeof(float32) - SHLQ $2, INC_X - MOVQ incY+64(FP), INC_Y // INC_Y := incY * sizeof(float32) - SHLQ $2, INC_Y - - MOVQ LEN, TAIL - ANDQ $0x3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ dot_tail // if LEN == 0 { goto dot_tail } - - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -dot_loop: // Loop unrolled 4x do { - MOVSS (X_PTR), X2 // X_i = x[i:i+1] - MOVSS (X_PTR)(INC_X*1), X3 - MOVSS (X_PTR)(INC_X*2), X4 - MOVSS (X_PTR)(INCx3_X*1), X5 - - MULSS (Y_PTR), X2 // X_i *= y[i:i+1] - MULSS (Y_PTR)(INC_Y*1), X3 - MULSS (Y_PTR)(INC_Y*2), X4 - MULSS (Y_PTR)(INCx3_Y*1), X5 - - ADDSS X2, SUM // SUM += X_i - ADDSS X3, P_SUM - ADDSS X4, SUM - ADDSS X5, P_SUM - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[INC_X * 4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[INC_Y * 4]) - - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDSS P_SUM, SUM // P_SUM += SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail: // do { - MOVSS (X_PTR), X2 // X2 = x[i] - MULSS (Y_PTR), X2 // X2 *= y[i] - ADDSS X2, SUM // SUM += X2 - ADDQ INC_X, X_PTR // X_PTR += INC_X - ADDQ INC_Y, Y_PTR // Y_PTR += INC_Y - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - MOVSS SUM, sum+88(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s deleted file mode 100644 index c32ede5a9..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/dotunitary_amd64.s +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define HADDPS_SUM_SUM LONG $0xC07C0FF2 // @ HADDPS X0, X0 - -#define X_PTR SI -#define Y_PTR DI -#define LEN CX -#define TAIL BX -#define IDX AX -#define SUM X0 -#define P_SUM X1 - -// func DotUnitary(x, y []float32) (sum float32) -TEXT ·DotUnitary(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ y_base+24(FP), Y_PTR // Y_PTR = &y - PXOR SUM, SUM // SUM = 0 - MOVQ x_len+8(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+32(FP), LEN - CMOVQLE y_len+32(FP), LEN - CMPQ LEN, $0 - JE dot_end - - XORQ IDX, IDX - MOVQ Y_PTR, DX - ANDQ $0xF, DX // Align on 16-byte boundary for MULPS - JZ dot_no_trim // if DX == 0 { goto dot_no_trim } - SUBQ $16, DX - -dot_align: // Trim first value(s) in unaligned buffer do { - MOVSS (X_PTR)(IDX*4), X2 // X2 = x[i] - MULSS (Y_PTR)(IDX*4), X2 // X2 *= y[i] - ADDSS X2, SUM // SUM += X2 - INCQ IDX // IDX++ - DECQ LEN - JZ dot_end // if --TAIL == 0 { return } - ADDQ $4, DX - JNZ dot_align // } while --DX > 0 - -dot_no_trim: - PXOR P_SUM, P_SUM // P_SUM = 0 for pipelining - MOVQ LEN, TAIL - ANDQ $0xF, TAIL // TAIL = LEN % 16 - SHRQ $4, LEN // LEN = floor( LEN / 16 ) - JZ dot_tail4_start // if LEN == 0 { goto dot_tail4_start } - -dot_loop: // Loop unrolled 16x do { - MOVUPS (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - MOVUPS 16(X_PTR)(IDX*4), X3 - MOVUPS 32(X_PTR)(IDX*4), X4 - MOVUPS 48(X_PTR)(IDX*4), X5 - - MULPS (Y_PTR)(IDX*4), X2 // X_i *= y[i:i+1] - MULPS 16(Y_PTR)(IDX*4), X3 - MULPS 32(Y_PTR)(IDX*4), X4 - MULPS 48(Y_PTR)(IDX*4), X5 - - ADDPS X2, SUM // SUM += X_i - ADDPS X3, P_SUM - ADDPS X4, SUM - ADDPS X5, P_SUM - - ADDQ $16, IDX // IDX += 16 - DECQ LEN - JNZ dot_loop // } while --LEN > 0 - - ADDPS P_SUM, SUM // SUM += P_SUM - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE dot_end - -dot_tail4_start: // Reset loop counter for 4-wide tail loop - MOVQ TAIL, LEN // LEN = floor( TAIL / 4 ) - SHRQ $2, LEN - JZ dot_tail_start // if LEN == 0 { goto dot_tail_start } - -dot_tail4_loop: // Loop unrolled 4x do { - MOVUPS (X_PTR)(IDX*4), X2 // X_i = x[i:i+1] - MULPS (Y_PTR)(IDX*4), X2 // X_i *= y[i:i+1] - ADDPS X2, SUM // SUM += X_i - ADDQ $4, IDX // i += 4 - DECQ LEN - JNZ dot_tail4_loop // } while --LEN > 0 - -dot_tail_start: // Reset loop counter for 1-wide tail loop - ANDQ $3, TAIL // TAIL = TAIL % 4 - JZ dot_end // if TAIL == 0 { return } - -dot_tail: // do { - MOVSS (X_PTR)(IDX*4), X2 // X2 = x[i] - MULSS (Y_PTR)(IDX*4), X2 // X2 *= y[i] - ADDSS X2, SUM // psum += X2 - INCQ IDX // IDX++ - DECQ TAIL - JNZ dot_tail // } while --TAIL > 0 - -dot_end: - HADDPS_SUM_SUM // SUM = \sum{ SUM[i] } - HADDPS_SUM_SUM - MOVSS SUM, sum+48(FP) // return SUM - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go deleted file mode 100644 index 2b336a2af..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f32 - -// Ger performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float32, - x []float32, incX uintptr, - y []float32, incY uintptr, - a []float32, lda uintptr) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s deleted file mode 100644 index e5e80c52c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_amd64.s +++ /dev/null @@ -1,757 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 4 -#define BITSIZE 2 -#define KERNELSIZE 3 - -#define M_DIM m+0(FP) -#define M CX -#define N_DIM n+8(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define Y y_base+56(FP) -#define Y_PTR DX -#define A_ROW AX -#define A_PTR DI - -#define INC_X R8 -#define INC3_X R9 - -#define INC_Y R10 -#define INC3_Y R11 - -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X0 -#define ALPHA_SPILL al-16(SP) - -#define LOAD_ALPHA \ - MOVSS alpha+16(FP), ALPHA \ - SHUFPS $0, ALPHA, ALPHA - -#define LOAD_SCALED4 \ - PREFETCHNTA 16*SIZE(X_PTR) \ - MOVDDUP (X_PTR), X1 \ - MOVDDUP 2*SIZE(X_PTR), X3 \ - MOVSHDUP X1, X2 \ - MOVSHDUP X3, X4 \ - MOVSLDUP X1, X1 \ - MOVSLDUP X3, X3 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 \ - MULPS ALPHA, X3 \ - MULPS ALPHA, X4 - -#define LOAD_SCALED2 \ - MOVDDUP (X_PTR), X1 \ - MOVSHDUP X1, X2 \ - MOVSLDUP X1, X1 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 - -#define LOAD_SCALED1 \ - MOVSS (X_PTR), X1 \ - SHUFPS $0, X1, X1 \ - MULPS ALPHA, X1 - -#define LOAD_SCALED4_INC \ - PREFETCHNTA (X_PTR)(INC_X*8) \ - MOVSS (X_PTR), X1 \ - MOVSS (X_PTR)(INC_X*1), X2 \ - MOVSS (X_PTR)(INC_X*2), X3 \ - MOVSS (X_PTR)(INC3_X*1), X4 \ - SHUFPS $0, X1, X1 \ - SHUFPS $0, X2, X2 \ - SHUFPS $0, X3, X3 \ - SHUFPS $0, X4, X4 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 \ - MULPS ALPHA, X3 \ - MULPS ALPHA, X4 - -#define LOAD_SCALED2_INC \ - MOVSS (X_PTR), X1 \ - MOVSS (X_PTR)(INC_X*1), X2 \ - SHUFPS $0, X1, X1 \ - SHUFPS $0, X2, X2 \ - MULPS ALPHA, X1 \ - MULPS ALPHA, X2 - -#define KERNEL_LOAD8 \ - MOVUPS (Y_PTR), X5 \ - MOVUPS 4*SIZE(Y_PTR), X6 - -#define KERNEL_LOAD8_INC \ - MOVSS (Y_PTR), X5 \ - MOVSS (Y_PTR)(INC_Y*1), X6 \ - MOVSS (Y_PTR)(INC_Y*2), X7 \ - MOVSS (Y_PTR)(INC3_Y*1), X8 \ - UNPCKLPS X6, X5 \ - UNPCKLPS X8, X7 \ - MOVLHPS X7, X5 \ - LEAQ (Y_PTR)(INC_Y*4), Y_PTR \ - MOVSS (Y_PTR), X6 \ - MOVSS (Y_PTR)(INC_Y*1), X7 \ - MOVSS (Y_PTR)(INC_Y*2), X8 \ - MOVSS (Y_PTR)(INC3_Y*1), X9 \ - UNPCKLPS X7, X6 \ - UNPCKLPS X9, X8 \ - MOVLHPS X8, X6 - -#define KERNEL_LOAD4 \ - MOVUPS (Y_PTR), X5 - -#define KERNEL_LOAD4_INC \ - MOVSS (Y_PTR), X5 \ - MOVSS (Y_PTR)(INC_Y*1), X6 \ - MOVSS (Y_PTR)(INC_Y*2), X7 \ - MOVSS (Y_PTR)(INC3_Y*1), X8 \ - UNPCKLPS X6, X5 \ - UNPCKLPS X8, X7 \ - MOVLHPS X7, X5 - -#define KERNEL_LOAD2 \ - MOVSD (Y_PTR), X5 - -#define KERNEL_LOAD2_INC \ - MOVSS (Y_PTR), X5 \ - MOVSS (Y_PTR)(INC_Y*1), X6 \ - UNPCKLPS X6, X5 - -#define KERNEL_4x8 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MOVUPS X5, X9 \ - MOVUPS X6, X10 \ - MOVUPS X5, X11 \ - MOVUPS X6, X12 \ - MULPS X1, X5 \ - MULPS X1, X6 \ - MULPS X2, X7 \ - MULPS X2, X8 \ - MULPS X3, X9 \ - MULPS X3, X10 \ - MULPS X4, X11 \ - MULPS X4, X12 - -#define STORE_4x8 \ - MOVUPS ALPHA, ALPHA_SPILL \ - MOVUPS (A_PTR), X13 \ - ADDPS X13, X5 \ - MOVUPS 4*SIZE(A_PTR), X14 \ - ADDPS X14, X6 \ - MOVUPS (A_PTR)(LDA*1), X15 \ - ADDPS X15, X7 \ - MOVUPS 4*SIZE(A_PTR)(LDA*1), X0 \ - ADDPS X0, X8 \ - MOVUPS (A_PTR)(LDA*2), X13 \ - ADDPS X13, X9 \ - MOVUPS 4*SIZE(A_PTR)(LDA*2), X14 \ - ADDPS X14, X10 \ - MOVUPS (A_PTR)(LDA3*1), X15 \ - ADDPS X15, X11 \ - MOVUPS 4*SIZE(A_PTR)(LDA3*1), X0 \ - ADDPS X0, X12 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 4*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 4*SIZE(A_PTR)(LDA*1) \ - MOVUPS X9, (A_PTR)(LDA*2) \ - MOVUPS X10, 4*SIZE(A_PTR)(LDA*2) \ - MOVUPS X11, (A_PTR)(LDA3*1) \ - MOVUPS X12, 4*SIZE(A_PTR)(LDA3*1) \ - MOVUPS ALPHA_SPILL, ALPHA \ - ADDQ $8*SIZE, A_PTR - -#define KERNEL_4x4 \ - MOVUPS X5, X6 \ - MOVUPS X5, X7 \ - MOVUPS X5, X8 \ - MULPS X1, X5 \ - MULPS X2, X6 \ - MULPS X3, X7 \ - MULPS X4, X8 - -#define STORE_4x4 \ - MOVUPS (A_PTR), X13 \ - ADDPS X13, X5 \ - MOVUPS (A_PTR)(LDA*1), X14 \ - ADDPS X14, X6 \ - MOVUPS (A_PTR)(LDA*2), X15 \ - ADDPS X15, X7 \ - MOVUPS (A_PTR)(LDA3*1), X13 \ - ADDPS X13, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - MOVUPS X7, (A_PTR)(LDA*2) \ - MOVUPS X8, (A_PTR)(LDA3*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS X5, X6 \ - MOVUPS X5, X7 \ - MOVUPS X5, X8 \ - MULPS X1, X5 \ - MULPS X2, X6 \ - MULPS X3, X7 \ - MULPS X4, X8 - -#define STORE_4x2 \ - MOVSD (A_PTR), X9 \ - ADDPS X9, X5 \ - MOVSD (A_PTR)(LDA*1), X10 \ - ADDPS X10, X6 \ - MOVSD (A_PTR)(LDA*2), X11 \ - ADDPS X11, X7 \ - MOVSD (A_PTR)(LDA3*1), X12 \ - ADDPS X12, X8 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - MOVSD X7, (A_PTR)(LDA*2) \ - MOVSD X8, (A_PTR)(LDA3*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVSS (Y_PTR), X5 \ - MOVSS X5, X6 \ - MOVSS X5, X7 \ - MOVSS X5, X8 \ - MULSS X1, X5 \ - MULSS X2, X6 \ - MULSS X3, X7 \ - MULSS X4, X8 - -#define STORE_4x1 \ - ADDSS (A_PTR), X5 \ - ADDSS (A_PTR)(LDA*1), X6 \ - ADDSS (A_PTR)(LDA*2), X7 \ - ADDSS (A_PTR)(LDA3*1), X8 \ - MOVSS X5, (A_PTR) \ - MOVSS X6, (A_PTR)(LDA*1) \ - MOVSS X7, (A_PTR)(LDA*2) \ - MOVSS X8, (A_PTR)(LDA3*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_2x8 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MULPS X1, X5 \ - MULPS X1, X6 \ - MULPS X2, X7 \ - MULPS X2, X8 - -#define STORE_2x8 \ - MOVUPS (A_PTR), X9 \ - ADDPS X9, X5 \ - MOVUPS 4*SIZE(A_PTR), X10 \ - ADDPS X10, X6 \ - MOVUPS (A_PTR)(LDA*1), X11 \ - ADDPS X11, X7 \ - MOVUPS 4*SIZE(A_PTR)(LDA*1), X12 \ - ADDPS X12, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 4*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 4*SIZE(A_PTR)(LDA*1) \ - ADDQ $8*SIZE, A_PTR - -#define KERNEL_2x4 \ - MOVUPS X5, X6 \ - MULPS X1, X5 \ - MULPS X2, X6 - -#define STORE_2x4 \ - MOVUPS (A_PTR), X9 \ - ADDPS X9, X5 \ - MOVUPS (A_PTR)(LDA*1), X11 \ - ADDPS X11, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVSD X5, X6 \ - MULPS X1, X5 \ - MULPS X2, X6 - -#define STORE_2x2 \ - MOVSD (A_PTR), X7 \ - ADDPS X7, X5 \ - MOVSD (A_PTR)(LDA*1), X8 \ - ADDPS X8, X6 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVSS (Y_PTR), X5 \ - MOVSS X5, X6 \ - MULSS X1, X5 \ - MULSS X2, X6 - -#define STORE_2x1 \ - ADDSS (A_PTR), X5 \ - ADDSS (A_PTR)(LDA*1), X6 \ - MOVSS X5, (A_PTR) \ - MOVSS X6, (A_PTR)(LDA*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x8 \ - MULPS X1, X5 \ - MULPS X1, X6 - -#define STORE_1x8 \ - MOVUPS (A_PTR), X7 \ - ADDPS X7, X5 \ - MOVUPS 4*SIZE(A_PTR), X8 \ - ADDPS X8, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 4*SIZE(A_PTR) \ - ADDQ $8*SIZE, A_PTR - -#define KERNEL_1x4 \ - MULPS X1, X5 \ - MULPS X1, X6 - -#define STORE_1x4 \ - MOVUPS (A_PTR), X7 \ - ADDPS X7, X5 \ - MOVUPS X5, (A_PTR) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_1x2 \ - MULPS X1, X5 - -#define STORE_1x2 \ - MOVSD (A_PTR), X6 \ - ADDPS X6, X5 \ - MOVSD X5, (A_PTR) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSS (Y_PTR), X5 \ - MULSS X1, X5 - -#define STORE_1x1 \ - ADDSS (A_PTR), X5 \ - MOVSS X5, (A_PTR) \ - ADDQ $SIZE, A_PTR - -// func Ger(m, n uintptr, alpha float32, -// x []float32, incX uintptr, -// y []float32, incY uintptr, -// a []float32, lda uintptr) -TEXT ·Ger(SB), 0, $16-120 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - LOAD_ALPHA - - MOVQ x_base+24(FP), X_PTR - MOVQ y_base+56(FP), Y_PTR - MOVQ a_base+88(FP), A_ROW - MOVQ A_ROW, A_PTR - MOVQ lda+112(FP), LDA // LDA = LDA * sizeof(float32) - SHLQ $BITSIZE, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - - CMPQ incY+80(FP), $1 // Check for dense vector Y (fast-path) - JNE inc - CMPQ incX+48(FP), $1 // Check for dense vector X (fast-path) - JNE inc - - SHRQ $2, M - JZ r2 - -r4: - - // LOAD 4 - LOAD_SCALED4 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ r4c4 - -r4c8: - // 4x8 KERNEL - KERNEL_LOAD8 - KERNEL_4x8 - STORE_4x8 - - ADDQ $8*SIZE, Y_PTR - - DECQ N - JNZ r4c8 - -r4c4: - TESTQ $4, N_DIM - JZ r4c2 - - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - STORE_4x4 - - ADDQ $4*SIZE, Y_PTR - -r4c2: - TESTQ $2, N_DIM - JZ r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_4x2 - STORE_4x2 - - ADDQ $2*SIZE, Y_PTR - -r4c1: - TESTQ $1, N_DIM - JZ r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ $SIZE, Y_PTR - -r4end: - ADDQ $4*SIZE, X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ r4 - -r2: - TESTQ $2, M_DIM - JZ r1 - - // LOAD 2 - LOAD_SCALED2 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ r2c4 - -r2c8: - // 2x8 KERNEL - KERNEL_LOAD8 - KERNEL_2x8 - STORE_2x8 - - ADDQ $8*SIZE, Y_PTR - - DECQ N - JNZ r2c8 - -r2c4: - TESTQ $4, N_DIM - JZ r2c2 - - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_2x4 - STORE_2x4 - - ADDQ $4*SIZE, Y_PTR - -r2c2: - TESTQ $2, N_DIM - JZ r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - STORE_2x2 - - ADDQ $2*SIZE, Y_PTR - -r2c1: - TESTQ $1, N_DIM - JZ r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ $SIZE, Y_PTR - -r2end: - ADDQ $2*SIZE, X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD_SCALED1 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ r1c4 - -r1c8: - // 1x8 KERNEL - KERNEL_LOAD8 - KERNEL_1x8 - STORE_1x8 - - ADDQ $8*SIZE, Y_PTR - - DECQ N - JNZ r1c8 - -r1c4: - TESTQ $4, N_DIM - JZ r1c2 - - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_1x4 - STORE_1x4 - - ADDQ $4*SIZE, Y_PTR - -r1c2: - TESTQ $2, N_DIM - JZ r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_1x2 - STORE_1x2 - - ADDQ $2*SIZE, Y_PTR - -r1c1: - TESTQ $1, N_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - -end: - RET - -inc: // Algorithm for incY != 0 ( split loads in kernel ) - - MOVQ incX+48(FP), INC_X // INC_X = incX * sizeof(float32) - SHLQ $BITSIZE, INC_X - MOVQ incY+80(FP), INC_Y // INC_Y = incY * sizeof(float32) - SHLQ $BITSIZE, INC_Y - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_X, TMP1 - NEGQ TMP1 - CMPQ INC_X, $0 - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR - - XORQ TMP2, TMP2 - MOVQ N, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - - SHRQ $2, M - JZ inc_r2 - -inc_r4: - // LOAD 4 - LOAD_SCALED4_INC - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ inc_r4c4 - -inc_r4c8: - // 4x4 KERNEL - KERNEL_LOAD8_INC - KERNEL_4x8 - STORE_4x8 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r4c8 - -inc_r4c4: - TESTQ $4, N_DIM - JZ inc_r4c2 - - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - STORE_4x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r4c2: - TESTQ $2, N_DIM - JZ inc_r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_4x2 - STORE_4x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r4c1: - TESTQ $1, N_DIM - JZ inc_r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ INC_Y, Y_PTR - -inc_r4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ inc_r4 - -inc_r2: - TESTQ $2, M_DIM - JZ inc_r1 - - // LOAD 2 - LOAD_SCALED2_INC - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ inc_r2c4 - -inc_r2c8: - // 2x8 KERNEL - KERNEL_LOAD8_INC - KERNEL_2x8 - STORE_2x8 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r2c8 - -inc_r2c4: - TESTQ $4, N_DIM - JZ inc_r2c2 - - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_2x4 - STORE_2x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r2c2: - TESTQ $2, N_DIM - JZ inc_r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - STORE_2x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r2c1: - TESTQ $1, N_DIM - JZ inc_r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ INC_Y, Y_PTR - -inc_r2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD_SCALED1 - - MOVQ N_DIM, N - SHRQ $KERNELSIZE, N - JZ inc_r1c4 - -inc_r1c8: - // 1x8 KERNEL - KERNEL_LOAD8_INC - KERNEL_1x8 - STORE_1x8 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r1c8 - -inc_r1c4: - TESTQ $4, N_DIM - JZ inc_r1c2 - - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_1x4 - STORE_1x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r1c2: - TESTQ $2, N_DIM - JZ inc_r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_1x2 - STORE_1x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r1c1: - TESTQ $1, N_DIM - JZ inc_end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go deleted file mode 100644 index d92f9968d..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/ge_noasm.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f32 - -// Ger performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float32, x []float32, incX uintptr, y []float32, incY uintptr, a []float32, lda uintptr) { - - if incX == 1 && incY == 1 { - x = x[:m] - y = y[:n] - for i, xv := range x { - AxpyUnitary(alpha*xv, y, a[uintptr(i)*lda:uintptr(i)*lda+n]) - } - return - } - - var ky, kx uintptr - if int(incY) < 0 { - ky = uintptr(-int(n-1) * int(incY)) - } - if int(incX) < 0 { - kx = uintptr(-int(m-1) * int(incX)) - } - - ix := kx - for i := 0; i < int(m); i++ { - AxpyInc(alpha*x[ix], y, a[uintptr(i)*lda:uintptr(i)*lda+n], uintptr(n), uintptr(incY), 1, uintptr(ky), 0) - ix += incX - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go deleted file mode 100644 index d0867a460..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/scal.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package f32 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha float32, x []float32) { - for i := range x { - x[i] *= alpha - } -} - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []float32, alpha float32, x []float32) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha float32, x []float32, n, incX uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += incX - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []float32, incDst uintptr, alpha float32, x []float32, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go deleted file mode 100644 index fcbce09e7..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_amd64.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f32 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float32, x, y []float32) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) - -// DdotUnitary is -// for i, v := range x { -// sum += float64(y[i]) * float64(v) -// } -// return -func DdotUnitary(x, y []float32) (sum float64) - -// DdotInc is -// for i := 0; i < int(n); i++ { -// sum += float64(y[iy]) * float64(x[ix]) -// ix += incX -// iy += incY -// } -// return -func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float32) (sum float32) - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go deleted file mode 100644 index 3b5b09702..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f32/stubs_noasm.go +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f32 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float32, x, y []float32) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float32, alpha float32, x, y []float32) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float32, incDst, idst uintptr, alpha float32, x, y []float32, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float32) (sum float32) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float32) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} - -// DdotUnitary is -// for i, v := range x { -// sum += float64(y[i]) * float64(v) -// } -// return -func DdotUnitary(x, y []float32) (sum float64) { - for i, v := range x { - sum += float64(y[i]) * float64(v) - } - return -} - -// DdotInc is -// for i := 0; i < int(n); i++ { -// sum += float64(y[iy]) * float64(x[ix]) -// ix += incX -// iy += incY -// } -// return -func DdotInc(x, y []float32, n, incX, incY, ix, iy uintptr) (sum float64) { - for i := 0; i < int(n); i++ { - sum += float64(y[iy]) * float64(x[ix]) - ix += incX - iy += incY - } - return -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s deleted file mode 100644 index d9d61bb7b..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssum_amd64.s +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func L1Norm(x []float64) float64 -TEXT ·L1Norm(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), SI // SI = &x - MOVQ x_len+8(FP), CX // CX = len(x) - XORQ AX, AX // i = 0 - PXOR X0, X0 // p_sum_i = 0 - PXOR X1, X1 - PXOR X2, X2 - PXOR X3, X3 - PXOR X4, X4 - PXOR X5, X5 - PXOR X6, X6 - PXOR X7, X7 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE absum_end - MOVQ CX, BX - ANDQ $7, BX // BX = len(x) % 8 - SHRQ $3, CX // CX = floor( len(x) / 8 ) - JZ absum_tail_start // if CX == 0 { goto absum_tail_start } - -absum_loop: // do { - // p_sum += max( p_sum + x[i], p_sum - x[i] ) - MOVUPS (SI)(AX*8), X8 // X_i = x[i:i+1] - MOVUPS 16(SI)(AX*8), X9 - MOVUPS 32(SI)(AX*8), X10 - MOVUPS 48(SI)(AX*8), X11 - ADDPD X8, X0 // p_sum_i += X_i ( positive values ) - ADDPD X9, X2 - ADDPD X10, X4 - ADDPD X11, X6 - SUBPD X8, X1 // p_sum_(i+1) -= X_i ( negative values ) - SUBPD X9, X3 - SUBPD X10, X5 - SUBPD X11, X7 - MAXPD X1, X0 // p_sum_i = max( p_sum_i, p_sum_(i+1) ) - MAXPD X3, X2 - MAXPD X5, X4 - MAXPD X7, X6 - MOVAPS X0, X1 // p_sum_(i+1) = p_sum_i - MOVAPS X2, X3 - MOVAPS X4, X5 - MOVAPS X6, X7 - ADDQ $8, AX // i += 8 - LOOP absum_loop // } while --CX > 0 - - // p_sum_0 = \sum_{i=1}^{3}( p_sum_(i*2) ) - ADDPD X3, X0 - ADDPD X5, X7 - ADDPD X7, X0 - - // p_sum_0[0] = p_sum_0[0] + p_sum_0[1] - MOVAPS X0, X1 - SHUFPD $0x3, X0, X0 // lower( p_sum_0 ) = upper( p_sum_0 ) - ADDSD X1, X0 - CMPQ BX, $0 - JE absum_end // if BX == 0 { goto absum_end } - -absum_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - XORPS X8, X8 // X_8 = 0 - -absum_tail: // do { - // p_sum += max( p_sum + x[i], p_sum - x[i] ) - MOVSD (SI)(AX*8), X8 // X_8 = x[i] - MOVSD X0, X1 // p_sum_1 = p_sum_0 - ADDSD X8, X0 // p_sum_0 += X_8 - SUBSD X8, X1 // p_sum_1 -= X_8 - MAXSD X1, X0 // p_sum_0 = max( p_sum_0, p_sum_1 ) - INCQ AX // i++ - LOOP absum_tail // } while --CX > 0 - -absum_end: // return p_sum_0 - MOVSD X0, sum+24(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s deleted file mode 100644 index cac19aa64..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/abssuminc_amd64.s +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func L1NormInc(x []float64, n, incX int) (sum float64) -TEXT ·L1NormInc(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), SI // SI = &x - MOVQ n+24(FP), CX // CX = n - MOVQ incX+32(FP), AX // AX = increment * sizeof( float64 ) - SHLQ $3, AX - MOVQ AX, DX // DX = AX * 3 - IMULQ $3, DX - PXOR X0, X0 // p_sum_i = 0 - PXOR X1, X1 - PXOR X2, X2 - PXOR X3, X3 - PXOR X4, X4 - PXOR X5, X5 - PXOR X6, X6 - PXOR X7, X7 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE absum_end - MOVQ CX, BX - ANDQ $7, BX // BX = n % 8 - SHRQ $3, CX // CX = floor( n / 8 ) - JZ absum_tail_start // if CX == 0 { goto absum_tail_start } - -absum_loop: // do { - // p_sum = max( p_sum + x[i], p_sum - x[i] ) - MOVSD (SI), X8 // X_i[0] = x[i] - MOVSD (SI)(AX*1), X9 - MOVSD (SI)(AX*2), X10 - MOVSD (SI)(DX*1), X11 - LEAQ (SI)(AX*4), SI // SI = SI + 4 - MOVHPD (SI), X8 // X_i[1] = x[i+4] - MOVHPD (SI)(AX*1), X9 - MOVHPD (SI)(AX*2), X10 - MOVHPD (SI)(DX*1), X11 - ADDPD X8, X0 // p_sum_i += X_i ( positive values ) - ADDPD X9, X2 - ADDPD X10, X4 - ADDPD X11, X6 - SUBPD X8, X1 // p_sum_(i+1) -= X_i ( negative values ) - SUBPD X9, X3 - SUBPD X10, X5 - SUBPD X11, X7 - MAXPD X1, X0 // p_sum_i = max( p_sum_i, p_sum_(i+1) ) - MAXPD X3, X2 - MAXPD X5, X4 - MAXPD X7, X6 - MOVAPS X0, X1 // p_sum_(i+1) = p_sum_i - MOVAPS X2, X3 - MOVAPS X4, X5 - MOVAPS X6, X7 - LEAQ (SI)(AX*4), SI // SI = SI + 4 - LOOP absum_loop // } while --CX > 0 - - // p_sum_0 = \sum_{i=1}^{3}( p_sum_(i*2) ) - ADDPD X3, X0 - ADDPD X5, X7 - ADDPD X7, X0 - - // p_sum_0[0] = p_sum_0[0] + p_sum_0[1] - MOVAPS X0, X1 - SHUFPD $0x3, X0, X0 // lower( p_sum_0 ) = upper( p_sum_0 ) - ADDSD X1, X0 - CMPQ BX, $0 - JE absum_end // if BX == 0 { goto absum_end } - -absum_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - XORPS X8, X8 // X_8 = 0 - -absum_tail: // do { - // p_sum += max( p_sum + x[i], p_sum - x[i] ) - MOVSD (SI), X8 // X_8 = x[i] - MOVSD X0, X1 // p_sum_1 = p_sum_0 - ADDSD X8, X0 // p_sum_0 += X_8 - SUBSD X8, X1 // p_sum_1 -= X_8 - MAXSD X1, X0 // p_sum_0 = max( p_sum_0, p_sum_1 ) - ADDQ AX, SI // i++ - LOOP absum_tail // } while --CX > 0 - -absum_end: // return p_sum_0 - MOVSD X0, sum+40(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s deleted file mode 100644 index bc0ea6a40..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/add_amd64.s +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Add(dst, s []float64) -TEXT ·Add(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE add_end - XORQ AX, AX - MOVQ DI, BX - ANDQ $0x0F, BX // BX = &dst & 15 - JZ add_no_trim // if BX == 0 { goto add_no_trim } - - // Align on 16-bit boundary - MOVSD (SI)(AX*8), X0 // X0 = s[i] - ADDSD (DI)(AX*8), X0 // X0 += dst[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // i++ - DECQ CX // --CX - JE add_end // if CX == 0 { return } - -add_no_trim: - MOVQ CX, BX - ANDQ $7, BX // BX = len(dst) % 8 - SHRQ $3, CX // CX = floor( len(dst) / 8 ) - JZ add_tail_start // if CX == 0 { goto add_tail_start } - -add_loop: // Loop unrolled 8x do { - MOVUPS (SI)(AX*8), X0 // X_i = s[i:i+1] - MOVUPS 16(SI)(AX*8), X1 - MOVUPS 32(SI)(AX*8), X2 - MOVUPS 48(SI)(AX*8), X3 - ADDPD (DI)(AX*8), X0 // X_i += dst[i:i+1] - ADDPD 16(DI)(AX*8), X1 - ADDPD 32(DI)(AX*8), X2 - ADDPD 48(DI)(AX*8), X3 - MOVUPS X0, (DI)(AX*8) // dst[i:i+1] = X_i - MOVUPS X1, 16(DI)(AX*8) - MOVUPS X2, 32(DI)(AX*8) - MOVUPS X3, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP add_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE add_end - -add_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -add_tail: // do { - MOVSD (SI)(AX*8), X0 // X0 = s[i] - ADDSD (DI)(AX*8), X0 // X0 += dst[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - LOOP add_tail // } while --CX > 0 - -add_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s deleted file mode 100644 index 7cc68c78c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/addconst_amd64.s +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Addconst(alpha float64, x []float64) -TEXT ·AddConst(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), SI // SI = &x - MOVQ x_len+16(FP), CX // CX = len(x) - CMPQ CX, $0 // if len(x) == 0 { return } - JE ac_end - MOVSD alpha+0(FP), X4 // X4 = { a, a } - SHUFPD $0, X4, X4 - MOVUPS X4, X5 // X5 = X4 - XORQ AX, AX // i = 0 - MOVQ CX, BX - ANDQ $7, BX // BX = len(x) % 8 - SHRQ $3, CX // CX = floor( len(x) / 8 ) - JZ ac_tail_start // if CX == 0 { goto ac_tail_start } - -ac_loop: // Loop unrolled 8x do { - MOVUPS (SI)(AX*8), X0 // X_i = s[i:i+1] - MOVUPS 16(SI)(AX*8), X1 - MOVUPS 32(SI)(AX*8), X2 - MOVUPS 48(SI)(AX*8), X3 - ADDPD X4, X0 // X_i += a - ADDPD X5, X1 - ADDPD X4, X2 - ADDPD X5, X3 - MOVUPS X0, (SI)(AX*8) // s[i:i+1] = X_i - MOVUPS X1, 16(SI)(AX*8) - MOVUPS X2, 32(SI)(AX*8) - MOVUPS X3, 48(SI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP ac_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE ac_end - -ac_tail_start: // Reset loop counters - MOVQ BX, CX // Loop counter: CX = BX - -ac_tail: // do { - MOVSD (SI)(AX*8), X0 // X0 = s[i] - ADDSD X4, X0 // X0 += a - MOVSD X0, (SI)(AX*8) // s[i] = X0 - INCQ AX // ++i - LOOP ac_tail // } while --CX > 0 - -ac_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go deleted file mode 100644 index b83221398..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpy.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float64, x, y []float64) { - for i, v := range x { - y[i] += alpha * v - } -} - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) { - for i, v := range x { - dst[i] = alpha*v + y[i] - } -} - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - y[iy] += alpha * x[ix] - ix += incX - iy += incY - } -} - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) { - for i := 0; i < int(n); i++ { - dst[idst] = alpha*x[ix] + y[iy] - ix += incX - iy += incY - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s deleted file mode 100644 index 95fe9f904..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyinc_amd64.s +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R11 -#define INC_Y R9 -#define INCx3_Y R12 -#define INC_DST R9 -#define INCx3_DST R12 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyInc(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), X_PTR // X_PTR = &x - MOVQ y_base+32(FP), Y_PTR // Y_PTR = &y - MOVQ n+56(FP), LEN // LEN = n - CMPQ LEN, $0 // if LEN == 0 { return } - JE end - - MOVQ ix+80(FP), INC_X - MOVQ iy+88(FP), INC_Y - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(x[ix]) - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(y[iy]) - MOVQ Y_PTR, DST_PTR // DST_PTR = Y_PTR // Write pointer - - MOVQ incX+64(FP), INC_X // INC_X = incX * sizeof(float64) - SHLQ $3, INC_X - MOVQ incY+72(FP), INC_Y // INC_Y = incY * sizeof(float64) - SHLQ $3, INC_Y - - MOVSD alpha+0(FP), ALPHA // ALPHA = alpha - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = n % 4 - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVAPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - -loop: // do { // y[i] += alpha * x[i] unrolled 4x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - ADDSD (Y_PTR)(INC_Y*2), X4 - ADDSD (Y_PTR)(INCx3_Y*1), X5 - - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - MOVSD X4, (DST_PTR)(INC_DST*2) - MOVSD X5, (DST_PTR)(INCx3_DST*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset Loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR // Y_PTR = &(Y_PTR[incY*2]) - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - // y[i] += alpha * x[i] for the last n % 4 iterations. - MOVSD (X_PTR), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[i] - MOVSD X2, (DST_PTR) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s deleted file mode 100644 index dcb79d878..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyincto_amd64.s +++ /dev/null @@ -1,148 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define DST_PTR DX -#define IDX AX -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R11 -#define INC_Y R9 -#define INCx3_Y R12 -#define INC_DST R10 -#define INCx3_DST R13 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) -TEXT ·AxpyIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DST_PTR // DST_PTR := &dst - MOVQ x_base+48(FP), X_PTR // X_PTR := &x - MOVQ y_base+72(FP), Y_PTR // Y_PTR := &y - MOVQ n+96(FP), LEN // LEN := n - CMPQ LEN, $0 // if LEN == 0 { return } - JE end - - MOVQ ix+120(FP), INC_X - LEAQ (X_PTR)(INC_X*8), X_PTR // X_PTR = &(x[ix]) - MOVQ iy+128(FP), INC_Y - LEAQ (Y_PTR)(INC_Y*8), Y_PTR // Y_PTR = &(dst[idst]) - MOVQ idst+32(FP), INC_DST - LEAQ (DST_PTR)(INC_DST*8), DST_PTR // DST_PTR = &(y[iy]) - - MOVQ incX+104(FP), INC_X // INC_X = incX * sizeof(float64) - SHLQ $3, INC_X - MOVQ incY+112(FP), INC_Y // INC_Y = incY * sizeof(float64) - SHLQ $3, INC_Y - MOVQ incDst+24(FP), INC_DST // INC_DST = incDst * sizeof(float64) - SHLQ $3, INC_DST - MOVSD alpha+40(FP), ALPHA - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = n % 4 - SHRQ $2, LEN // LEN = floor( n / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVSD ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_Y)(INC_Y*2), INCx3_Y // INCx3_Y = INC_Y * 3 - LEAQ (INC_DST)(INC_DST*2), INCx3_DST // INCx3_DST = INC_DST * 3 - -loop: // do { // y[i] += alpha * x[i] unrolled 2x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - ADDSD (Y_PTR)(INC_Y*2), X4 - ADDSD (Y_PTR)(INCx3_Y*1), X5 - - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - MOVSD X4, (DST_PTR)(INC_DST*2) - MOVSD X5, (DST_PTR)(INCx3_DST*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR // Y_PTR = &(Y_PTR[incY*4]) - LEAQ (DST_PTR)(INC_DST*4), DST_PTR // DST_PTR = &(DST_PTR[incDst*4] - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset Loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - ADDSD (Y_PTR), X2 // X_i += y[i] - ADDSD (Y_PTR)(INC_Y*1), X3 - MOVSD X2, (DST_PTR) // y[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR // Y_PTR = &(Y_PTR[incY*2]) - LEAQ (DST_PTR)(INC_DST*2), DST_PTR // DST_PTR = &(DST_PTR[incY*2] - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - MOVSD (X_PTR), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[i] - MOVSD X2, (DST_PTR) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s deleted file mode 100644 index bc290a152..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitary_amd64.s +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyUnitary(alpha float64, x, y []float64) -TEXT ·AxpyUnitary(SB), NOSPLIT, $0 - MOVQ x_base+8(FP), X_PTR // X_PTR := &x - MOVQ y_base+32(FP), Y_PTR // Y_PTR := &y - MOVQ x_len+16(FP), LEN // LEN = min( len(x), len(y) ) - CMPQ y_len+40(FP), LEN - CMOVQLE y_len+40(FP), LEN - CMPQ LEN, $0 // if LEN == 0 { return } - JE end - XORQ IDX, IDX - MOVSD alpha+0(FP), ALPHA // ALPHA := { alpha, alpha } - SHUFPD $0, ALPHA, ALPHA - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 := ALPHA for pipelining - MOVQ Y_PTR, TAIL // Check memory alignment - ANDQ $15, TAIL // TAIL = &y % 16 - JZ no_trim // if TAIL == 0 { goto no_trim } - - // Align on 16-byte boundary - MOVSD (X_PTR), X2 // X2 := x[0] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[0] - MOVSD X2, (DST_PTR) // y[0] = X2 - INCQ IDX // i++ - DECQ LEN // LEN-- - JZ end // if LEN == 0 { return } - -no_trim: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL := n % 8 - SHRQ $3, LEN // LEN = floor( n / 8 ) - JZ tail_start // if LEN == 0 { goto tail2_start } - -loop: // do { - // y[i] += alpha * x[i] unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= a - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - ADDPD (Y_PTR)(IDX*8), X2 // X_i += y[i] - ADDPD 16(Y_PTR)(IDX*8), X3 - ADDPD 32(Y_PTR)(IDX*8), X4 - ADDPD 48(Y_PTR)(IDX*8), X5 - - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X_i - MOVUPS X3, 16(DST_PTR)(IDX*8) - MOVUPS X4, 32(DST_PTR)(IDX*8) - MOVUPS X5, 48(DST_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if TAIL == 0 { goto tail } - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X2 = x[i] - MULPD ALPHA, X2 // X2 *= a - ADDPD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X2 - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // } while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - MOVSD (X_PTR)(IDX*8), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVSD X2, (DST_PTR)(IDX*8) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s deleted file mode 100644 index 16798ebaa..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/axpyunitaryto_amd64.s +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define Y_PTR DX -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) -TEXT ·AxpyUnitaryTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DST_PTR // DST_PTR := &dst - MOVQ x_base+32(FP), X_PTR // X_PTR := &x - MOVQ y_base+56(FP), Y_PTR // Y_PTR := &y - MOVQ x_len+40(FP), LEN // LEN = min( len(x), len(y), len(dst) ) - CMPQ y_len+64(FP), LEN - CMOVQLE y_len+64(FP), LEN - CMPQ dst_len+8(FP), LEN - CMOVQLE dst_len+8(FP), LEN - - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - XORQ IDX, IDX // IDX = 0 - MOVSD alpha+24(FP), ALPHA - SHUFPD $0, ALPHA, ALPHA // ALPHA := { alpha, alpha } - MOVQ Y_PTR, TAIL // Check memory alignment - ANDQ $15, TAIL // TAIL = &y % 16 - JZ no_trim // if TAIL == 0 { goto no_trim } - - // Align on 16-byte boundary - MOVSD (X_PTR), X2 // X2 := x[0] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR), X2 // X2 += y[0] - MOVSD X2, (DST_PTR) // y[0] = X2 - INCQ IDX // i++ - DECQ LEN // LEN-- - JZ end // if LEN == 0 { return } - -no_trim: - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL := n % 8 - SHRQ $3, LEN // LEN = floor( n / 8 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 := ALPHA for pipelining - -loop: // do { - // y[i] += alpha * x[i] unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= alpha - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - ADDPD (Y_PTR)(IDX*8), X2 // X_i += y[i] - ADDPD 16(Y_PTR)(IDX*8), X3 - ADDPD 32(Y_PTR)(IDX*8), X4 - ADDPD 48(Y_PTR)(IDX*8), X5 - - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X_i - MOVUPS X3, 16(DST_PTR)(IDX*8) - MOVUPS X4, 32(DST_PTR)(IDX*8) - MOVUPS X5, 48(DST_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 // if TAIL == 0 { return } - JE end - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if LEN == 0 { goto tail } - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X2 = x[i] - MULPD ALPHA, X2 // X2 *= alpha - ADDPD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVUPS X2, (DST_PTR)(IDX*8) // y[i] = X2 - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // } while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { goto end } - -tail_one: - MOVSD (X_PTR)(IDX*8), X2 // X2 = x[i] - MULSD ALPHA, X2 // X2 *= a - ADDSD (Y_PTR)(IDX*8), X2 // X2 += y[i] - MOVSD X2, (DST_PTR)(IDX*8) // y[i] = X2 - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s deleted file mode 100644 index 32bd1572b..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumprod_amd64.s +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -TEXT ·CumProd(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - MOVQ CX, ret_len+56(FP) // len(ret) = CX - CMPQ CX, $0 // if CX == 0 { return } - JE cp_end - XORQ AX, AX // i = 0 - - MOVSD (SI), X5 // p_prod = { s[0], s[0] } - SHUFPD $0, X5, X5 - MOVSD X5, (DI) // dst[0] = s[0] - INCQ AX // ++i - DECQ CX // -- CX - JZ cp_end // if CX == 0 { return } - - MOVQ CX, BX - ANDQ $3, BX // BX = CX % 4 - SHRQ $2, CX // CX = floor( CX / 4 ) - JZ cp_tail_start // if CX == 0 { goto cp_tail_start } - -cp_loop: // Loop unrolled 4x do { - MOVUPS (SI)(AX*8), X0 // X0 = s[i:i+1] - MOVUPS 16(SI)(AX*8), X2 - MOVAPS X0, X1 // X1 = X0 - MOVAPS X2, X3 - SHUFPD $1, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[0] } - SHUFPD $1, X3, X3 - MULPD X0, X1 // X1 *= X0 - MULPD X2, X3 - SHUFPD $2, X1, X0 // { X0[0], X0[1] } = { X0[0], X1[1] } - SHUFPD $3, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[1] } - SHUFPD $2, X3, X2 - SHUFPD $3, X3, X3 - MULPD X5, X0 // X0 *= p_prod - MULPD X1, X5 // p_prod *= X1 - MULPD X5, X2 - MOVUPS X0, (DI)(AX*8) // dst[i] = X0 - MOVUPS X2, 16(DI)(AX*8) - MULPD X3, X5 - ADDQ $4, AX // i += 4 - LOOP cp_loop // } while --CX > 0 - - // if BX == 0 { return } - CMPQ BX, $0 - JE cp_end - -cp_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -cp_tail: // do { - MULSD (SI)(AX*8), X5 // p_prod *= s[i] - MOVSD X5, (DI)(AX*8) // dst[i] = p_prod - INCQ AX // ++i - LOOP cp_tail // } while --CX > 0 - -cp_end: - MOVQ DI, ret_base+48(FP) // &ret = &dst - MOVQ dst_cap+16(FP), SI // cap(ret) = cap(dst) - MOVQ SI, ret_cap+64(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s deleted file mode 100644 index 10d7fdab9..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/cumsum_amd64.s +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -TEXT ·CumSum(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - MOVQ CX, ret_len+56(FP) // len(ret) = CX - CMPQ CX, $0 // if CX == 0 { return } - JE cs_end - XORQ AX, AX // i = 0 - PXOR X5, X5 // p_sum = 0 - MOVQ CX, BX - ANDQ $3, BX // BX = CX % 4 - SHRQ $2, CX // CX = floor( CX / 4 ) - JZ cs_tail_start // if CX == 0 { goto cs_tail_start } - -cs_loop: // Loop unrolled 4x do { - MOVUPS (SI)(AX*8), X0 // X0 = s[i:i+1] - MOVUPS 16(SI)(AX*8), X2 - MOVAPS X0, X1 // X1 = X0 - MOVAPS X2, X3 - SHUFPD $1, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[0] } - SHUFPD $1, X3, X3 - ADDPD X0, X1 // X1 += X0 - ADDPD X2, X3 - SHUFPD $2, X1, X0 // { X0[0], X0[1] } = { X0[0], X1[1] } - SHUFPD $3, X1, X1 // { X1[0], X1[1] } = { X1[1], X1[1] } - SHUFPD $2, X3, X2 - SHUFPD $3, X3, X3 - ADDPD X5, X0 // X0 += p_sum - ADDPD X1, X5 // p_sum += X1 - ADDPD X5, X2 - MOVUPS X0, (DI)(AX*8) // dst[i] = X0 - MOVUPS X2, 16(DI)(AX*8) - ADDPD X3, X5 - ADDQ $4, AX // i += 4 - LOOP cs_loop // } while --CX > 0 - - // if BX == 0 { return } - CMPQ BX, $0 - JE cs_end - -cs_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -cs_tail: // do { - ADDSD (SI)(AX*8), X5 // p_sum *= s[i] - MOVSD X5, (DI)(AX*8) // dst[i] = p_sum - INCQ AX // ++i - LOOP cs_tail // } while --CX > 0 - -cs_end: - MOVQ DI, ret_base+48(FP) // &ret = &dst - MOVQ dst_cap+16(FP), SI // cap(ret) = cap(dst) - MOVQ SI, ret_cap+64(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s deleted file mode 100644 index 1a4e9eec9..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/div_amd64.s +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func Div(dst, s []float64) -TEXT ·Div(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ s_base+24(FP), SI // SI = &s - CMPQ s_len+32(FP), CX // CX = max( CX, len(s) ) - CMOVQLE s_len+32(FP), CX - CMPQ CX, $0 // if CX == 0 { return } - JE div_end - XORQ AX, AX // i = 0 - MOVQ SI, BX - ANDQ $15, BX // BX = &s & 15 - JZ div_no_trim // if BX == 0 { goto div_no_trim } - - // Align on 16-bit boundary - MOVSD (DI)(AX*8), X0 // X0 = dst[i] - DIVSD (SI)(AX*8), X0 // X0 /= s[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - DECQ CX // --CX - JZ div_end // if CX == 0 { return } - -div_no_trim: - MOVQ CX, BX - ANDQ $7, BX // BX = len(dst) % 8 - SHRQ $3, CX // CX = floor( len(dst) / 8 ) - JZ div_tail_start // if CX == 0 { goto div_tail_start } - -div_loop: // Loop unrolled 8x do { - MOVUPS (DI)(AX*8), X0 // X0 = dst[i:i+1] - MOVUPS 16(DI)(AX*8), X1 - MOVUPS 32(DI)(AX*8), X2 - MOVUPS 48(DI)(AX*8), X3 - DIVPD (SI)(AX*8), X0 // X0 /= s[i:i+1] - DIVPD 16(SI)(AX*8), X1 - DIVPD 32(SI)(AX*8), X2 - DIVPD 48(SI)(AX*8), X3 - MOVUPS X0, (DI)(AX*8) // dst[i] = X0 - MOVUPS X1, 16(DI)(AX*8) - MOVUPS X2, 32(DI)(AX*8) - MOVUPS X3, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP div_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE div_end - -div_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -div_tail: // do { - MOVSD (DI)(AX*8), X0 // X0 = dst[i] - DIVSD (SI)(AX*8), X0 // X0 /= s[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - LOOP div_tail // } while --CX > 0 - -div_end: - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s deleted file mode 100644 index 16ab9b7ec..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/divto_amd64.s +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func DivTo(dst, x, y []float64) -TEXT ·DivTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DI // DI = &dst - MOVQ dst_len+8(FP), CX // CX = len(dst) - MOVQ x_base+24(FP), SI // SI = &x - MOVQ y_base+48(FP), DX // DX = &y - CMPQ x_len+32(FP), CX // CX = max( len(dst), len(x), len(y) ) - CMOVQLE x_len+32(FP), CX - CMPQ y_len+56(FP), CX - CMOVQLE y_len+56(FP), CX - MOVQ CX, ret_len+80(FP) // len(ret) = CX - CMPQ CX, $0 // if CX == 0 { return } - JE div_end - XORQ AX, AX // i = 0 - MOVQ DX, BX - ANDQ $15, BX // BX = &y & OxF - JZ div_no_trim // if BX == 0 { goto div_no_trim } - - // Align on 16-bit boundary - MOVSD (SI)(AX*8), X0 // X0 = s[i] - DIVSD (DX)(AX*8), X0 // X0 /= t[i] - MOVSD X0, (DI)(AX*8) // dst[i] = X0 - INCQ AX // ++i - DECQ CX // --CX - JZ div_end // if CX == 0 { return } - -div_no_trim: - MOVQ CX, BX - ANDQ $7, BX // BX = len(dst) % 8 - SHRQ $3, CX // CX = floor( len(dst) / 8 ) - JZ div_tail_start // if CX == 0 { goto div_tail_start } - -div_loop: // Loop unrolled 8x do { - MOVUPS (SI)(AX*8), X0 // X0 = x[i:i+1] - MOVUPS 16(SI)(AX*8), X1 - MOVUPS 32(SI)(AX*8), X2 - MOVUPS 48(SI)(AX*8), X3 - DIVPD (DX)(AX*8), X0 // X0 /= y[i:i+1] - DIVPD 16(DX)(AX*8), X1 - DIVPD 32(DX)(AX*8), X2 - DIVPD 48(DX)(AX*8), X3 - MOVUPS X0, (DI)(AX*8) // dst[i:i+1] = X0 - MOVUPS X1, 16(DI)(AX*8) - MOVUPS X2, 32(DI)(AX*8) - MOVUPS X3, 48(DI)(AX*8) - ADDQ $8, AX // i += 8 - LOOP div_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE div_end - -div_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - -div_tail: // do { - MOVSD (SI)(AX*8), X0 // X0 = x[i] - DIVSD (DX)(AX*8), X0 // X0 /= y[i] - MOVSD X0, (DI)(AX*8) - INCQ AX // ++i - LOOP div_tail // } while --CX > 0 - -div_end: - MOVQ DI, ret_base+72(FP) // &ret = &dst - MOVQ dst_cap+16(FP), DI // cap(ret) = cap(dst) - MOVQ DI, ret_cap+88(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go deleted file mode 100644 index 33c76c1e0..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package f64 provides float64 vector primitives. -package f64 // import "gonum.org/v1/gonum/internal/asm/f64" diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go deleted file mode 100644 index b77138d1a..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float64) (sum float64) { - for i, v := range x { - sum += y[i] * v - } - return sum -} - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) { - for i := 0; i < int(n); i++ { - sum += y[iy] * x[ix] - ix += incX - iy += incY - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s deleted file mode 100644 index eff25059f..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/dot_amd64.s +++ /dev/null @@ -1,145 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -// func DdotUnitary(x, y []float64) (sum float64) -// This function assumes len(y) >= len(x). -TEXT ·DotUnitary(SB), NOSPLIT, $0 - MOVQ x+0(FP), R8 - MOVQ x_len+8(FP), DI // n = len(x) - MOVQ y+24(FP), R9 - - MOVSD $(0.0), X7 // sum = 0 - MOVSD $(0.0), X8 // sum = 0 - - MOVQ $0, SI // i = 0 - SUBQ $4, DI // n -= 4 - JL tail_uni // if n < 0 goto tail_uni - -loop_uni: - // sum += x[i] * y[i] unrolled 4x. - MOVUPD 0(R8)(SI*8), X0 - MOVUPD 0(R9)(SI*8), X1 - MOVUPD 16(R8)(SI*8), X2 - MOVUPD 16(R9)(SI*8), X3 - MULPD X1, X0 - MULPD X3, X2 - ADDPD X0, X7 - ADDPD X2, X8 - - ADDQ $4, SI // i += 4 - SUBQ $4, DI // n -= 4 - JGE loop_uni // if n >= 0 goto loop_uni - -tail_uni: - ADDQ $4, DI // n += 4 - JLE end_uni // if n <= 0 goto end_uni - -onemore_uni: - // sum += x[i] * y[i] for the remaining 1-3 elements. - MOVSD 0(R8)(SI*8), X0 - MOVSD 0(R9)(SI*8), X1 - MULSD X1, X0 - ADDSD X0, X7 - - ADDQ $1, SI // i++ - SUBQ $1, DI // n-- - JNZ onemore_uni // if n != 0 goto onemore_uni - -end_uni: - // Add the four sums together. - ADDPD X8, X7 - MOVSD X7, X0 - UNPCKHPD X7, X7 - ADDSD X0, X7 - MOVSD X7, sum+48(FP) // Return final sum. - RET - -// func DdotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) -TEXT ·DotInc(SB), NOSPLIT, $0 - MOVQ x+0(FP), R8 - MOVQ y+24(FP), R9 - MOVQ n+48(FP), CX - MOVQ incX+56(FP), R11 - MOVQ incY+64(FP), R12 - MOVQ ix+72(FP), R13 - MOVQ iy+80(FP), R14 - - MOVSD $(0.0), X7 // sum = 0 - LEAQ (R8)(R13*8), SI // p = &x[ix] - LEAQ (R9)(R14*8), DI // q = &y[ix] - SHLQ $3, R11 // incX *= sizeof(float64) - SHLQ $3, R12 // indY *= sizeof(float64) - - SUBQ $2, CX // n -= 2 - JL tail_inc // if n < 0 goto tail_inc - -loop_inc: - // sum += *p * *q unrolled 2x. - MOVHPD (SI), X0 - MOVHPD (DI), X1 - ADDQ R11, SI // p += incX - ADDQ R12, DI // q += incY - MOVLPD (SI), X0 - MOVLPD (DI), X1 - ADDQ R11, SI // p += incX - ADDQ R12, DI // q += incY - - MULPD X1, X0 - ADDPD X0, X7 - - SUBQ $2, CX // n -= 2 - JGE loop_inc // if n >= 0 goto loop_inc - -tail_inc: - ADDQ $2, CX // n += 2 - JLE end_inc // if n <= 0 goto end_inc - - // sum += *p * *q for the last iteration if n is odd. - MOVSD (SI), X0 - MULSD (DI), X0 - ADDSD X0, X7 - -end_inc: - // Add the two sums together. - MOVSD X7, X0 - UNPCKHPD X7, X7 - ADDSD X0, X7 - MOVSD X7, sum+88(FP) // Return final sum. - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go deleted file mode 100644 index 00c99e932..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_amd64.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f64 - -// Ger performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) - -// GemvN computes -// y = alpha * A * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) - -// GemvT computes -// y = alpha * A^T * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go deleted file mode 100644 index 2a1cfd5cd..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ge_noasm.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// Ger performs the rank-one operation -// A += alpha * x * y^T -// where A is an m×n dense matrix, x and y are vectors, and alpha is a scalar. -func Ger(m, n uintptr, alpha float64, x []float64, incX uintptr, y []float64, incY uintptr, a []float64, lda uintptr) { - if incX == 1 && incY == 1 { - x = x[:m] - y = y[:n] - for i, xv := range x { - AxpyUnitary(alpha*xv, y, a[uintptr(i)*lda:uintptr(i)*lda+n]) - } - return - } - - var ky, kx uintptr - if int(incY) < 0 { - ky = uintptr(-int(n-1) * int(incY)) - } - if int(incX) < 0 { - kx = uintptr(-int(m-1) * int(incX)) - } - - ix := kx - for i := 0; i < int(m); i++ { - AxpyInc(alpha*x[ix], y, a[uintptr(i)*lda:uintptr(i)*lda+n], n, incY, 1, ky, 0) - ix += incX - } -} - -// GemvN computes -// y = alpha * A * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvN(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) { - var kx, ky, i uintptr - if int(incX) < 0 { - kx = uintptr(-int(n-1) * int(incX)) - } - if int(incY) < 0 { - ky = uintptr(-int(m-1) * int(incY)) - } - - if incX == 1 && incY == 1 { - if beta == 0 { - for i = 0; i < m; i++ { - y[i] = alpha * DotUnitary(a[lda*i:lda*i+n], x) - } - return - } - for i = 0; i < m; i++ { - y[i] = y[i]*beta + alpha*DotUnitary(a[lda*i:lda*i+n], x) - } - return - } - iy := ky - if beta == 0 { - for i = 0; i < m; i++ { - y[iy] = alpha * DotInc(x, a[lda*i:lda*i+n], n, incX, 1, kx, 0) - iy += incY - } - return - } - for i = 0; i < m; i++ { - y[iy] = y[iy]*beta + alpha*DotInc(x, a[lda*i:lda*i+n], n, incX, 1, kx, 0) - iy += incY - } -} - -// GemvT computes -// y = alpha * A^T * x + beta * y -// where A is an m×n dense matrix, x and y are vectors, and alpha and beta are scalars. -func GemvT(m, n uintptr, alpha float64, a []float64, lda uintptr, x []float64, incX uintptr, beta float64, y []float64, incY uintptr) { - var kx, ky, i uintptr - if int(incX) < 0 { - kx = uintptr(-int(m-1) * int(incX)) - } - if int(incY) < 0 { - ky = uintptr(-int(n-1) * int(incY)) - } - switch { - case beta == 0: // beta == 0 is special-cased to memclear - if incY == 1 { - for i := range y { - y[i] = 0 - } - } else { - iy := ky - for i := 0; i < int(n); i++ { - y[iy] = 0 - iy += incY - } - } - case int(incY) < 0: - ScalInc(beta, y, n, uintptr(int(-incY))) - case incY == 1: - ScalUnitary(beta, y[:n]) - default: - ScalInc(beta, y, n, incY) - } - - if incX == 1 && incY == 1 { - for i = 0; i < m; i++ { - AxpyUnitaryTo(y, alpha*x[i], a[lda*i:lda*i+n], y) - } - return - } - ix := kx - for i = 0; i < m; i++ { - AxpyInc(alpha*x[ix], a[lda*i:lda*i+n], y, n, 1, incY, 0, ky) - ix += incX - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s deleted file mode 100644 index 8d2a6a71a..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvN_amd64.s +++ /dev/null @@ -1,685 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 8 - -#define M_DIM m+0(FP) -#define M CX -#define N_DIM n+8(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define X x_base+56(FP) -#define INC_X R8 -#define INC3_X R9 - -#define Y_PTR DX -#define Y y_base+96(FP) -#define INC_Y R10 -#define INC3_Y R11 - -#define A_ROW AX -#define A_PTR DI -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X15 -#define BETA X14 - -#define INIT4 \ - XORPS X0, X0 \ - XORPS X1, X1 \ - XORPS X2, X2 \ - XORPS X3, X3 - -#define INIT2 \ - XORPS X0, X0 \ - XORPS X1, X1 - -#define INIT1 \ - XORPS X0, X0 - -#define KERNEL_LOAD4 \ - MOVUPS (X_PTR), X12 \ - MOVUPS 2*SIZE(X_PTR), X13 - -#define KERNEL_LOAD2 \ - MOVUPS (X_PTR), X12 - -#define KERNEL_LOAD4_INC \ - MOVSD (X_PTR), X12 \ - MOVHPD (X_PTR)(INC_X*1), X12 \ - MOVSD (X_PTR)(INC_X*2), X13 \ - MOVHPD (X_PTR)(INC3_X*1), X13 - -#define KERNEL_LOAD2_INC \ - MOVSD (X_PTR), X12 \ - MOVHPD (X_PTR)(INC_X*1), X12 - -#define KERNEL_4x4 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MOVUPS (A_PTR)(LDA*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X7 \ - MOVUPS (A_PTR)(LDA*2), X8 \ - MOVUPS 2*SIZE(A_PTR)(LDA*2), X9 \ - MOVUPS (A_PTR)(LDA3*1), X10 \ - MOVUPS 2*SIZE(A_PTR)(LDA3*1), X11 \ - MULPD X12, X4 \ - MULPD X13, X5 \ - MULPD X12, X6 \ - MULPD X13, X7 \ - MULPD X12, X8 \ - MULPD X13, X9 \ - MULPD X12, X10 \ - MULPD X13, X11 \ - ADDPD X4, X0 \ - ADDPD X5, X0 \ - ADDPD X6, X1 \ - ADDPD X7, X1 \ - ADDPD X8, X2 \ - ADDPD X9, X2 \ - ADDPD X10, X3 \ - ADDPD X11, X3 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS (A_PTR), X4 \ - MOVUPS (A_PTR)(LDA*1), X5 \ - MOVUPS (A_PTR)(LDA*2), X6 \ - MOVUPS (A_PTR)(LDA3*1), X7 \ - MULPD X12, X4 \ - MULPD X12, X5 \ - MULPD X12, X6 \ - MULPD X12, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X2 \ - ADDPD X7, X3 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVDDUP (X_PTR), X12 \ - MOVSD (A_PTR), X4 \ - MOVHPD (A_PTR)(LDA*1), X4 \ - MOVSD (A_PTR)(LDA*2), X5 \ - MOVHPD (A_PTR)(LDA3*1), X5 \ - MULPD X12, X4 \ - MULPD X12, X5 \ - ADDPD X4, X0 \ - ADDPD X5, X2 \ - ADDQ $SIZE, A_PTR - -#define STORE4 \ - MOVUPS (Y_PTR), X4 \ - MOVUPS 2*SIZE(Y_PTR), X5 \ - MULPD ALPHA, X0 \ - MULPD ALPHA, X2 \ - MULPD BETA, X4 \ - MULPD BETA, X5 \ - ADDPD X0, X4 \ - ADDPD X2, X5 \ - MOVUPS X4, (Y_PTR) \ - MOVUPS X5, 2*SIZE(Y_PTR) - -#define STORE4_INC \ - MOVSD (Y_PTR), X4 \ - MOVHPD (Y_PTR)(INC_Y*1), X4 \ - MOVSD (Y_PTR)(INC_Y*2), X5 \ - MOVHPD (Y_PTR)(INC3_Y*1), X5 \ - MULPD ALPHA, X0 \ - MULPD ALPHA, X2 \ - MULPD BETA, X4 \ - MULPD BETA, X5 \ - ADDPD X0, X4 \ - ADDPD X2, X5 \ - MOVLPD X4, (Y_PTR) \ - MOVHPD X4, (Y_PTR)(INC_Y*1) \ - MOVLPD X5, (Y_PTR)(INC_Y*2) \ - MOVHPD X5, (Y_PTR)(INC3_Y*1) - -#define KERNEL_2x4 \ - MOVUPS (A_PTR), X8 \ - MOVUPS 2*SIZE(A_PTR), X9 \ - MOVUPS (A_PTR)(LDA*1), X10 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X11 \ - MULPD X12, X8 \ - MULPD X13, X9 \ - MULPD X12, X10 \ - MULPD X13, X11 \ - ADDPD X8, X0 \ - ADDPD X10, X1 \ - ADDPD X9, X0 \ - ADDPD X11, X1 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVUPS (A_PTR), X8 \ - MOVUPS (A_PTR)(LDA*1), X9 \ - MULPD X12, X8 \ - MULPD X12, X9 \ - ADDPD X8, X0 \ - ADDPD X9, X1 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVDDUP (X_PTR), X12 \ - MOVSD (A_PTR), X8 \ - MOVHPD (A_PTR)(LDA*1), X8 \ - MULPD X12, X8 \ - ADDPD X8, X0 \ - ADDQ $SIZE, A_PTR - -#define STORE2 \ - MOVUPS (Y_PTR), X4 \ - MULPD ALPHA, X0 \ - MULPD BETA, X4 \ - ADDPD X0, X4 \ - MOVUPS X4, (Y_PTR) - -#define STORE2_INC \ - MOVSD (Y_PTR), X4 \ - MOVHPD (Y_PTR)(INC_Y*1), X4 \ - MULPD ALPHA, X0 \ - MULPD BETA, X4 \ - ADDPD X0, X4 \ - MOVSD X4, (Y_PTR) \ - MOVHPD X4, (Y_PTR)(INC_Y*1) - -#define KERNEL_1x4 \ - MOVUPS (A_PTR), X8 \ - MOVUPS 2*SIZE(A_PTR), X9 \ - MULPD X12, X8 \ - MULPD X13, X9 \ - ADDPD X8, X0 \ - ADDPD X9, X0 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_1x2 \ - MOVUPS (A_PTR), X8 \ - MULPD X12, X8 \ - ADDPD X8, X0 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSD (X_PTR), X12 \ - MOVSD (A_PTR), X8 \ - MULSD X12, X8 \ - ADDSD X8, X0 \ - ADDQ $SIZE, A_PTR - -#define STORE1 \ - HADDPD X0, X0 \ - MOVSD (Y_PTR), X4 \ - MULSD ALPHA, X0 \ - MULSD BETA, X4 \ - ADDSD X0, X4 \ - MOVSD X4, (Y_PTR) - -// func GemvN(m, n int, -// alpha float64, -// a []float64, lda int, -// x []float64, incX int, -// beta float64, -// y []float64, incY int) -TEXT ·GemvN(SB), NOSPLIT, $32-128 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - MOVDDUP alpha+16(FP), ALPHA - MOVDDUP beta+88(FP), BETA - - MOVQ x_base+56(FP), X_PTR - MOVQ y_base+96(FP), Y_PTR - MOVQ a_base+24(FP), A_ROW - MOVQ incY+120(FP), INC_Y - MOVQ lda+48(FP), LDA // LDA = LDA * sizeof(float64) - SHLQ $3, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - MOVQ A_ROW, A_PTR - - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - MOVQ Y_PTR, Y - - SHLQ $3, INC_Y // INC_Y = incY * sizeof(float64) - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - MOVSD $0.0, X0 - COMISD BETA, X0 - JNE gemv_start // if beta != 0 { goto gemv_start } - -gemv_clear: // beta == 0 is special cased to clear memory (no nan handling) - XORPS X0, X0 - XORPS X1, X1 - XORPS X2, X2 - XORPS X3, X3 - - CMPQ incY+120(FP), $1 // Check for dense vector X (fast-path) - JNE inc_clear - - SHRQ $3, M - JZ clear4 - -clear8: - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - MOVUPS X2, 32(Y_PTR) - MOVUPS X3, 48(Y_PTR) - ADDQ $8*SIZE, Y_PTR - DECQ M - JNZ clear8 - -clear4: - TESTQ $4, M_DIM - JZ clear2 - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - ADDQ $4*SIZE, Y_PTR - -clear2: - TESTQ $2, M_DIM - JZ clear1 - MOVUPS X0, (Y_PTR) - ADDQ $2*SIZE, Y_PTR - -clear1: - TESTQ $1, M_DIM - JZ prep_end - MOVSD X0, (Y_PTR) - - JMP prep_end - -inc_clear: - SHRQ $2, M - JZ inc_clear2 - -inc_clear4: - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - MOVSD X2, (Y_PTR)(INC_Y*2) - MOVSD X3, (Y_PTR)(INC3_Y*1) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_clear4 - -inc_clear2: - TESTQ $2, M_DIM - JZ inc_clear1 - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_clear1: - TESTQ $1, M_DIM - JZ prep_end - MOVSD X0, (Y_PTR) - -prep_end: - MOVQ Y, Y_PTR - MOVQ M_DIM, M - -gemv_start: - CMPQ incX+80(FP), $1 // Check for dense vector X (fast-path) - JNE inc - - SHRQ $2, M - JZ r2 - -r4: - // LOAD 4 - INIT4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r4c2 - -r4c4: - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - - ADDQ $4*SIZE, X_PTR - - DECQ N - JNZ r4c4 - -r4c2: - TESTQ $2, N_DIM - JZ r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_4x2 - - ADDQ $2*SIZE, X_PTR - -r4c1: - HADDPD X1, X0 - HADDPD X3, X2 - TESTQ $1, N_DIM - JZ r4end - - // 4x1 KERNEL - KERNEL_4x1 - - ADDQ $SIZE, X_PTR - -r4end: - CMPQ INC_Y, $SIZE - JNZ r4st_inc - - STORE4 - ADDQ $4*SIZE, Y_PTR - JMP r4inc - -r4st_inc: - STORE4_INC - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -r4inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ r4 - -r2: - TESTQ $2, M_DIM - JZ r1 - - // LOAD 2 - INIT2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r2c2 - -r2c4: - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_2x4 - - ADDQ $4*SIZE, X_PTR - - DECQ N - JNZ r2c4 - -r2c2: - TESTQ $2, N_DIM - JZ r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - - ADDQ $2*SIZE, X_PTR - -r2c1: - HADDPD X1, X0 - TESTQ $1, N_DIM - JZ r2end - - // 2x1 KERNEL - KERNEL_2x1 - - ADDQ $SIZE, X_PTR - -r2end: - CMPQ INC_Y, $SIZE - JNE r2st_inc - - STORE2 - ADDQ $2*SIZE, Y_PTR - JMP r2inc - -r2st_inc: - STORE2_INC - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -r2inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - INIT1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r1c2 - -r1c4: - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_1x4 - - ADDQ $4*SIZE, X_PTR - - DECQ N - JNZ r1c4 - -r1c2: - TESTQ $2, N_DIM - JZ r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_1x2 - - ADDQ $2*SIZE, X_PTR - -r1c1: - - TESTQ $1, N_DIM - JZ r1end - - // 1x1 KERNEL - KERNEL_1x1 - -r1end: - STORE1 - -end: - RET - -inc: // Algorithm for incX != 1 ( split loads in kernel ) - MOVQ incX+80(FP), INC_X // INC_X = incX - - XORQ TMP2, TMP2 // TMP2 = 0 - MOVQ N, TMP1 // TMP1 = N - SUBQ $1, TMP1 // TMP1 -= 1 - NEGQ TMP1 // TMP1 = -TMP1 - IMULQ INC_X, TMP1 // TMP1 *= INC_X - CMPQ INC_X, $0 // if INC_X < 0 { TMP2 = TMP1 } - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR // X_PTR = X_PTR[TMP2] - MOVQ X_PTR, X // X = X_PTR - - SHLQ $3, INC_X - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - - SHRQ $2, M - JZ inc_r2 - -inc_r4: - // LOAD 4 - INIT4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r4c2 - -inc_r4c4: - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - - LEAQ (X_PTR)(INC_X*4), X_PTR - - DECQ N - JNZ inc_r4c4 - -inc_r4c2: - TESTQ $2, N_DIM - JZ inc_r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_4x2 - - LEAQ (X_PTR)(INC_X*2), X_PTR - -inc_r4c1: - HADDPD X1, X0 - HADDPD X3, X2 - TESTQ $1, N_DIM - JZ inc_r4end - - // 4x1 KERNEL - KERNEL_4x1 - - ADDQ INC_X, X_PTR - -inc_r4end: - CMPQ INC_Y, $SIZE - JNE inc_r4st_inc - - STORE4 - ADDQ $4*SIZE, Y_PTR - JMP inc_r4inc - -inc_r4st_inc: - STORE4_INC - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - -inc_r4inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ inc_r4 - -inc_r2: - TESTQ $2, M_DIM - JZ inc_r1 - - // LOAD 2 - INIT2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r2c2 - -inc_r2c4: - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_2x4 - - LEAQ (X_PTR)(INC_X*4), X_PTR - DECQ N - JNZ inc_r2c4 - -inc_r2c2: - TESTQ $2, N_DIM - JZ inc_r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - - LEAQ (X_PTR)(INC_X*2), X_PTR - -inc_r2c1: - HADDPD X1, X0 - TESTQ $1, N_DIM - JZ inc_r2end - - // 2x1 KERNEL - KERNEL_2x1 - - ADDQ INC_X, X_PTR - -inc_r2end: - CMPQ INC_Y, $SIZE - JNE inc_r2st_inc - - STORE2 - ADDQ $2*SIZE, Y_PTR - JMP inc_r2inc - -inc_r2st_inc: - STORE2_INC - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r2inc: - MOVQ X, X_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_r1: - TESTQ $1, M_DIM - JZ inc_end - - // LOAD 1 - INIT1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r1c2 - -inc_r1c4: - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_1x4 - - LEAQ (X_PTR)(INC_X*4), X_PTR - DECQ N - JNZ inc_r1c4 - -inc_r1c2: - TESTQ $2, N_DIM - JZ inc_r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_1x2 - - LEAQ (X_PTR)(INC_X*2), X_PTR - -inc_r1c1: - TESTQ $1, N_DIM - JZ inc_r1end - - // 1x1 KERNEL - KERNEL_1x1 - -inc_r1end: - STORE1 - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s deleted file mode 100644 index ff7d60fb6..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/gemvT_amd64.s +++ /dev/null @@ -1,745 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 8 - -#define M_DIM n+8(FP) -#define M CX -#define N_DIM m+0(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define X x_base+56(FP) -#define Y_PTR DX -#define Y y_base+96(FP) -#define A_ROW AX -#define A_PTR DI - -#define INC_X R8 -#define INC3_X R9 - -#define INC_Y R10 -#define INC3_Y R11 - -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X15 -#define BETA X14 - -#define INIT4 \ - MOVDDUP (X_PTR), X8 \ - MOVDDUP (X_PTR)(INC_X*1), X9 \ - MOVDDUP (X_PTR)(INC_X*2), X10 \ - MOVDDUP (X_PTR)(INC3_X*1), X11 \ - MULPD ALPHA, X8 \ - MULPD ALPHA, X9 \ - MULPD ALPHA, X10 \ - MULPD ALPHA, X11 - -#define INIT2 \ - MOVDDUP (X_PTR), X8 \ - MOVDDUP (X_PTR)(INC_X*1), X9 \ - MULPD ALPHA, X8 \ - MULPD ALPHA, X9 - -#define INIT1 \ - MOVDDUP (X_PTR), X8 \ - MULPD ALPHA, X8 - -#define KERNEL_LOAD4 \ - MOVUPS (Y_PTR), X0 \ - MOVUPS 2*SIZE(Y_PTR), X1 - -#define KERNEL_LOAD2 \ - MOVUPS (Y_PTR), X0 - -#define KERNEL_LOAD4_INC \ - MOVSD (Y_PTR), X0 \ - MOVHPD (Y_PTR)(INC_Y*1), X0 \ - MOVSD (Y_PTR)(INC_Y*2), X1 \ - MOVHPD (Y_PTR)(INC3_Y*1), X1 - -#define KERNEL_LOAD2_INC \ - MOVSD (Y_PTR), X0 \ - MOVHPD (Y_PTR)(INC_Y*1), X0 - -#define KERNEL_4x4 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MOVUPS (A_PTR)(LDA*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X7 \ - MULPD X8, X4 \ - MULPD X8, X5 \ - MULPD X9, X6 \ - MULPD X9, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X0 \ - ADDPD X7, X1 \ - MOVUPS (A_PTR)(LDA*2), X4 \ - MOVUPS 2*SIZE(A_PTR)(LDA*2), X5 \ - MOVUPS (A_PTR)(LDA3*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA3*1), X7 \ - MULPD X10, X4 \ - MULPD X10, X5 \ - MULPD X11, X6 \ - MULPD X11, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X0 \ - ADDPD X7, X1 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MOVUPS (A_PTR)(LDA*1), X6 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X7 \ - MULPD X8, X4 \ - MULPD X8, X5 \ - MULPD X9, X6 \ - MULPD X9, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDPD X6, X0 \ - ADDPD X7, X1 \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVUPS (A_PTR), X4 \ - MOVUPS 2*SIZE(A_PTR), X5 \ - MULPD X8, X4 \ - MULPD X8, X5 \ - ADDPD X4, X0 \ - ADDPD X5, X1 \ - ADDQ $4*SIZE, A_PTR - -#define STORE4 \ - MOVUPS X0, (Y_PTR) \ - MOVUPS X1, 2*SIZE(Y_PTR) - -#define STORE4_INC \ - MOVLPD X0, (Y_PTR) \ - MOVHPD X0, (Y_PTR)(INC_Y*1) \ - MOVLPD X1, (Y_PTR)(INC_Y*2) \ - MOVHPD X1, (Y_PTR)(INC3_Y*1) - -#define KERNEL_2x4 \ - MOVUPS (A_PTR), X4 \ - MOVUPS (A_PTR)(LDA*1), X5 \ - MOVUPS (A_PTR)(LDA*2), X6 \ - MOVUPS (A_PTR)(LDA3*1), X7 \ - MULPD X8, X4 \ - MULPD X9, X5 \ - MULPD X10, X6 \ - MULPD X11, X7 \ - ADDPD X4, X0 \ - ADDPD X5, X0 \ - ADDPD X6, X0 \ - ADDPD X7, X0 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVUPS (A_PTR), X4 \ - MOVUPS (A_PTR)(LDA*1), X5 \ - MULPD X8, X4 \ - MULPD X9, X5 \ - ADDPD X4, X0 \ - ADDPD X5, X0 \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVUPS (A_PTR), X4 \ - MULPD X8, X4 \ - ADDPD X4, X0 \ - ADDQ $2*SIZE, A_PTR - -#define STORE2 \ - MOVUPS X0, (Y_PTR) - -#define STORE2_INC \ - MOVLPD X0, (Y_PTR) \ - MOVHPD X0, (Y_PTR)(INC_Y*1) - -#define KERNEL_1x4 \ - MOVSD (Y_PTR), X0 \ - MOVSD (A_PTR), X4 \ - MOVSD (A_PTR)(LDA*1), X5 \ - MOVSD (A_PTR)(LDA*2), X6 \ - MOVSD (A_PTR)(LDA3*1), X7 \ - MULSD X8, X4 \ - MULSD X9, X5 \ - MULSD X10, X6 \ - MULSD X11, X7 \ - ADDSD X4, X0 \ - ADDSD X5, X0 \ - ADDSD X6, X0 \ - ADDSD X7, X0 \ - MOVSD X0, (Y_PTR) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x2 \ - MOVSD (Y_PTR), X0 \ - MOVSD (A_PTR), X4 \ - MOVSD (A_PTR)(LDA*1), X5 \ - MULSD X8, X4 \ - MULSD X9, X5 \ - ADDSD X4, X0 \ - ADDSD X5, X0 \ - MOVSD X0, (Y_PTR) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSD (Y_PTR), X0 \ - MOVSD (A_PTR), X4 \ - MULSD X8, X4 \ - ADDSD X4, X0 \ - MOVSD X0, (Y_PTR) \ - ADDQ $SIZE, A_PTR - -#define SCALE_8(PTR, SCAL) \ - MOVUPS (PTR), X0 \ - MOVUPS 16(PTR), X1 \ - MOVUPS 32(PTR), X2 \ - MOVUPS 48(PTR), X3 \ - MULPD SCAL, X0 \ - MULPD SCAL, X1 \ - MULPD SCAL, X2 \ - MULPD SCAL, X3 \ - MOVUPS X0, (PTR) \ - MOVUPS X1, 16(PTR) \ - MOVUPS X2, 32(PTR) \ - MOVUPS X3, 48(PTR) - -#define SCALE_4(PTR, SCAL) \ - MOVUPS (PTR), X0 \ - MOVUPS 16(PTR), X1 \ - MULPD SCAL, X0 \ - MULPD SCAL, X1 \ - MOVUPS X0, (PTR) \ - MOVUPS X1, 16(PTR) \ - -#define SCALE_2(PTR, SCAL) \ - MOVUPS (PTR), X0 \ - MULPD SCAL, X0 \ - MOVUPS X0, (PTR) \ - -#define SCALE_1(PTR, SCAL) \ - MOVSD (PTR), X0 \ - MULSD SCAL, X0 \ - MOVSD X0, (PTR) \ - -#define SCALEINC_4(PTR, INC, INC3, SCAL) \ - MOVSD (PTR), X0 \ - MOVSD (PTR)(INC*1), X1 \ - MOVSD (PTR)(INC*2), X2 \ - MOVSD (PTR)(INC3*1), X3 \ - MULSD SCAL, X0 \ - MULSD SCAL, X1 \ - MULSD SCAL, X2 \ - MULSD SCAL, X3 \ - MOVSD X0, (PTR) \ - MOVSD X1, (PTR)(INC*1) \ - MOVSD X2, (PTR)(INC*2) \ - MOVSD X3, (PTR)(INC3*1) - -#define SCALEINC_2(PTR, INC, SCAL) \ - MOVSD (PTR), X0 \ - MOVSD (PTR)(INC*1), X1 \ - MULSD SCAL, X0 \ - MULSD SCAL, X1 \ - MOVSD X0, (PTR) \ - MOVSD X1, (PTR)(INC*1) - -// func GemvT(m, n int, -// alpha float64, -// a []float64, lda int, -// x []float64, incX int, -// beta float64, -// y []float64, incY int) -TEXT ·GemvT(SB), NOSPLIT, $32-128 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - MOVDDUP alpha+16(FP), ALPHA - - MOVQ x_base+56(FP), X_PTR - MOVQ y_base+96(FP), Y_PTR - MOVQ a_base+24(FP), A_ROW - MOVQ incY+120(FP), INC_Y // INC_Y = incY * sizeof(float64) - MOVQ lda+48(FP), LDA // LDA = LDA * sizeof(float64) - SHLQ $3, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - MOVQ A_ROW, A_PTR - - MOVQ incX+80(FP), INC_X // INC_X = incX * sizeof(float64) - - XORQ TMP2, TMP2 - MOVQ N, TMP1 - SUBQ $1, TMP1 - NEGQ TMP1 - IMULQ INC_X, TMP1 - CMPQ INC_X, $0 - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR - MOVQ X_PTR, X - - SHLQ $3, INC_X - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - - CMPQ incY+120(FP), $1 // Check for dense vector Y (fast-path) - JNE inc - - MOVSD $1.0, X0 - COMISD beta+88(FP), X0 - JE gemv_start - - MOVSD $0.0, X0 - COMISD beta+88(FP), X0 - JE gemv_clear - - MOVDDUP beta+88(FP), BETA - SHRQ $3, M - JZ scal4 - -scal8: - SCALE_8(Y_PTR, BETA) - ADDQ $8*SIZE, Y_PTR - DECQ M - JNZ scal8 - -scal4: - TESTQ $4, M_DIM - JZ scal2 - SCALE_4(Y_PTR, BETA) - ADDQ $4*SIZE, Y_PTR - -scal2: - TESTQ $2, M_DIM - JZ scal1 - SCALE_2(Y_PTR, BETA) - ADDQ $2*SIZE, Y_PTR - -scal1: - TESTQ $1, M_DIM - JZ prep_end - SCALE_1(Y_PTR, BETA) - - JMP prep_end - -gemv_clear: // beta == 0 is special cased to clear memory (no nan handling) - XORPS X0, X0 - XORPS X1, X1 - XORPS X2, X2 - XORPS X3, X3 - - SHRQ $3, M - JZ clear4 - -clear8: - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - MOVUPS X2, 32(Y_PTR) - MOVUPS X3, 48(Y_PTR) - ADDQ $8*SIZE, Y_PTR - DECQ M - JNZ clear8 - -clear4: - TESTQ $4, M_DIM - JZ clear2 - MOVUPS X0, (Y_PTR) - MOVUPS X1, 16(Y_PTR) - ADDQ $4*SIZE, Y_PTR - -clear2: - TESTQ $2, M_DIM - JZ clear1 - MOVUPS X0, (Y_PTR) - ADDQ $2*SIZE, Y_PTR - -clear1: - TESTQ $1, M_DIM - JZ prep_end - MOVSD X0, (Y_PTR) - -prep_end: - MOVQ Y, Y_PTR - MOVQ M_DIM, M - -gemv_start: - SHRQ $2, N - JZ c2 - -c4: - // LOAD 4 - INIT4 - - MOVQ M_DIM, M - SHRQ $2, M - JZ c4r2 - -c4r4: - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - STORE4 - - ADDQ $4*SIZE, Y_PTR - - DECQ M - JNZ c4r4 - -c4r2: - TESTQ $2, M_DIM - JZ c4r1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x4 - STORE2 - - ADDQ $2*SIZE, Y_PTR - -c4r1: - TESTQ $1, M_DIM - JZ c4end - - // 4x1 KERNEL - KERNEL_1x4 - - ADDQ $SIZE, Y_PTR - -c4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ N - JNZ c4 - -c2: - TESTQ $2, N_DIM - JZ c1 - - // LOAD 2 - INIT2 - - MOVQ M_DIM, M - SHRQ $2, M - JZ c2r2 - -c2r4: - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x2 - STORE4 - - ADDQ $4*SIZE, Y_PTR - - DECQ M - JNZ c2r4 - -c2r2: - TESTQ $2, M_DIM - JZ c2r1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - STORE2 - - ADDQ $2*SIZE, Y_PTR - -c2r1: - TESTQ $1, M_DIM - JZ c2end - - // 2x1 KERNEL - KERNEL_1x2 - - ADDQ $SIZE, Y_PTR - -c2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -c1: - TESTQ $1, N_DIM - JZ end - - // LOAD 1 - INIT1 - - MOVQ M_DIM, M - SHRQ $2, M - JZ c1r2 - -c1r4: - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x1 - STORE4 - - ADDQ $4*SIZE, Y_PTR - - DECQ M - JNZ c1r4 - -c1r2: - TESTQ $2, M_DIM - JZ c1r1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x1 - STORE2 - - ADDQ $2*SIZE, Y_PTR - -c1r1: - TESTQ $1, M_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - -end: - RET - -inc: // Algorithm for incX != 0 ( split loads in kernel ) - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - MOVQ Y_PTR, Y - - SHLQ $3, INC_Y - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - MOVSD $1.0, X0 - COMISD beta+88(FP), X0 - JE inc_gemv_start - - MOVSD $0.0, X0 - COMISD beta+88(FP), X0 - JE inc_gemv_clear - - MOVDDUP beta+88(FP), BETA - SHRQ $2, M - JZ inc_scal2 - -inc_scal4: - SCALEINC_4(Y_PTR, INC_Y, INC3_Y, BETA) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_scal4 - -inc_scal2: - TESTQ $2, M_DIM - JZ inc_scal1 - - SCALEINC_2(Y_PTR, INC_Y, BETA) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_scal1: - TESTQ $1, M_DIM - JZ inc_prep_end - SCALE_1(Y_PTR, BETA) - - JMP inc_prep_end - -inc_gemv_clear: // beta == 0 is special-cased to clear memory (no nan handling) - XORPS X0, X0 - XORPS X1, X1 - XORPS X2, X2 - XORPS X3, X3 - - SHRQ $2, M - JZ inc_clear2 - -inc_clear4: - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - MOVSD X2, (Y_PTR)(INC_Y*2) - MOVSD X3, (Y_PTR)(INC3_Y*1) - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_clear4 - -inc_clear2: - TESTQ $2, M_DIM - JZ inc_clear1 - MOVSD X0, (Y_PTR) - MOVSD X1, (Y_PTR)(INC_Y*1) - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_clear1: - TESTQ $1, M_DIM - JZ inc_prep_end - MOVSD X0, (Y_PTR) - -inc_prep_end: - MOVQ Y, Y_PTR - MOVQ M_DIM, M - -inc_gemv_start: - SHRQ $2, N - JZ inc_c2 - -inc_c4: - // LOAD 4 - INIT4 - - MOVQ M_DIM, M - SHRQ $2, M - JZ inc_c4r2 - -inc_c4r4: - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - STORE4_INC - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - - DECQ M - JNZ inc_c4r4 - -inc_c4r2: - TESTQ $2, M_DIM - JZ inc_c4r1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x4 - STORE2_INC - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_c4r1: - TESTQ $1, M_DIM - JZ inc_c4end - - // 4x1 KERNEL - KERNEL_1x4 - - ADDQ INC_Y, Y_PTR - -inc_c4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ N - JNZ inc_c4 - -inc_c2: - TESTQ $2, N_DIM - JZ inc_c1 - - // LOAD 2 - INIT2 - - MOVQ M_DIM, M - SHRQ $2, M - JZ inc_c2r2 - -inc_c2r4: - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x2 - STORE4_INC - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_c2r4 - -inc_c2r2: - TESTQ $2, M_DIM - JZ inc_c2r1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - STORE2_INC - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_c2r1: - TESTQ $1, M_DIM - JZ inc_c2end - - // 2x1 KERNEL - KERNEL_1x2 - - ADDQ INC_Y, Y_PTR - -inc_c2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_c1: - TESTQ $1, N_DIM - JZ inc_end - - // LOAD 1 - INIT1 - - MOVQ M_DIM, M - SHRQ $2, M - JZ inc_c1r2 - -inc_c1r4: - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x1 - STORE4_INC - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ M - JNZ inc_c1r4 - -inc_c1r2: - TESTQ $2, M_DIM - JZ inc_c1r1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x1 - STORE2_INC - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_c1r1: - TESTQ $1, M_DIM - JZ inc_end - - // 1x1 KERNEL - KERNEL_1x1 - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s deleted file mode 100644 index 8c1b36a65..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/ger_amd64.s +++ /dev/null @@ -1,591 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define SIZE 8 - -#define M_DIM m+0(FP) -#define M CX -#define N_DIM n+8(FP) -#define N BX - -#define TMP1 R14 -#define TMP2 R15 - -#define X_PTR SI -#define Y y_base+56(FP) -#define Y_PTR DX -#define A_ROW AX -#define A_PTR DI - -#define INC_X R8 -#define INC3_X R9 - -#define INC_Y R10 -#define INC3_Y R11 - -#define LDA R12 -#define LDA3 R13 - -#define ALPHA X0 - -#define LOAD4 \ - PREFETCHNTA (X_PTR )(INC_X*8) \ - MOVDDUP (X_PTR), X1 \ - MOVDDUP (X_PTR)(INC_X*1), X2 \ - MOVDDUP (X_PTR)(INC_X*2), X3 \ - MOVDDUP (X_PTR)(INC3_X*1), X4 \ - MULPD ALPHA, X1 \ - MULPD ALPHA, X2 \ - MULPD ALPHA, X3 \ - MULPD ALPHA, X4 - -#define LOAD2 \ - MOVDDUP (X_PTR), X1 \ - MOVDDUP (X_PTR)(INC_X*1), X2 \ - MULPD ALPHA, X1 \ - MULPD ALPHA, X2 - -#define LOAD1 \ - MOVDDUP (X_PTR), X1 \ - MULPD ALPHA, X1 - -#define KERNEL_LOAD4 \ - MOVUPS (Y_PTR), X5 \ - MOVUPS 2*SIZE(Y_PTR), X6 - -#define KERNEL_LOAD4_INC \ - MOVLPD (Y_PTR), X5 \ - MOVHPD (Y_PTR)(INC_Y*1), X5 \ - MOVLPD (Y_PTR)(INC_Y*2), X6 \ - MOVHPD (Y_PTR)(INC3_Y*1), X6 - -#define KERNEL_LOAD2 \ - MOVUPS (Y_PTR), X5 - -#define KERNEL_LOAD2_INC \ - MOVLPD (Y_PTR), X5 \ - MOVHPD (Y_PTR)(INC_Y*1), X5 - -#define KERNEL_4x4 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MOVUPS X5, X9 \ - MOVUPS X6, X10 \ - MOVUPS X5, X11 \ - MOVUPS X6, X12 \ - MULPD X1, X5 \ - MULPD X1, X6 \ - MULPD X2, X7 \ - MULPD X2, X8 \ - MULPD X3, X9 \ - MULPD X3, X10 \ - MULPD X4, X11 \ - MULPD X4, X12 - -#define STORE_4x4 \ - MOVUPS (A_PTR), X13 \ - ADDPD X13, X5 \ - MOVUPS 2*SIZE(A_PTR), X14 \ - ADDPD X14, X6 \ - MOVUPS (A_PTR)(LDA*1), X15 \ - ADDPD X15, X7 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X0 \ - ADDPD X0, X8 \ - MOVUPS (A_PTR)(LDA*2), X13 \ - ADDPD X13, X9 \ - MOVUPS 2*SIZE(A_PTR)(LDA*2), X14 \ - ADDPD X14, X10 \ - MOVUPS (A_PTR)(LDA3*1), X15 \ - ADDPD X15, X11 \ - MOVUPS 2*SIZE(A_PTR)(LDA3*1), X0 \ - ADDPD X0, X12 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 2*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 2*SIZE(A_PTR)(LDA*1) \ - MOVUPS X9, (A_PTR)(LDA*2) \ - MOVUPS X10, 2*SIZE(A_PTR)(LDA*2) \ - MOVUPS X11, (A_PTR)(LDA3*1) \ - MOVUPS X12, 2*SIZE(A_PTR)(LDA3*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_4x2 \ - MOVUPS X5, X6 \ - MOVUPS X5, X7 \ - MOVUPS X5, X8 \ - MULPD X1, X5 \ - MULPD X2, X6 \ - MULPD X3, X7 \ - MULPD X4, X8 - -#define STORE_4x2 \ - MOVUPS (A_PTR), X9 \ - ADDPD X9, X5 \ - MOVUPS (A_PTR)(LDA*1), X10 \ - ADDPD X10, X6 \ - MOVUPS (A_PTR)(LDA*2), X11 \ - ADDPD X11, X7 \ - MOVUPS (A_PTR)(LDA3*1), X12 \ - ADDPD X12, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - MOVUPS X7, (A_PTR)(LDA*2) \ - MOVUPS X8, (A_PTR)(LDA3*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_4x1 \ - MOVSD (Y_PTR), X5 \ - MOVSD X5, X6 \ - MOVSD X5, X7 \ - MOVSD X5, X8 \ - MULSD X1, X5 \ - MULSD X2, X6 \ - MULSD X3, X7 \ - MULSD X4, X8 - -#define STORE_4x1 \ - ADDSD (A_PTR), X5 \ - ADDSD (A_PTR)(LDA*1), X6 \ - ADDSD (A_PTR)(LDA*2), X7 \ - ADDSD (A_PTR)(LDA3*1), X8 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - MOVSD X7, (A_PTR)(LDA*2) \ - MOVSD X8, (A_PTR)(LDA3*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_2x4 \ - MOVUPS X5, X7 \ - MOVUPS X6, X8 \ - MULPD X1, X5 \ - MULPD X1, X6 \ - MULPD X2, X7 \ - MULPD X2, X8 - -#define STORE_2x4 \ - MOVUPS (A_PTR), X9 \ - ADDPD X9, X5 \ - MOVUPS 2*SIZE(A_PTR), X10 \ - ADDPD X10, X6 \ - MOVUPS (A_PTR)(LDA*1), X11 \ - ADDPD X11, X7 \ - MOVUPS 2*SIZE(A_PTR)(LDA*1), X12 \ - ADDPD X12, X8 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 2*SIZE(A_PTR) \ - MOVUPS X7, (A_PTR)(LDA*1) \ - MOVUPS X8, 2*SIZE(A_PTR)(LDA*1) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_2x2 \ - MOVUPS X5, X6 \ - MULPD X1, X5 \ - MULPD X2, X6 - -#define STORE_2x2 \ - MOVUPS (A_PTR), X7 \ - ADDPD X7, X5 \ - MOVUPS (A_PTR)(LDA*1), X8 \ - ADDPD X8, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, (A_PTR)(LDA*1) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_2x1 \ - MOVSD (Y_PTR), X5 \ - MOVSD X5, X6 \ - MULSD X1, X5 \ - MULSD X2, X6 - -#define STORE_2x1 \ - ADDSD (A_PTR), X5 \ - ADDSD (A_PTR)(LDA*1), X6 \ - MOVSD X5, (A_PTR) \ - MOVSD X6, (A_PTR)(LDA*1) \ - ADDQ $SIZE, A_PTR - -#define KERNEL_1x4 \ - MULPD X1, X5 \ - MULPD X1, X6 - -#define STORE_1x4 \ - MOVUPS (A_PTR), X7 \ - ADDPD X7, X5 \ - MOVUPS 2*SIZE(A_PTR), X8 \ - ADDPD X8, X6 \ - MOVUPS X5, (A_PTR) \ - MOVUPS X6, 2*SIZE(A_PTR) \ - ADDQ $4*SIZE, A_PTR - -#define KERNEL_1x2 \ - MULPD X1, X5 - -#define STORE_1x2 \ - MOVUPS (A_PTR), X6 \ - ADDPD X6, X5 \ - MOVUPS X5, (A_PTR) \ - ADDQ $2*SIZE, A_PTR - -#define KERNEL_1x1 \ - MOVSD (Y_PTR), X5 \ - MULSD X1, X5 - -#define STORE_1x1 \ - ADDSD (A_PTR), X5 \ - MOVSD X5, (A_PTR) \ - ADDQ $SIZE, A_PTR - -// func Ger(m, n uintptr, alpha float64, -// x []float64, incX uintptr, -// y []float64, incY uintptr, -// a []float64, lda uintptr) -TEXT ·Ger(SB), NOSPLIT, $0 - MOVQ M_DIM, M - MOVQ N_DIM, N - CMPQ M, $0 - JE end - CMPQ N, $0 - JE end - - MOVDDUP alpha+16(FP), ALPHA - - MOVQ x_base+24(FP), X_PTR - MOVQ y_base+56(FP), Y_PTR - MOVQ a_base+88(FP), A_ROW - MOVQ incX+48(FP), INC_X // INC_X = incX * sizeof(float64) - SHLQ $3, INC_X - MOVQ lda+112(FP), LDA // LDA = LDA * sizeof(float64) - SHLQ $3, LDA - LEAQ (LDA)(LDA*2), LDA3 // LDA3 = LDA * 3 - LEAQ (INC_X)(INC_X*2), INC3_X // INC3_X = INC_X * 3 - MOVQ A_ROW, A_PTR - - XORQ TMP2, TMP2 - MOVQ M, TMP1 - SUBQ $1, TMP1 - IMULQ INC_X, TMP1 - NEGQ TMP1 - CMPQ INC_X, $0 - CMOVQLT TMP1, TMP2 - LEAQ (X_PTR)(TMP2*SIZE), X_PTR - - CMPQ incY+80(FP), $1 // Check for dense vector Y (fast-path) - JG inc - JL end - - SHRQ $2, M - JZ r2 - -r4: - // LOAD 4 - LOAD4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r4c2 - -r4c4: - // 4x4 KERNEL - KERNEL_LOAD4 - KERNEL_4x4 - STORE_4x4 - - ADDQ $4*SIZE, Y_PTR - - DECQ N - JNZ r4c4 - - // Reload ALPHA after it's clobbered by STORE_4x4 - MOVDDUP alpha+16(FP), ALPHA - -r4c2: - TESTQ $2, N_DIM - JZ r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2 - KERNEL_4x2 - STORE_4x2 - - ADDQ $2*SIZE, Y_PTR - -r4c1: - TESTQ $1, N_DIM - JZ r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ $SIZE, Y_PTR - -r4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ r4 - -r2: - TESTQ $2, M_DIM - JZ r1 - - // LOAD 2 - LOAD2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r2c2 - -r2c4: - // 2x4 KERNEL - KERNEL_LOAD4 - KERNEL_2x4 - STORE_2x4 - - ADDQ $4*SIZE, Y_PTR - - DECQ N - JNZ r2c4 - -r2c2: - TESTQ $2, N_DIM - JZ r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2 - KERNEL_2x2 - STORE_2x2 - - ADDQ $2*SIZE, Y_PTR - -r2c1: - TESTQ $1, N_DIM - JZ r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ $SIZE, Y_PTR - -r2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ r1c2 - -r1c4: - // 1x4 KERNEL - KERNEL_LOAD4 - KERNEL_1x4 - STORE_1x4 - - ADDQ $4*SIZE, Y_PTR - - DECQ N - JNZ r1c4 - -r1c2: - TESTQ $2, N_DIM - JZ r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2 - KERNEL_1x2 - STORE_1x2 - - ADDQ $2*SIZE, Y_PTR - -r1c1: - TESTQ $1, N_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - - ADDQ $SIZE, Y_PTR - -end: - RET - -inc: // Algorithm for incY != 1 ( split loads in kernel ) - - MOVQ incY+80(FP), INC_Y // INC_Y = incY * sizeof(float64) - SHLQ $3, INC_Y - LEAQ (INC_Y)(INC_Y*2), INC3_Y // INC3_Y = INC_Y * 3 - - XORQ TMP2, TMP2 - MOVQ N, TMP1 - SUBQ $1, TMP1 - IMULQ INC_Y, TMP1 - NEGQ TMP1 - CMPQ INC_Y, $0 - CMOVQLT TMP1, TMP2 - LEAQ (Y_PTR)(TMP2*SIZE), Y_PTR - - SHRQ $2, M - JZ inc_r2 - -inc_r4: - // LOAD 4 - LOAD4 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r4c2 - -inc_r4c4: - // 4x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_4x4 - STORE_4x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r4c4 - - // Reload ALPHA after it's clobbered by STORE_4x4 - MOVDDUP alpha+16(FP), ALPHA - -inc_r4c2: - TESTQ $2, N_DIM - JZ inc_r4c1 - - // 4x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_4x2 - STORE_4x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r4c1: - TESTQ $1, N_DIM - JZ inc_r4end - - // 4x1 KERNEL - KERNEL_4x1 - STORE_4x1 - - ADDQ INC_Y, Y_PTR - -inc_r4end: - LEAQ (X_PTR)(INC_X*4), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*4), A_ROW - MOVQ A_ROW, A_PTR - - DECQ M - JNZ inc_r4 - -inc_r2: - TESTQ $2, M_DIM - JZ inc_r1 - - // LOAD 2 - LOAD2 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r2c2 - -inc_r2c4: - // 2x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_2x4 - STORE_2x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r2c4 - -inc_r2c2: - TESTQ $2, N_DIM - JZ inc_r2c1 - - // 2x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_2x2 - STORE_2x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r2c1: - TESTQ $1, N_DIM - JZ inc_r2end - - // 2x1 KERNEL - KERNEL_2x1 - STORE_2x1 - - ADDQ INC_Y, Y_PTR - -inc_r2end: - LEAQ (X_PTR)(INC_X*2), X_PTR - MOVQ Y, Y_PTR - LEAQ (A_ROW)(LDA*2), A_ROW - MOVQ A_ROW, A_PTR - -inc_r1: - TESTQ $1, M_DIM - JZ end - - // LOAD 1 - LOAD1 - - MOVQ N_DIM, N - SHRQ $2, N - JZ inc_r1c2 - -inc_r1c4: - // 1x4 KERNEL - KERNEL_LOAD4_INC - KERNEL_1x4 - STORE_1x4 - - LEAQ (Y_PTR)(INC_Y*4), Y_PTR - DECQ N - JNZ inc_r1c4 - -inc_r1c2: - TESTQ $2, N_DIM - JZ inc_r1c1 - - // 1x2 KERNEL - KERNEL_LOAD2_INC - KERNEL_1x2 - STORE_1x2 - - LEAQ (Y_PTR)(INC_Y*2), Y_PTR - -inc_r1c1: - TESTQ $1, N_DIM - JZ end - - // 1x1 KERNEL - KERNEL_1x1 - STORE_1x1 - - ADDQ INC_Y, Y_PTR - -inc_end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s deleted file mode 100644 index f87f856ca..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/l1norm_amd64.s +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func L1Dist(s, t []float64) float64 -TEXT ·L1Dist(SB), NOSPLIT, $0 - MOVQ s_base+0(FP), DI // DI = &s - MOVQ t_base+24(FP), SI // SI = &t - MOVQ s_len+8(FP), CX // CX = len(s) - CMPQ t_len+32(FP), CX // CX = max( CX, len(t) ) - CMOVQLE t_len+32(FP), CX - PXOR X3, X3 // norm = 0 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE l1_end - XORQ AX, AX // i = 0 - MOVQ CX, BX - ANDQ $1, BX // BX = CX % 2 - SHRQ $1, CX // CX = floor( CX / 2 ) - JZ l1_tail_start // if CX == 0 { return 0 } - -l1_loop: // Loop unrolled 2x do { - MOVUPS (SI)(AX*8), X0 // X0 = t[i:i+1] - MOVUPS (DI)(AX*8), X1 // X1 = s[i:i+1] - MOVAPS X0, X2 - SUBPD X1, X0 - SUBPD X2, X1 - MAXPD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - ADDPD X0, X3 // norm += X0 - ADDQ $2, AX // i += 2 - LOOP l1_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE l1_end - -l1_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - PXOR X0, X0 // reset X0, X1 to break dependencies - PXOR X1, X1 - -l1_tail: - MOVSD (SI)(AX*8), X0 // X0 = t[i] - MOVSD (DI)(AX*8), X1 // x1 = s[i] - MOVAPD X0, X2 - SUBSD X1, X0 - SUBSD X2, X1 - MAXSD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - ADDSD X0, X3 // norm += X0 - -l1_end: - MOVAPS X3, X2 - SHUFPD $1, X2, X2 - ADDSD X3, X2 // X2 = X3[1] + X3[0] - MOVSD X2, ret+48(FP) // return X2 - RET - diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s deleted file mode 100644 index b06259280..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/linfnorm_amd64.s +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -// func LinfDist(s, t []float64) float64 -TEXT ·LinfDist(SB), NOSPLIT, $0 - MOVQ s_base+0(FP), DI // DI = &s - MOVQ t_base+24(FP), SI // SI = &t - MOVQ s_len+8(FP), CX // CX = len(s) - CMPQ t_len+32(FP), CX // CX = max( CX, len(t) ) - CMOVQLE t_len+32(FP), CX - PXOR X3, X3 // norm = 0 - CMPQ CX, $0 // if CX == 0 { return 0 } - JE l1_end - XORQ AX, AX // i = 0 - MOVQ CX, BX - ANDQ $1, BX // BX = CX % 2 - SHRQ $1, CX // CX = floor( CX / 2 ) - JZ l1_tail_start // if CX == 0 { return 0 } - -l1_loop: // Loop unrolled 2x do { - MOVUPS (SI)(AX*8), X0 // X0 = t[i:i+1] - MOVUPS (DI)(AX*8), X1 // X1 = s[i:i+1] - MOVAPS X0, X2 - SUBPD X1, X0 - SUBPD X2, X1 - MAXPD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - MAXPD X0, X3 // norm = max( norm, X0 ) - ADDQ $2, AX // i += 2 - LOOP l1_loop // } while --CX > 0 - CMPQ BX, $0 // if BX == 0 { return } - JE l1_end - -l1_tail_start: // Reset loop registers - MOVQ BX, CX // Loop counter: CX = BX - PXOR X0, X0 // reset X0, X1 to break dependencies - PXOR X1, X1 - -l1_tail: - MOVSD (SI)(AX*8), X0 // X0 = t[i] - MOVSD (DI)(AX*8), X1 // X1 = s[i] - MOVAPD X0, X2 - SUBSD X1, X0 - SUBSD X2, X1 - MAXSD X1, X0 // X0 = max( X0 - X1, X1 - X0 ) - MAXSD X0, X3 // norm = max( norm, X0 ) - -l1_end: - MOVAPS X3, X2 - SHUFPD $1, X2, X2 - MAXSD X3, X2 // X2 = max( X3[1], X3[0] ) - MOVSD X2, ret+48(FP) // return X2 - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go deleted file mode 100644 index 3cc7aca69..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scal.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha float64, x []float64) { - for i := range x { - x[i] *= alpha - } -} - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []float64, alpha float64, x []float64) { - for i, v := range x { - dst[i] = alpha * v - } -} - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha float64, x []float64, n, incX uintptr) { - var ix uintptr - for i := 0; i < int(n); i++ { - x[ix] *= alpha - ix += incX - } -} - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) { - var idst, ix uintptr - for i := 0; i < int(n); i++ { - dst[idst] = alpha * x[ix] - ix += incX - idst += incDst - } -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s deleted file mode 100644 index fb8b545eb..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalinc_amd64.s +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R9 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalInc(alpha float64, x []float64, n, incX uintptr) -TEXT ·ScalInc(SB), NOSPLIT, $0 - MOVSD alpha+0(FP), ALPHA // ALPHA = alpha - MOVQ x_base+8(FP), X_PTR // X_PTR = &x - MOVQ incX+40(FP), INC_X // INC_X = incX - SHLQ $3, INC_X // INC_X *= sizeof(float64) - MOVQ n+32(FP), LEN // LEN = n - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - -loop: // do { // x[i] *= alpha unrolled 4x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - MOVSD X2, (X_PTR) // x[i] = X_i - MOVSD X3, (X_PTR)(INC_X*1) - MOVSD X4, (X_PTR)(INC_X*2) - MOVSD X5, (X_PTR)(INCx3_X*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: // do { - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - MOVSD X2, (X_PTR) // x[i] = X_i - MOVSD X3, (X_PTR)(INC_X*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - - ANDQ $1, TAIL - JZ end - -tail_one: - MOVSD (X_PTR), X2 // X_i = x[i] - MULSD ALPHA, X2 // X_i *= ALPHA - MOVSD X2, (X_PTR) // x[i] = X_i - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s deleted file mode 100644 index 186fd1c05..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalincto_amd64.s +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define DST_PTR DI -#define LEN CX -#define TAIL BX -#define INC_X R8 -#define INCx3_X R9 -#define INC_DST R10 -#define INCx3_DST R11 -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) -TEXT ·ScalIncTo(SB), NOSPLIT, $0 - MOVQ dst_base+0(FP), DST_PTR // DST_PTR = &dst - MOVQ incDst+24(FP), INC_DST // INC_DST = incDst - SHLQ $3, INC_DST // INC_DST *= sizeof(float64) - MOVSD alpha+32(FP), ALPHA // ALPHA = alpha - MOVQ x_base+40(FP), X_PTR // X_PTR = &x - MOVQ n+64(FP), LEN // LEN = n - MOVQ incX+72(FP), INC_X // INC_X = incX - SHLQ $3, INC_X // INC_X *= sizeof(float64) - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - MOVQ LEN, TAIL - ANDQ $3, TAIL // TAIL = LEN % 4 - SHRQ $2, LEN // LEN = floor( LEN / 4 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - LEAQ (INC_X)(INC_X*2), INCx3_X // INCx3_X = INC_X * 3 - LEAQ (INC_DST)(INC_DST*2), INCx3_DST // INCx3_DST = INC_DST * 3 - -loop: // do { // x[i] *= alpha unrolled 4x. - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MOVSD (X_PTR)(INC_X*2), X4 - MOVSD (X_PTR)(INCx3_X*1), X5 - - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA_2, X3 - MULSD ALPHA, X4 - MULSD ALPHA_2, X5 - - MOVSD X2, (DST_PTR) // dst[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - MOVSD X4, (DST_PTR)(INC_DST*2) - MOVSD X5, (DST_PTR)(INCx3_DST*1) - - LEAQ (X_PTR)(INC_X*4), X_PTR // X_PTR = &(X_PTR[incX*4]) - LEAQ (DST_PTR)(INC_DST*4), DST_PTR // DST_PTR = &(DST_PTR[incDst*4]) - DECQ LEN - JNZ loop // } while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( LEN / 2 ) - JZ tail_one - -tail_two: - MOVSD (X_PTR), X2 // X_i = x[i] - MOVSD (X_PTR)(INC_X*1), X3 - MULSD ALPHA, X2 // X_i *= a - MULSD ALPHA, X3 - MOVSD X2, (DST_PTR) // dst[i] = X_i - MOVSD X3, (DST_PTR)(INC_DST*1) - - LEAQ (X_PTR)(INC_X*2), X_PTR // X_PTR = &(X_PTR[incX*2]) - LEAQ (DST_PTR)(INC_DST*2), DST_PTR // DST_PTR = &(DST_PTR[incDst*2]) - - ANDQ $1, TAIL - JZ end - -tail_one: - MOVSD (X_PTR), X2 // X_i = x[i] - MULSD ALPHA, X2 // X_i *= ALPHA - MOVSD X2, (DST_PTR) // x[i] = X_i - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s deleted file mode 100644 index f852c7f7c..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitary_amd64.s +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x0824 // @ MOVDDUP XMM0, 8[RSP] - -#define X_PTR SI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalUnitary(alpha float64, x []float64) -TEXT ·ScalUnitary(SB), NOSPLIT, $0 - MOVDDUP_ALPHA // ALPHA = { alpha, alpha } - MOVQ x_base+8(FP), X_PTR // X_PTR = &x - MOVQ x_len+16(FP), LEN // LEN = len(x) - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - XORQ IDX, IDX // IDX = 0 - - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 - -loop: // do { // x[i] *= alpha unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (X_PTR)(IDX*8) // x[i] = X_i - MOVUPS X3, 16(X_PTR)(IDX*8) - MOVUPS X4, 32(X_PTR)(IDX*8) - MOVUPS X5, 48(X_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop registers - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if n == 0 goto end - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (X_PTR)(IDX*8) // x[i] = X_i - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { return } - -tail_one: - // x[i] *= alpha for the remaining element. - MOVSD (X_PTR)(IDX*8), X2 - MULSD ALPHA, X2 - MOVSD X2, (X_PTR)(IDX*8) - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s deleted file mode 100644 index d2b607f52..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/scalunitaryto_amd64.s +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// -// Some of the loop unrolling code is copied from: -// http://golang.org/src/math/big/arith_amd64.s -// which is distributed under these terms: -// -// Copyright (c) 2012 The Go Authors. All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -//+build !noasm,!appengine,!safe - -#include "textflag.h" - -#define MOVDDUP_ALPHA LONG $0x44120FF2; WORD $0x2024 // @ MOVDDUP 32(SP), X0 /*XMM0, 32[RSP]*/ - -#define X_PTR SI -#define DST_PTR DI -#define IDX AX -#define LEN CX -#define TAIL BX -#define ALPHA X0 -#define ALPHA_2 X1 - -// func ScalUnitaryTo(dst []float64, alpha float64, x []float64) -// This function assumes len(dst) >= len(x). -TEXT ·ScalUnitaryTo(SB), NOSPLIT, $0 - MOVQ x_base+32(FP), X_PTR // X_PTR = &x - MOVQ dst_base+0(FP), DST_PTR // DST_PTR = &dst - MOVDDUP_ALPHA // ALPHA = { alpha, alpha } - MOVQ x_len+40(FP), LEN // LEN = len(x) - CMPQ LEN, $0 - JE end // if LEN == 0 { return } - - XORQ IDX, IDX // IDX = 0 - MOVQ LEN, TAIL - ANDQ $7, TAIL // TAIL = LEN % 8 - SHRQ $3, LEN // LEN = floor( LEN / 8 ) - JZ tail_start // if LEN == 0 { goto tail_start } - - MOVUPS ALPHA, ALPHA_2 // ALPHA_2 = ALPHA for pipelining - -loop: // do { // dst[i] = alpha * x[i] unrolled 8x. - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MOVUPS 16(X_PTR)(IDX*8), X3 - MOVUPS 32(X_PTR)(IDX*8), X4 - MOVUPS 48(X_PTR)(IDX*8), X5 - - MULPD ALPHA, X2 // X_i *= ALPHA - MULPD ALPHA_2, X3 - MULPD ALPHA, X4 - MULPD ALPHA_2, X5 - - MOVUPS X2, (DST_PTR)(IDX*8) // dst[i] = X_i - MOVUPS X3, 16(DST_PTR)(IDX*8) - MOVUPS X4, 32(DST_PTR)(IDX*8) - MOVUPS X5, 48(DST_PTR)(IDX*8) - - ADDQ $8, IDX // i += 8 - DECQ LEN - JNZ loop // while --LEN > 0 - CMPQ TAIL, $0 - JE end // if TAIL == 0 { return } - -tail_start: // Reset loop counters - MOVQ TAIL, LEN // Loop counter: LEN = TAIL - SHRQ $1, LEN // LEN = floor( TAIL / 2 ) - JZ tail_one // if LEN == 0 { goto tail_one } - -tail_two: // do { - MOVUPS (X_PTR)(IDX*8), X2 // X_i = x[i] - MULPD ALPHA, X2 // X_i *= ALPHA - MOVUPS X2, (DST_PTR)(IDX*8) // dst[i] = X_i - ADDQ $2, IDX // i += 2 - DECQ LEN - JNZ tail_two // while --LEN > 0 - - ANDQ $1, TAIL - JZ end // if TAIL == 0 { return } - -tail_one: - MOVSD (X_PTR)(IDX*8), X2 // X_i = x[i] - MULSD ALPHA, X2 // X_i *= ALPHA - MOVSD X2, (DST_PTR)(IDX*8) // dst[i] = X_i - -end: - RET diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go deleted file mode 100644 index a51b94514..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_amd64.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package f64 - -// L1Norm is -// for _, v := range x { -// sum += math.Abs(v) -// } -// return sum -func L1Norm(x []float64) (sum float64) - -// L1NormInc is -// for i := 0; i < n*incX; i += incX { -// sum += math.Abs(x[i]) -// } -// return sum -func L1NormInc(x []float64, n, incX int) (sum float64) - -// AddConst is -// for i := range x { -// x[i] += alpha -// } -func AddConst(alpha float64, x []float64) - -// Add is -// for i, v := range s { -// dst[i] += v -// } -func Add(dst, s []float64) - -// AxpyUnitary is -// for i, v := range x { -// y[i] += alpha * v -// } -func AxpyUnitary(alpha float64, x, y []float64) - -// AxpyUnitaryTo is -// for i, v := range x { -// dst[i] = alpha*v + y[i] -// } -func AxpyUnitaryTo(dst []float64, alpha float64, x, y []float64) - -// AxpyInc is -// for i := 0; i < int(n); i++ { -// y[iy] += alpha * x[ix] -// ix += incX -// iy += incY -// } -func AxpyInc(alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) - -// AxpyIncTo is -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha*x[ix] + y[iy] -// ix += incX -// iy += incY -// idst += incDst -// } -func AxpyIncTo(dst []float64, incDst, idst uintptr, alpha float64, x, y []float64, n, incX, incY, ix, iy uintptr) - -// CumSum is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] + v -// } -// return dst -func CumSum(dst, s []float64) []float64 - -// CumProd is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] * v -// } -// return dst -func CumProd(dst, s []float64) []float64 - -// Div is -// for i, v := range s { -// dst[i] /= v -// } -func Div(dst, s []float64) - -// DivTo is -// for i, v := range s { -// dst[i] = v / t[i] -// } -// return dst -func DivTo(dst, x, y []float64) []float64 - -// DotUnitary is -// for i, v := range x { -// sum += y[i] * v -// } -// return sum -func DotUnitary(x, y []float64) (sum float64) - -// DotInc is -// for i := 0; i < int(n); i++ { -// sum += y[iy] * x[ix] -// ix += incX -// iy += incY -// } -// return sum -func DotInc(x, y []float64, n, incX, incY, ix, iy uintptr) (sum float64) - -// L1Dist is -// var norm float64 -// for i, v := range s { -// norm += math.Abs(t[i] - v) -// } -// return norm -func L1Dist(s, t []float64) float64 - -// LinfDist is -// var norm float64 -// if len(s) == 0 { -// return 0 -// } -// norm = math.Abs(t[0] - s[0]) -// for i, v := range s[1:] { -// absDiff := math.Abs(t[i+1] - v) -// if absDiff > norm || math.IsNaN(norm) { -// norm = absDiff -// } -// } -// return norm -func LinfDist(s, t []float64) float64 - -// ScalUnitary is -// for i := range x { -// x[i] *= alpha -// } -func ScalUnitary(alpha float64, x []float64) - -// ScalUnitaryTo is -// for i, v := range x { -// dst[i] = alpha * v -// } -func ScalUnitaryTo(dst []float64, alpha float64, x []float64) - -// ScalInc is -// var ix uintptr -// for i := 0; i < int(n); i++ { -// x[ix] *= alpha -// ix += incX -// } -func ScalInc(alpha float64, x []float64, n, incX uintptr) - -// ScalIncTo is -// var idst, ix uintptr -// for i := 0; i < int(n); i++ { -// dst[idst] = alpha * x[ix] -// ix += incX -// idst += incDst -// } -func ScalIncTo(dst []float64, incDst uintptr, alpha float64, x []float64, n, incX uintptr) - -// Sum is -// var sum float64 -// for i := range x { -// sum += x[i] -// } -func Sum(x []float64) float64 diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go b/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go deleted file mode 100644 index 670978aa4..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/stubs_noasm.go +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package f64 - -import "math" - -// L1Norm is -// for _, v := range x { -// sum += math.Abs(v) -// } -// return sum -func L1Norm(x []float64) (sum float64) { - for _, v := range x { - sum += math.Abs(v) - } - return sum -} - -// L1NormInc is -// for i := 0; i < n*incX; i += incX { -// sum += math.Abs(x[i]) -// } -// return sum -func L1NormInc(x []float64, n, incX int) (sum float64) { - for i := 0; i < n*incX; i += incX { - sum += math.Abs(x[i]) - } - return sum -} - -// Add is -// for i, v := range s { -// dst[i] += v -// } -func Add(dst, s []float64) { - for i, v := range s { - dst[i] += v - } -} - -// AddConst is -// for i := range x { -// x[i] += alpha -// } -func AddConst(alpha float64, x []float64) { - for i := range x { - x[i] += alpha - } -} - -// CumSum is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] + v -// } -// return dst -func CumSum(dst, s []float64) []float64 { - if len(s) == 0 { - return dst - } - dst[0] = s[0] - for i, v := range s[1:] { - dst[i+1] = dst[i] + v - } - return dst -} - -// CumProd is -// if len(s) == 0 { -// return dst -// } -// dst[0] = s[0] -// for i, v := range s[1:] { -// dst[i+1] = dst[i] * v -// } -// return dst -func CumProd(dst, s []float64) []float64 { - if len(s) == 0 { - return dst - } - dst[0] = s[0] - for i, v := range s[1:] { - dst[i+1] = dst[i] * v - } - return dst -} - -// Div is -// for i, v := range s { -// dst[i] /= v -// } -func Div(dst, s []float64) { - for i, v := range s { - dst[i] /= v - } -} - -// DivTo is -// for i, v := range s { -// dst[i] = v / t[i] -// } -// return dst -func DivTo(dst, s, t []float64) []float64 { - for i, v := range s { - dst[i] = v / t[i] - } - return dst -} - -// L1Dist is -// var norm float64 -// for i, v := range s { -// norm += math.Abs(t[i] - v) -// } -// return norm -func L1Dist(s, t []float64) float64 { - var norm float64 - for i, v := range s { - norm += math.Abs(t[i] - v) - } - return norm -} - -// LinfDist is -// var norm float64 -// if len(s) == 0 { -// return 0 -// } -// norm = math.Abs(t[0] - s[0]) -// for i, v := range s[1:] { -// absDiff := math.Abs(t[i+1] - v) -// if absDiff > norm || math.IsNaN(norm) { -// norm = absDiff -// } -// } -// return norm -func LinfDist(s, t []float64) float64 { - var norm float64 - if len(s) == 0 { - return 0 - } - norm = math.Abs(t[0] - s[0]) - for i, v := range s[1:] { - absDiff := math.Abs(t[i+1] - v) - if absDiff > norm || math.IsNaN(norm) { - norm = absDiff - } - } - return norm -} - -// Sum is -// var sum float64 -// for i := range x { -// sum += x[i] -// } -func Sum(x []float64) float64 { - var sum float64 - for _, v := range x { - sum += v - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s b/vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s deleted file mode 100644 index 22eede6e1..000000000 --- a/vendor/gonum.org/v1/gonum/internal/asm/f64/sum_amd64.s +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -#include "textflag.h" - -#define X_PTR SI -#define IDX AX -#define LEN CX -#define TAIL BX -#define SUM X0 -#define SUM_1 X1 -#define SUM_2 X2 -#define SUM_3 X3 - -// func Sum(x []float64) float64 -TEXT ·Sum(SB), NOSPLIT, $0 - MOVQ x_base+0(FP), X_PTR // X_PTR = &x - MOVQ x_len+8(FP), LEN // LEN = len(x) - XORQ IDX, IDX // i = 0 - PXOR SUM, SUM // p_sum_i = 0 - CMPQ LEN, $0 // if LEN == 0 { return 0 } - JE sum_end - - PXOR SUM_1, SUM_1 - PXOR SUM_2, SUM_2 - PXOR SUM_3, SUM_3 - - MOVQ X_PTR, TAIL // Check memory alignment - ANDQ $15, TAIL // TAIL = &y % 16 - JZ no_trim // if TAIL == 0 { goto no_trim } - - // Align on 16-byte boundary - ADDSD (X_PTR), X0 // X0 += x[0] - INCQ IDX // i++ - DECQ LEN // LEN-- - DECQ TAIL // TAIL-- - JZ sum_end // if TAIL == 0 { return } - -no_trim: - MOVQ LEN, TAIL - SHRQ $4, LEN // LEN = floor( n / 16 ) - JZ sum_tail8 // if LEN == 0 { goto sum_tail8 } - -sum_loop: // sum 16x wide do { - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDPD 16(SI)(AX*8), SUM_1 - ADDPD 32(SI)(AX*8), SUM_2 - ADDPD 48(SI)(AX*8), SUM_3 - ADDPD 64(SI)(AX*8), SUM - ADDPD 80(SI)(AX*8), SUM_1 - ADDPD 96(SI)(AX*8), SUM_2 - ADDPD 112(SI)(AX*8), SUM_3 - ADDQ $16, IDX // i += 16 - DECQ LEN - JNZ sum_loop // } while --CX > 0 - -sum_tail8: - TESTQ $8, TAIL - JZ sum_tail4 - - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDPD 16(SI)(AX*8), SUM_1 - ADDPD 32(SI)(AX*8), SUM_2 - ADDPD 48(SI)(AX*8), SUM_3 - ADDQ $8, IDX - -sum_tail4: - ADDPD SUM_3, SUM - ADDPD SUM_2, SUM_1 - - TESTQ $4, TAIL - JZ sum_tail2 - - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDPD 16(SI)(AX*8), SUM_1 - ADDQ $4, IDX - -sum_tail2: - ADDPD SUM_1, SUM - - TESTQ $2, TAIL - JZ sum_tail1 - - ADDPD (SI)(AX*8), SUM // sum_i += x[i:i+2] - ADDQ $2, IDX - -sum_tail1: - HADDPD SUM, SUM // sum_i[0] += sum_i[1] - - TESTQ $1, TAIL - JZ sum_end - - ADDSD (SI)(IDX*8), SUM - -sum_end: // return sum - MOVSD SUM, sum+24(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go deleted file mode 100644 index ac6eb81c0..000000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/abs.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// Abs returns the absolute value (also called the modulus) of x. -func Abs(x complex64) float32 { return math.Hypot(real(x), imag(x)) } diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go deleted file mode 100644 index 705262f2f..000000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/conj.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmplx64 - -// Conj returns the complex conjugate of x. -func Conj(x complex64) complex64 { return complex(real(x), -imag(x)) } diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go deleted file mode 100644 index 5424ea099..000000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package cmplx64 provides complex64 versions of standard library math/cmplx -// package routines used by gonum/blas. -package cmplx64 // import "gonum.org/v1/gonum/internal/cmplx64" diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go deleted file mode 100644 index 21d3d180e..000000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/isinf.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// IsInf returns true if either real(x) or imag(x) is an infinity. -func IsInf(x complex64) bool { - if math.IsInf(real(x), 0) || math.IsInf(imag(x), 0) { - return true - } - return false -} - -// Inf returns a complex infinity, complex(+Inf, +Inf). -func Inf() complex64 { - inf := math.Inf(1) - return complex(inf, inf) -} diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go deleted file mode 100644 index 7e0bf788f..000000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/isnan.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// IsNaN returns true if either real(x) or imag(x) is NaN -// and neither is an infinity. -func IsNaN(x complex64) bool { - switch { - case math.IsInf(real(x), 0) || math.IsInf(imag(x), 0): - return false - case math.IsNaN(real(x)) || math.IsNaN(imag(x)): - return true - } - return false -} - -// NaN returns a complex ``not-a-number'' value. -func NaN() complex64 { - nan := math.NaN() - return complex(nan, nan) -} diff --git a/vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go b/vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go deleted file mode 100644 index 439987b4b..000000000 --- a/vendor/gonum.org/v1/gonum/internal/cmplx64/sqrt.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cmplx64 - -import math "gonum.org/v1/gonum/internal/math32" - -// The original C code, the long comment, and the constants -// below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.c. -// The go code is a simplified version of the original C. -// -// Cephes Math Library Release 2.8: June, 2000 -// Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier -// -// The readme file at http://netlib.sandia.gov/cephes/ says: -// Some software in this archive may be from the book _Methods and -// Programs for Mathematical Functions_ (Prentice-Hall or Simon & Schuster -// International, 1989) or from the Cephes Mathematical Library, a -// commercial product. In either event, it is copyrighted by the author. -// What you see here may be used freely but it comes with no support or -// guarantee. -// -// The two known misprints in the book are repaired here in the -// source listings for the gamma function and the incomplete beta -// integral. -// -// Stephen L. Moshier -// moshier@na-net.ornl.gov - -// Complex square root -// -// DESCRIPTION: -// -// If z = x + iy, r = |z|, then -// -// 1/2 -// Re w = [ (r + x)/2 ] , -// -// 1/2 -// Im w = [ (r - x)/2 ] . -// -// Cancelation error in r-x or r+x is avoided by using the -// identity 2 Re w Im w = y. -// -// Note that -w is also a square root of z. The root chosen -// is always in the right half plane and Im w has the same sign as y. -// -// ACCURACY: -// -// Relative error: -// arithmetic domain # trials peak rms -// DEC -10,+10 25000 3.2e-17 9.6e-18 -// IEEE -10,+10 1,000,000 2.9e-16 6.1e-17 - -// Sqrt returns the square root of x. -// The result r is chosen so that real(r) ≥ 0 and imag(r) has the same sign as imag(x). -func Sqrt(x complex64) complex64 { - if imag(x) == 0 { - if real(x) == 0 { - return complex(0, 0) - } - if real(x) < 0 { - return complex(0, math.Sqrt(-real(x))) - } - return complex(math.Sqrt(real(x)), 0) - } - if real(x) == 0 { - if imag(x) < 0 { - r := math.Sqrt(-0.5 * imag(x)) - return complex(r, -r) - } - r := math.Sqrt(0.5 * imag(x)) - return complex(r, r) - } - a := real(x) - b := imag(x) - var scale float32 - // Rescale to avoid internal overflow or underflow. - if math.Abs(a) > 4 || math.Abs(b) > 4 { - a *= 0.25 - b *= 0.25 - scale = 2 - } else { - a *= 1.8014398509481984e16 // 2**54 - b *= 1.8014398509481984e16 - scale = 7.450580596923828125e-9 // 2**-27 - } - r := math.Hypot(a, b) - var t float32 - if a > 0 { - t = math.Sqrt(0.5*r + 0.5*a) - r = scale * math.Abs((0.5*b)/t) - t *= scale - } else { - r = math.Sqrt(0.5*r - 0.5*a) - t = scale * math.Abs((0.5*b)/r) - r *= scale - } - if b < 0 { - return complex(t, -r) - } - return complex(t, r) -} diff --git a/vendor/gonum.org/v1/gonum/internal/math32/doc.go b/vendor/gonum.org/v1/gonum/internal/math32/doc.go deleted file mode 100644 index 68917c64e..000000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/doc.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package math32 provides float32 versions of standard library math package -// routines used by gonum/blas/native. -package math32 // import "gonum.org/v1/gonum/internal/math32" diff --git a/vendor/gonum.org/v1/gonum/internal/math32/math.go b/vendor/gonum.org/v1/gonum/internal/math32/math.go deleted file mode 100644 index 56c90be02..000000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/math.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package math32 - -import ( - "math" -) - -const ( - unan = 0x7fc00000 - uinf = 0x7f800000 - uneginf = 0xff800000 - mask = 0x7f8 >> 3 - shift = 32 - 8 - 1 - bias = 127 -) - -// Abs returns the absolute value of x. -// -// Special cases are: -// Abs(±Inf) = +Inf -// Abs(NaN) = NaN -func Abs(x float32) float32 { - switch { - case x < 0: - return -x - case x == 0: - return 0 // return correctly abs(-0) - } - return x -} - -// Copysign returns a value with the magnitude -// of x and the sign of y. -func Copysign(x, y float32) float32 { - const sign = 1 << 31 - return math.Float32frombits(math.Float32bits(x)&^sign | math.Float32bits(y)&sign) -} - -// Hypot returns Sqrt(p*p + q*q), taking care to avoid -// unnecessary overflow and underflow. -// -// Special cases are: -// Hypot(±Inf, q) = +Inf -// Hypot(p, ±Inf) = +Inf -// Hypot(NaN, q) = NaN -// Hypot(p, NaN) = NaN -func Hypot(p, q float32) float32 { - // special cases - switch { - case IsInf(p, 0) || IsInf(q, 0): - return Inf(1) - case IsNaN(p) || IsNaN(q): - return NaN() - } - if p < 0 { - p = -p - } - if q < 0 { - q = -q - } - if p < q { - p, q = q, p - } - if p == 0 { - return 0 - } - q = q / p - return p * Sqrt(1+q*q) -} - -// Inf returns positive infinity if sign >= 0, negative infinity if sign < 0. -func Inf(sign int) float32 { - var v uint32 - if sign >= 0 { - v = uinf - } else { - v = uneginf - } - return math.Float32frombits(v) -} - -// IsInf reports whether f is an infinity, according to sign. -// If sign > 0, IsInf reports whether f is positive infinity. -// If sign < 0, IsInf reports whether f is negative infinity. -// If sign == 0, IsInf reports whether f is either infinity. -func IsInf(f float32, sign int) bool { - // Test for infinity by comparing against maximum float. - // To avoid the floating-point hardware, could use: - // x := math.Float32bits(f); - // return sign >= 0 && x == uinf || sign <= 0 && x == uneginf; - return sign >= 0 && f > math.MaxFloat32 || sign <= 0 && f < -math.MaxFloat32 -} - -// IsNaN reports whether f is an IEEE 754 ``not-a-number'' value. -func IsNaN(f float32) (is bool) { - // IEEE 754 says that only NaNs satisfy f != f. - // To avoid the floating-point hardware, could use: - // x := math.Float32bits(f); - // return uint32(x>>shift)&mask == mask && x != uinf && x != uneginf - return f != f -} - -// NaN returns an IEEE 754 ``not-a-number'' value. -func NaN() float32 { return math.Float32frombits(unan) } diff --git a/vendor/gonum.org/v1/gonum/internal/math32/signbit.go b/vendor/gonum.org/v1/gonum/internal/math32/signbit.go deleted file mode 100644 index 3e9f0bb41..000000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/signbit.go +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package math32 - -import "math" - -// Signbit returns true if x is negative or negative zero. -func Signbit(x float32) bool { - return math.Float32bits(x)&(1<<31) != 0 -} diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt.go b/vendor/gonum.org/v1/gonum/internal/math32/sqrt.go deleted file mode 100644 index bf630de99..000000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !amd64 noasm appengine safe - -package math32 - -import ( - "math" -) - -// Sqrt returns the square root of x. -// -// Special cases are: -// Sqrt(+Inf) = +Inf -// Sqrt(±0) = ±0 -// Sqrt(x < 0) = NaN -// Sqrt(NaN) = NaN -func Sqrt(x float32) float32 { - // FIXME(kortschak): Direct translation of the math package - // asm code for 386 fails to build. No test hardware is available - // for arm, so using conversion instead. - return float32(math.Sqrt(float64(x))) -} diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go b/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go deleted file mode 100644 index 905ae5c68..000000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !noasm,!appengine,!safe - -package math32 - -// Sqrt returns the square root of x. -// -// Special cases are: -// Sqrt(+Inf) = +Inf -// Sqrt(±0) = ±0 -// Sqrt(x < 0) = NaN -// Sqrt(NaN) = NaN -func Sqrt(x float32) float32 diff --git a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s b/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s deleted file mode 100644 index fa2b8696e..000000000 --- a/vendor/gonum.org/v1/gonum/internal/math32/sqrt_amd64.s +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//+build !noasm,!appengine,!safe - -// TODO(kortschak): use textflag.h after we drop Go 1.3 support -//#include "textflag.h" -// Don't insert stack check preamble. -#define NOSPLIT 4 - -// func Sqrt(x float32) float32 -TEXT ·Sqrt(SB),NOSPLIT,$0 - SQRTSS x+0(FP), X0 - MOVSS X0, ret+8(FP) - RET diff --git a/vendor/gonum.org/v1/gonum/lapack/.gitignore b/vendor/gonum.org/v1/gonum/lapack/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/gonum.org/v1/gonum/lapack/README.md b/vendor/gonum.org/v1/gonum/lapack/README.md deleted file mode 100644 index c355017c8..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/README.md +++ /dev/null @@ -1,28 +0,0 @@ -Gonum LAPACK [![GoDoc](https://godoc.org/gonum.org/v1/gonum/lapack?status.svg)](https://godoc.org/gonum.org/v1/gonum/lapack) -====== - -A collection of packages to provide LAPACK functionality for the Go programming -language (http://golang.org). This provides a partial implementation in native go -and a wrapper using cgo to a c-based implementation. - -## Installation - -``` - go get gonum.org/v1/gonum/lapack/... -``` - -## Packages - -### lapack - -Defines the LAPACK API based on http://www.netlib.org/lapack/lapacke.html - -### lapack/gonum - -Go implementation of the LAPACK API (incomplete, implements the `float64` API). - -### lapack/lapack64 - -Wrappers for an implementation of the double (i.e., `float64`) precision real parts of -the LAPACK API. - diff --git a/vendor/gonum.org/v1/gonum/lapack/doc.go b/vendor/gonum.org/v1/gonum/lapack/doc.go deleted file mode 100644 index 2475cb4aa..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lapack provides interfaces for the LAPACK linear algebra standard. -package lapack // import "gonum.org/v1/gonum/lapack" diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go deleted file mode 100644 index 5f3833fd9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dbdsqr.go +++ /dev/null @@ -1,505 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dbdsqr performs a singular value decomposition of a real n×n bidiagonal matrix. -// -// The SVD of the bidiagonal matrix B is -// B = Q * S * P^T -// where S is a diagonal matrix of singular values, Q is an orthogonal matrix of -// left singular vectors, and P is an orthogonal matrix of right singular vectors. -// -// Q and P are only computed if requested. If left singular vectors are requested, -// this routine returns U * Q instead of Q, and if right singular vectors are -// requested P^T * VT is returned instead of P^T. -// -// Frequently Dbdsqr is used in conjunction with Dgebrd which reduces a general -// matrix A into bidiagonal form. In this case, the SVD of A is -// A = (U * Q) * S * (P^T * VT) -// -// This routine may also compute Q^T * C. -// -// d and e contain the elements of the bidiagonal matrix b. d must have length at -// least n, and e must have length at least n-1. Dbdsqr will panic if there is -// insufficient length. On exit, D contains the singular values of B in decreasing -// order. -// -// VT is a matrix of size n×ncvt whose elements are stored in vt. The elements -// of vt are modified to contain P^T * VT on exit. VT is not used if ncvt == 0. -// -// U is a matrix of size nru×n whose elements are stored in u. The elements -// of u are modified to contain U * Q on exit. U is not used if nru == 0. -// -// C is a matrix of size n×ncc whose elements are stored in c. The elements -// of c are modified to contain Q^T * C on exit. C is not used if ncc == 0. -// -// work contains temporary storage and must have length at least 4*(n-1). Dbdsqr -// will panic if there is insufficient working memory. -// -// Dbdsqr returns whether the decomposition was successful. -// -// Dbdsqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dbdsqr(uplo blas.Uplo, n, ncvt, nru, ncc int, d, e, vt []float64, ldvt int, u []float64, ldu int, c []float64, ldc int, work []float64) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case ncvt < 0: - panic(ncvtLT0) - case nru < 0: - panic(nruLT0) - case ncc < 0: - panic(nccLT0) - case ldvt < max(1, ncvt): - panic(badLdVT) - case (ldu < max(1, n) && nru > 0) || (ldu < 1 && nru == 0): - panic(badLdU) - case ldc < max(1, ncc): - panic(badLdC) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(vt) < (n-1)*ldvt+ncvt && ncvt != 0 { - panic(shortVT) - } - if len(u) < (nru-1)*ldu+n && nru != 0 { - panic(shortU) - } - if len(c) < (n-1)*ldc+ncc && ncc != 0 { - panic(shortC) - } - if len(d) < n { - panic(shortD) - } - if len(e) < n-1 { - panic(shortE) - } - if len(work) < 4*(n-1) { - panic(shortWork) - } - - var info int - bi := blas64.Implementation() - const maxIter = 6 - - if n != 1 { - // If the singular vectors do not need to be computed, use qd algorithm. - if !(ncvt > 0 || nru > 0 || ncc > 0) { - info = impl.Dlasq1(n, d, e, work) - // If info is 2 dqds didn't finish, and so try to. - if info != 2 { - return info == 0 - } - } - nm1 := n - 1 - nm12 := nm1 + nm1 - nm13 := nm12 + nm1 - idir := 0 - - eps := dlamchE - unfl := dlamchS - lower := uplo == blas.Lower - var cs, sn, r float64 - if lower { - for i := 0; i < n-1; i++ { - cs, sn, r = impl.Dlartg(d[i], e[i]) - d[i] = r - e[i] = sn * d[i+1] - d[i+1] *= cs - work[i] = cs - work[nm1+i] = sn - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, nru, n, work, work[n-1:], u, ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, n, ncc, work, work[n-1:], c, ldc) - } - } - // Compute singular values to a relative accuracy of tol. If tol is negative - // the values will be computed to an absolute accuracy of math.Abs(tol) * norm(b) - tolmul := math.Max(10, math.Min(100, math.Pow(eps, -1.0/8))) - tol := tolmul * eps - var smax float64 - for i := 0; i < n; i++ { - smax = math.Max(smax, math.Abs(d[i])) - } - for i := 0; i < n-1; i++ { - smax = math.Max(smax, math.Abs(e[i])) - } - - var sminl float64 - var thresh float64 - if tol >= 0 { - sminoa := math.Abs(d[0]) - if sminoa != 0 { - mu := sminoa - for i := 1; i < n; i++ { - mu = math.Abs(d[i]) * (mu / (mu + math.Abs(e[i-1]))) - sminoa = math.Min(sminoa, mu) - if sminoa == 0 { - break - } - } - } - sminoa = sminoa / math.Sqrt(float64(n)) - thresh = math.Max(tol*sminoa, float64(maxIter*n*n)*unfl) - } else { - thresh = math.Max(math.Abs(tol)*smax, float64(maxIter*n*n)*unfl) - } - // Prepare for the main iteration loop for the singular values. - maxIt := maxIter * n * n - iter := 0 - oldl2 := -1 - oldm := -1 - // m points to the last element of unconverged part of matrix. - m := n - - Outer: - for m > 1 { - if iter > maxIt { - info = 0 - for i := 0; i < n-1; i++ { - if e[i] != 0 { - info++ - } - } - return info == 0 - } - // Find diagonal block of matrix to work on. - if tol < 0 && math.Abs(d[m-1]) <= thresh { - d[m-1] = 0 - } - smax = math.Abs(d[m-1]) - smin := smax - var l2 int - var broke bool - for l3 := 0; l3 < m-1; l3++ { - l2 = m - l3 - 2 - abss := math.Abs(d[l2]) - abse := math.Abs(e[l2]) - if tol < 0 && abss <= thresh { - d[l2] = 0 - } - if abse <= thresh { - broke = true - break - } - smin = math.Min(smin, abss) - smax = math.Max(math.Max(smax, abss), abse) - } - if broke { - e[l2] = 0 - if l2 == m-2 { - // Convergence of bottom singular value, return to top. - m-- - continue - } - l2++ - } else { - l2 = 0 - } - // e[ll] through e[m-2] are nonzero, e[ll-1] is zero - if l2 == m-2 { - // Handle 2×2 block separately. - var sinr, cosr, sinl, cosl float64 - d[m-1], d[m-2], sinr, cosr, sinl, cosl = impl.Dlasv2(d[m-2], e[m-2], d[m-1]) - e[m-2] = 0 - if ncvt > 0 { - bi.Drot(ncvt, vt[(m-2)*ldvt:], 1, vt[(m-1)*ldvt:], 1, cosr, sinr) - } - if nru > 0 { - bi.Drot(nru, u[m-2:], ldu, u[m-1:], ldu, cosl, sinl) - } - if ncc > 0 { - bi.Drot(ncc, c[(m-2)*ldc:], 1, c[(m-1)*ldc:], 1, cosl, sinl) - } - m -= 2 - continue - } - // If working on a new submatrix, choose shift direction from larger end - // diagonal element toward smaller. - if l2 > oldm-1 || m-1 < oldl2 { - if math.Abs(d[l2]) >= math.Abs(d[m-1]) { - idir = 1 - } else { - idir = 2 - } - } - // Apply convergence tests. - // TODO(btracey): There is a lot of similar looking code here. See - // if there is a better way to de-duplicate. - if idir == 1 { - // Run convergence test in forward direction. - // First apply standard test to bottom of matrix. - if math.Abs(e[m-2]) <= math.Abs(tol)*math.Abs(d[m-1]) || (tol < 0 && math.Abs(e[m-2]) <= thresh) { - e[m-2] = 0 - continue - } - if tol >= 0 { - // If relative accuracy desired, apply convergence criterion forward. - mu := math.Abs(d[l2]) - sminl = mu - for l3 := l2; l3 < m-1; l3++ { - if math.Abs(e[l3]) <= tol*mu { - e[l3] = 0 - continue Outer - } - mu = math.Abs(d[l3+1]) * (mu / (mu + math.Abs(e[l3]))) - sminl = math.Min(sminl, mu) - } - } - } else { - // Run convergence test in backward direction. - // First apply standard test to top of matrix. - if math.Abs(e[l2]) <= math.Abs(tol)*math.Abs(d[l2]) || (tol < 0 && math.Abs(e[l2]) <= thresh) { - e[l2] = 0 - continue - } - if tol >= 0 { - // If relative accuracy desired, apply convergence criterion backward. - mu := math.Abs(d[m-1]) - sminl = mu - for l3 := m - 2; l3 >= l2; l3-- { - if math.Abs(e[l3]) <= tol*mu { - e[l3] = 0 - continue Outer - } - mu = math.Abs(d[l3]) * (mu / (mu + math.Abs(e[l3]))) - sminl = math.Min(sminl, mu) - } - } - } - oldl2 = l2 - oldm = m - // Compute shift. First, test if shifting would ruin relative accuracy, - // and if so set the shift to zero. - var shift float64 - if tol >= 0 && float64(n)*tol*(sminl/smax) <= math.Max(eps, (1.0/100)*tol) { - shift = 0 - } else { - var sl2 float64 - if idir == 1 { - sl2 = math.Abs(d[l2]) - shift, _ = impl.Dlas2(d[m-2], e[m-2], d[m-1]) - } else { - sl2 = math.Abs(d[m-1]) - shift, _ = impl.Dlas2(d[l2], e[l2], d[l2+1]) - } - // Test if shift is negligible - if sl2 > 0 { - if (shift/sl2)*(shift/sl2) < eps { - shift = 0 - } - } - } - iter += m - l2 + 1 - // If no shift, do simplified QR iteration. - if shift == 0 { - if idir == 1 { - cs := 1.0 - oldcs := 1.0 - var sn, r, oldsn float64 - for i := l2; i < m-1; i++ { - cs, sn, r = impl.Dlartg(d[i]*cs, e[i]) - if i > l2 { - e[i-1] = oldsn * r - } - oldcs, oldsn, d[i] = impl.Dlartg(oldcs*r, d[i+1]*sn) - work[i-l2] = cs - work[i-l2+nm1] = sn - work[i-l2+nm12] = oldcs - work[i-l2+nm13] = oldsn - } - h := d[m-1] * cs - d[m-1] = h * oldcs - e[m-2] = h * oldsn - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncvt, work, work[n-1:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, nru, m-l2, work[nm12:], work[nm13:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncc, work[nm12:], work[nm13:], c[l2*ldc:], ldc) - } - if math.Abs(e[m-2]) < thresh { - e[m-2] = 0 - } - } else { - cs := 1.0 - oldcs := 1.0 - var sn, r, oldsn float64 - for i := m - 1; i >= l2+1; i-- { - cs, sn, r = impl.Dlartg(d[i]*cs, e[i-1]) - if i < m-1 { - e[i] = oldsn * r - } - oldcs, oldsn, d[i] = impl.Dlartg(oldcs*r, d[i-1]*sn) - work[i-l2-1] = cs - work[i-l2+nm1-1] = -sn - work[i-l2+nm12-1] = oldcs - work[i-l2+nm13-1] = -oldsn - } - h := d[l2] * cs - d[l2] = h * oldcs - e[l2] = h * oldsn - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncvt, work[nm12:], work[nm13:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, nru, m-l2, work, work[n-1:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncc, work, work[n-1:], c[l2*ldc:], ldc) - } - if math.Abs(e[l2]) <= thresh { - e[l2] = 0 - } - } - } else { - // Use nonzero shift. - if idir == 1 { - // Chase bulge from top to bottom. Save cosines and sines for - // later singular vector updates. - f := (math.Abs(d[l2]) - shift) * (math.Copysign(1, d[l2]) + shift/d[l2]) - g := e[l2] - var cosl, sinl float64 - for i := l2; i < m-1; i++ { - cosr, sinr, r := impl.Dlartg(f, g) - if i > l2 { - e[i-1] = r - } - f = cosr*d[i] + sinr*e[i] - e[i] = cosr*e[i] - sinr*d[i] - g = sinr * d[i+1] - d[i+1] *= cosr - cosl, sinl, r = impl.Dlartg(f, g) - d[i] = r - f = cosl*e[i] + sinl*d[i+1] - d[i+1] = cosl*d[i+1] - sinl*e[i] - if i < m-2 { - g = sinl * e[i+1] - e[i+1] = cosl * e[i+1] - } - work[i-l2] = cosr - work[i-l2+nm1] = sinr - work[i-l2+nm12] = cosl - work[i-l2+nm13] = sinl - } - e[m-2] = f - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncvt, work, work[n-1:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, nru, m-l2, work[nm12:], work[nm13:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Forward, m-l2, ncc, work[nm12:], work[nm13:], c[l2*ldc:], ldc) - } - if math.Abs(e[m-2]) <= thresh { - e[m-2] = 0 - } - } else { - // Chase bulge from top to bottom. Save cosines and sines for - // later singular vector updates. - f := (math.Abs(d[m-1]) - shift) * (math.Copysign(1, d[m-1]) + shift/d[m-1]) - g := e[m-2] - for i := m - 1; i > l2; i-- { - cosr, sinr, r := impl.Dlartg(f, g) - if i < m-1 { - e[i] = r - } - f = cosr*d[i] + sinr*e[i-1] - e[i-1] = cosr*e[i-1] - sinr*d[i] - g = sinr * d[i-1] - d[i-1] *= cosr - cosl, sinl, r := impl.Dlartg(f, g) - d[i] = r - f = cosl*e[i-1] + sinl*d[i-1] - d[i-1] = cosl*d[i-1] - sinl*e[i-1] - if i > l2+1 { - g = sinl * e[i-2] - e[i-2] *= cosl - } - work[i-l2-1] = cosr - work[i-l2+nm1-1] = -sinr - work[i-l2+nm12-1] = cosl - work[i-l2+nm13-1] = -sinl - } - e[l2] = f - if math.Abs(e[l2]) <= thresh { - e[l2] = 0 - } - if ncvt > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncvt, work[nm12:], work[nm13:], vt[l2*ldvt:], ldvt) - } - if nru > 0 { - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, nru, m-l2, work, work[n-1:], u[l2:], ldu) - } - if ncc > 0 { - impl.Dlasr(blas.Left, lapack.Variable, lapack.Backward, m-l2, ncc, work, work[n-1:], c[l2*ldc:], ldc) - } - } - } - } - } - - // All singular values converged, make them positive. - for i := 0; i < n; i++ { - if d[i] < 0 { - d[i] *= -1 - if ncvt > 0 { - bi.Dscal(ncvt, -1, vt[i*ldvt:], 1) - } - } - } - - // Sort the singular values in decreasing order. - for i := 0; i < n-1; i++ { - isub := 0 - smin := d[0] - for j := 1; j < n-i; j++ { - if d[j] <= smin { - isub = j - smin = d[j] - } - } - if isub != n-i { - // Swap singular values and vectors. - d[isub] = d[n-i-1] - d[n-i-1] = smin - if ncvt > 0 { - bi.Dswap(ncvt, vt[isub*ldvt:], 1, vt[(n-i-1)*ldvt:], 1) - } - if nru > 0 { - bi.Dswap(nru, u[isub:], ldu, u[n-i-1:], ldu) - } - if ncc > 0 { - bi.Dswap(ncc, c[isub*ldc:], 1, c[(n-i-1)*ldc:], 1) - } - } - } - info = 0 - for i := 0; i < n-1; i++ { - if e[i] != 0 { - info++ - } - } - return info == 0 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go deleted file mode 100644 index 7caa0b173..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebak.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgebak updates an n×m matrix V as -// V = P D V, if side == lapack.EVRight, -// V = P D^{-1} V, if side == lapack.EVLeft, -// where P and D are n×n permutation and scaling matrices, respectively, -// implicitly represented by job, scale, ilo and ihi as returned by Dgebal. -// -// Typically, columns of the matrix V contain the right or left (determined by -// side) eigenvectors of the balanced matrix output by Dgebal, and Dgebak forms -// the eigenvectors of the original matrix. -// -// Dgebak is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebak(job lapack.BalanceJob, side lapack.EVSide, n, ilo, ihi int, scale []float64, m int, v []float64, ldv int) { - switch { - case job != lapack.BalanceNone && job != lapack.Permute && job != lapack.Scale && job != lapack.PermuteScale: - panic(badBalanceJob) - case side != lapack.EVLeft && side != lapack.EVRight: - panic(badEVSide) - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case m < 0: - panic(mLT0) - case ldv < max(1, m): - panic(badLdV) - } - - // Quick return if possible. - if n == 0 || m == 0 { - return - } - - if len(scale) < n { - panic(shortScale) - } - if len(v) < (n-1)*ldv+m { - panic(shortV) - } - - // Quick return if possible. - if job == lapack.BalanceNone { - return - } - - bi := blas64.Implementation() - if ilo != ihi && job != lapack.Permute { - // Backward balance. - if side == lapack.EVRight { - for i := ilo; i <= ihi; i++ { - bi.Dscal(m, scale[i], v[i*ldv:], 1) - } - } else { - for i := ilo; i <= ihi; i++ { - bi.Dscal(m, 1/scale[i], v[i*ldv:], 1) - } - } - } - if job == lapack.Scale { - return - } - // Backward permutation. - for i := ilo - 1; i >= 0; i-- { - k := int(scale[i]) - if k == i { - continue - } - bi.Dswap(m, v[i*ldv:], 1, v[k*ldv:], 1) - } - for i := ihi + 1; i < n; i++ { - k := int(scale[i]) - if k == i { - continue - } - bi.Dswap(m, v[i*ldv:], 1, v[k*ldv:], 1) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go deleted file mode 100644 index 6fb5170cd..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebal.go +++ /dev/null @@ -1,239 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgebal balances an n×n matrix A. Balancing consists of two stages, permuting -// and scaling. Both steps are optional and depend on the value of job. -// -// Permuting consists of applying a permutation matrix P such that the matrix -// that results from P^T*A*P takes the upper block triangular form -// [ T1 X Y ] -// P^T A P = [ 0 B Z ], -// [ 0 0 T2 ] -// where T1 and T2 are upper triangular matrices and B contains at least one -// nonzero off-diagonal element in each row and column. The indices ilo and ihi -// mark the starting and ending columns of the submatrix B. The eigenvalues of A -// isolated in the first 0 to ilo-1 and last ihi+1 to n-1 elements on the -// diagonal can be read off without any roundoff error. -// -// Scaling consists of applying a diagonal similarity transformation D such that -// D^{-1}*B*D has the 1-norm of each row and its corresponding column nearly -// equal. The output matrix is -// [ T1 X*D Y ] -// [ 0 inv(D)*B*D inv(D)*Z ]. -// [ 0 0 T2 ] -// Scaling may reduce the 1-norm of the matrix, and improve the accuracy of -// the computed eigenvalues and/or eigenvectors. -// -// job specifies the operations that will be performed on A. -// If job is lapack.BalanceNone, Dgebal sets scale[i] = 1 for all i and returns ilo=0, ihi=n-1. -// If job is lapack.Permute, only permuting will be done. -// If job is lapack.Scale, only scaling will be done. -// If job is lapack.PermuteScale, both permuting and scaling will be done. -// -// On return, if job is lapack.Permute or lapack.PermuteScale, it will hold that -// A[i,j] == 0, for i > j and j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}. -// If job is lapack.BalanceNone or lapack.Scale, or if n == 0, it will hold that -// ilo == 0 and ihi == n-1. -// -// On return, scale will contain information about the permutations and scaling -// factors applied to A. If π(j) denotes the index of the column interchanged -// with column j, and D[j,j] denotes the scaling factor applied to column j, -// then -// scale[j] == π(j), for j ∈ {0, ..., ilo-1, ihi+1, ..., n-1}, -// == D[j,j], for j ∈ {ilo, ..., ihi}. -// scale must have length equal to n, otherwise Dgebal will panic. -// -// Dgebal is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebal(job lapack.BalanceJob, n int, a []float64, lda int, scale []float64) (ilo, ihi int) { - switch { - case job != lapack.BalanceNone && job != lapack.Permute && job != lapack.Scale && job != lapack.PermuteScale: - panic(badBalanceJob) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - ilo = 0 - ihi = n - 1 - - if n == 0 { - return ilo, ihi - } - - if len(scale) != n { - panic(shortScale) - } - - if job == lapack.BalanceNone { - for i := range scale { - scale[i] = 1 - } - return ilo, ihi - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - swapped := true - - if job == lapack.Scale { - goto scaling - } - - // Permutation to isolate eigenvalues if possible. - // - // Search for rows isolating an eigenvalue and push them down. - for swapped { - swapped = false - rows: - for i := ihi; i >= 0; i-- { - for j := 0; j <= ihi; j++ { - if i == j { - continue - } - if a[i*lda+j] != 0 { - continue rows - } - } - // Row i has only zero off-diagonal elements in the - // block A[ilo:ihi+1,ilo:ihi+1]. - scale[ihi] = float64(i) - if i != ihi { - bi.Dswap(ihi+1, a[i:], lda, a[ihi:], lda) - bi.Dswap(n, a[i*lda:], 1, a[ihi*lda:], 1) - } - if ihi == 0 { - scale[0] = 1 - return ilo, ihi - } - ihi-- - swapped = true - break - } - } - // Search for columns isolating an eigenvalue and push them left. - swapped = true - for swapped { - swapped = false - columns: - for j := ilo; j <= ihi; j++ { - for i := ilo; i <= ihi; i++ { - if i == j { - continue - } - if a[i*lda+j] != 0 { - continue columns - } - } - // Column j has only zero off-diagonal elements in the - // block A[ilo:ihi+1,ilo:ihi+1]. - scale[ilo] = float64(j) - if j != ilo { - bi.Dswap(ihi+1, a[j:], lda, a[ilo:], lda) - bi.Dswap(n-ilo, a[j*lda+ilo:], 1, a[ilo*lda+ilo:], 1) - } - swapped = true - ilo++ - break - } - } - -scaling: - for i := ilo; i <= ihi; i++ { - scale[i] = 1 - } - - if job == lapack.Permute { - return ilo, ihi - } - - // Balance the submatrix in rows ilo to ihi. - - const ( - // sclfac should be a power of 2 to avoid roundoff errors. - // Elements of scale are restricted to powers of sclfac, - // therefore the matrix will be only nearly balanced. - sclfac = 2 - // factor determines the minimum reduction of the row and column - // norms that is considered non-negligible. It must be less than 1. - factor = 0.95 - ) - sfmin1 := dlamchS / dlamchP - sfmax1 := 1 / sfmin1 - sfmin2 := sfmin1 * sclfac - sfmax2 := 1 / sfmin2 - - // Iterative loop for norm reduction. - var conv bool - for !conv { - conv = true - for i := ilo; i <= ihi; i++ { - c := bi.Dnrm2(ihi-ilo+1, a[ilo*lda+i:], lda) - r := bi.Dnrm2(ihi-ilo+1, a[i*lda+ilo:], 1) - ica := bi.Idamax(ihi+1, a[i:], lda) - ca := math.Abs(a[ica*lda+i]) - ira := bi.Idamax(n-ilo, a[i*lda+ilo:], 1) - ra := math.Abs(a[i*lda+ilo+ira]) - - // Guard against zero c or r due to underflow. - if c == 0 || r == 0 { - continue - } - g := r / sclfac - f := 1.0 - s := c + r - for c < g && math.Max(f, math.Max(c, ca)) < sfmax2 && math.Min(r, math.Min(g, ra)) > sfmin2 { - if math.IsNaN(c + f + ca + r + g + ra) { - // Panic if NaN to avoid infinite loop. - panic("lapack: NaN") - } - f *= sclfac - c *= sclfac - ca *= sclfac - g /= sclfac - r /= sclfac - ra /= sclfac - } - g = c / sclfac - for r <= g && math.Max(r, ra) < sfmax2 && math.Min(math.Min(f, c), math.Min(g, ca)) > sfmin2 { - f /= sclfac - c /= sclfac - ca /= sclfac - g /= sclfac - r *= sclfac - ra *= sclfac - } - - if c+r >= factor*s { - // Reduction would be negligible. - continue - } - if f < 1 && scale[i] < 1 && f*scale[i] <= sfmin1 { - continue - } - if f > 1 && scale[i] > 1 && scale[i] >= sfmax1/f { - continue - } - - // Now balance. - scale[i] *= f - bi.Dscal(n-ilo, 1/f, a[i*lda+ilo:], 1) - bi.Dscal(ihi+1, f, a[i:], lda) - conv = false - } - } - return ilo, ihi -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go deleted file mode 100644 index cf951a120..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebd2.go +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dgebd2 reduces an m×n matrix A to upper or lower bidiagonal form by an orthogonal -// transformation. -// Q^T * A * P = B -// if m >= n, B is upper diagonal, otherwise B is lower bidiagonal. -// d is the diagonal, len = min(m,n) -// e is the off-diagonal len = min(m,n)-1 -// -// Dgebd2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebd2(m, n int, a []float64, lda int, d, e, tauQ, tauP, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - minmn := min(m, n) - if minmn == 0 { - return - } - - switch { - case len(d) < minmn: - panic(shortD) - case len(e) < minmn-1: - panic(shortE) - case len(tauQ) < minmn: - panic(shortTauQ) - case len(tauP) < minmn: - panic(shortTauP) - case len(work) < max(m, n): - panic(shortWork) - } - - if m >= n { - for i := 0; i < n; i++ { - a[i*lda+i], tauQ[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min(i+1, m-1)*lda+i:], lda) - d[i] = a[i*lda+i] - a[i*lda+i] = 1 - // Apply H_i to A[i:m, i+1:n] from the left. - if i < n-1 { - impl.Dlarf(blas.Left, m-i, n-i-1, a[i*lda+i:], lda, tauQ[i], a[i*lda+i+1:], lda, work) - } - a[i*lda+i] = d[i] - if i < n-1 { - a[i*lda+i+1], tauP[i] = impl.Dlarfg(n-i-1, a[i*lda+i+1], a[i*lda+min(i+2, n-1):], 1) - e[i] = a[i*lda+i+1] - a[i*lda+i+1] = 1 - impl.Dlarf(blas.Right, m-i-1, n-i-1, a[i*lda+i+1:], 1, tauP[i], a[(i+1)*lda+i+1:], lda, work) - a[i*lda+i+1] = e[i] - } else { - tauP[i] = 0 - } - } - return - } - for i := 0; i < m; i++ { - a[i*lda+i], tauP[i] = impl.Dlarfg(n-i, a[i*lda+i], a[i*lda+min(i+1, n-1):], 1) - d[i] = a[i*lda+i] - a[i*lda+i] = 1 - if i < m-1 { - impl.Dlarf(blas.Right, m-i-1, n-i, a[i*lda+i:], 1, tauP[i], a[(i+1)*lda+i:], lda, work) - } - a[i*lda+i] = d[i] - if i < m-1 { - a[(i+1)*lda+i], tauQ[i] = impl.Dlarfg(m-i-1, a[(i+1)*lda+i], a[min(i+2, m-1)*lda+i:], lda) - e[i] = a[(i+1)*lda+i] - a[(i+1)*lda+i] = 1 - impl.Dlarf(blas.Left, m-i-1, n-i-1, a[(i+1)*lda+i:], lda, tauQ[i], a[(i+1)*lda+i+1:], lda, work) - a[(i+1)*lda+i] = e[i] - } else { - tauQ[i] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go deleted file mode 100644 index f03bf8d93..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgebrd.go +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgebrd reduces a general m×n matrix A to upper or lower bidiagonal form B by -// an orthogonal transformation: -// Q^T * A * P = B. -// The diagonal elements of B are stored in d and the off-diagonal elements are stored -// in e. These are additionally stored along the diagonal of A and the off-diagonal -// of A. If m >= n B is an upper-bidiagonal matrix, and if m < n B is a -// lower-bidiagonal matrix. -// -// The remaining elements of A store the data needed to construct Q and P. -// The matrices Q and P are products of elementary reflectors -// if m >= n, Q = H_0 * H_1 * ... * H_{n-1}, -// P = G_0 * G_1 * ... * G_{n-2}, -// if m < n, Q = H_0 * H_1 * ... * H_{m-2}, -// P = G_0 * G_1 * ... * G_{m-1}, -// where -// H_i = I - tauQ[i] * v_i * v_i^T, -// G_i = I - tauP[i] * u_i * u_i^T. -// -// As an example, on exit the entries of A when m = 6, and n = 5 -// [ d e u1 u1 u1] -// [v1 d e u2 u2] -// [v1 v2 d e u3] -// [v1 v2 v3 d e] -// [v1 v2 v3 v4 d] -// [v1 v2 v3 v4 v5] -// and when m = 5, n = 6 -// [ d u1 u1 u1 u1 u1] -// [ e d u2 u2 u2 u2] -// [v1 e d u3 u3 u3] -// [v1 v2 e d u4 u4] -// [v1 v2 v3 e d u5] -// -// d, tauQ, and tauP must all have length at least min(m,n), and e must have -// length min(m,n) - 1, unless lwork is -1 when there is no check except for -// work which must have a length of at least one. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= max(1,m,n) or be -1 and this function will panic otherwise. -// Dgebrd is blocked decomposition, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgebrd, -// the optimal work length will be stored into work[0]. -// -// Dgebrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgebrd(m, n int, a []float64, lda int, d, e, tauQ, tauP, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, max(m, n)) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - minmn := min(m, n) - if minmn == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DGEBRD", " ", m, n, -1, -1) - lwkopt := (m + n) * nb - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(d) < minmn: - panic(shortD) - case len(e) < minmn-1: - panic(shortE) - case len(tauQ) < minmn: - panic(shortTauQ) - case len(tauP) < minmn: - panic(shortTauP) - } - - nx := minmn - ws := max(m, n) - if 1 < nb && nb < minmn { - // At least one blocked operation can be done. - // Get the crossover point nx. - nx = max(nb, impl.Ilaenv(3, "DGEBRD", " ", m, n, -1, -1)) - // Determine when to switch from blocked to unblocked code. - if nx < minmn { - // At least one blocked operation will be done. - ws = (m + n) * nb - if lwork < ws { - // Not enough work space for the optimal nb, - // consider using a smaller block size. - nbmin := impl.Ilaenv(2, "DGEBRD", " ", m, n, -1, -1) - if lwork >= (m+n)*nbmin { - // Enough work space for minimum block size. - nb = lwork / (m + n) - } else { - nb = minmn - nx = minmn - } - } - } - } - bi := blas64.Implementation() - ldworkx := nb - ldworky := nb - var i int - for i = 0; i < minmn-nx; i += nb { - // Reduce rows and columns i:i+nb to bidiagonal form and return - // the matrices X and Y which are needed to update the unreduced - // part of the matrix. - // X is stored in the first m rows of work, y in the next rows. - x := work[:m*ldworkx] - y := work[m*ldworkx:] - impl.Dlabrd(m-i, n-i, nb, a[i*lda+i:], lda, - d[i:], e[i:], tauQ[i:], tauP[i:], - x, ldworkx, y, ldworky) - - // Update the trailing submatrix A[i+nb:m,i+nb:n], using an update - // of the form A := A - V*Y**T - X*U**T - bi.Dgemm(blas.NoTrans, blas.Trans, m-i-nb, n-i-nb, nb, - -1, a[(i+nb)*lda+i:], lda, y[nb*ldworky:], ldworky, - 1, a[(i+nb)*lda+i+nb:], lda) - - bi.Dgemm(blas.NoTrans, blas.NoTrans, m-i-nb, n-i-nb, nb, - -1, x[nb*ldworkx:], ldworkx, a[i*lda+i+nb:], lda, - 1, a[(i+nb)*lda+i+nb:], lda) - - // Copy diagonal and off-diagonal elements of B back into A. - if m >= n { - for j := i; j < i+nb; j++ { - a[j*lda+j] = d[j] - a[j*lda+j+1] = e[j] - } - } else { - for j := i; j < i+nb; j++ { - a[j*lda+j] = d[j] - a[(j+1)*lda+j] = e[j] - } - } - } - // Use unblocked code to reduce the remainder of the matrix. - impl.Dgebd2(m-i, n-i, a[i*lda+i:], lda, d[i:], e[i:], tauQ[i:], tauP[i:], work) - work[0] = float64(ws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go deleted file mode 100644 index 1d1ca586b..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgecon.go +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgecon estimates the reciprocal of the condition number of the n×n matrix A -// given the LU decomposition of the matrix. The condition number computed may -// be based on the 1-norm or the ∞-norm. -// -// The slice a contains the result of the LU decomposition of A as computed by Dgetrf. -// -// anorm is the corresponding 1-norm or ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 4*n and Dgecon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Dgecon will panic otherwise. -func (impl Implementation) Dgecon(norm lapack.MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 { - switch { - case norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum: - panic(badNorm) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 1 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(work) < 4*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - // Quick return if possible. - if anorm == 0 { - return 0 - } - - bi := blas64.Implementation() - var rcond, ainvnm float64 - var kase int - var normin bool - isave := new([3]int) - onenrm := norm == lapack.MaxColumnSum - smlnum := dlamchS - kase1 := 2 - if onenrm { - kase1 = 1 - } - for { - ainvnm, kase = impl.Dlacn2(n, work[n:], work, iwork, ainvnm, kase, isave) - if kase == 0 { - if ainvnm != 0 { - rcond = (1 / ainvnm) / anorm - } - return rcond - } - var sl, su float64 - if kase == kase1 { - sl = impl.Dlatrs(blas.Lower, blas.NoTrans, blas.Unit, normin, n, a, lda, work, work[2*n:]) - su = impl.Dlatrs(blas.Upper, blas.NoTrans, blas.NonUnit, normin, n, a, lda, work, work[3*n:]) - } else { - su = impl.Dlatrs(blas.Upper, blas.Trans, blas.NonUnit, normin, n, a, lda, work, work[3*n:]) - sl = impl.Dlatrs(blas.Lower, blas.Trans, blas.Unit, normin, n, a, lda, work, work[2*n:]) - } - scale := sl * su - normin = true - if scale != 1 { - ix := bi.Idamax(n, work, 1) - if scale == 0 || scale < math.Abs(work[ix])*smlnum { - return rcond - } - impl.Drscl(n, scale, work, 1) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go deleted file mode 100644 index 0da4e609c..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeev.go +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgeev computes the eigenvalues and, optionally, the left and/or right -// eigenvectors for an n×n real nonsymmetric matrix A. -// -// The right eigenvector v_j of A corresponding to an eigenvalue λ_j -// is defined by -// A v_j = λ_j v_j, -// and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_j^H A = λ_j u_j^H, -// where u_j^H is the conjugate transpose of u_j. -// -// On return, A will be overwritten and the left and right eigenvectors will be -// stored, respectively, in the columns of the n×n matrices VL and VR in the -// same order as their eigenvalues. If the j-th eigenvalue is real, then -// u_j = VL[:,j], -// v_j = VR[:,j], -// and if it is not real, then j and j+1 form a complex conjugate pair and the -// eigenvectors can be recovered as -// u_j = VL[:,j] + i*VL[:,j+1], -// u_{j+1} = VL[:,j] - i*VL[:,j+1], -// v_j = VR[:,j] + i*VR[:,j+1], -// v_{j+1} = VR[:,j] - i*VR[:,j+1], -// where i is the imaginary unit. The computed eigenvectors are normalized to -// have Euclidean norm equal to 1 and largest component real. -// -// Left eigenvectors will be computed only if jobvl == lapack.LeftEVCompute, -// otherwise jobvl must be lapack.LeftEVNone. -// Right eigenvectors will be computed only if jobvr == lapack.RightEVCompute, -// otherwise jobvr must be lapack.RightEVNone. -// For other values of jobvl and jobvr Dgeev will panic. -// -// wr and wi contain the real and imaginary parts, respectively, of the computed -// eigenvalues. Complex conjugate pairs of eigenvalues appear consecutively with -// the eigenvalue having the positive imaginary part first. -// wr and wi must have length n, and Dgeev will panic otherwise. -// -// work must have length at least lwork and lwork must be at least max(1,4*n) if -// the left or right eigenvectors are computed, and at least max(1,3*n) if no -// eigenvectors are computed. For good performance, lwork must generally be -// larger. On return, optimal value of lwork will be stored in work[0]. -// -// If lwork == -1, instead of performing Dgeev, the function only calculates the -// optimal vaule of lwork and stores it into work[0]. -// -// On return, first is the index of the first valid eigenvalue. If first == 0, -// all eigenvalues and eigenvectors have been computed. If first is positive, -// Dgeev failed to compute all the eigenvalues, no eigenvectors have been -// computed and wr[first:] and wi[first:] contain those eigenvalues which have -// converged. -func (impl Implementation) Dgeev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) { - wantvl := jobvl == lapack.LeftEVCompute - wantvr := jobvr == lapack.RightEVCompute - var minwrk int - if wantvl || wantvr { - minwrk = max(1, 4*n) - } else { - minwrk = max(1, 3*n) - } - switch { - case jobvl != lapack.LeftEVCompute && jobvl != lapack.LeftEVNone: - panic(badLeftEVJob) - case jobvr != lapack.RightEVCompute && jobvr != lapack.RightEVNone: - panic(badRightEVJob) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldvl < 1 || (ldvl < n && wantvl): - panic(badLdVL) - case ldvr < 1 || (ldvr < n && wantvr): - panic(badLdVR) - case lwork < minwrk && lwork != -1: - panic(badLWork) - case len(work) < lwork: - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return 0 - } - - maxwrk := 2*n + n*impl.Ilaenv(1, "DGEHRD", " ", n, 1, n, 0) - if wantvl || wantvr { - maxwrk = max(maxwrk, 2*n+(n-1)*impl.Ilaenv(1, "DORGHR", " ", n, 1, n, -1)) - impl.Dhseqr(lapack.EigenvaluesAndSchur, lapack.SchurOrig, n, 0, n-1, - a, lda, wr, wi, nil, n, work, -1) - maxwrk = max(maxwrk, max(n+1, n+int(work[0]))) - side := lapack.EVLeft - if wantvr { - side = lapack.EVRight - } - impl.Dtrevc3(side, lapack.EVAllMulQ, nil, n, a, lda, vl, ldvl, vr, ldvr, - n, work, -1) - maxwrk = max(maxwrk, n+int(work[0])) - maxwrk = max(maxwrk, 4*n) - } else { - impl.Dhseqr(lapack.EigenvaluesOnly, lapack.SchurNone, n, 0, n-1, - a, lda, wr, wi, vr, ldvr, work, -1) - maxwrk = max(maxwrk, max(n+1, n+int(work[0]))) - } - maxwrk = max(maxwrk, minwrk) - - if lwork == -1 { - work[0] = float64(maxwrk) - return 0 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(wr) != n: - panic(badLenWr) - case len(wi) != n: - panic(badLenWi) - case len(vl) < (n-1)*ldvl+n && wantvl: - panic(shortVL) - case len(vr) < (n-1)*ldvr+n && wantvr: - panic(shortVR) - } - - // Get machine constants. - smlnum := math.Sqrt(dlamchS) / dlamchP - bignum := 1 / smlnum - - // Scale A if max element outside range [smlnum,bignum]. - anrm := impl.Dlange(lapack.MaxAbs, n, n, a, lda, nil) - var scalea bool - var cscale float64 - if 0 < anrm && anrm < smlnum { - scalea = true - cscale = smlnum - } else if anrm > bignum { - scalea = true - cscale = bignum - } - if scalea { - impl.Dlascl(lapack.General, 0, 0, anrm, cscale, n, n, a, lda) - } - - // Balance the matrix. - workbal := work[:n] - ilo, ihi := impl.Dgebal(lapack.PermuteScale, n, a, lda, workbal) - - // Reduce to upper Hessenberg form. - iwrk := 2 * n - tau := work[n : iwrk-1] - impl.Dgehrd(n, ilo, ihi, a, lda, tau, work[iwrk:], lwork-iwrk) - - var side lapack.EVSide - if wantvl { - side = lapack.EVLeft - // Copy Householder vectors to VL. - impl.Dlacpy(blas.Lower, n, n, a, lda, vl, ldvl) - // Generate orthogonal matrix in VL. - impl.Dorghr(n, ilo, ihi, vl, ldvl, tau, work[iwrk:], lwork-iwrk) - // Perform QR iteration, accumulating Schur vectors in VL. - iwrk = n - first = impl.Dhseqr(lapack.EigenvaluesAndSchur, lapack.SchurOrig, n, ilo, ihi, - a, lda, wr, wi, vl, ldvl, work[iwrk:], lwork-iwrk) - if wantvr { - // Want left and right eigenvectors. - // Copy Schur vectors to VR. - side = lapack.EVBoth - impl.Dlacpy(blas.All, n, n, vl, ldvl, vr, ldvr) - } - } else if wantvr { - side = lapack.EVRight - // Copy Householder vectors to VR. - impl.Dlacpy(blas.Lower, n, n, a, lda, vr, ldvr) - // Generate orthogonal matrix in VR. - impl.Dorghr(n, ilo, ihi, vr, ldvr, tau, work[iwrk:], lwork-iwrk) - // Perform QR iteration, accumulating Schur vectors in VR. - iwrk = n - first = impl.Dhseqr(lapack.EigenvaluesAndSchur, lapack.SchurOrig, n, ilo, ihi, - a, lda, wr, wi, vr, ldvr, work[iwrk:], lwork-iwrk) - } else { - // Compute eigenvalues only. - iwrk = n - first = impl.Dhseqr(lapack.EigenvaluesOnly, lapack.SchurNone, n, ilo, ihi, - a, lda, wr, wi, nil, 1, work[iwrk:], lwork-iwrk) - } - - if first > 0 { - if scalea { - // Undo scaling. - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wr[first:], 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wi[first:], 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, ilo, 1, wr, 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, ilo, 1, wi, 1) - } - work[0] = float64(maxwrk) - return first - } - - if wantvl || wantvr { - // Compute left and/or right eigenvectors. - impl.Dtrevc3(side, lapack.EVAllMulQ, nil, n, - a, lda, vl, ldvl, vr, ldvr, n, work[iwrk:], lwork-iwrk) - } - bi := blas64.Implementation() - if wantvl { - // Undo balancing of left eigenvectors. - impl.Dgebak(lapack.PermuteScale, lapack.EVLeft, n, ilo, ihi, workbal, n, vl, ldvl) - // Normalize left eigenvectors and make largest component real. - for i, wii := range wi { - if wii < 0 { - continue - } - if wii == 0 { - scl := 1 / bi.Dnrm2(n, vl[i:], ldvl) - bi.Dscal(n, scl, vl[i:], ldvl) - continue - } - scl := 1 / impl.Dlapy2(bi.Dnrm2(n, vl[i:], ldvl), bi.Dnrm2(n, vl[i+1:], ldvl)) - bi.Dscal(n, scl, vl[i:], ldvl) - bi.Dscal(n, scl, vl[i+1:], ldvl) - for k := 0; k < n; k++ { - vi := vl[k*ldvl+i] - vi1 := vl[k*ldvl+i+1] - work[iwrk+k] = vi*vi + vi1*vi1 - } - k := bi.Idamax(n, work[iwrk:iwrk+n], 1) - cs, sn, _ := impl.Dlartg(vl[k*ldvl+i], vl[k*ldvl+i+1]) - bi.Drot(n, vl[i:], ldvl, vl[i+1:], ldvl, cs, sn) - vl[k*ldvl+i+1] = 0 - } - } - if wantvr { - // Undo balancing of right eigenvectors. - impl.Dgebak(lapack.PermuteScale, lapack.EVRight, n, ilo, ihi, workbal, n, vr, ldvr) - // Normalize right eigenvectors and make largest component real. - for i, wii := range wi { - if wii < 0 { - continue - } - if wii == 0 { - scl := 1 / bi.Dnrm2(n, vr[i:], ldvr) - bi.Dscal(n, scl, vr[i:], ldvr) - continue - } - scl := 1 / impl.Dlapy2(bi.Dnrm2(n, vr[i:], ldvr), bi.Dnrm2(n, vr[i+1:], ldvr)) - bi.Dscal(n, scl, vr[i:], ldvr) - bi.Dscal(n, scl, vr[i+1:], ldvr) - for k := 0; k < n; k++ { - vi := vr[k*ldvr+i] - vi1 := vr[k*ldvr+i+1] - work[iwrk+k] = vi*vi + vi1*vi1 - } - k := bi.Idamax(n, work[iwrk:iwrk+n], 1) - cs, sn, _ := impl.Dlartg(vr[k*ldvr+i], vr[k*ldvr+i+1]) - bi.Drot(n, vr[i:], ldvr, vr[i+1:], ldvr, cs, sn) - vr[k*ldvr+i+1] = 0 - } - } - - if scalea { - // Undo scaling. - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wr[first:], 1) - impl.Dlascl(lapack.General, 0, 0, cscale, anrm, n-first, 1, wi[first:], 1) - } - - work[0] = float64(maxwrk) - return first -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go deleted file mode 100644 index 261f21b98..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehd2.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dgehd2 reduces a block of a general n×n matrix A to upper Hessenberg form H -// by an orthogonal similarity transformation Q^T * A * Q = H. -// -// The matrix Q is represented as a product of (ihi-ilo) elementary -// reflectors -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// Each H_i has the form -// H_i = I - tau[i] * v * v^T -// where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. -// v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. -// -// On entry, a contains the n×n general matrix to be reduced. On return, the -// upper triangle and the first subdiagonal of A are overwritten with the upper -// Hessenberg matrix H, and the elements below the first subdiagonal, with the -// slice tau, represent the orthogonal matrix Q as a product of elementary -// reflectors. -// -// The contents of A are illustrated by the following example, with n = 7, ilo = -// 1 and ihi = 5. -// On entry, -// [ a a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a ] -// on return, -// [ a a h h h h a ] -// [ a h h h h a ] -// [ h h h h h h ] -// [ v1 h h h h h ] -// [ v1 v2 h h h h ] -// [ v1 v2 v3 h h h ] -// [ a ] -// where a denotes an element of the original matrix A, h denotes a -// modified element of the upper Hessenberg matrix H, and vi denotes an -// element of the vector defining H_i. -// -// ilo and ihi determine the block of A that will be reduced to upper Hessenberg -// form. It must hold that 0 <= ilo <= ihi <= max(0, n-1), otherwise Dgehd2 will -// panic. -// -// On return, tau will contain the scalar factors of the elementary reflectors. -// It must have length equal to n-1, otherwise Dgehd2 will panic. -// -// work must have length at least n, otherwise Dgehd2 will panic. -// -// Dgehd2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgehd2(n, ilo, ihi int, a []float64, lda int, tau, work []float64) { - switch { - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(tau) != n-1: - panic(badLenTau) - case len(work) < n: - panic(shortWork) - } - - for i := ilo; i < ihi; i++ { - // Compute elementary reflector H_i to annihilate A[i+2:ihi+1,i]. - var aii float64 - aii, tau[i] = impl.Dlarfg(ihi-i, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) - a[(i+1)*lda+i] = 1 - - // Apply H_i to A[0:ihi+1,i+1:ihi+1] from the right. - impl.Dlarf(blas.Right, ihi+1, ihi-i, a[(i+1)*lda+i:], lda, tau[i], a[i+1:], lda, work) - - // Apply H_i to A[i+1:ihi+1,i+1:n] from the left. - impl.Dlarf(blas.Left, ihi-i, n-i-1, a[(i+1)*lda+i:], lda, tau[i], a[(i+1)*lda+i+1:], lda, work) - a[(i+1)*lda+i] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go deleted file mode 100644 index 89b73cef9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgehrd.go +++ /dev/null @@ -1,194 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dgehrd reduces a block of a real n×n general matrix A to upper Hessenberg -// form H by an orthogonal similarity transformation Q^T * A * Q = H. -// -// The matrix Q is represented as a product of (ihi-ilo) elementary -// reflectors -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// Each H_i has the form -// H_i = I - tau[i] * v * v^T -// where v is a real vector with v[0:i+1] = 0, v[i+1] = 1 and v[ihi+1:n] = 0. -// v[i+2:ihi+1] is stored on exit in A[i+2:ihi+1,i]. -// -// On entry, a contains the n×n general matrix to be reduced. On return, the -// upper triangle and the first subdiagonal of A will be overwritten with the -// upper Hessenberg matrix H, and the elements below the first subdiagonal, with -// the slice tau, represent the orthogonal matrix Q as a product of elementary -// reflectors. -// -// The contents of a are illustrated by the following example, with n = 7, ilo = -// 1 and ihi = 5. -// On entry, -// [ a a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a a a a a a ] -// [ a ] -// on return, -// [ a a h h h h a ] -// [ a h h h h a ] -// [ h h h h h h ] -// [ v1 h h h h h ] -// [ v1 v2 h h h h ] -// [ v1 v2 v3 h h h ] -// [ a ] -// where a denotes an element of the original matrix A, h denotes a -// modified element of the upper Hessenberg matrix H, and vi denotes an -// element of the vector defining H_i. -// -// ilo and ihi determine the block of A that will be reduced to upper Hessenberg -// form. It must hold that 0 <= ilo <= ihi < n if n > 0, and ilo == 0 and ihi == -// -1 if n == 0, otherwise Dgehrd will panic. -// -// On return, tau will contain the scalar factors of the elementary reflectors. -// Elements tau[:ilo] and tau[ihi:] will be set to zero. tau must have length -// equal to n-1 if n > 0, otherwise Dgehrd will panic. -// -// work must have length at least lwork and lwork must be at least max(1,n), -// otherwise Dgehrd will panic. On return, work[0] contains the optimal value of -// lwork. -// -// If lwork == -1, instead of performing Dgehrd, only the optimal value of lwork -// will be stored in work[0]. -// -// Dgehrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgehrd(n, ilo, ihi int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < lwork: - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - const ( - nbmax = 64 - ldt = nbmax + 1 - tsize = ldt * nbmax - ) - // Compute the workspace requirements. - nb := min(nbmax, impl.Ilaenv(1, "DGEHRD", " ", n, ilo, ihi, -1)) - lwkopt := n*nb + tsize - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - if len(tau) != n-1 { - panic(badLenTau) - } - - // Set tau[:ilo] and tau[ihi:] to zero. - for i := 0; i < ilo; i++ { - tau[i] = 0 - } - for i := ihi; i < n-1; i++ { - tau[i] = 0 - } - - // Quick return if possible. - nh := ihi - ilo + 1 - if nh <= 1 { - work[0] = 1 - return - } - - // Determine the block size. - nbmin := 2 - var nx int - if 1 < nb && nb < nh { - // Determine when to cross over from blocked to unblocked code - // (last block is always handled by unblocked code). - nx = max(nb, impl.Ilaenv(3, "DGEHRD", " ", n, ilo, ihi, -1)) - if nx < nh { - // Determine if workspace is large enough for blocked code. - if lwork < n*nb+tsize { - // Not enough workspace to use optimal nb: - // determine the minimum value of nb, and reduce - // nb or force use of unblocked code. - nbmin = max(2, impl.Ilaenv(2, "DGEHRD", " ", n, ilo, ihi, -1)) - if lwork >= n*nbmin+tsize { - nb = (lwork - tsize) / n - } else { - nb = 1 - } - } - } - } - ldwork := nb // work is used as an n×nb matrix. - - var i int - if nb < nbmin || nh <= nb { - // Use unblocked code below. - i = ilo - } else { - // Use blocked code. - bi := blas64.Implementation() - iwt := n * nb // Size of the matrix Y and index where the matrix T starts in work. - for i = ilo; i < ihi-nx; i += nb { - ib := min(nb, ihi-i) - - // Reduce columns [i:i+ib] to Hessenberg form, returning the - // matrices V and T of the block reflector H = I - V*T*V^T - // which performs the reduction, and also the matrix Y = A*V*T. - impl.Dlahr2(ihi+1, i+1, ib, a[i:], lda, tau[i:], work[iwt:], ldt, work, ldwork) - - // Apply the block reflector H to A[:ihi+1,i+ib:ihi+1] from the - // right, computing A := A - Y * V^T. V[i+ib,i+ib-1] must be set - // to 1. - ei := a[(i+ib)*lda+i+ib-1] - a[(i+ib)*lda+i+ib-1] = 1 - bi.Dgemm(blas.NoTrans, blas.Trans, ihi+1, ihi-i-ib+1, ib, - -1, work, ldwork, - a[(i+ib)*lda+i:], lda, - 1, a[i+ib:], lda) - a[(i+ib)*lda+i+ib-1] = ei - - // Apply the block reflector H to A[0:i+1,i+1:i+ib-1] from the - // right. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, i+1, ib-1, - 1, a[(i+1)*lda+i:], lda, work, ldwork) - for j := 0; j <= ib-2; j++ { - bi.Daxpy(i+1, -1, work[j:], ldwork, a[i+j+1:], lda) - } - - // Apply the block reflector H to A[i+1:ihi+1,i+ib:n] from the - // left. - impl.Dlarfb(blas.Left, blas.Trans, lapack.Forward, lapack.ColumnWise, - ihi-i, n-i-ib, ib, - a[(i+1)*lda+i:], lda, work[iwt:], ldt, a[(i+1)*lda+i+ib:], lda, work, ldwork) - } - } - // Use unblocked code to reduce the rest of the matrix. - impl.Dgehd2(n, i, ihi, a, lda, tau, work) - work[0] = float64(lwkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go deleted file mode 100644 index abc96f7d2..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelq2.go +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dgelq2 computes the LQ factorization of the m×n matrix A. -// -// In an LQ factorization, L is a lower triangular m×n matrix, and Q is an n×n -// orthonormal matrix. -// -// a is modified to contain the information to construct L and Q. -// The lower triangle of a contains the matrix L. The upper triangular elements -// (not including the diagonal) contain the elementary reflectors. tau is modified -// to contain the reflector scales. tau must have length of at least k = min(m,n) -// and this function will panic otherwise. -// -// See Dgeqr2 for a description of the elementary reflectors and orthonormal -// matrix Q. Q is constructed as a product of these elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0. -// -// work is temporary storage of length at least m and this function will panic otherwise. -// -// Dgelq2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgelq2(m, n int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < m: - panic(shortWork) - } - - for i := 0; i < k; i++ { - a[i*lda+i], tau[i] = impl.Dlarfg(n-i, a[i*lda+i], a[i*lda+min(i+1, n-1):], 1) - if i < m-1 { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(blas.Right, m-i-1, n-i, - a[i*lda+i:], 1, - tau[i], - a[(i+1)*lda+i:], lda, - work) - a[i*lda+i] = aii - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go deleted file mode 100644 index f1fd13a01..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgelqf.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgelqf computes the LQ factorization of the m×n matrix A using a blocked -// algorithm. See the documentation for Dgelq2 for a description of the -// parameters at entry and exit. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m, and this function will panic otherwise. -// Dgelqf is a blocked LQ factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgelqf, -// the optimal work length will be stored into work[0]. -// -// tau must have length at least min(m,n), and this function will panic otherwise. -func (impl Implementation) Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, m) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - k := min(m, n) - if k == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DGELQF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(m * nb) - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(tau) < k { - panic(shortTau) - } - - // Find the optimal blocking size based on the size of available memory - // and optimal machine parameters. - nbmin := 2 - var nx int - iws := m - if 1 < nb && nb < k { - nx = max(0, impl.Ilaenv(3, "DGELQF", " ", m, n, -1, -1)) - if nx < k { - iws = m * nb - if lwork < iws { - nb = lwork / m - nbmin = max(2, impl.Ilaenv(2, "DGELQF", " ", m, n, -1, -1)) - } - } - } - ldwork := nb - // Computed blocked LQ factorization. - var i int - if nbmin <= nb && nb < k && nx < k { - for i = 0; i < k-nx; i += nb { - ib := min(k-i, nb) - impl.Dgelq2(ib, n-i, a[i*lda+i:], lda, tau[i:], work) - if i+ib < m { - impl.Dlarft(lapack.Forward, lapack.RowWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - impl.Dlarfb(blas.Right, blas.NoTrans, lapack.Forward, lapack.RowWise, - m-i-ib, n-i, ib, - a[i*lda+i:], lda, - work, ldwork, - a[(i+ib)*lda+i:], lda, - work[ib*ldwork:], ldwork) - } - } - } - // Perform unblocked LQ factorization on the remainder. - if i < k { - impl.Dgelq2(m-i, n-i, a[i*lda+i:], lda, tau[i:], work) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go deleted file mode 100644 index a3894b6a0..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgels.go +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgels finds a minimum-norm solution based on the matrices A and B using the -// QR or LQ factorization. Dgels returns false if the matrix -// A is singular, and true if this solution was successfully found. -// -// The minimization problem solved depends on the input parameters. -// -// 1. If m >= n and trans == blas.NoTrans, Dgels finds X such that || A*X - B||_2 -// is minimized. -// 2. If m < n and trans == blas.NoTrans, Dgels finds the minimum norm solution of -// A * X = B. -// 3. If m >= n and trans == blas.Trans, Dgels finds the minimum norm solution of -// A^T * X = B. -// 4. If m < n and trans == blas.Trans, Dgels finds X such that || A*X - B||_2 -// is minimized. -// Note that the least-squares solutions (cases 1 and 3) perform the minimization -// per column of B. This is not the same as finding the minimum-norm matrix. -// -// The matrix A is a general matrix of size m×n and is modified during this call. -// The input matrix B is of size max(m,n)×nrhs, and serves two purposes. On entry, -// the elements of b specify the input matrix B. B has size m×nrhs if -// trans == blas.NoTrans, and n×nrhs if trans == blas.Trans. On exit, the -// leading submatrix of b contains the solution vectors X. If trans == blas.NoTrans, -// this submatrix is of size n×nrhs, and of size m×nrhs otherwise. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= max(m,n) + max(m,n,nrhs), and this function will panic -// otherwise. A longer work will enable blocked algorithms to be called. -// In the special case that lwork == -1, work[0] will be set to the optimal working -// length. -func (impl Implementation) Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool { - mn := min(m, n) - minwrk := mn + max(mn, nrhs) - switch { - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - case lwork < max(1, minwrk) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if mn == 0 || nrhs == 0 { - impl.Dlaset(blas.All, max(m, n), nrhs, 0, 0, b, ldb) - work[0] = 1 - return true - } - - // Find optimal block size. - var nb int - if m >= n { - nb = impl.Ilaenv(1, "DGEQRF", " ", m, n, -1, -1) - if trans != blas.NoTrans { - nb = max(nb, impl.Ilaenv(1, "DORMQR", "LN", m, nrhs, n, -1)) - } else { - nb = max(nb, impl.Ilaenv(1, "DORMQR", "LT", m, nrhs, n, -1)) - } - } else { - nb = impl.Ilaenv(1, "DGELQF", " ", m, n, -1, -1) - if trans != blas.NoTrans { - nb = max(nb, impl.Ilaenv(1, "DORMLQ", "LT", n, nrhs, m, -1)) - } else { - nb = max(nb, impl.Ilaenv(1, "DORMLQ", "LN", n, nrhs, m, -1)) - } - } - wsize := max(1, mn+max(mn, nrhs)*nb) - work[0] = float64(wsize) - - if lwork == -1 { - return true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (max(m, n)-1)*ldb+nrhs: - panic(shortB) - } - - // Scale the input matrices if they contain extreme values. - smlnum := dlamchS / dlamchP - bignum := 1 / smlnum - anrm := impl.Dlange(lapack.MaxAbs, m, n, a, lda, nil) - var iascl int - if anrm > 0 && anrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, anrm, smlnum, m, n, a, lda) - iascl = 1 - } else if anrm > bignum { - impl.Dlascl(lapack.General, 0, 0, anrm, bignum, m, n, a, lda) - } else if anrm == 0 { - // Matrix is all zeros. - impl.Dlaset(blas.All, max(m, n), nrhs, 0, 0, b, ldb) - return true - } - brow := m - if trans != blas.NoTrans { - brow = n - } - bnrm := impl.Dlange(lapack.MaxAbs, brow, nrhs, b, ldb, nil) - ibscl := 0 - if bnrm > 0 && bnrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, bnrm, smlnum, brow, nrhs, b, ldb) - ibscl = 1 - } else if bnrm > bignum { - impl.Dlascl(lapack.General, 0, 0, bnrm, bignum, brow, nrhs, b, ldb) - ibscl = 2 - } - - // Solve the minimization problem using a QR or an LQ decomposition. - var scllen int - if m >= n { - impl.Dgeqrf(m, n, a, lda, work, work[mn:], lwork-mn) - if trans == blas.NoTrans { - impl.Dormqr(blas.Left, blas.Trans, m, nrhs, n, - a, lda, - work[:n], - b, ldb, - work[mn:], lwork-mn) - ok := impl.Dtrtrs(blas.Upper, blas.NoTrans, blas.NonUnit, n, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - scllen = n - } else { - ok := impl.Dtrtrs(blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - for i := n; i < m; i++ { - for j := 0; j < nrhs; j++ { - b[i*ldb+j] = 0 - } - } - impl.Dormqr(blas.Left, blas.NoTrans, m, nrhs, n, - a, lda, - work[:n], - b, ldb, - work[mn:], lwork-mn) - scllen = m - } - } else { - impl.Dgelqf(m, n, a, lda, work, work[mn:], lwork-mn) - if trans == blas.NoTrans { - ok := impl.Dtrtrs(blas.Lower, blas.NoTrans, blas.NonUnit, - m, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - for i := m; i < n; i++ { - for j := 0; j < nrhs; j++ { - b[i*ldb+j] = 0 - } - } - impl.Dormlq(blas.Left, blas.Trans, n, nrhs, m, - a, lda, - work, - b, ldb, - work[mn:], lwork-mn) - scllen = n - } else { - impl.Dormlq(blas.Left, blas.NoTrans, n, nrhs, m, - a, lda, - work, - b, ldb, - work[mn:], lwork-mn) - ok := impl.Dtrtrs(blas.Lower, blas.Trans, blas.NonUnit, - m, nrhs, - a, lda, - b, ldb) - if !ok { - return false - } - } - } - - // Adjust answer vector based on scaling. - if iascl == 1 { - impl.Dlascl(lapack.General, 0, 0, anrm, smlnum, scllen, nrhs, b, ldb) - } - if iascl == 2 { - impl.Dlascl(lapack.General, 0, 0, anrm, bignum, scllen, nrhs, b, ldb) - } - if ibscl == 1 { - impl.Dlascl(lapack.General, 0, 0, smlnum, bnrm, scllen, nrhs, b, ldb) - } - if ibscl == 2 { - impl.Dlascl(lapack.General, 0, 0, bignum, bnrm, scllen, nrhs, b, ldb) - } - - work[0] = float64(wsize) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go deleted file mode 100644 index 3f3ddb163..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeql2.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dgeql2 computes the QL factorization of the m×n matrix A. That is, Dgeql2 -// computes Q and L such that -// A = Q * L -// where Q is an m×m orthonormal matrix and L is a lower trapezoidal matrix. -// -// Q is represented as a product of elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0 -// where k = min(m,n) and each H_i has the form -// H_i = I - tau[i] * v_i * v_i^T -// Vector v_i has v[m-k+i+1:m] = 0, v[m-k+i] = 1, and v[:m-k+i+1] is stored on -// exit in A[0:m-k+i-1, n-k+i]. -// -// tau must have length at least min(m,n), and Dgeql2 will panic otherwise. -// -// work is temporary memory storage and must have length at least n. -// -// Dgeql2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgeql2(m, n int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < n: - panic(shortWork) - } - - var aii float64 - for i := k - 1; i >= 0; i-- { - // Generate elementary reflector H_i to annihilate A[0:m-k+i-1, n-k+i]. - aii, tau[i] = impl.Dlarfg(m-k+i+1, a[(m-k+i)*lda+n-k+i], a[n-k+i:], lda) - - // Apply H_i to A[0:m-k+i, 0:n-k+i-1] from the left. - a[(m-k+i)*lda+n-k+i] = 1 - impl.Dlarf(blas.Left, m-k+i+1, n-k+i, a[n-k+i:], lda, tau[i], a, lda, work) - a[(m-k+i)*lda+n-k+i] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go deleted file mode 100644 index 6949da967..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqp3.go +++ /dev/null @@ -1,186 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgeqp3 computes a QR factorization with column pivoting of the -// m×n matrix A: A*P = Q*R using Level 3 BLAS. -// -// The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{k-1}, where k = min(m,n). -// Each H_i has the form -// H_i = I - tau * v * v^T -// where tau and v are real vectors with v[0:i-1] = 0 and v[i] = 1; -// v[i:m] is stored on exit in A[i:m, i], and tau in tau[i]. -// -// jpvt specifies a column pivot to be applied to A. If -// jpvt[j] is at least zero, the jth column of A is permuted -// to the front of A*P (a leading column), if jpvt[j] is -1 -// the jth column of A is a free column. If jpvt[j] < -1, Dgeqp3 -// will panic. On return, jpvt holds the permutation that was -// applied; the jth column of A*P was the jpvt[j] column of A. -// jpvt must have length n or Dgeqp3 will panic. -// -// tau holds the scalar factors of the elementary reflectors. -// It must have length min(m, n), otherwise Dgeqp3 will panic. -// -// work must have length at least max(1,lwork), and lwork must be at least -// 3*n+1, otherwise Dgeqp3 will panic. For optimal performance lwork must -// be at least 2*n+(n+1)*nb, where nb is the optimal blocksize. On return, -// work[0] will contain the optimal value of lwork. -// -// If lwork == -1, instead of performing Dgeqp3, only the optimal value of lwork -// will be stored in work[0]. -// -// Dgeqp3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgeqp3(m, n int, a []float64, lda int, jpvt []int, tau, work []float64, lwork int) { - const ( - inb = 1 - inbmin = 2 - ixover = 3 - ) - - minmn := min(m, n) - iws := 3*n + 1 - if minmn == 0 { - iws = 1 - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < iws && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if minmn == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(inb, "DGEQRF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(2*n + (n+1)*nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(jpvt) != n: - panic(badLenJpvt) - case len(tau) < minmn: - panic(shortTau) - } - - for _, v := range jpvt { - if v < -1 || n <= v { - panic(badJpvt) - } - } - - bi := blas64.Implementation() - - // Move initial columns up front. - var nfxd int - for j := 0; j < n; j++ { - if jpvt[j] == -1 { - jpvt[j] = j - continue - } - if j != nfxd { - bi.Dswap(m, a[j:], lda, a[nfxd:], lda) - jpvt[j], jpvt[nfxd] = jpvt[nfxd], j - } else { - jpvt[j] = j - } - nfxd++ - } - - // Factorize nfxd columns. - // - // Compute the QR factorization of nfxd columns and update remaining columns. - if nfxd > 0 { - na := min(m, nfxd) - impl.Dgeqrf(m, na, a, lda, tau, work, lwork) - iws = max(iws, int(work[0])) - if na < n { - impl.Dormqr(blas.Left, blas.Trans, m, n-na, na, a, lda, tau[:na], a[na:], lda, - work, lwork) - iws = max(iws, int(work[0])) - } - } - - if nfxd >= minmn { - work[0] = float64(iws) - return - } - - // Factorize free columns. - sm := m - nfxd - sn := n - nfxd - sminmn := minmn - nfxd - - // Determine the block size. - nb = impl.Ilaenv(inb, "DGEQRF", " ", sm, sn, -1, -1) - nbmin := 2 - nx := 0 - - if 1 < nb && nb < sminmn { - // Determine when to cross over from blocked to unblocked code. - nx = max(0, impl.Ilaenv(ixover, "DGEQRF", " ", sm, sn, -1, -1)) - - if nx < sminmn { - // Determine if workspace is large enough for blocked code. - minws := 2*sn + (sn+1)*nb - iws = max(iws, minws) - if lwork < minws { - // Not enough workspace to use optimal nb. Reduce - // nb and determine the minimum value of nb. - nb = (lwork - 2*sn) / (sn + 1) - nbmin = max(2, impl.Ilaenv(inbmin, "DGEQRF", " ", sm, sn, -1, -1)) - } - } - } - - // Initialize partial column norms. - // The first n elements of work store the exact column norms. - for j := nfxd; j < n; j++ { - work[j] = bi.Dnrm2(sm, a[nfxd*lda+j:], lda) - work[n+j] = work[j] - } - j := nfxd - if nbmin <= nb && nb < sminmn && nx < sminmn { - // Use blocked code initially. - - // Compute factorization. - var fjb int - for topbmn := minmn - nx; j < topbmn; j += fjb { - jb := min(nb, topbmn-j) - - // Factorize jb columns among columns j:n. - fjb = impl.Dlaqps(m, n-j, j, jb, a[j:], lda, jpvt[j:], tau[j:], - work[j:n], work[j+n:2*n], work[2*n:2*n+jb], work[2*n+jb:], jb) - } - } - - // Use unblocked code to factor the last or only block. - if j < minmn { - impl.Dlaqp2(m, n-j, j, a[j:], lda, jpvt[j:], tau[j:], - work[j:n], work[j+n:2*n], work[2*n:]) - } - - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go deleted file mode 100644 index 3e35d7e2f..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqr2.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dgeqr2 computes a QR factorization of the m×n matrix A. -// -// In a QR factorization, Q is an m×m orthonormal matrix, and R is an -// upper triangular m×n matrix. -// -// A is modified to contain the information to construct Q and R. -// The upper triangle of a contains the matrix R. The lower triangular elements -// (not including the diagonal) contain the elementary reflectors. tau is modified -// to contain the reflector scales. tau must have length at least min(m,n), and -// this function will panic otherwise. -// -// The ith elementary reflector can be explicitly constructed by first extracting -// the -// v[j] = 0 j < i -// v[j] = 1 j == i -// v[j] = a[j*lda+i] j > i -// and computing H_i = I - tau[i] * v * v^T. -// -// The orthonormal matrix Q can be constructed from a product of these elementary -// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). -// -// work is temporary storage of length at least n and this function will panic otherwise. -// -// Dgeqr2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgeqr2(m, n int, a []float64, lda int, tau, work []float64) { - // TODO(btracey): This is oriented such that columns of a are eliminated. - // This likely could be re-arranged to take better advantage of row-major - // storage. - - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case len(work) < n: - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - for i := 0; i < k; i++ { - // Generate elementary reflector H_i. - a[i*lda+i], tau[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min((i+1), m-1)*lda+i:], lda) - if i < n-1 { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(blas.Left, m-i, n-i-1, - a[i*lda+i:], lda, - tau[i], - a[i*lda+i+1:], lda, - work) - a[i*lda+i] = aii - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go deleted file mode 100644 index 300f8eea4..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgeqrf.go +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgeqrf computes the QR factorization of the m×n matrix A using a blocked -// algorithm. See the documentation for Dgeqr2 for a description of the -// parameters at entry and exit. -// -// work is temporary storage, and lwork specifies the usable memory length. -// The length of work must be at least max(1, lwork) and lwork must be -1 -// or at least n, otherwise this function will panic. -// Dgeqrf is a blocked QR factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgeqrf, -// the optimal work length will be stored into work[0]. -// -// tau must have length at least min(m,n), and this function will panic otherwise. -func (impl Implementation) Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - work[0] = 1 - return - } - - // nb is the optimal blocksize, i.e. the number of columns transformed at a time. - nb := impl.Ilaenv(1, "DGEQRF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(n * nb) - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(tau) < k { - panic(shortTau) - } - - nbmin := 2 // Minimal block size. - var nx int // Use unblocked (unless changed in the next for loop) - iws := n - // Only consider blocked if the suggested block size is > 1 and the - // number of rows or columns is sufficiently large. - if 1 < nb && nb < k { - // nx is the block size at which the code switches from blocked - // to unblocked. - nx = max(0, impl.Ilaenv(3, "DGEQRF", " ", m, n, -1, -1)) - if k > nx { - iws = n * nb - if lwork < iws { - // Not enough workspace to use the optimal block - // size. Get the minimum block size instead. - nb = lwork / n - nbmin = max(2, impl.Ilaenv(2, "DGEQRF", " ", m, n, -1, -1)) - } - } - } - - // Compute QR using a blocked algorithm. - var i int - if nbmin <= nb && nb < k && nx < k { - ldwork := nb - for i = 0; i < k-nx; i += nb { - ib := min(k-i, nb) - // Compute the QR factorization of the current block. - impl.Dgeqr2(m-i, ib, a[i*lda+i:], lda, tau[i:], work) - if i+ib < n { - // Form the triangular factor of the block reflector and apply H^T - // In Dlarft, work becomes the T matrix. - impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - impl.Dlarfb(blas.Left, blas.Trans, lapack.Forward, lapack.ColumnWise, - m-i, n-i-ib, ib, - a[i*lda+i:], lda, - work, ldwork, - a[i*lda+i+ib:], lda, - work[ib*ldwork:], ldwork) - } - } - } - // Call unblocked code on the remaining columns. - if i < k { - impl.Dgeqr2(m-i, n-i, a[i*lda+i:], lda, tau[i:], work) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go deleted file mode 100644 index 60dac973a..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerq2.go +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dgerq2 computes an RQ factorization of the m×n matrix A, -// A = R * Q. -// On exit, if m <= n, the upper triangle of the subarray -// A[0:m, n-m:n] contains the m×m upper triangular matrix R. -// If m >= n, the elements on and above the (m-n)-th subdiagonal -// contain the m×n upper trapezoidal matrix R. -// The remaining elements, with tau, represent the -// orthogonal matrix Q as a product of min(m,n) elementary -// reflectors. -// -// The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{min(m,n)-1}. -// Each H(i) has the form -// H_i = I - tau_i * v * v^T -// where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], -// v[n-k+i:n] = 0 and v[n-k+i] = 1. -// -// tau must have length min(m,n) and work must have length m, otherwise -// Dgerq2 will panic. -// -// Dgerq2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgerq2(m, n int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case len(work) < m: - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - for i := k - 1; i >= 0; i-- { - // Generate elementary reflector H[i] to annihilate - // A[m-k+i, 0:n-k+i-1]. - mki := m - k + i - nki := n - k + i - var aii float64 - aii, tau[i] = impl.Dlarfg(nki+1, a[mki*lda+nki], a[mki*lda:], 1) - - // Apply H[i] to A[0:m-k+i-1, 0:n-k+i] from the right. - a[mki*lda+nki] = 1 - impl.Dlarf(blas.Right, mki, nki+1, a[mki*lda:], 1, tau[i], a, lda, work) - a[mki*lda+nki] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go deleted file mode 100644 index 9b4aa050e..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgerqf.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dgerqf computes an RQ factorization of the m×n matrix A, -// A = R * Q. -// On exit, if m <= n, the upper triangle of the subarray -// A[0:m, n-m:n] contains the m×m upper triangular matrix R. -// If m >= n, the elements on and above the (m-n)-th subdiagonal -// contain the m×n upper trapezoidal matrix R. -// The remaining elements, with tau, represent the -// orthogonal matrix Q as a product of min(m,n) elementary -// reflectors. -// -// The matrix Q is represented as a product of elementary reflectors -// Q = H_0 H_1 . . . H_{min(m,n)-1}. -// Each H(i) has the form -// H_i = I - tau_i * v * v^T -// where v is a vector with v[0:n-k+i-1] stored in A[m-k+i, 0:n-k+i-1], -// v[n-k+i:n] = 0 and v[n-k+i] = 1. -// -// tau must have length min(m,n), work must have length max(1, lwork), -// and lwork must be -1 or at least max(1, m), otherwise Dgerqf will panic. -// On exit, work[0] will contain the optimal length for work. -// -// Dgerqf is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dgerqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, m) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - k := min(m, n) - if k == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DGERQF", " ", m, n, -1, -1) - if lwork == -1 { - work[0] = float64(m * nb) - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(tau) != k { - panic(badLenTau) - } - - nbmin := 2 - nx := 1 - iws := m - var ldwork int - if 1 < nb && nb < k { - // Determine when to cross over from blocked to unblocked code. - nx = max(0, impl.Ilaenv(3, "DGERQF", " ", m, n, -1, -1)) - if nx < k { - // Determine whether workspace is large enough for blocked code. - iws = m * nb - if lwork < iws { - // Not enough workspace to use optimal nb. Reduce - // nb and determine the minimum value of nb. - nb = lwork / m - nbmin = max(2, impl.Ilaenv(2, "DGERQF", " ", m, n, -1, -1)) - } - ldwork = nb - } - } - - var mu, nu int - if nbmin <= nb && nb < k && nx < k { - // Use blocked code initially. - // The last kk rows are handled by the block method. - ki := ((k - nx - 1) / nb) * nb - kk := min(k, ki+nb) - - var i int - for i = k - kk + ki; i >= k-kk; i -= nb { - ib := min(k-i, nb) - - // Compute the RQ factorization of the current block - // A[m-k+i:m-k+i+ib-1, 0:n-k+i+ib-1]. - impl.Dgerq2(ib, n-k+i+ib, a[(m-k+i)*lda:], lda, tau[i:], work) - if m-k+i > 0 { - // Form the triangular factor of the block reflector - // H = H_{i+ib-1} . . . H_{i+1} H_i. - impl.Dlarft(lapack.Backward, lapack.RowWise, - n-k+i+ib, ib, a[(m-k+i)*lda:], lda, tau[i:], - work, ldwork) - - // Apply H to A[0:m-k+i-1, 0:n-k+i+ib-1] from the right. - impl.Dlarfb(blas.Right, blas.NoTrans, lapack.Backward, lapack.RowWise, - m-k+i, n-k+i+ib, ib, a[(m-k+i)*lda:], lda, - work, ldwork, - a, lda, - work[ib*ldwork:], ldwork) - } - } - mu = m - k + i + nb - nu = n - k + i + nb - } else { - mu = m - nu = n - } - - // Use unblocked code to factor the last or only block. - if mu > 0 && nu > 0 { - impl.Dgerq2(mu, nu, a, lda, tau, work) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go deleted file mode 100644 index 136f683e4..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgesvd.go +++ /dev/null @@ -1,1374 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -const noSVDO = "dgesvd: not coded for overwrite" - -// Dgesvd computes the singular value decomposition of the input matrix A. -// -// The singular value decomposition is -// A = U * Sigma * V^T -// where Sigma is an m×n diagonal matrix containing the singular values of A, -// U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first -// min(m,n) columns of U and V are the left and right singular vectors of A -// respectively. -// -// jobU and jobVT are options for computing the singular vectors. The behavior -// is as follows -// jobU == lapack.SVDAll All m columns of U are returned in u -// jobU == lapack.SVDStore The first min(m,n) columns are returned in u -// jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a -// jobU == lapack.SVDNone The columns of U are not computed. -// The behavior is the same for jobVT and the rows of V^T. At most one of jobU -// and jobVT can equal lapack.SVDOverwrite, and Dgesvd will panic otherwise. -// -// On entry, a contains the data for the m×n matrix A. During the call to Dgesvd -// the data is overwritten. On exit, A contains the appropriate singular vectors -// if either job is lapack.SVDOverwrite. -// -// s is a slice of length at least min(m,n) and on exit contains the singular -// values in decreasing order. -// -// u contains the left singular vectors on exit, stored column-wise. If -// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDStore u is -// of size m×min(m,n). If jobU == lapack.SVDOverwrite or lapack.SVDNone, u is -// not used. -// -// vt contains the left singular vectors on exit, stored row-wise. If -// jobV == lapack.SVDAll, vt is of size n×n. If jobVT == lapack.SVDStore vt is -// of size min(m,n)×n. If jobVT == lapack.SVDOverwrite or lapack.SVDNone, vt is -// not used. -// -// work is a slice for storing temporary memory, and lwork is the usable size of -// the slice. lwork must be at least max(5*min(m,n), 3*min(m,n)+max(m,n)). -// If lwork == -1, instead of performing Dgesvd, the optimal work length will be -// stored into work[0]. Dgesvd will panic if the working memory has insufficient -// storage. -// -// Dgesvd returns whether the decomposition successfully completed. -func (impl Implementation) Dgesvd(jobU, jobVT lapack.SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) { - if jobU == lapack.SVDOverwrite || jobVT == lapack.SVDOverwrite { - panic(noSVDO) - } - - wantua := jobU == lapack.SVDAll - wantus := jobU == lapack.SVDStore - wantuas := wantua || wantus - wantuo := jobU == lapack.SVDOverwrite - wantun := jobU == lapack.SVDNone - if !(wantua || wantus || wantuo || wantun) { - panic(badSVDJob) - } - - wantva := jobVT == lapack.SVDAll - wantvs := jobVT == lapack.SVDStore - wantvas := wantva || wantvs - wantvo := jobVT == lapack.SVDOverwrite - wantvn := jobVT == lapack.SVDNone - if !(wantva || wantvs || wantvo || wantvn) { - panic(badSVDJob) - } - - if wantuo && wantvo { - panic(bothSVDOver) - } - - minmn := min(m, n) - minwork := 1 - if minmn > 0 { - minwork = max(3*minmn+max(m, n), 5*minmn) - } - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldu < 1, wantua && ldu < m, wantus && ldu < minmn: - panic(badLdU) - case ldvt < 1 || (wantvas && ldvt < n): - panic(badLdVT) - case lwork < minwork && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if minmn == 0 { - work[0] = 1 - return true - } - - // Compute optimal workspace size for subroutines. - opts := string(jobU) + string(jobVT) - mnthr := impl.Ilaenv(6, "DGESVD", opts, m, n, 0, 0) - maxwrk := 1 - var wrkbl, bdspac int - if m >= n { - bdspac = 5 * n - impl.Dgeqrf(m, n, a, lda, nil, work, -1) - lwork_dgeqrf := int(work[0]) - - impl.Dorgqr(m, n, n, a, lda, nil, work, -1) - lwork_dorgqr_n := int(work[0]) - impl.Dorgqr(m, m, n, a, lda, nil, work, -1) - lwork_dorgqr_m := int(work[0]) - - impl.Dgebrd(n, n, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd := int(work[0]) - - impl.Dorgbr(lapack.GeneratePT, n, n, n, a, lda, nil, work, -1) - lwork_dorgbr_p := int(work[0]) - - impl.Dorgbr(lapack.GenerateQ, n, n, n, a, lda, nil, work, -1) - lwork_dorgbr_q := int(work[0]) - - if m >= mnthr { - if wantun { - // Path 1 (m much larger than n, jobU == None) - maxwrk = n + lwork_dgeqrf - maxwrk = max(maxwrk, 3*n+lwork_dgebrd) - if wantvo || wantvas { - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_p) - } - maxwrk = max(maxwrk, bdspac) - } else if wantuo && wantvn { - // Path 2 (m much larger than n, jobU == Overwrite, jobVT == None) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(n*n+wrkbl, n*n+m*n+n) - } else if wantuo && wantvas { - // Path 3 (m much larger than n, jobU == Overwrite, jobVT == Store or All) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(n*n+wrkbl, n*n+m*n+n) - } else if wantus && wantvn { - // Path 4 (m much larger than n, jobU == Store, jobVT == None) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } else if wantus && wantvo { - // Path 5 (m much larger than n, jobU == Store, jobVT == Overwrite) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*n*n + wrkbl - } else if wantus && wantvas { - // Path 6 (m much larger than n, jobU == Store, jobVT == Store or All) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_n) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } else if wantua && wantvn { - // Path 7 (m much larger than n, jobU == All, jobVT == None) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_m) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } else if wantua && wantvo { - // Path 8 (m much larger than n, jobU == All, jobVT == Overwrite) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_m) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*n*n + wrkbl - } else if wantua && wantvas { - // Path 9 (m much larger than n, jobU == All, jobVT == Store or All) - wrkbl = n + lwork_dgeqrf - wrkbl = max(wrkbl, n+lwork_dorgqr_m) - wrkbl = max(wrkbl, 3*n+lwork_dgebrd) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_q) - wrkbl = max(wrkbl, 3*n+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = n*n + wrkbl - } - } else { - // Path 10 (m at least n, but not much larger) - impl.Dgebrd(m, n, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd := int(work[0]) - maxwrk = 3*n + lwork_dgebrd - if wantus || wantuo { - impl.Dorgbr(lapack.GenerateQ, m, n, n, a, lda, nil, work, -1) - lwork_dorgbr_q = int(work[0]) - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_q) - } - if wantua { - impl.Dorgbr(lapack.GenerateQ, m, m, n, a, lda, nil, work, -1) - lwork_dorgbr_q := int(work[0]) - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_q) - } - if !wantvn { - maxwrk = max(maxwrk, 3*n+lwork_dorgbr_p) - } - maxwrk = max(maxwrk, bdspac) - } - } else { - bdspac = 5 * m - - impl.Dgelqf(m, n, a, lda, nil, work, -1) - lwork_dgelqf := int(work[0]) - - impl.Dorglq(n, n, m, nil, n, nil, work, -1) - lwork_dorglq_n := int(work[0]) - impl.Dorglq(m, n, m, a, lda, nil, work, -1) - lwork_dorglq_m := int(work[0]) - - impl.Dgebrd(m, m, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd := int(work[0]) - - impl.Dorgbr(lapack.GeneratePT, m, m, m, a, n, nil, work, -1) - lwork_dorgbr_p := int(work[0]) - - impl.Dorgbr(lapack.GenerateQ, m, m, m, a, n, nil, work, -1) - lwork_dorgbr_q := int(work[0]) - - if n >= mnthr { - if wantvn { - // Path 1t (n much larger than m, jobVT == None) - maxwrk = m + lwork_dgelqf - maxwrk = max(maxwrk, 3*m+lwork_dgebrd) - if wantuo || wantuas { - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_q) - } - maxwrk = max(maxwrk, bdspac) - } else if wantvo && wantun { - // Path 2t (n much larger than m, jobU == None, jobVT == Overwrite) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(m*m+wrkbl, m*m+m*n+m) - } else if wantvo && wantuas { - // Path 3t (n much larger than m, jobU == Store or All, jobVT == Overwrite) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = max(m*m+wrkbl, m*m+m*n+m) - } else if wantvs && wantun { - // Path 4t (n much larger than m, jobU == None, jobVT == Store) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } else if wantvs && wantuo { - // Path 5t (n much larger than m, jobU == Overwrite, jobVT == Store) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*m*m + wrkbl - } else if wantvs && wantuas { - // Path 6t (n much larger than m, jobU == Store or All, jobVT == Store) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_m) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } else if wantva && wantun { - // Path 7t (n much larger than m, jobU== None, jobVT == All) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_n) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } else if wantva && wantuo { - // Path 8t (n much larger than m, jobU == Overwrite, jobVT == All) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_n) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = 2*m*m + wrkbl - } else if wantva && wantuas { - // Path 9t (n much larger than m, jobU == Store or All, jobVT == All) - wrkbl = m + lwork_dgelqf - wrkbl = max(wrkbl, m+lwork_dorglq_n) - wrkbl = max(wrkbl, 3*m+lwork_dgebrd) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_p) - wrkbl = max(wrkbl, 3*m+lwork_dorgbr_q) - wrkbl = max(wrkbl, bdspac) - maxwrk = m*m + wrkbl - } - } else { - // Path 10t (n greater than m, but not much larger) - impl.Dgebrd(m, n, a, lda, s, nil, nil, nil, work, -1) - lwork_dgebrd = int(work[0]) - maxwrk = 3*m + lwork_dgebrd - if wantvs || wantvo { - impl.Dorgbr(lapack.GeneratePT, m, n, m, a, n, nil, work, -1) - lwork_dorgbr_p = int(work[0]) - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_p) - } - if wantva { - impl.Dorgbr(lapack.GeneratePT, n, n, m, a, n, nil, work, -1) - lwork_dorgbr_p = int(work[0]) - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_p) - } - if !wantun { - maxwrk = max(maxwrk, 3*m+lwork_dorgbr_q) - } - maxwrk = max(maxwrk, bdspac) - } - } - - maxwrk = max(maxwrk, minwork) - if lwork == -1 { - work[0] = float64(maxwrk) - return true - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - if len(s) < minmn { - panic(shortS) - } - if (len(u) < (m-1)*ldu+m && wantua) || (len(u) < (m-1)*ldu+minmn && wantus) { - panic(shortU) - } - if (len(vt) < (n-1)*ldvt+n && wantva) || (len(vt) < (minmn-1)*ldvt+n && wantvs) { - panic(shortVT) - } - - // Perform decomposition. - eps := dlamchE - smlnum := math.Sqrt(dlamchS) / eps - bignum := 1 / smlnum - - // Scale A if max element outside range [smlnum, bignum]. - anrm := impl.Dlange(lapack.MaxAbs, m, n, a, lda, nil) - var iscl bool - if anrm > 0 && anrm < smlnum { - iscl = true - impl.Dlascl(lapack.General, 0, 0, anrm, smlnum, m, n, a, lda) - } else if anrm > bignum { - iscl = true - impl.Dlascl(lapack.General, 0, 0, anrm, bignum, m, n, a, lda) - } - - bi := blas64.Implementation() - var ie int - if m >= n { - // If A has sufficiently more rows than columns, use the QR decomposition. - if m >= mnthr { - // m >> n - if wantun { - // Path 1. - itau := 0 - iwork := itau + n - - // Compute A = Q * R. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Zero out below R. - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, a[lda:], lda) - ie = 0 - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - // Bidiagonalize R in A. - impl.Dgebrd(n, n, a, lda, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - ncvt := 0 - if wantvo || wantvas { - impl.Dorgbr(lapack.GeneratePT, n, n, n, a, lda, work[itaup:], - work[iwork:], lwork-iwork) - ncvt = n - } - iwork = ie + n - - // Perform bidiagonal QR iteration computing right singular vectors - // of A in A if desired. - ok = impl.Dbdsqr(blas.Upper, n, ncvt, 0, 0, s, work[ie:], - a, lda, work, 1, work, 1, work[iwork:]) - - // If right singular vectors desired in VT, copy them there. - if wantvas { - impl.Dlacpy(blas.All, n, n, a, lda, vt, ldvt) - } - } else if wantuo && wantvn { - // Path 2 - panic(noSVDO) - } else if wantuo && wantvas { - // Path 3 - panic(noSVDO) - } else if wantus { - if wantvn { - // Path 4 - if lwork >= n*n+max(4*n, bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*n { - ldworkr = lda - } else { - ldworkr = n - } - itau := ir + ldworkr*n - iwork := itau + n - // Compute A = Q * R. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy R to work[ir:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[ir+ldworkr:], ldworkr) - - // Generate Q in A. - impl.Dorgqr(m, n, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[ir:]. - impl.Dgebrd(n, n, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate left vectors bidiagonalizing R in work[ir:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[ir:], ldworkr, - work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, compuing left singular - // vectors of R in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, n, 0, n, 0, s, work[ie:], work, 1, - work[ir:], ldworkr, work, 1, work[iwork:]) - - // Multiply Q in A by left singular vectors of R in - // work[ir:], storing result in U. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, a, lda, - work[ir:], ldworkr, 0, u, ldu) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, n, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Zero out below R in A. - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, a[lda:], lda) - - // Bidiagonalize R in A. - impl.Dgebrd(n, n, a, lda, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left vectors bidiagonalizing R. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, m, n, n, - a, lda, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left - // singular vectors of A in U. - ok = impl.Dbdsqr(blas.Upper, n, 0, m, 0, s, work[ie:], work, 1, - u, ldu, work, 1, work[iwork:]) - } - } else if wantvo { - // Path 5 - panic(noSVDO) - } else if wantvas { - // Path 6 - if lwork >= n*n+max(4*n, bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - var ldworku int - if lwork >= wrkbl+lda*n { - ldworku = lda - } else { - ldworku = n - } - itau := iu + ldworku*n - iwork := itau + n - - // Compute A = Q * R. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - // Copy R to work[iu:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[iu+ldworku:], ldworku) - - // Generate Q in A. - impl.Dorgqr(m, n, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[iu:], copying result to VT. - impl.Dgebrd(n, n, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, n, n, work[iu:], ldworku, vt, ldvt) - - // Generate left bidiagonalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[iu:], ldworku, - work[itauq:], work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of R in work[iu:], and computing right singular - // vectors of R in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, n, 0, s, work[ie:], - vt, ldvt, work[iu:], ldworku, work, 1, work[iwork:]) - - // Multiply Q in A by left singular vectors of R in - // work[iu:], storing result in U. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, a, lda, - work[iu:], ldworku, 0, u, ldu) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q * R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, n, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - - // Copy R to VT, zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, vt, ldvt) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, vt[ldvt:], ldvt) - - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in VT. - impl.Dgebrd(n, n, vt, ldvt, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in VT. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, m, n, n, - vt, ldvt, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } - } - } else if wantua { - if wantvn { - // Path 7 - if lwork >= n*n+max(max(n+m, 4*n), bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*n { - ldworkr = lda - } else { - ldworkr = n - } - itau := ir + ldworkr*n - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Copy R to work[ir:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[ir+ldworkr:], ldworkr) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[ir:]. - impl.Dgebrd(n, n, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in work[ir:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[ir:], ldworkr, - work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of R in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, n, 0, n, 0, s, work[ie:], work, 1, - work[ir:], ldworkr, work, 1, work[iwork:]) - - // Multiply Q in U by left singular vectors of R in - // work[ir:], storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, u, ldu, - work[ir:], ldworkr, 0, a, lda) - - // Copy left singular vectors of A from A to U. - impl.Dlacpy(blas.All, m, n, a, lda, u, ldu) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Zero out below R in A. - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, a[lda:], lda) - - // Bidiagonalize R in A. - impl.Dgebrd(n, n, a, lda, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in A. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, m, n, n, - a, lda, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left - // singular vectors of A in U. - ok = impl.Dbdsqr(blas.Upper, n, 0, m, 0, s, work[ie:], - work, 1, u, ldu, work, 1, work[iwork:]) - } - } else if wantvo { - // Path 8. - panic(noSVDO) - } else if wantvas { - // Path 9. - if lwork >= n*n+max(max(n+m, 4*n), bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - var ldworku int - if lwork >= wrkbl+lda*n { - ldworku = lda - } else { - ldworku = n - } - itau := iu + ldworku*n - iwork := itau + n - - // Compute A = Q * R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - - // Copy R to work[iu:], zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, work[iu+ldworku:], ldworku) - - ie = itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in work[iu:], copying result to VT. - impl.Dgebrd(n, n, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, n, n, work[iu:], ldworku, vt, ldvt) - - // Generate left bidiagonalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GenerateQ, n, n, n, work[iu:], ldworku, - work[itauq:], work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of R in work[iu:] and computing right - // singular vectors of R in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, n, 0, s, work[ie:], - vt, ldvt, work[iu:], ldworku, work, 1, work[iwork:]) - - // Multiply Q in U by left singular vectors of R in - // work[iu:], storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, n, 1, - u, ldu, work[iu:], ldworku, 0, a, lda) - - // Copy left singular vectors of A from A to U. - impl.Dlacpy(blas.All, m, n, a, lda, u, ldu) - - /* - // Bidiagonalize R in VT. - impl.Dgebrd(n, n, vt, ldvt, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in VT. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, - m, n, n, vt, ldvt, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - */ - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + n - - // Compute A = Q*R, copying result to U. - impl.Dgeqrf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - - // Generate Q in U. - impl.Dorgqr(m, m, n, u, ldu, work[itau:], work[iwork:], lwork-iwork) - - // Copy R from A to VT, zeroing out below it. - impl.Dlacpy(blas.Upper, n, n, a, lda, vt, ldvt) - if n > 1 { - impl.Dlaset(blas.Lower, n-1, n-1, 0, 0, vt[ldvt:], ldvt) - } - - ie := itau - itauq := ie + n - itaup := itauq + n - iwork = itaup + n - - // Bidiagonalize R in VT. - impl.Dgebrd(n, n, vt, ldvt, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply Q in U by left bidiagonalizing vectors in VT. - impl.Dormbr(lapack.ApplyQ, blas.Right, blas.NoTrans, - m, n, n, vt, ldvt, work[itauq:], u, ldu, work[iwork:], lwork-iwork) - - // Generate right bidiagonizing vectors in VT. - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + n - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, n, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } - } - } - } else { - // Path 10. - // M at least N, but not much larger. - ie = 0 - itauq := ie + n - itaup := itauq + n - iwork := itaup + n - - // Bidiagonalize A. - impl.Dgebrd(m, n, a, lda, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - if wantuas { - // Left singular vectors are desired in U. Copy result to U and - // generate left biadiagonalizing vectors in U. - impl.Dlacpy(blas.Lower, m, n, a, lda, u, ldu) - var ncu int - if wantus { - ncu = n - } - if wantua { - ncu = m - } - impl.Dorgbr(lapack.GenerateQ, m, ncu, n, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - } - if wantvas { - // Right singular vectors are desired in VT. Copy result to VT and - // generate left biadiagonalizing vectors in VT. - impl.Dlacpy(blas.Upper, n, n, a, lda, vt, ldvt) - impl.Dorgbr(lapack.GeneratePT, n, n, n, vt, ldvt, work[itaup:], work[iwork:], lwork-iwork) - } - if wantuo { - panic(noSVDO) - } - if wantvo { - panic(noSVDO) - } - iwork = ie + n - var nru, ncvt int - if wantuas || wantuo { - nru = m - } - if wantun { - nru = 0 - } - if wantvas || wantvo { - ncvt = n - } - if wantvn { - ncvt = 0 - } - if !wantuo && !wantvo { - // Perform bidiagonal QR iteration, if desired, computing left - // singular vectors in U and right singular vectors in VT. - ok = impl.Dbdsqr(blas.Upper, n, ncvt, nru, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } else { - // There will be two branches when the implementation is complete. - panic(noSVDO) - } - } - } else { - // A has more columns than rows. If A has sufficiently more columns than - // rows, first reduce using the LQ decomposition. - if n >= mnthr { - // n >> m. - if wantvn { - // Path 1t. - itau := 0 - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Zero out above L. - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, a[1:], lda) - ie := 0 - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in A. - impl.Dgebrd(m, m, a, lda, s, work[ie:itauq], - work[itauq:itaup], work[itaup:iwork], work[iwork:], lwork-iwork) - if wantuo || wantuas { - impl.Dorgbr(lapack.GenerateQ, m, m, m, a, lda, - work[itauq:], work[iwork:], lwork-iwork) - } - iwork = ie + m - nru := 0 - if wantuo || wantuas { - nru = m - } - - // Perform bidiagonal QR iteration, computing left singular vectors - // of A in A if desired. - ok = impl.Dbdsqr(blas.Upper, m, 0, nru, 0, s, work[ie:], - work, 1, a, lda, work, 1, work[iwork:]) - - // If left singular vectors desired in U, copy them there. - if wantuas { - impl.Dlacpy(blas.All, m, m, a, lda, u, ldu) - } - } else if wantvo && wantun { - // Path 2t. - panic(noSVDO) - } else if wantvo && wantuas { - // Path 3t. - panic(noSVDO) - } else if wantvs { - if wantun { - // Path 4t. - if lwork >= m*m+max(4*m, bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*m { - ldworkr = lda - } else { - ldworkr = m - } - itau := ir + ldworkr*m - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to work[ir:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[ir+1:], ldworkr) - - // Generate Q in A. - impl.Dorglq(m, n, m, a, lda, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[ir:]. - impl.Dgebrd(m, m, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate right vectors bidiagonalizing L in work[ir:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[ir:], ldworkr, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right singular - // vectors of L in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, m, m, 0, 0, s, work[ie:], - work[ir:], ldworkr, work, 1, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[ir:] by - // Q in A, storing result in VT. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[ir:], ldworkr, a, lda, 0, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy result to VT. - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(m, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Zero out above L in A. - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, a[1:], lda) - - // Bidiagonalize L in A. - impl.Dgebrd(m, m, a, lda, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right vectors bidiagonalizing L by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - a, lda, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right - // singular vectors of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, 0, 0, s, work[ie:], - vt, ldvt, work, 1, work, 1, work[iwork:]) - } - } else if wantuo { - // Path 5t. - panic(noSVDO) - } else if wantuas { - // Path 6t. - if lwork >= m*m+max(4*m, bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - var ldworku int - if lwork >= wrkbl+lda*m { - ldworku = lda - } else { - ldworku = m - } - itau := iu + ldworku*m - iwork := itau + m - - // Compute A = L*Q. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to work[iu:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[iu+1:], ldworku) - - // Generate Q in A. - impl.Dorglq(m, n, m, a, lda, work[itau:], work[iwork:], lwork-iwork) - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[iu:], copying result to U. - impl.Dgebrd(m, m, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, m, work[iu:], ldworku, u, ldu) - - // Generate right bidiagionalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[iu:], ldworku, - work[itaup:], work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of L in U and computing right singular vectors of - // L in work[iu:]. - ok = impl.Dbdsqr(blas.Upper, m, m, m, 0, s, work[ie:], - work[iu:], ldworku, u, ldu, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[iu:] by - // Q in A, storing result in VT. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[iu:], ldworku, a, lda, 0, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - - // Compute A = L*Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(m, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to U, zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, u, ldu) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, u[1:], ldu) - - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in U. - impl.Dgebrd(m, m, u, ldu, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right bidiagonalizing vectors in U by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - u, ldu, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, m, 0, s, work[ie:], vt, ldvt, - u, ldu, work, 1, work[iwork:]) - } - } - } else if wantva { - if wantun { - // Path 7t. - if lwork >= m*m+max(max(n+m, 4*m), bdspac) { - // Sufficient workspace for a fast algorithm. - ir := 0 - var ldworkr int - if lwork >= wrkbl+lda*m { - ldworkr = lda - } else { - ldworkr = m - } - itau := ir + ldworkr*m - iwork := itau + m - - // Compute A = L*Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Copy L to work[ir:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[ir:], ldworkr) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[ir+1:], ldworkr) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[ir:]. - impl.Dgebrd(m, m, work[ir:], ldworkr, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - - // Generate right bidiagonalizing vectors in work[ir:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[ir:], ldworkr, - work[itaup:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right - // singular vectors of L in work[ir:]. - ok = impl.Dbdsqr(blas.Upper, m, m, 0, 0, s, work[ie:], - work[ir:], ldworkr, work, 1, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[ir:] by - // Q in VT, storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[ir:], ldworkr, vt, ldvt, 0, a, lda) - - // Copy right singular vectors of A from A to VT. - impl.Dlacpy(blas.All, m, n, a, lda, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - // Compute A = L * Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - ie := itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Zero out above L in A. - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, a[1:], lda) - - // Bidiagonalize L in A. - impl.Dgebrd(m, m, a, lda, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right bidiagonalizing vectors in A by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - a, lda, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing right singular - // vectors of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, 0, 0, s, work[ie:], - vt, ldvt, work, 1, work, 1, work[iwork:]) - } - } else if wantuo { - panic(noSVDO) - } else if wantuas { - // Path 9t. - if lwork >= m*m+max(max(m+n, 4*m), bdspac) { - // Sufficient workspace for a fast algorithm. - iu := 0 - - var ldworku int - if lwork >= wrkbl+lda*m { - ldworku = lda - } else { - ldworku = m - } - itau := iu + ldworku*m - iwork := itau + m - - // Generate A = L * Q copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to work[iu:], zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, work[iu:], ldworku) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, work[iu+1:], ldworku) - ie = itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in work[iu:], copying result to U. - impl.Dgebrd(m, m, work[iu:], ldworku, s, work[ie:], - work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Lower, m, m, work[iu:], ldworku, u, ldu) - - // Generate right bidiagonalizing vectors in work[iu:]. - impl.Dorgbr(lapack.GeneratePT, m, m, m, work[iu:], ldworku, - work[itaup:], work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of L in U and computing right singular vectors - // of L in work[iu:]. - ok = impl.Dbdsqr(blas.Upper, m, m, m, 0, s, work[ie:], - work[iu:], ldworku, u, ldu, work, 1, work[iwork:]) - - // Multiply right singular vectors of L in work[iu:] - // Q in VT, storing result in A. - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n, m, 1, - work[iu:], ldworku, vt, ldvt, 0, a, lda) - - // Copy right singular vectors of A from A to VT. - impl.Dlacpy(blas.All, m, n, a, lda, vt, ldvt) - } else { - // Insufficient workspace for a fast algorithm. - itau := 0 - iwork := itau + m - - // Compute A = L * Q, copying result to VT. - impl.Dgelqf(m, n, a, lda, work[itau:], work[iwork:], lwork-iwork) - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - - // Generate Q in VT. - impl.Dorglq(n, n, m, vt, ldvt, work[itau:], work[iwork:], lwork-iwork) - - // Copy L to U, zeroing out above it. - impl.Dlacpy(blas.Lower, m, m, a, lda, u, ldu) - impl.Dlaset(blas.Upper, m-1, m-1, 0, 0, u[1:], ldu) - - ie = itau - itauq := ie + m - itaup := itauq + m - iwork = itaup + m - - // Bidiagonalize L in U. - impl.Dgebrd(m, m, u, ldu, s, work[ie:], work[itauq:], - work[itaup:], work[iwork:], lwork-iwork) - - // Multiply right bidiagonalizing vectors in U by Q in VT. - impl.Dormbr(lapack.ApplyP, blas.Left, blas.Trans, m, n, m, - u, ldu, work[itaup:], vt, ldvt, work[iwork:], lwork-iwork) - - // Generate left bidiagonalizing vectors in U. - impl.Dorgbr(lapack.GenerateQ, m, m, m, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - iwork = ie + m - - // Perform bidiagonal QR iteration, computing left singular - // vectors of A in U and computing right singular vectors - // of A in VT. - ok = impl.Dbdsqr(blas.Upper, m, n, m, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } - } - } - } else { - // Path 10t. - // N at least M, but not much larger. - ie = 0 - itauq := ie + m - itaup := itauq + m - iwork := itaup + m - - // Bidiagonalize A. - impl.Dgebrd(m, n, a, lda, s, work[ie:], work[itauq:], work[itaup:], work[iwork:], lwork-iwork) - if wantuas { - // If left singular vectors desired in U, copy result to U and - // generate left bidiagonalizing vectors in U. - impl.Dlacpy(blas.Lower, m, m, a, lda, u, ldu) - impl.Dorgbr(lapack.GenerateQ, m, m, n, u, ldu, work[itauq:], work[iwork:], lwork-iwork) - } - if wantvas { - // If right singular vectors desired in VT, copy result to VT - // and generate right bidiagonalizing vectors in VT. - impl.Dlacpy(blas.Upper, m, n, a, lda, vt, ldvt) - var nrvt int - if wantva { - nrvt = n - } else { - nrvt = m - } - impl.Dorgbr(lapack.GeneratePT, nrvt, n, m, vt, ldvt, work[itaup:], work[iwork:], lwork-iwork) - } - if wantuo { - panic(noSVDO) - } - if wantvo { - panic(noSVDO) - } - iwork = ie + m - var nru, ncvt int - if wantuas || wantuo { - nru = m - } - if wantvas || wantvo { - ncvt = n - } - if !wantuo && !wantvo { - // Perform bidiagonal QR iteration, if desired, computing left - // singular vectors in U and computing right singular vectors in - // VT. - ok = impl.Dbdsqr(blas.Lower, m, ncvt, nru, 0, s, work[ie:], - vt, ldvt, u, ldu, work, 1, work[iwork:]) - } else { - // There will be two branches when the implementation is complete. - panic(noSVDO) - } - } - } - if !ok { - if ie > 1 { - for i := 0; i < minmn-1; i++ { - work[i+1] = work[i+ie] - } - } - if ie < 1 { - for i := minmn - 2; i >= 0; i-- { - work[i+1] = work[i+ie] - } - } - } - // Undo scaling if necessary. - if iscl { - if anrm > bignum { - impl.Dlascl(lapack.General, 0, 0, bignum, anrm, 1, minmn, s, minmn) - } - if !ok && anrm > bignum { - impl.Dlascl(lapack.General, 0, 0, bignum, anrm, 1, minmn-1, work[1:], minmn) - } - if anrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, smlnum, anrm, 1, minmn, s, minmn) - } - if !ok && anrm < smlnum { - impl.Dlascl(lapack.General, 0, 0, smlnum, anrm, 1, minmn-1, work[1:], minmn) - } - } - work[0] = float64(maxwrk) - return ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go deleted file mode 100644 index 63ad72e99..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetf2.go +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetf2 computes the LU decomposition of the m×n matrix A. -// The LU decomposition is a factorization of a into -// A = P * L * U -// where P is a permutation matrix, L is a unit lower triangular matrix, and -// U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored -// in place into a. -// -// ipiv is a permutation vector. It indicates that row i of the matrix was -// changed with ipiv[i]. ipiv must have length at least min(m,n), and will panic -// otherwise. ipiv is zero-indexed. -// -// Dgetf2 returns whether the matrix A is singular. The LU decomposition will -// be computed regardless of the singularity of A, but division by zero -// will occur if the false is returned and the result is used to solve a -// system of equations. -// -// Dgetf2 is an internal routine. It is exported for testing purposes. -func (Implementation) Dgetf2(m, n int, a []float64, lda int, ipiv []int) (ok bool) { - mn := min(m, n) - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if mn == 0 { - return true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(ipiv) != mn: - panic(badLenIpiv) - } - - bi := blas64.Implementation() - - sfmin := dlamchS - ok = true - for j := 0; j < mn; j++ { - // Find a pivot and test for singularity. - jp := j + bi.Idamax(m-j, a[j*lda+j:], lda) - ipiv[j] = jp - if a[jp*lda+j] == 0 { - ok = false - } else { - // Swap the rows if necessary. - if jp != j { - bi.Dswap(n, a[j*lda:], 1, a[jp*lda:], 1) - } - if j < m-1 { - aj := a[j*lda+j] - if math.Abs(aj) >= sfmin { - bi.Dscal(m-j-1, 1/aj, a[(j+1)*lda+j:], lda) - } else { - for i := 0; i < m-j-1; i++ { - a[(j+1)*lda+j] = a[(j+1)*lda+j] / a[lda*j+j] - } - } - } - } - if j < mn-1 { - bi.Dger(m-j-1, n-j-1, -1, a[(j+1)*lda+j:], lda, a[j*lda+j+1:], 1, a[(j+1)*lda+j+1:], lda) - } - } - return ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go deleted file mode 100644 index ad01e71e4..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrf.go +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetrf computes the LU decomposition of the m×n matrix A. -// The LU decomposition is a factorization of A into -// A = P * L * U -// where P is a permutation matrix, L is a unit lower triangular matrix, and -// U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored -// in place into a. -// -// ipiv is a permutation vector. It indicates that row i of the matrix was -// changed with ipiv[i]. ipiv must have length at least min(m,n), and will panic -// otherwise. ipiv is zero-indexed. -// -// Dgetrf is the blocked version of the algorithm. -// -// Dgetrf returns whether the matrix A is singular. The LU decomposition will -// be computed regardless of the singularity of A, but division by zero -// will occur if the false is returned and the result is used to solve a -// system of equations. -func (impl Implementation) Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool) { - mn := min(m, n) - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if mn == 0 { - return true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(ipiv) != mn: - panic(badLenIpiv) - } - - bi := blas64.Implementation() - - nb := impl.Ilaenv(1, "DGETRF", " ", m, n, -1, -1) - if nb <= 1 || mn <= nb { - // Use the unblocked algorithm. - return impl.Dgetf2(m, n, a, lda, ipiv) - } - ok = true - for j := 0; j < mn; j += nb { - jb := min(mn-j, nb) - blockOk := impl.Dgetf2(m-j, jb, a[j*lda+j:], lda, ipiv[j:j+jb]) - if !blockOk { - ok = false - } - for i := j; i <= min(m-1, j+jb-1); i++ { - ipiv[i] = j + ipiv[i] - } - impl.Dlaswp(j, a, lda, j, j+jb-1, ipiv[:j+jb], 1) - if j+jb < n { - impl.Dlaswp(n-j-jb, a[j+jb:], lda, j, j+jb-1, ipiv[:j+jb], 1) - bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.Unit, - jb, n-j-jb, 1, - a[j*lda+j:], lda, - a[j*lda+j+jb:], lda) - if j+jb < m { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m-j-jb, n-j-jb, jb, -1, - a[(j+jb)*lda+j:], lda, - a[j*lda+j+jb:], lda, - 1, a[(j+jb)*lda+j+jb:], lda) - } - } - } - return ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go deleted file mode 100644 index b2f2ae46b..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetri.go +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetri computes the inverse of the matrix A using the LU factorization computed -// by Dgetrf. On entry, a contains the PLU decomposition of A as computed by -// Dgetrf and on exit contains the reciprocal of the original matrix. -// -// Dgetri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= n and this function will panic otherwise. -// Dgetri is a blocked inversion, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dgetri, -// the optimal work length will be stored into work[0]. -func (impl Implementation) Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool) { - iws := max(1, n) - switch { - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < iws && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if n == 0 { - work[0] = 1 - return true - } - - nb := impl.Ilaenv(1, "DGETRI", " ", n, -1, -1, -1) - if lwork == -1 { - work[0] = float64(n * nb) - return true - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(ipiv) != n: - panic(badLenIpiv) - } - - // Form inv(U). - ok = impl.Dtrtri(blas.Upper, blas.NonUnit, n, a, lda) - if !ok { - return false - } - - nbmin := 2 - if 1 < nb && nb < n { - iws = max(n*nb, 1) - if lwork < iws { - nb = lwork / n - nbmin = max(2, impl.Ilaenv(2, "DGETRI", " ", n, -1, -1, -1)) - } - } - ldwork := nb - - bi := blas64.Implementation() - // Solve the equation inv(A)*L = inv(U) for inv(A). - // TODO(btracey): Replace this with a more row-major oriented algorithm. - if nb < nbmin || n <= nb { - // Unblocked code. - for j := n - 1; j >= 0; j-- { - for i := j + 1; i < n; i++ { - // Copy current column of L to work and replace with zeros. - work[i] = a[i*lda+j] - a[i*lda+j] = 0 - } - // Compute current column of inv(A). - if j < n-1 { - bi.Dgemv(blas.NoTrans, n, n-j-1, -1, a[(j+1):], lda, work[(j+1):], 1, 1, a[j:], lda) - } - } - } else { - // Blocked code. - nn := ((n - 1) / nb) * nb - for j := nn; j >= 0; j -= nb { - jb := min(nb, n-j) - // Copy current block column of L to work and replace - // with zeros. - for jj := j; jj < j+jb; jj++ { - for i := jj + 1; i < n; i++ { - work[i*ldwork+(jj-j)] = a[i*lda+jj] - a[i*lda+jj] = 0 - } - } - // Compute current block column of inv(A). - if j+jb < n { - bi.Dgemm(blas.NoTrans, blas.NoTrans, n, jb, n-j-jb, -1, a[(j+jb):], lda, work[(j+jb)*ldwork:], ldwork, 1, a[j:], lda) - } - bi.Dtrsm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, jb, 1, work[j*ldwork:], ldwork, a[j:], lda) - } - } - // Apply column interchanges. - for j := n - 2; j >= 0; j-- { - jp := ipiv[j] - if jp != j { - bi.Dswap(n, a[j:], lda, a[jp:], lda) - } - } - work[0] = float64(iws) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go deleted file mode 100644 index ecc20d7c9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dgetrs.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dgetrs solves a system of equations using an LU factorization. -// The system of equations solved is -// A * X = B if trans == blas.Trans -// A^T * X = B if trans == blas.NoTrans -// A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. -// -// On entry b contains the elements of the matrix B. On exit, b contains the -// elements of X, the solution to the system of equations. -// -// a and ipiv contain the LU factorization of A and the permutation indices as -// computed by Dgetrf. ipiv is zero-indexed. -func (impl Implementation) Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) { - switch { - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - // Quick return if possible. - if n == 0 || nrhs == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(b) < (n-1)*ldb+nrhs: - panic(shortB) - case len(ipiv) != n: - panic(badLenIpiv) - } - - bi := blas64.Implementation() - - if trans == blas.NoTrans { - // Solve A * X = B. - impl.Dlaswp(nrhs, b, ldb, 0, n-1, ipiv, 1) - // Solve L * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.Unit, - n, nrhs, 1, a, lda, b, ldb) - // Solve U * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Upper, blas.NoTrans, blas.NonUnit, - n, nrhs, 1, a, lda, b, ldb) - return - } - // Solve A^T * X = B. - // Solve U^T * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, - n, nrhs, 1, a, lda, b, ldb) - // Solve L^T * X = B, updating b. - bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.Unit, - n, nrhs, 1, a, lda, b, ldb) - impl.Dlaswp(nrhs, b, ldb, 0, n-1, ipiv, -1) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go deleted file mode 100644 index ac234dce3..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvd3.go +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dggsvd3 computes the generalized singular value decomposition (GSVD) -// of an m×n matrix A and p×n matrix B: -// U^T*A*Q = D1*[ 0 R ] -// -// V^T*B*Q = D2*[ 0 R ] -// where U, V and Q are orthogonal matrices. -// -// Dggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. -// R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and -// D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following -// structures, respectively: -// -// If m-k-l >= 0, -// -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] -// -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] -// -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l -// -// where -// -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. -// -// R is stored in -// A[0:k+l, n-k-l:n] -// on exit. -// -// If m-k-l < 0, -// -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] -// -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] -// -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] -// -// where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. -// -// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] -// [ 0 R22 R23 ] -// and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. -// -// Dggsvd3 computes C, S, R, and optionally the orthogonal transformation -// matrices U, V and Q. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// alpha and beta must have length n or Dggsvd3 will panic. On exit, alpha and -// beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, -// if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), -// if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. -// if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. -// -// On exit, iwork contains the permutation required to sort alpha descending. -// -// iwork must have length n, work must have length at least max(1, lwork), and -// lwork must be -1 or greater than n, otherwise Dggsvd3 will panic. If -// lwork is -1, work[0] holds the optimal lwork on return, but Dggsvd3 does -// not perform the GSVD. -func (impl Implementation) Dggsvd3(jobU, jobV, jobQ lapack.GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool) { - wantu := jobU == lapack.GSVDU - wantv := jobV == lapack.GSVDV - wantq := jobQ == lapack.GSVDQ - switch { - case !wantu && jobU != lapack.GSVDNone: - panic(badGSVDJob + "U") - case !wantv && jobV != lapack.GSVDNone: - panic(badGSVDJob + "V") - case !wantq && jobQ != lapack.GSVDNone: - panic(badGSVDJob + "Q") - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case p < 0: - panic(pLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldu < 1, wantu && ldu < m: - panic(badLdU) - case ldv < 1, wantv && ldv < p: - panic(badLdV) - case ldq < 1, wantq && ldq < n: - panic(badLdQ) - case len(iwork) < n: - panic(shortWork) - case lwork < 1 && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Determine optimal work length. - impl.Dggsvp3(jobU, jobV, jobQ, - m, p, n, - a, lda, - b, ldb, - 0, 0, - u, ldu, - v, ldv, - q, ldq, - iwork, - work, work, -1) - lwkopt := n + int(work[0]) - lwkopt = max(lwkopt, 2*n) - lwkopt = max(lwkopt, 1) - work[0] = float64(lwkopt) - if lwork == -1 { - return 0, 0, true - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (p-1)*ldb+n: - panic(shortB) - case wantu && len(u) < (m-1)*ldu+m: - panic(shortU) - case wantv && len(v) < (p-1)*ldv+p: - panic(shortV) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - case len(alpha) != n: - panic(badLenAlpha) - case len(beta) != n: - panic(badLenBeta) - } - - // Compute the Frobenius norm of matrices A and B. - anorm := impl.Dlange(lapack.Frobenius, m, n, a, lda, nil) - bnorm := impl.Dlange(lapack.Frobenius, p, n, b, ldb, nil) - - // Get machine precision and set up threshold for determining - // the effective numerical rank of the matrices A and B. - tola := float64(max(m, n)) * math.Max(anorm, dlamchS) * dlamchP - tolb := float64(max(p, n)) * math.Max(bnorm, dlamchS) * dlamchP - - // Preprocessing. - k, l = impl.Dggsvp3(jobU, jobV, jobQ, - m, p, n, - a, lda, - b, ldb, - tola, tolb, - u, ldu, - v, ldv, - q, ldq, - iwork, - work[:n], work[n:], lwork-n) - - // Compute the GSVD of two upper "triangular" matrices. - _, ok = impl.Dtgsja(jobU, jobV, jobQ, - m, p, n, - k, l, - a, lda, - b, ldb, - tola, tolb, - alpha, beta, - u, ldu, - v, ldv, - q, ldq, - work) - - // Sort the singular values and store the pivot indices in iwork - // Copy alpha to work, then sort alpha in work. - bi := blas64.Implementation() - bi.Dcopy(n, alpha, 1, work[:n], 1) - ibnd := min(l, m-k) - for i := 0; i < ibnd; i++ { - // Scan for largest alpha_{k+i}. - isub := i - smax := work[k+i] - for j := i + 1; j < ibnd; j++ { - if v := work[k+j]; v > smax { - isub = j - smax = v - } - } - if isub != i { - work[k+isub] = work[k+i] - work[k+i] = smax - iwork[k+i] = k + isub - } else { - iwork[k+i] = k + i - } - } - - work[0] = float64(lwkopt) - - return k, l, ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go deleted file mode 100644 index 7a9ad9fbf..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dggsvp3.go +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dggsvp3 computes orthogonal matrices U, V and Q such that -// -// n-k-l k l -// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l >= 0; -// l [ 0 0 A23 ] -// m-k-l [ 0 0 0 ] -// -// n-k-l k l -// U^T*A*Q = k [ 0 A12 A13 ] if m-k-l < 0; -// m-k [ 0 0 A23 ] -// -// n-k-l k l -// V^T*B*Q = l [ 0 0 B13 ] -// p-l [ 0 0 0 ] -// -// where the k×k matrix A12 and l×l matrix B13 are non-singular -// upper triangular. A23 is l×l upper triangular if m-k-l >= 0, -// otherwise A23 is (m-k)×l upper trapezoidal. -// -// Dggsvp3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz -// iteration procedure. Generally, they are the same as used in the preprocessing -// step, for example, -// tola = max(m, n)*norm(A)*eps, -// tolb = max(p, n)*norm(B)*eps. -// Where eps is the machine epsilon. -// -// iwork must have length n, work must have length at least max(1, lwork), and -// lwork must be -1 or greater than zero, otherwise Dggsvp3 will panic. -// -// Dggsvp3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dggsvp3(jobU, jobV, jobQ lapack.GSVDJob, m, p, n int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, iwork []int, tau, work []float64, lwork int) (k, l int) { - wantu := jobU == lapack.GSVDU - wantv := jobV == lapack.GSVDV - wantq := jobQ == lapack.GSVDQ - switch { - case !wantu && jobU != lapack.GSVDNone: - panic(badGSVDJob + "U") - case !wantv && jobV != lapack.GSVDNone: - panic(badGSVDJob + "V") - case !wantq && jobQ != lapack.GSVDNone: - panic(badGSVDJob + "Q") - case m < 0: - panic(mLT0) - case p < 0: - panic(pLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - case ldu < 1, wantu && ldu < m: - panic(badLdU) - case ldv < 1, wantv && ldv < p: - panic(badLdV) - case ldq < 1, wantq && ldq < n: - panic(badLdQ) - case len(iwork) != n: - panic(shortWork) - case lwork < 1 && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - var lwkopt int - impl.Dgeqp3(p, n, b, ldb, iwork, tau, work, -1) - lwkopt = int(work[0]) - if wantv { - lwkopt = max(lwkopt, p) - } - lwkopt = max(lwkopt, min(n, p)) - lwkopt = max(lwkopt, m) - if wantq { - lwkopt = max(lwkopt, n) - } - impl.Dgeqp3(m, n, a, lda, iwork, tau, work, -1) - lwkopt = max(lwkopt, int(work[0])) - lwkopt = max(1, lwkopt) - if lwork == -1 { - work[0] = float64(lwkopt) - return 0, 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (p-1)*ldb+n: - panic(shortB) - case wantu && len(u) < (m-1)*ldu+m: - panic(shortU) - case wantv && len(v) < (p-1)*ldv+p: - panic(shortV) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - case len(tau) < n: - // tau check must come after lwkopt query since - // the Dggsvd3 call for lwkopt query may have - // lwork == -1, and tau is provided by work. - panic(shortTau) - } - - const forward = true - - // QR with column pivoting of B: B*P = V*[ S11 S12 ]. - // [ 0 0 ] - for i := range iwork[:n] { - iwork[i] = 0 - } - impl.Dgeqp3(p, n, b, ldb, iwork, tau, work, lwork) - - // Update A := A*P. - impl.Dlapmt(forward, m, n, a, lda, iwork) - - // Determine the effective rank of matrix B. - for i := 0; i < min(p, n); i++ { - if math.Abs(b[i*ldb+i]) > tolb { - l++ - } - } - - if wantv { - // Copy the details of V, and form V. - impl.Dlaset(blas.All, p, p, 0, 0, v, ldv) - if p > 1 { - impl.Dlacpy(blas.Lower, p-1, min(p, n), b[ldb:], ldb, v[ldv:], ldv) - } - impl.Dorg2r(p, p, min(p, n), v, ldv, tau, work) - } - - // Clean up B. - for i := 1; i < l; i++ { - r := b[i*ldb : i*ldb+i] - for j := range r { - r[j] = 0 - } - } - if p > l { - impl.Dlaset(blas.All, p-l, n, 0, 0, b[l*ldb:], ldb) - } - - if wantq { - // Set Q = I and update Q := Q*P. - impl.Dlaset(blas.All, n, n, 0, 1, q, ldq) - impl.Dlapmt(forward, n, n, q, ldq, iwork) - } - - if p >= l && n != l { - // RQ factorization of [ S11 S12 ]: [ S11 S12 ] = [ 0 S12 ]*Z. - impl.Dgerq2(l, n, b, ldb, tau, work) - - // Update A := A*Z^T. - impl.Dormr2(blas.Right, blas.Trans, m, n, l, b, ldb, tau, a, lda, work) - - if wantq { - // Update Q := Q*Z^T. - impl.Dormr2(blas.Right, blas.Trans, n, n, l, b, ldb, tau, q, ldq, work) - } - - // Clean up B. - impl.Dlaset(blas.All, l, n-l, 0, 0, b, ldb) - for i := 1; i < l; i++ { - r := b[i*ldb+n-l : i*ldb+i+n-l] - for j := range r { - r[j] = 0 - } - } - } - - // Let N-L L - // A = [ A11 A12 ] M, - // - // then the following does the complete QR decomposition of A11: - // - // A11 = U*[ 0 T12 ]*P1^T. - // [ 0 0 ] - for i := range iwork[:n-l] { - iwork[i] = 0 - } - impl.Dgeqp3(m, n-l, a, lda, iwork[:n-l], tau, work, lwork) - - // Determine the effective rank of A11. - for i := 0; i < min(m, n-l); i++ { - if math.Abs(a[i*lda+i]) > tola { - k++ - } - } - - // Update A12 := U^T*A12, where A12 = A[0:m, n-l:n]. - impl.Dorm2r(blas.Left, blas.Trans, m, l, min(m, n-l), a, lda, tau, a[n-l:], lda, work) - - if wantu { - // Copy the details of U, and form U. - impl.Dlaset(blas.All, m, m, 0, 0, u, ldu) - if m > 1 { - impl.Dlacpy(blas.Lower, m-1, min(m, n-l), a[lda:], lda, u[ldu:], ldu) - } - impl.Dorg2r(m, m, min(m, n-l), u, ldu, tau, work) - } - - if wantq { - // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*P1. - impl.Dlapmt(forward, n, n-l, q, ldq, iwork[:n-l]) - } - - // Clean up A: set the strictly lower triangular part of - // A[0:k, 0:k] = 0, and A[k:m, 0:n-l] = 0. - for i := 1; i < k; i++ { - r := a[i*lda : i*lda+i] - for j := range r { - r[j] = 0 - } - } - if m > k { - impl.Dlaset(blas.All, m-k, n-l, 0, 0, a[k*lda:], lda) - } - - if n-l > k { - // RQ factorization of [ T11 T12 ] = [ 0 T12 ]*Z1. - impl.Dgerq2(k, n-l, a, lda, tau, work) - - if wantq { - // Update Q[0:n, 0:n-l] := Q[0:n, 0:n-l]*Z1^T. - impl.Dorm2r(blas.Right, blas.Trans, n, n-l, k, a, lda, tau, q, ldq, work) - } - - // Clean up A. - impl.Dlaset(blas.All, k, n-l-k, 0, 0, a, lda) - for i := 1; i < k; i++ { - r := a[i*lda+n-k-l : i*lda+i+n-k-l] - for j := range r { - a[j] = 0 - } - } - } - - if m > k { - // QR factorization of A[k:m, n-l:n]. - impl.Dgeqr2(m-k, l, a[k*lda+n-l:], lda, tau, work) - if wantu { - // Update U[:, k:m) := U[:, k:m]*U1. - impl.Dorm2r(blas.Right, blas.NoTrans, m, m-k, min(m-k, l), a[k*lda+n-l:], lda, tau, u[k:], ldu, work) - } - - // Clean up A. - for i := k + 1; i < m; i++ { - r := a[i*lda+n-l : i*lda+min(n-l+i-k, n)] - for j := range r { - r[j] = 0 - } - } - } - - work[0] = float64(lwkopt) - return k, l -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go deleted file mode 100644 index ed3fbca85..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dhseqr.go +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dhseqr computes the eigenvalues of an n×n Hessenberg matrix H and, -// optionally, the matrices T and Z from the Schur decomposition -// H = Z T Z^T, -// where T is an n×n upper quasi-triangular matrix (the Schur form), and Z is -// the n×n orthogonal matrix of Schur vectors. -// -// Optionally Z may be postmultiplied into an input orthogonal matrix Q so that -// this routine can give the Schur factorization of a matrix A which has been -// reduced to the Hessenberg form H by the orthogonal matrix Q: -// A = Q H Q^T = (QZ) T (QZ)^T. -// -// If job == lapack.EigenvaluesOnly, only the eigenvalues will be computed. -// If job == lapack.EigenvaluesAndSchur, the eigenvalues and the Schur form T will -// be computed. -// For other values of job Dhseqr will panic. -// -// If compz == lapack.SchurNone, no Schur vectors will be computed and Z will not be -// referenced. -// If compz == lapack.SchurHess, on return Z will contain the matrix of Schur -// vectors of H. -// If compz == lapack.SchurOrig, on entry z is assumed to contain the orthogonal -// matrix Q that is the identity except for the submatrix -// Q[ilo:ihi+1,ilo:ihi+1]. On return z will be updated to the product Q*Z. -// -// ilo and ihi determine the block of H on which Dhseqr operates. It is assumed -// that H is already upper triangular in rows and columns [0:ilo] and [ihi+1:n], -// although it will be only checked that the block is isolated, that is, -// ilo == 0 or H[ilo,ilo-1] == 0, -// ihi == n-1 or H[ihi+1,ihi] == 0, -// and Dhseqr will panic otherwise. ilo and ihi are typically set by a previous -// call to Dgebal, otherwise they should be set to 0 and n-1, respectively. It -// must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0. -// -// wr and wi must have length n. -// -// work must have length at least lwork and lwork must be at least max(1,n) -// otherwise Dhseqr will panic. The minimum lwork delivers very good and -// sometimes optimal performance, although lwork as large as 11*n may be -// required. On return, work[0] will contain the optimal value of lwork. -// -// If lwork is -1, instead of performing Dhseqr, the function only estimates the -// optimal workspace size and stores it into work[0]. Neither h nor z are -// accessed. -// -// unconverged indicates whether Dhseqr computed all the eigenvalues. -// -// If unconverged == 0, all the eigenvalues have been computed and their real -// and imaginary parts will be stored on return in wr and wi, respectively. If -// two eigenvalues are computed as a complex conjugate pair, they are stored in -// consecutive elements of wr and wi, say the i-th and (i+1)th, with wi[i] > 0 -// and wi[i+1] < 0. -// -// If unconverged == 0 and job == lapack.EigenvaluesAndSchur, on return H will -// contain the upper quasi-triangular matrix T from the Schur decomposition (the -// Schur form). 2×2 diagonal blocks (corresponding to complex conjugate pairs of -// eigenvalues) will be returned in standard form, with -// H[i,i] == H[i+1,i+1], -// and -// H[i+1,i]*H[i,i+1] < 0. -// The eigenvalues will be stored in wr and wi in the same order as on the -// diagonal of the Schur form returned in H, with -// wr[i] = H[i,i], -// and, if H[i:i+2,i:i+2] is a 2×2 diagonal block, -// wi[i] = sqrt(-H[i+1,i]*H[i,i+1]), -// wi[i+1] = -wi[i]. -// -// If unconverged == 0 and job == lapack.EigenvaluesOnly, the contents of h -// on return is unspecified. -// -// If unconverged > 0, some eigenvalues have not converged, and the blocks -// [0:ilo] and [unconverged:n] of wr and wi will contain those eigenvalues which -// have been successfully computed. Failures are rare. -// -// If unconverged > 0 and job == lapack.EigenvaluesOnly, on return the -// remaining unconverged eigenvalues are the eigenvalues of the upper Hessenberg -// matrix H[ilo:unconverged,ilo:unconverged]. -// -// If unconverged > 0 and job == lapack.EigenvaluesAndSchur, then on -// return -// (initial H) U = U (final H), (*) -// where U is an orthogonal matrix. The final H is upper Hessenberg and -// H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. -// -// If unconverged > 0 and compz == lapack.SchurOrig, then on return -// (final Z) = (initial Z) U, -// where U is the orthogonal matrix in (*) regardless of the value of job. -// -// If unconverged > 0 and compz == lapack.SchurHess, then on return -// (final Z) = U, -// where U is the orthogonal matrix in (*) regardless of the value of job. -// -// References: -// [1] R. Byers. LAPACK 3.1 xHSEQR: Tuning and Implementation Notes on the -// Small Bulge Multi-Shift QR Algorithm with Aggressive Early Deflation. -// LAPACK Working Note 187 (2007) -// URL: http://www.netlib.org/lapack/lawnspdf/lawn187.pdf -// [2] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part I: -// Maintaining Well-Focused Shifts and Level 3 Performance. SIAM J. Matrix -// Anal. Appl. 23(4) (2002), pp. 929—947 -// URL: http://dx.doi.org/10.1137/S0895479801384573 -// [3] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl. 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 -// -// Dhseqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dhseqr(job lapack.SchurJob, compz lapack.SchurComp, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, z []float64, ldz int, work []float64, lwork int) (unconverged int) { - wantt := job == lapack.EigenvaluesAndSchur - wantz := compz == lapack.SchurHess || compz == lapack.SchurOrig - - switch { - case job != lapack.EigenvaluesOnly && job != lapack.EigenvaluesAndSchur: - panic(badSchurJob) - case compz != lapack.SchurNone && compz != lapack.SchurHess && compz != lapack.SchurOrig: - panic(badSchurComp) - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case ldh < max(1, n): - panic(badLdH) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return 0 - } - - // Quick return in case of a workspace query. - if lwork == -1 { - impl.Dlaqr04(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo, ihi, z, ldz, work, -1, 1) - work[0] = math.Max(float64(n), work[0]) - return 0 - } - - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case len(wr) < n: - panic(shortWr) - case len(wi) < n: - panic(shortWi) - } - - const ( - // Matrices of order ntiny or smaller must be processed by - // Dlahqr because of insufficient subdiagonal scratch space. - // This is a hard limit. - ntiny = 11 - - // nl is the size of a local workspace to help small matrices - // through a rare Dlahqr failure. nl > ntiny is required and - // nl <= nmin = Ilaenv(ispec=12,...) is recommended (the default - // value of nmin is 75). Using nl = 49 allows up to six - // simultaneous shifts and a 16×16 deflation window. - nl = 49 - ) - - // Copy eigenvalues isolated by Dgebal. - for i := 0; i < ilo; i++ { - wr[i] = h[i*ldh+i] - wi[i] = 0 - } - for i := ihi + 1; i < n; i++ { - wr[i] = h[i*ldh+i] - wi[i] = 0 - } - - // Initialize Z to identity matrix if requested. - if compz == lapack.SchurHess { - impl.Dlaset(blas.All, n, n, 0, 1, z, ldz) - } - - // Quick return if possible. - if ilo == ihi { - wr[ilo] = h[ilo*ldh+ilo] - wi[ilo] = 0 - return 0 - } - - // Dlahqr/Dlaqr04 crossover point. - nmin := impl.Ilaenv(12, "DHSEQR", string(job)+string(compz), n, ilo, ihi, lwork) - nmin = max(ntiny, nmin) - - if n > nmin { - // Dlaqr0 for big matrices. - unconverged = impl.Dlaqr04(wantt, wantz, n, ilo, ihi, h, ldh, wr[:ihi+1], wi[:ihi+1], - ilo, ihi, z, ldz, work, lwork, 1) - } else { - // Dlahqr for small matrices. - unconverged = impl.Dlahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr[:ihi+1], wi[:ihi+1], - ilo, ihi, z, ldz) - if unconverged > 0 { - // A rare Dlahqr failure! Dlaqr04 sometimes succeeds - // when Dlahqr fails. - kbot := unconverged - if n >= nl { - // Larger matrices have enough subdiagonal - // scratch space to call Dlaqr04 directly. - unconverged = impl.Dlaqr04(wantt, wantz, n, ilo, kbot, h, ldh, - wr[:ihi+1], wi[:ihi+1], ilo, ihi, z, ldz, work, lwork, 1) - } else { - // Tiny matrices don't have enough subdiagonal - // scratch space to benefit from Dlaqr04. Hence, - // tiny matrices must be copied into a larger - // array before calling Dlaqr04. - var hl [nl * nl]float64 - impl.Dlacpy(blas.All, n, n, h, ldh, hl[:], nl) - impl.Dlaset(blas.All, nl, nl-n, 0, 0, hl[n:], nl) - var workl [nl]float64 - unconverged = impl.Dlaqr04(wantt, wantz, nl, ilo, kbot, hl[:], nl, - wr[:ihi+1], wi[:ihi+1], ilo, ihi, z, ldz, workl[:], nl, 1) - work[0] = workl[0] - if wantt || unconverged > 0 { - impl.Dlacpy(blas.All, n, n, hl[:], nl, h, ldh) - } - } - } - } - // Zero out under the first subdiagonal, if necessary. - if (wantt || unconverged > 0) && n > 2 { - impl.Dlaset(blas.Lower, n-2, n-2, 0, 0, h[2*ldh:], ldh) - } - - work[0] = math.Max(float64(n), work[0]) - return unconverged -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go deleted file mode 100644 index babc0b7c0..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlabrd.go +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlabrd reduces the first NB rows and columns of a real general m×n matrix -// A to upper or lower bidiagonal form by an orthogonal transformation -// Q**T * A * P -// If m >= n, A is reduced to upper bidiagonal form and upon exit the elements -// on and below the diagonal in the first nb columns represent the elementary -// reflectors, and the elements above the diagonal in the first nb rows represent -// the matrix P. If m < n, A is reduced to lower bidiagonal form and the elements -// P is instead stored above the diagonal. -// -// The reduction to bidiagonal form is stored in d and e, where d are the diagonal -// elements, and e are the off-diagonal elements. -// -// The matrices Q and P are products of elementary reflectors -// Q = H_0 * H_1 * ... * H_{nb-1} -// P = G_0 * G_1 * ... * G_{nb-1} -// where -// H_i = I - tauQ[i] * v_i * v_i^T -// G_i = I - tauP[i] * u_i * u_i^T -// -// As an example, on exit the entries of A when m = 6, n = 5, and nb = 2 -// [ 1 1 u1 u1 u1] -// [v1 1 1 u2 u2] -// [v1 v2 a a a] -// [v1 v2 a a a] -// [v1 v2 a a a] -// [v1 v2 a a a] -// and when m = 5, n = 6, and nb = 2 -// [ 1 u1 u1 u1 u1 u1] -// [ 1 1 u2 u2 u2 u2] -// [v1 1 a a a a] -// [v1 v2 a a a a] -// [v1 v2 a a a a] -// -// Dlabrd also returns the matrices X and Y which are used with U and V to -// apply the transformation to the unreduced part of the matrix -// A := A - V*Y^T - X*U^T -// and returns the matrices X and Y which are needed to apply the -// transformation to the unreduced part of A. -// -// X is an m×nb matrix, Y is an n×nb matrix. d, e, taup, and tauq must all have -// length at least nb. Dlabrd will panic if these size constraints are violated. -// -// Dlabrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlabrd(m, n, nb int, a []float64, lda int, d, e, tauQ, tauP, x []float64, ldx int, y []float64, ldy int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case nb > m: - panic(nbGTM) - case lda < max(1, n): - panic(badLdA) - case ldx < max(1, nb): - panic(badLdX) - case ldy < max(1, nb): - panic(badLdY) - } - - if m == 0 || n == 0 || nb == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(d) < nb: - panic(shortD) - case len(e) < nb: - panic(shortE) - case len(tauQ) < nb: - panic(shortTauQ) - case len(tauP) < nb: - panic(shortTauP) - case len(x) < (m-1)*ldx+nb: - panic(shortX) - case len(y) < (n-1)*ldy+nb: - panic(shortY) - } - - bi := blas64.Implementation() - - if m >= n { - // Reduce to upper bidiagonal form. - for i := 0; i < nb; i++ { - bi.Dgemv(blas.NoTrans, m-i, i, -1, a[i*lda:], lda, y[i*ldy:], 1, 1, a[i*lda+i:], lda) - bi.Dgemv(blas.NoTrans, m-i, i, -1, x[i*ldx:], ldx, a[i:], lda, 1, a[i*lda+i:], lda) - - a[i*lda+i], tauQ[i] = impl.Dlarfg(m-i, a[i*lda+i], a[min(i+1, m-1)*lda+i:], lda) - d[i] = a[i*lda+i] - if i < n-1 { - // Compute Y[i+1:n, i]. - a[i*lda+i] = 1 - bi.Dgemv(blas.Trans, m-i, n-i-1, 1, a[i*lda+i+1:], lda, a[i*lda+i:], lda, 0, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i, i, 1, a[i*lda:], lda, a[i*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, y[(i+1)*ldy:], ldy, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i, i, 1, x[i*ldx:], ldx, a[i*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.Trans, i, n-i-1, -1, a[i+1:], lda, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dscal(n-i-1, tauQ[i], y[(i+1)*ldy+i:], ldy) - - // Update A[i, i+1:n]. - bi.Dgemv(blas.NoTrans, n-i-1, i+1, -1, y[(i+1)*ldy:], ldy, a[i*lda:], 1, 1, a[i*lda+i+1:], 1) - bi.Dgemv(blas.Trans, i, n-i-1, -1, a[i+1:], lda, x[i*ldx:], 1, 1, a[i*lda+i+1:], 1) - - // Generate reflection P[i] to annihilate A[i, i+2:n]. - a[i*lda+i+1], tauP[i] = impl.Dlarfg(n-i-1, a[i*lda+i+1], a[i*lda+min(i+2, n-1):], 1) - e[i] = a[i*lda+i+1] - a[i*lda+i+1] = 1 - - // Compute X[i+1:m, i]. - bi.Dgemv(blas.NoTrans, m-i-1, n-i-1, 1, a[(i+1)*lda+i+1:], lda, a[i*lda+i+1:], 1, 0, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.Trans, n-i-1, i+1, 1, y[(i+1)*ldy:], ldy, a[i*lda+i+1:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i+1, -1, a[(i+1)*lda:], lda, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.NoTrans, i, n-i-1, 1, a[i+1:], lda, a[i*lda+i+1:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, x[(i+1)*ldx:], ldx, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dscal(m-i-1, tauP[i], x[(i+1)*ldx+i:], ldx) - } - } - return - } - // Reduce to lower bidiagonal form. - for i := 0; i < nb; i++ { - // Update A[i,i:n] - bi.Dgemv(blas.NoTrans, n-i, i, -1, y[i*ldy:], ldy, a[i*lda:], 1, 1, a[i*lda+i:], 1) - bi.Dgemv(blas.Trans, i, n-i, -1, a[i:], lda, x[i*ldx:], 1, 1, a[i*lda+i:], 1) - - // Generate reflection P[i] to annihilate A[i, i+1:n] - a[i*lda+i], tauP[i] = impl.Dlarfg(n-i, a[i*lda+i], a[i*lda+min(i+1, n-1):], 1) - d[i] = a[i*lda+i] - if i < m-1 { - a[i*lda+i] = 1 - // Compute X[i+1:m, i]. - bi.Dgemv(blas.NoTrans, m-i-1, n-i, 1, a[(i+1)*lda+i:], lda, a[i*lda+i:], 1, 0, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.Trans, n-i, i, 1, y[i*ldy:], ldy, a[i*lda+i:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, a[(i+1)*lda:], lda, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dgemv(blas.NoTrans, i, n-i, 1, a[i:], lda, a[i*lda+i:], 1, 0, x[i:], ldx) - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, x[(i+1)*ldx:], ldx, x[i:], ldx, 1, x[(i+1)*ldx+i:], ldx) - bi.Dscal(m-i-1, tauP[i], x[(i+1)*ldx+i:], ldx) - - // Update A[i+1:m, i]. - bi.Dgemv(blas.NoTrans, m-i-1, i, -1, a[(i+1)*lda:], lda, y[i*ldy:], 1, 1, a[(i+1)*lda+i:], lda) - bi.Dgemv(blas.NoTrans, m-i-1, i+1, -1, x[(i+1)*ldx:], ldx, a[i:], lda, 1, a[(i+1)*lda+i:], lda) - - // Generate reflection Q[i] to annihilate A[i+2:m, i]. - a[(i+1)*lda+i], tauQ[i] = impl.Dlarfg(m-i-1, a[(i+1)*lda+i], a[min(i+2, m-1)*lda+i:], lda) - e[i] = a[(i+1)*lda+i] - a[(i+1)*lda+i] = 1 - - // Compute Y[i+1:n, i]. - bi.Dgemv(blas.Trans, m-i-1, n-i-1, 1, a[(i+1)*lda+i+1:], lda, a[(i+1)*lda+i:], lda, 0, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i-1, i, 1, a[(i+1)*lda:], lda, a[(i+1)*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, y[(i+1)*ldy:], ldy, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dgemv(blas.Trans, m-i-1, i+1, 1, x[(i+1)*ldx:], ldx, a[(i+1)*lda+i:], lda, 0, y[i:], ldy) - bi.Dgemv(blas.Trans, i+1, n-i-1, -1, a[i+1:], lda, y[i:], ldy, 1, y[(i+1)*ldy+i:], ldy) - bi.Dscal(n-i-1, tauQ[i], y[(i+1)*ldy+i:], ldy) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go deleted file mode 100644 index e8ac1e439..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacn2.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlacn2 estimates the 1-norm of an n×n matrix A using sequential updates with -// matrix-vector products provided externally. -// -// Dlacn2 is called sequentially and it returns the value of est and kase to be -// used on the next call. -// On the initial call, kase must be 0. -// In between calls, x must be overwritten by -// A * X if kase was returned as 1, -// A^T * X if kase was returned as 2, -// and all other parameters must not be changed. -// On the final return, kase is returned as 0, v contains A*W where W is a -// vector, and est = norm(V)/norm(W) is a lower bound for 1-norm of A. -// -// v, x, and isgn must all have length n and n must be at least 1, otherwise -// Dlacn2 will panic. isave is used for temporary storage. -// -// Dlacn2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlacn2(n int, v, x []float64, isgn []int, est float64, kase int, isave *[3]int) (float64, int) { - switch { - case n < 1: - panic(nLT1) - case len(v) < n: - panic(shortV) - case len(x) < n: - panic(shortX) - case len(isgn) < n: - panic(shortIsgn) - case isave[0] < 0 || 5 < isave[0]: - panic(badIsave) - case isave[0] == 0 && kase != 0: - panic(badIsave) - } - - const itmax = 5 - bi := blas64.Implementation() - - if kase == 0 { - for i := 0; i < n; i++ { - x[i] = 1 / float64(n) - } - kase = 1 - isave[0] = 1 - return est, kase - } - switch isave[0] { - case 1: - if n == 1 { - v[0] = x[0] - est = math.Abs(v[0]) - kase = 0 - return est, kase - } - est = bi.Dasum(n, x, 1) - for i := 0; i < n; i++ { - x[i] = math.Copysign(1, x[i]) - isgn[i] = int(x[i]) - } - kase = 2 - isave[0] = 2 - return est, kase - case 2: - isave[1] = bi.Idamax(n, x, 1) - isave[2] = 2 - for i := 0; i < n; i++ { - x[i] = 0 - } - x[isave[1]] = 1 - kase = 1 - isave[0] = 3 - return est, kase - case 3: - bi.Dcopy(n, x, 1, v, 1) - estold := est - est = bi.Dasum(n, v, 1) - sameSigns := true - for i := 0; i < n; i++ { - if int(math.Copysign(1, x[i])) != isgn[i] { - sameSigns = false - break - } - } - if !sameSigns && est > estold { - for i := 0; i < n; i++ { - x[i] = math.Copysign(1, x[i]) - isgn[i] = int(x[i]) - } - kase = 2 - isave[0] = 4 - return est, kase - } - case 4: - jlast := isave[1] - isave[1] = bi.Idamax(n, x, 1) - if x[jlast] != math.Abs(x[isave[1]]) && isave[2] < itmax { - isave[2] += 1 - for i := 0; i < n; i++ { - x[i] = 0 - } - x[isave[1]] = 1 - kase = 1 - isave[0] = 3 - return est, kase - } - case 5: - tmp := 2 * (bi.Dasum(n, x, 1)) / float64(3*n) - if tmp > est { - bi.Dcopy(n, x, 1, v, 1) - est = tmp - } - kase = 0 - return est, kase - } - // Iteration complete. Final stage - altsgn := 1.0 - for i := 0; i < n; i++ { - x[i] = altsgn * (1 + float64(i)/float64(n-1)) - altsgn *= -1 - } - kase = 1 - isave[0] = 5 - return est, kase -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go deleted file mode 100644 index a37f3b0db..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlacpy.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dlacpy copies the elements of A specified by uplo into B. Uplo can specify -// a triangular portion with blas.Upper or blas.Lower, or can specify all of the -// elemest with blas.All. -// -// Dlacpy is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlacpy(uplo blas.Uplo, m, n int, a []float64, lda int, b []float64, ldb int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower && uplo != blas.All: - panic(badUplo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, n): - panic(badLdB) - } - - if m == 0 || n == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(b) < (m-1)*ldb+n: - panic(shortB) - } - - switch uplo { - case blas.Upper: - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - b[i*ldb+j] = a[i*lda+j] - } - } - case blas.Lower: - for i := 0; i < m; i++ { - for j := 0; j < min(i+1, n); j++ { - b[i*ldb+j] = a[i*lda+j] - } - } - case blas.All: - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - b[i*ldb+j] = a[i*lda+j] - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go deleted file mode 100644 index c071fec7d..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlae2.go +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlae2 computes the eigenvalues of a 2×2 symmetric matrix -// [a b] -// [b c] -// and returns the eigenvalue with the larger absolute value as rt1 and the -// smaller as rt2. -// -// Dlae2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlae2(a, b, c float64) (rt1, rt2 float64) { - sm := a + c - df := a - c - adf := math.Abs(df) - tb := b + b - ab := math.Abs(tb) - acmx := c - acmn := a - if math.Abs(a) > math.Abs(c) { - acmx = a - acmn = c - } - var rt float64 - if adf > ab { - rt = adf * math.Sqrt(1+(ab/adf)*(ab/adf)) - } else if adf < ab { - rt = ab * math.Sqrt(1+(adf/ab)*(adf/ab)) - } else { - rt = ab * math.Sqrt2 - } - if sm < 0 { - rt1 = 0.5 * (sm - rt) - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - return rt1, rt2 - } - if sm > 0 { - rt1 = 0.5 * (sm + rt) - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - return rt1, rt2 - } - rt1 = 0.5 * rt - rt2 = -0.5 * rt - return rt1, rt2 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go deleted file mode 100644 index 74d75b913..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaev2.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlaev2 computes the Eigen decomposition of a symmetric 2×2 matrix. -// The matrix is given by -// [a b] -// [b c] -// Dlaev2 returns rt1 and rt2, the eigenvalues of the matrix where |RT1| > |RT2|, -// and [cs1, sn1] which is the unit right eigenvalue for RT1. -// [ cs1 sn1] [a b] [cs1 -sn1] = [rt1 0] -// [-sn1 cs1] [b c] [sn1 cs1] [ 0 rt2] -// -// Dlaev2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaev2(a, b, c float64) (rt1, rt2, cs1, sn1 float64) { - sm := a + c - df := a - c - adf := math.Abs(df) - tb := b + b - ab := math.Abs(tb) - acmx := c - acmn := a - if math.Abs(a) > math.Abs(c) { - acmx = a - acmn = c - } - var rt float64 - if adf > ab { - rt = adf * math.Sqrt(1+(ab/adf)*(ab/adf)) - } else if adf < ab { - rt = ab * math.Sqrt(1+(adf/ab)*(adf/ab)) - } else { - rt = ab * math.Sqrt(2) - } - var sgn1 float64 - if sm < 0 { - rt1 = 0.5 * (sm - rt) - sgn1 = -1 - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - } else if sm > 0 { - rt1 = 0.5 * (sm + rt) - sgn1 = 1 - rt2 = (acmx/rt1)*acmn - (b/rt1)*b - } else { - rt1 = 0.5 * rt - rt2 = -0.5 * rt - sgn1 = 1 - } - var cs, sgn2 float64 - if df >= 0 { - cs = df + rt - sgn2 = 1 - } else { - cs = df - rt - sgn2 = -1 - } - acs := math.Abs(cs) - if acs > ab { - ct := -tb / cs - sn1 = 1 / math.Sqrt(1+ct*ct) - cs1 = ct * sn1 - } else { - if ab == 0 { - cs1 = 1 - sn1 = 0 - } else { - tn := -cs / tb - cs1 = 1 / math.Sqrt(1+tn*tn) - sn1 = tn * cs1 - } - } - if sgn1 == sgn2 { - tn := cs1 - cs1 = -sn1 - sn1 = tn - } - return rt1, rt2, cs1, sn1 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go deleted file mode 100644 index 2b79bd8ae..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaexc.go +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlaexc swaps two adjacent diagonal blocks of order 1 or 2 in an n×n upper -// quasi-triangular matrix T by an orthogonal similarity transformation. -// -// T must be in Schur canonical form, that is, block upper triangular with 1×1 -// and 2×2 diagonal blocks; each 2×2 diagonal block has its diagonal elements -// equal and its off-diagonal elements of opposite sign. On return, T will -// contain the updated matrix again in Schur canonical form. -// -// If wantq is true, the transformation is accumulated in the n×n matrix Q, -// otherwise Q is not referenced. -// -// j1 is the index of the first row of the first block. n1 and n2 are the order -// of the first and second block, respectively. -// -// work must have length at least n, otherwise Dlaexc will panic. -// -// If ok is false, the transformed matrix T would be too far from Schur form. -// The blocks are not swapped, and T and Q are not modified. -// -// If n1 and n2 are both equal to 1, Dlaexc will always return true. -// -// Dlaexc is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaexc(wantq bool, n int, t []float64, ldt int, q []float64, ldq int, j1, n1, n2 int, work []float64) (ok bool) { - switch { - case n < 0: - panic(nLT0) - case ldt < max(1, n): - panic(badLdT) - case wantq && ldt < max(1, n): - panic(badLdQ) - case j1 < 0 || n <= j1: - panic(badJ1) - case len(work) < n: - panic(shortWork) - case n1 < 0 || 2 < n1: - panic(badN1) - case n2 < 0 || 2 < n2: - panic(badN2) - } - - if n == 0 || n1 == 0 || n2 == 0 { - return true - } - - switch { - case len(t) < (n-1)*ldt+n: - panic(shortT) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - } - - if j1+n1 >= n { - // TODO(vladimir-ch): Reference LAPACK does this check whether - // the start of the second block is in the matrix T. It returns - // true if it is not and moreover it does not check whether the - // whole second block fits into T. This does not feel - // satisfactory. The only caller of Dlaexc is Dtrexc, so if the - // caller makes sure that this does not happen, we could be - // stricter here. - return true - } - - j2 := j1 + 1 - j3 := j1 + 2 - - bi := blas64.Implementation() - - if n1 == 1 && n2 == 1 { - // Swap two 1×1 blocks. - t11 := t[j1*ldt+j1] - t22 := t[j2*ldt+j2] - - // Determine the transformation to perform the interchange. - cs, sn, _ := impl.Dlartg(t[j1*ldt+j2], t22-t11) - - // Apply transformation to the matrix T. - if n-j3 > 0 { - bi.Drot(n-j3, t[j1*ldt+j3:], 1, t[j2*ldt+j3:], 1, cs, sn) - } - if j1 > 0 { - bi.Drot(j1, t[j1:], ldt, t[j2:], ldt, cs, sn) - } - - t[j1*ldt+j1] = t22 - t[j2*ldt+j2] = t11 - - if wantq { - // Accumulate transformation in the matrix Q. - bi.Drot(n, q[j1:], ldq, q[j2:], ldq, cs, sn) - } - - return true - } - - // Swapping involves at least one 2×2 block. - // - // Copy the diagonal block of order n1+n2 to the local array d and - // compute its norm. - nd := n1 + n2 - var d [16]float64 - const ldd = 4 - impl.Dlacpy(blas.All, nd, nd, t[j1*ldt+j1:], ldt, d[:], ldd) - dnorm := impl.Dlange(lapack.MaxAbs, nd, nd, d[:], ldd, work) - - // Compute machine-dependent threshold for test for accepting swap. - eps := dlamchP - thresh := math.Max(10*eps*dnorm, dlamchS/eps) - - // Solve T11*X - X*T22 = scale*T12 for X. - var x [4]float64 - const ldx = 2 - scale, _, _ := impl.Dlasy2(false, false, -1, n1, n2, d[:], ldd, d[n1*ldd+n1:], ldd, d[n1:], ldd, x[:], ldx) - - // Swap the adjacent diagonal blocks. - switch { - case n1 == 1 && n2 == 2: - // Generate elementary reflector H so that - // ( scale, X11, X12 ) H = ( 0, 0, * ) - u := [3]float64{scale, x[0], 1} - _, tau := impl.Dlarfg(3, x[1], u[:2], 1) - t11 := t[j1*ldt+j1] - - // Perform swap provisionally on diagonal block in d. - impl.Dlarfx(blas.Left, 3, 3, u[:], tau, d[:], ldd, work) - impl.Dlarfx(blas.Right, 3, 3, u[:], tau, d[:], ldd, work) - - // Test whether to reject swap. - if math.Max(math.Abs(d[2*ldd]), math.Max(math.Abs(d[2*ldd+1]), math.Abs(d[2*ldd+2]-t11))) > thresh { - return false - } - - // Accept swap: apply transformation to the entire matrix T. - impl.Dlarfx(blas.Left, 3, n-j1, u[:], tau, t[j1*ldt+j1:], ldt, work) - impl.Dlarfx(blas.Right, j2+1, 3, u[:], tau, t[j1:], ldt, work) - - t[j3*ldt+j1] = 0 - t[j3*ldt+j2] = 0 - t[j3*ldt+j3] = t11 - - if wantq { - // Accumulate transformation in the matrix Q. - impl.Dlarfx(blas.Right, n, 3, u[:], tau, q[j1:], ldq, work) - } - - case n1 == 2 && n2 == 1: - // Generate elementary reflector H so that: - // H ( -X11 ) = ( * ) - // ( -X21 ) = ( 0 ) - // ( scale ) = ( 0 ) - u := [3]float64{1, -x[ldx], scale} - _, tau := impl.Dlarfg(3, -x[0], u[1:], 1) - t33 := t[j3*ldt+j3] - - // Perform swap provisionally on diagonal block in D. - impl.Dlarfx(blas.Left, 3, 3, u[:], tau, d[:], ldd, work) - impl.Dlarfx(blas.Right, 3, 3, u[:], tau, d[:], ldd, work) - - // Test whether to reject swap. - if math.Max(math.Abs(d[ldd]), math.Max(math.Abs(d[2*ldd]), math.Abs(d[0]-t33))) > thresh { - return false - } - - // Accept swap: apply transformation to the entire matrix T. - impl.Dlarfx(blas.Right, j3+1, 3, u[:], tau, t[j1:], ldt, work) - impl.Dlarfx(blas.Left, 3, n-j1-1, u[:], tau, t[j1*ldt+j2:], ldt, work) - - t[j1*ldt+j1] = t33 - t[j2*ldt+j1] = 0 - t[j3*ldt+j1] = 0 - - if wantq { - // Accumulate transformation in the matrix Q. - impl.Dlarfx(blas.Right, n, 3, u[:], tau, q[j1:], ldq, work) - } - - default: // n1 == 2 && n2 == 2 - // Generate elementary reflectors H_1 and H_2 so that: - // H_2 H_1 ( -X11 -X12 ) = ( * * ) - // ( -X21 -X22 ) ( 0 * ) - // ( scale 0 ) ( 0 0 ) - // ( 0 scale ) ( 0 0 ) - u1 := [3]float64{1, -x[ldx], scale} - _, tau1 := impl.Dlarfg(3, -x[0], u1[1:], 1) - - temp := -tau1 * (x[1] + u1[1]*x[ldx+1]) - u2 := [3]float64{1, -temp * u1[2], scale} - _, tau2 := impl.Dlarfg(3, -temp*u1[1]-x[ldx+1], u2[1:], 1) - - // Perform swap provisionally on diagonal block in D. - impl.Dlarfx(blas.Left, 3, 4, u1[:], tau1, d[:], ldd, work) - impl.Dlarfx(blas.Right, 4, 3, u1[:], tau1, d[:], ldd, work) - impl.Dlarfx(blas.Left, 3, 4, u2[:], tau2, d[ldd:], ldd, work) - impl.Dlarfx(blas.Right, 4, 3, u2[:], tau2, d[1:], ldd, work) - - // Test whether to reject swap. - m1 := math.Max(math.Abs(d[2*ldd]), math.Abs(d[2*ldd+1])) - m2 := math.Max(math.Abs(d[3*ldd]), math.Abs(d[3*ldd+1])) - if math.Max(m1, m2) > thresh { - return false - } - - // Accept swap: apply transformation to the entire matrix T. - j4 := j1 + 3 - impl.Dlarfx(blas.Left, 3, n-j1, u1[:], tau1, t[j1*ldt+j1:], ldt, work) - impl.Dlarfx(blas.Right, j4+1, 3, u1[:], tau1, t[j1:], ldt, work) - impl.Dlarfx(blas.Left, 3, n-j1, u2[:], tau2, t[j2*ldt+j1:], ldt, work) - impl.Dlarfx(blas.Right, j4+1, 3, u2[:], tau2, t[j2:], ldt, work) - - t[j3*ldt+j1] = 0 - t[j3*ldt+j2] = 0 - t[j4*ldt+j1] = 0 - t[j4*ldt+j2] = 0 - - if wantq { - // Accumulate transformation in the matrix Q. - impl.Dlarfx(blas.Right, n, 3, u1[:], tau1, q[j1:], ldq, work) - impl.Dlarfx(blas.Right, n, 3, u2[:], tau2, q[j2:], ldq, work) - } - } - - if n2 == 2 { - // Standardize new 2×2 block T11. - a, b := t[j1*ldt+j1], t[j1*ldt+j2] - c, d := t[j2*ldt+j1], t[j2*ldt+j2] - var cs, sn float64 - t[j1*ldt+j1], t[j1*ldt+j2], t[j2*ldt+j1], t[j2*ldt+j2], _, _, _, _, cs, sn = impl.Dlanv2(a, b, c, d) - if n-j1-2 > 0 { - bi.Drot(n-j1-2, t[j1*ldt+j1+2:], 1, t[j2*ldt+j1+2:], 1, cs, sn) - } - if j1 > 0 { - bi.Drot(j1, t[j1:], ldt, t[j2:], ldt, cs, sn) - } - if wantq { - bi.Drot(n, q[j1:], ldq, q[j2:], ldq, cs, sn) - } - } - if n1 == 2 { - // Standardize new 2×2 block T22. - j3 := j1 + n2 - j4 := j3 + 1 - a, b := t[j3*ldt+j3], t[j3*ldt+j4] - c, d := t[j4*ldt+j3], t[j4*ldt+j4] - var cs, sn float64 - t[j3*ldt+j3], t[j3*ldt+j4], t[j4*ldt+j3], t[j4*ldt+j4], _, _, _, _, cs, sn = impl.Dlanv2(a, b, c, d) - if n-j3-2 > 0 { - bi.Drot(n-j3-2, t[j3*ldt+j3+2:], 1, t[j4*ldt+j3+2:], 1, cs, sn) - } - bi.Drot(j3, t[j3:], ldt, t[j4:], ldt, cs, sn) - if wantq { - bi.Drot(n, q[j3:], ldq, q[j4:], ldq, cs, sn) - } - } - - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go deleted file mode 100644 index 6954deb42..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlags2.go +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlags2 computes 2-by-2 orthogonal matrices U, V and Q with the -// triangles of A and B specified by upper. -// -// If upper is true -// -// U^T*A*Q = U^T*[ a1 a2 ]*Q = [ x 0 ] -// [ 0 a3 ] [ x x ] -// and -// V^T*B*Q = V^T*[ b1 b2 ]*Q = [ x 0 ] -// [ 0 b3 ] [ x x ] -// -// otherwise -// -// U^T*A*Q = U^T*[ a1 0 ]*Q = [ x x ] -// [ a2 a3 ] [ 0 x ] -// and -// V^T*B*Q = V^T*[ b1 0 ]*Q = [ x x ] -// [ b2 b3 ] [ 0 x ]. -// -// The rows of the transformed A and B are parallel, where -// -// U = [ csu snu ], V = [ csv snv ], Q = [ csq snq ] -// [ -snu csu ] [ -snv csv ] [ -snq csq ] -// -// Dlags2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlags2(upper bool, a1, a2, a3, b1, b2, b3 float64) (csu, snu, csv, snv, csq, snq float64) { - if upper { - // Input matrices A and B are upper triangular matrices. - // - // Form matrix C = A*adj(B) = [ a b ] - // [ 0 d ] - a := a1 * b3 - d := a3 * b1 - b := a2*b1 - a1*b2 - - // The SVD of real 2-by-2 triangular C. - // - // [ csl -snl ]*[ a b ]*[ csr snr ] = [ r 0 ] - // [ snl csl ] [ 0 d ] [ -snr csr ] [ 0 t ] - _, _, snr, csr, snl, csl := impl.Dlasv2(a, b, d) - - if math.Abs(csl) >= math.Abs(snl) || math.Abs(csr) >= math.Abs(snr) { - // Compute the [0, 0] and [0, 1] elements of U^T*A and V^T*B, - // and [0, 1] element of |U|^T*|A| and |V|^T*|B|. - - ua11r := csl * a1 - ua12 := csl*a2 + snl*a3 - - vb11r := csr * b1 - vb12 := csr*b2 + snr*b3 - - aua12 := math.Abs(csl)*math.Abs(a2) + math.Abs(snl)*math.Abs(a3) - avb12 := math.Abs(csr)*math.Abs(b2) + math.Abs(snr)*math.Abs(b3) - - // Zero [0, 1] elements of U^T*A and V^T*B. - if math.Abs(ua11r)+math.Abs(ua12) != 0 { - if aua12/(math.Abs(ua11r)+math.Abs(ua12)) <= avb12/(math.Abs(vb11r)+math.Abs(vb12)) { - csq, snq, _ = impl.Dlartg(-ua11r, ua12) - } else { - csq, snq, _ = impl.Dlartg(-vb11r, vb12) - } - } else { - csq, snq, _ = impl.Dlartg(-vb11r, vb12) - } - - csu = csl - snu = -snl - csv = csr - snv = -snr - } else { - // Compute the [1, 0] and [1, 1] elements of U^T*A and V^T*B, - // and [1, 1] element of |U|^T*|A| and |V|^T*|B|. - - ua21 := -snl * a1 - ua22 := -snl*a2 + csl*a3 - - vb21 := -snr * b1 - vb22 := -snr*b2 + csr*b3 - - aua22 := math.Abs(snl)*math.Abs(a2) + math.Abs(csl)*math.Abs(a3) - avb22 := math.Abs(snr)*math.Abs(b2) + math.Abs(csr)*math.Abs(b3) - - // Zero [1, 1] elements of U^T*A and V^T*B, and then swap. - if math.Abs(ua21)+math.Abs(ua22) != 0 { - if aua22/(math.Abs(ua21)+math.Abs(ua22)) <= avb22/(math.Abs(vb21)+math.Abs(vb22)) { - csq, snq, _ = impl.Dlartg(-ua21, ua22) - } else { - csq, snq, _ = impl.Dlartg(-vb21, vb22) - } - } else { - csq, snq, _ = impl.Dlartg(-vb21, vb22) - } - - csu = snl - snu = csl - csv = snr - snv = csr - } - } else { - // Input matrices A and B are lower triangular matrices - // - // Form matrix C = A*adj(B) = [ a 0 ] - // [ c d ] - a := a1 * b3 - d := a3 * b1 - c := a2*b3 - a3*b2 - - // The SVD of real 2-by-2 triangular C - // - // [ csl -snl ]*[ a 0 ]*[ csr snr ] = [ r 0 ] - // [ snl csl ] [ c d ] [ -snr csr ] [ 0 t ] - _, _, snr, csr, snl, csl := impl.Dlasv2(a, c, d) - - if math.Abs(csr) >= math.Abs(snr) || math.Abs(csl) >= math.Abs(snl) { - // Compute the [1, 0] and [1, 1] elements of U^T*A and V^T*B, - // and [1, 0] element of |U|^T*|A| and |V|^T*|B|. - - ua21 := -snr*a1 + csr*a2 - ua22r := csr * a3 - - vb21 := -snl*b1 + csl*b2 - vb22r := csl * b3 - - aua21 := math.Abs(snr)*math.Abs(a1) + math.Abs(csr)*math.Abs(a2) - avb21 := math.Abs(snl)*math.Abs(b1) + math.Abs(csl)*math.Abs(b2) - - // Zero [1, 0] elements of U^T*A and V^T*B. - if (math.Abs(ua21) + math.Abs(ua22r)) != 0 { - if aua21/(math.Abs(ua21)+math.Abs(ua22r)) <= avb21/(math.Abs(vb21)+math.Abs(vb22r)) { - csq, snq, _ = impl.Dlartg(ua22r, ua21) - } else { - csq, snq, _ = impl.Dlartg(vb22r, vb21) - } - } else { - csq, snq, _ = impl.Dlartg(vb22r, vb21) - } - - csu = csr - snu = -snr - csv = csl - snv = -snl - } else { - // Compute the [0, 0] and [0, 1] elements of U^T *A and V^T *B, - // and [0, 0] element of |U|^T*|A| and |V|^T*|B|. - - ua11 := csr*a1 + snr*a2 - ua12 := snr * a3 - - vb11 := csl*b1 + snl*b2 - vb12 := snl * b3 - - aua11 := math.Abs(csr)*math.Abs(a1) + math.Abs(snr)*math.Abs(a2) - avb11 := math.Abs(csl)*math.Abs(b1) + math.Abs(snl)*math.Abs(b2) - - // Zero [0, 0] elements of U^T*A and V^T*B, and then swap. - if (math.Abs(ua11) + math.Abs(ua12)) != 0 { - if aua11/(math.Abs(ua11)+math.Abs(ua12)) <= avb11/(math.Abs(vb11)+math.Abs(vb12)) { - csq, snq, _ = impl.Dlartg(ua12, ua11) - } else { - csq, snq, _ = impl.Dlartg(vb12, vb11) - } - } else { - csq, snq, _ = impl.Dlartg(vb12, vb11) - } - - csu = snr - snu = csr - csv = snl - snv = csl - } - } - - return csu, snu, csv, snv, csq, snq -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go deleted file mode 100644 index 00a869bce..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahqr.go +++ /dev/null @@ -1,431 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlahqr computes the eigenvalues and Schur factorization of a block of an n×n -// upper Hessenberg matrix H, using the double-shift/single-shift QR algorithm. -// -// h and ldh represent the matrix H. Dlahqr works primarily with the Hessenberg -// submatrix H[ilo:ihi+1,ilo:ihi+1], but applies transformations to all of H if -// wantt is true. It is assumed that H[ihi+1:n,ihi+1:n] is already upper -// quasi-triangular, although this is not checked. -// -// It must hold that -// 0 <= ilo <= max(0,ihi), and ihi < n, -// and that -// H[ilo,ilo-1] == 0, if ilo > 0, -// otherwise Dlahqr will panic. -// -// If unconverged is zero on return, wr[ilo:ihi+1] and wi[ilo:ihi+1] will contain -// respectively the real and imaginary parts of the computed eigenvalues ilo -// to ihi. If two eigenvalues are computed as a complex conjugate pair, they are -// stored in consecutive elements of wr and wi, say the i-th and (i+1)th, with -// wi[i] > 0 and wi[i+1] < 0. If wantt is true, the eigenvalues are stored in -// the same order as on the diagonal of the Schur form returned in H, with -// wr[i] = H[i,i], and, if H[i:i+2,i:i+2] is a 2×2 diagonal block, -// wi[i] = sqrt(abs(H[i+1,i]*H[i,i+1])) and wi[i+1] = -wi[i]. -// -// wr and wi must have length ihi+1. -// -// z and ldz represent an n×n matrix Z. If wantz is true, the transformations -// will be applied to the submatrix Z[iloz:ihiz+1,ilo:ihi+1] and it must hold that -// 0 <= iloz <= ilo, and ihi <= ihiz < n. -// If wantz is false, z is not referenced. -// -// unconverged indicates whether Dlahqr computed all the eigenvalues ilo to ihi -// in a total of 30 iterations per eigenvalue. -// -// If unconverged is zero, all the eigenvalues ilo to ihi have been computed and -// will be stored on return in wr[ilo:ihi+1] and wi[ilo:ihi+1]. -// -// If unconverged is zero and wantt is true, H[ilo:ihi+1,ilo:ihi+1] will be -// overwritten on return by upper quasi-triangular full Schur form with any -// 2×2 diagonal blocks in standard form. -// -// If unconverged is zero and if wantt is false, the contents of h on return is -// unspecified. -// -// If unconverged is positive, some eigenvalues have not converged, and -// wr[unconverged:ihi+1] and wi[unconverged:ihi+1] contain those eigenvalues -// which have been successfully computed. -// -// If unconverged is positive and wantt is true, then on return -// (initial H)*U = U*(final H), (*) -// where U is an orthogonal matrix. The final H is upper Hessenberg and -// H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. -// -// If unconverged is positive and wantt is false, on return the remaining -// unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix -// H[ilo:unconverged,ilo:unconverged]. -// -// If unconverged is positive and wantz is true, then on return -// (final Z) = (initial Z)*U, -// where U is the orthogonal matrix in (*) regardless of the value of wantt. -// -// Dlahqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlahqr(wantt, wantz bool, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, iloz, ihiz int, z []float64, ldz int) (unconverged int) { - switch { - case n < 0: - panic(nLT0) - case ilo < 0, max(0, ihi) < ilo: - panic(badIlo) - case ihi >= n: - panic(badIhi) - case ldh < max(1, n): - panic(badLdH) - case wantz && (iloz < 0 || ilo < iloz): - panic(badIloz) - case wantz && (ihiz < ihi || n <= ihiz): - panic(badIhiz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case len(wr) != ihi+1: - panic(shortWr) - case len(wi) != ihi+1: - panic(shortWi) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case ilo > 0 && h[ilo*ldh+ilo-1] != 0: - panic(notIsolated) - } - - if ilo == ihi { - wr[ilo] = h[ilo*ldh+ilo] - wi[ilo] = 0 - return 0 - } - - // Clear out the trash. - for j := ilo; j < ihi-2; j++ { - h[(j+2)*ldh+j] = 0 - h[(j+3)*ldh+j] = 0 - } - if ilo <= ihi-2 { - h[ihi*ldh+ihi-2] = 0 - } - - nh := ihi - ilo + 1 - nz := ihiz - iloz + 1 - - // Set machine-dependent constants for the stopping criterion. - ulp := dlamchP - smlnum := float64(nh) / ulp * dlamchS - - // i1 and i2 are the indices of the first row and last column of H to - // which transformations must be applied. If eigenvalues only are being - // computed, i1 and i2 are set inside the main loop. - var i1, i2 int - if wantt { - i1 = 0 - i2 = n - 1 - } - - itmax := 30 * max(10, nh) // Total number of QR iterations allowed. - - // The main loop begins here. i is the loop index and decreases from ihi - // to ilo in steps of 1 or 2. Each iteration of the loop works with the - // active submatrix in rows and columns l to i. Eigenvalues i+1 to ihi - // have already converged. Either l = ilo or H[l,l-1] is negligible so - // that the matrix splits. - bi := blas64.Implementation() - i := ihi - for i >= ilo { - l := ilo - - // Perform QR iterations on rows and columns ilo to i until a - // submatrix of order 1 or 2 splits off at the bottom because a - // subdiagonal element has become negligible. - converged := false - for its := 0; its <= itmax; its++ { - // Look for a single small subdiagonal element. - var k int - for k = i; k > l; k-- { - if math.Abs(h[k*ldh+k-1]) <= smlnum { - break - } - tst := math.Abs(h[(k-1)*ldh+k-1]) + math.Abs(h[k*ldh+k]) - if tst == 0 { - if k-2 >= ilo { - tst += math.Abs(h[(k-1)*ldh+k-2]) - } - if k+1 <= ihi { - tst += math.Abs(h[(k+1)*ldh+k]) - } - } - // The following is a conservative small - // subdiagonal deflation criterion due to Ahues - // & Tisseur (LAWN 122, 1997). It has better - // mathematical foundation and improves accuracy - // in some cases. - if math.Abs(h[k*ldh+k-1]) <= ulp*tst { - ab := math.Max(math.Abs(h[k*ldh+k-1]), math.Abs(h[(k-1)*ldh+k])) - ba := math.Min(math.Abs(h[k*ldh+k-1]), math.Abs(h[(k-1)*ldh+k])) - aa := math.Max(math.Abs(h[k*ldh+k]), math.Abs(h[(k-1)*ldh+k-1]-h[k*ldh+k])) - bb := math.Min(math.Abs(h[k*ldh+k]), math.Abs(h[(k-1)*ldh+k-1]-h[k*ldh+k])) - s := aa + ab - if ab/s*ba <= math.Max(smlnum, aa/s*bb*ulp) { - break - } - } - } - l = k - if l > ilo { - // H[l,l-1] is negligible. - h[l*ldh+l-1] = 0 - } - if l >= i-1 { - // Break the loop because a submatrix of order 1 - // or 2 has split off. - converged = true - break - } - - // Now the active submatrix is in rows and columns l to - // i. If eigenvalues only are being computed, only the - // active submatrix need be transformed. - if !wantt { - i1 = l - i2 = i - } - - const ( - dat1 = 3.0 - dat2 = -0.4375 - ) - var h11, h21, h12, h22 float64 - switch its { - case 10: // Exceptional shift. - s := math.Abs(h[(l+1)*ldh+l]) + math.Abs(h[(l+2)*ldh+l+1]) - h11 = dat1*s + h[l*ldh+l] - h12 = dat2 * s - h21 = s - h22 = h11 - case 20: // Exceptional shift. - s := math.Abs(h[i*ldh+i-1]) + math.Abs(h[(i-1)*ldh+i-2]) - h11 = dat1*s + h[i*ldh+i] - h12 = dat2 * s - h21 = s - h22 = h11 - default: // Prepare to use Francis' double shift (i.e., - // 2nd degree generalized Rayleigh quotient). - h11 = h[(i-1)*ldh+i-1] - h21 = h[i*ldh+i-1] - h12 = h[(i-1)*ldh+i] - h22 = h[i*ldh+i] - } - s := math.Abs(h11) + math.Abs(h12) + math.Abs(h21) + math.Abs(h22) - var ( - rt1r, rt1i float64 - rt2r, rt2i float64 - ) - if s != 0 { - h11 /= s - h21 /= s - h12 /= s - h22 /= s - tr := (h11 + h22) / 2 - det := (h11-tr)*(h22-tr) - h12*h21 - rtdisc := math.Sqrt(math.Abs(det)) - if det >= 0 { - // Complex conjugate shifts. - rt1r = tr * s - rt2r = rt1r - rt1i = rtdisc * s - rt2i = -rt1i - } else { - // Real shifts (use only one of them). - rt1r = tr + rtdisc - rt2r = tr - rtdisc - if math.Abs(rt1r-h22) <= math.Abs(rt2r-h22) { - rt1r *= s - rt2r = rt1r - } else { - rt2r *= s - rt1r = rt2r - } - rt1i = 0 - rt2i = 0 - } - } - - // Look for two consecutive small subdiagonal elements. - var m int - var v [3]float64 - for m = i - 2; m >= l; m-- { - // Determine the effect of starting the - // double-shift QR iteration at row m, and see - // if this would make H[m,m-1] negligible. The - // following uses scaling to avoid overflows and - // most underflows. - h21s := h[(m+1)*ldh+m] - s := math.Abs(h[m*ldh+m]-rt2r) + math.Abs(rt2i) + math.Abs(h21s) - h21s /= s - v[0] = h21s*h[m*ldh+m+1] + (h[m*ldh+m]-rt1r)*((h[m*ldh+m]-rt2r)/s) - rt2i/s*rt1i - v[1] = h21s * (h[m*ldh+m] + h[(m+1)*ldh+m+1] - rt1r - rt2r) - v[2] = h21s * h[(m+2)*ldh+m+1] - s = math.Abs(v[0]) + math.Abs(v[1]) + math.Abs(v[2]) - v[0] /= s - v[1] /= s - v[2] /= s - if m == l { - break - } - dsum := math.Abs(h[(m-1)*ldh+m-1]) + math.Abs(h[m*ldh+m]) + math.Abs(h[(m+1)*ldh+m+1]) - if math.Abs(h[m*ldh+m-1])*(math.Abs(v[1])+math.Abs(v[2])) <= ulp*math.Abs(v[0])*dsum { - break - } - } - - // Double-shift QR step. - for k := m; k < i; k++ { - // The first iteration of this loop determines a - // reflection G from the vector V and applies it - // from left and right to H, thus creating a - // non-zero bulge below the subdiagonal. - // - // Each subsequent iteration determines a - // reflection G to restore the Hessenberg form - // in the (k-1)th column, and thus chases the - // bulge one step toward the bottom of the - // active submatrix. nr is the order of G. - - nr := min(3, i-k+1) - if k > m { - bi.Dcopy(nr, h[k*ldh+k-1:], ldh, v[:], 1) - } - var t0 float64 - v[0], t0 = impl.Dlarfg(nr, v[0], v[1:], 1) - if k > m { - h[k*ldh+k-1] = v[0] - h[(k+1)*ldh+k-1] = 0 - if k < i-1 { - h[(k+2)*ldh+k-1] = 0 - } - } else if m > l { - // Use the following instead of H[k,k-1] = -H[k,k-1] - // to avoid a bug when v[1] and v[2] underflow. - h[k*ldh+k-1] *= 1 - t0 - } - t1 := t0 * v[1] - if nr == 3 { - t2 := t0 * v[2] - - // Apply G from the left to transform - // the rows of the matrix in columns k - // to i2. - for j := k; j <= i2; j++ { - sum := h[k*ldh+j] + v[1]*h[(k+1)*ldh+j] + v[2]*h[(k+2)*ldh+j] - h[k*ldh+j] -= sum * t0 - h[(k+1)*ldh+j] -= sum * t1 - h[(k+2)*ldh+j] -= sum * t2 - } - - // Apply G from the right to transform - // the columns of the matrix in rows i1 - // to min(k+3,i). - for j := i1; j <= min(k+3, i); j++ { - sum := h[j*ldh+k] + v[1]*h[j*ldh+k+1] + v[2]*h[j*ldh+k+2] - h[j*ldh+k] -= sum * t0 - h[j*ldh+k+1] -= sum * t1 - h[j*ldh+k+2] -= sum * t2 - } - - if wantz { - // Accumulate transformations in the matrix Z. - for j := iloz; j <= ihiz; j++ { - sum := z[j*ldz+k] + v[1]*z[j*ldz+k+1] + v[2]*z[j*ldz+k+2] - z[j*ldz+k] -= sum * t0 - z[j*ldz+k+1] -= sum * t1 - z[j*ldz+k+2] -= sum * t2 - } - } - } else if nr == 2 { - // Apply G from the left to transform - // the rows of the matrix in columns k - // to i2. - for j := k; j <= i2; j++ { - sum := h[k*ldh+j] + v[1]*h[(k+1)*ldh+j] - h[k*ldh+j] -= sum * t0 - h[(k+1)*ldh+j] -= sum * t1 - } - - // Apply G from the right to transform - // the columns of the matrix in rows i1 - // to min(k+3,i). - for j := i1; j <= i; j++ { - sum := h[j*ldh+k] + v[1]*h[j*ldh+k+1] - h[j*ldh+k] -= sum * t0 - h[j*ldh+k+1] -= sum * t1 - } - - if wantz { - // Accumulate transformations in the matrix Z. - for j := iloz; j <= ihiz; j++ { - sum := z[j*ldz+k] + v[1]*z[j*ldz+k+1] - z[j*ldz+k] -= sum * t0 - z[j*ldz+k+1] -= sum * t1 - } - } - } - } - } - - if !converged { - // The QR iteration finished without splitting off a - // submatrix of order 1 or 2. - return i + 1 - } - - if l == i { - // H[i,i-1] is negligible: one eigenvalue has converged. - wr[i] = h[i*ldh+i] - wi[i] = 0 - } else if l == i-1 { - // H[i-1,i-2] is negligible: a pair of eigenvalues have converged. - - // Transform the 2×2 submatrix to standard Schur form, - // and compute and store the eigenvalues. - var cs, sn float64 - a, b := h[(i-1)*ldh+i-1], h[(i-1)*ldh+i] - c, d := h[i*ldh+i-1], h[i*ldh+i] - a, b, c, d, wr[i-1], wi[i-1], wr[i], wi[i], cs, sn = impl.Dlanv2(a, b, c, d) - h[(i-1)*ldh+i-1], h[(i-1)*ldh+i] = a, b - h[i*ldh+i-1], h[i*ldh+i] = c, d - - if wantt { - // Apply the transformation to the rest of H. - if i2 > i { - bi.Drot(i2-i, h[(i-1)*ldh+i+1:], 1, h[i*ldh+i+1:], 1, cs, sn) - } - bi.Drot(i-i1-1, h[i1*ldh+i-1:], ldh, h[i1*ldh+i:], ldh, cs, sn) - } - - if wantz { - // Apply the transformation to Z. - bi.Drot(nz, z[iloz*ldz+i-1:], ldz, z[iloz*ldz+i:], ldz, cs, sn) - } - } - - // Return to start of the main loop with new value of i. - i = l - 1 - } - return 0 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go deleted file mode 100644 index a47dc8fed..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlahr2.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlahr2 reduces the first nb columns of a real general n×(n-k+1) matrix A so -// that elements below the k-th subdiagonal are zero. The reduction is performed -// by an orthogonal similarity transformation Q^T * A * Q. Dlahr2 returns the -// matrices V and T which determine Q as a block reflector I - V*T*V^T, and -// also the matrix Y = A * V * T. -// -// The matrix Q is represented as a product of nb elementary reflectors -// Q = H_0 * H_1 * ... * H_{nb-1}. -// Each H_i has the form -// H_i = I - tau[i] * v * v^T, -// where v is a real vector with v[0:i+k-1] = 0 and v[i+k-1] = 1. v[i+k:n] is -// stored on exit in A[i+k+1:n,i]. -// -// The elements of the vectors v together form the (n-k+1)×nb matrix -// V which is needed, with T and Y, to apply the transformation to the -// unreduced part of the matrix, using an update of the form -// A = (I - V*T*V^T) * (A - Y*V^T). -// -// On entry, a contains the n×(n-k+1) general matrix A. On return, the elements -// on and above the k-th subdiagonal in the first nb columns are overwritten -// with the corresponding elements of the reduced matrix; the elements below the -// k-th subdiagonal, with the slice tau, represent the matrix Q as a product of -// elementary reflectors. The other columns of A are unchanged. -// -// The contents of A on exit are illustrated by the following example -// with n = 7, k = 3 and nb = 2: -// [ a a a a a ] -// [ a a a a a ] -// [ a a a a a ] -// [ h h a a a ] -// [ v0 h a a a ] -// [ v0 v1 a a a ] -// [ v0 v1 a a a ] -// where a denotes an element of the original matrix A, h denotes a -// modified element of the upper Hessenberg matrix H, and vi denotes an -// element of the vector defining H_i. -// -// k is the offset for the reduction. Elements below the k-th subdiagonal in the -// first nb columns are reduced to zero. -// -// nb is the number of columns to be reduced. -// -// On entry, a represents the n×(n-k+1) matrix A. On return, the elements on and -// above the k-th subdiagonal in the first nb columns are overwritten with the -// corresponding elements of the reduced matrix. The elements below the k-th -// subdiagonal, with the slice tau, represent the matrix Q as a product of -// elementary reflectors. The other columns of A are unchanged. -// -// tau will contain the scalar factors of the elementary reflectors. It must -// have length at least nb. -// -// t and ldt represent the nb×nb upper triangular matrix T, and y and ldy -// represent the n×nb matrix Y. -// -// Dlahr2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlahr2(n, k, nb int, a []float64, lda int, tau, t []float64, ldt int, y []float64, ldy int) { - switch { - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case lda < max(1, n-k+1): - panic(badLdA) - case ldt < max(1, nb): - panic(badLdT) - case ldy < max(1, nb): - panic(badLdY) - } - - // Quick return if possible. - if n < 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n-k+1: - panic(shortA) - case len(tau) < nb: - panic(shortTau) - case len(t) < (nb-1)*ldt+nb: - panic(shortT) - case len(y) < (n-1)*ldy+nb: - panic(shortY) - } - - // Quick return if possible. - if n == 1 { - return - } - - bi := blas64.Implementation() - var ei float64 - for i := 0; i < nb; i++ { - if i > 0 { - // Update A[k:n,i]. - - // Update i-th column of A - Y * V^T. - bi.Dgemv(blas.NoTrans, n-k, i, - -1, y[k*ldy:], ldy, - a[(k+i-1)*lda:], 1, - 1, a[k*lda+i:], lda) - - // Apply I - V * T^T * V^T to this column (call it b) - // from the left, using the last column of T as - // workspace. - // Let V = [ V1 ] and b = [ b1 ] (first i rows) - // [ V2 ] [ b2 ] - // where V1 is unit lower triangular. - // - // w := V1^T * b1. - bi.Dcopy(i, a[k*lda+i:], lda, t[nb-1:], ldt) - bi.Dtrmv(blas.Lower, blas.Trans, blas.Unit, i, - a[k*lda:], lda, t[nb-1:], ldt) - - // w := w + V2^T * b2. - bi.Dgemv(blas.Trans, n-k-i, i, - 1, a[(k+i)*lda:], lda, - a[(k+i)*lda+i:], lda, - 1, t[nb-1:], ldt) - - // w := T^T * w. - bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, i, - t, ldt, t[nb-1:], ldt) - - // b2 := b2 - V2*w. - bi.Dgemv(blas.NoTrans, n-k-i, i, - -1, a[(k+i)*lda:], lda, - t[nb-1:], ldt, - 1, a[(k+i)*lda+i:], lda) - - // b1 := b1 - V1*w. - bi.Dtrmv(blas.Lower, blas.NoTrans, blas.Unit, i, - a[k*lda:], lda, t[nb-1:], ldt) - bi.Daxpy(i, -1, t[nb-1:], ldt, a[k*lda+i:], lda) - - a[(k+i-1)*lda+i-1] = ei - } - - // Generate the elementary reflector H_i to annihilate - // A[k+i+1:n,i]. - ei, tau[i] = impl.Dlarfg(n-k-i, a[(k+i)*lda+i], a[min(k+i+1, n-1)*lda+i:], lda) - a[(k+i)*lda+i] = 1 - - // Compute Y[k:n,i]. - bi.Dgemv(blas.NoTrans, n-k, n-k-i, - 1, a[k*lda+i+1:], lda, - a[(k+i)*lda+i:], lda, - 0, y[k*ldy+i:], ldy) - bi.Dgemv(blas.Trans, n-k-i, i, - 1, a[(k+i)*lda:], lda, - a[(k+i)*lda+i:], lda, - 0, t[i:], ldt) - bi.Dgemv(blas.NoTrans, n-k, i, - -1, y[k*ldy:], ldy, - t[i:], ldt, - 1, y[k*ldy+i:], ldy) - bi.Dscal(n-k, tau[i], y[k*ldy+i:], ldy) - - // Compute T[0:i,i]. - bi.Dscal(i, -tau[i], t[i:], ldt) - bi.Dtrmv(blas.Upper, blas.NoTrans, blas.NonUnit, i, - t, ldt, t[i:], ldt) - - t[i*ldt+i] = tau[i] - } - a[(k+nb-1)*lda+nb-1] = ei - - // Compute Y[0:k,0:nb]. - impl.Dlacpy(blas.All, k, nb, a[1:], lda, y, ldy) - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, k, nb, - 1, a[k*lda:], lda, y, ldy) - if n > k+nb { - bi.Dgemm(blas.NoTrans, blas.NoTrans, k, nb, n-k-nb, - 1, a[1+nb:], lda, - a[(k+nb)*lda:], lda, - 1, y, ldy) - } - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.NonUnit, k, nb, - 1, t, ldt, y, ldy) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go deleted file mode 100644 index ca0b2f78c..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaln2.go +++ /dev/null @@ -1,405 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlaln2 solves a linear equation or a system of 2 linear equations of the form -// (ca A - w D) X = scale B, if trans == false, -// (ca A^T - w D) X = scale B, if trans == true, -// where A is a na×na real matrix, ca is a real scalar, D is a na×na diagonal -// real matrix, w is a scalar, real if nw == 1, complex if nw == 2, and X and B -// are na×1 matrices, real if w is real, complex if w is complex. -// -// If w is complex, X and B are represented as na×2 matrices, the first column -// of each being the real part and the second being the imaginary part. -// -// na and nw must be 1 or 2, otherwise Dlaln2 will panic. -// -// d1 and d2 are the diagonal elements of D. d2 is not used if na == 1. -// -// wr and wi represent the real and imaginary part, respectively, of the scalar -// w. wi is not used if nw == 1. -// -// smin is the desired lower bound on the singular values of A. This should be -// a safe distance away from underflow or overflow, say, between -// (underflow/machine precision) and (overflow*machine precision). -// -// If both singular values of (ca A - w D) are less than smin, smin*identity -// will be used instead of (ca A - w D). If only one singular value is less than -// smin, one element of (ca A - w D) will be perturbed enough to make the -// smallest singular value roughly smin. If both singular values are at least -// smin, (ca A - w D) will not be perturbed. In any case, the perturbation will -// be at most some small multiple of max(smin, ulp*norm(ca A - w D)). The -// singular values are computed by infinity-norm approximations, and thus will -// only be correct to a factor of 2 or so. -// -// All input quantities are assumed to be smaller than overflow by a reasonable -// factor. -// -// scale is a scaling factor less than or equal to 1 which is chosen so that X -// can be computed without overflow. X is further scaled if necessary to assure -// that norm(ca A - w D)*norm(X) is less than overflow. -// -// xnorm contains the infinity-norm of X when X is regarded as a na×nw real -// matrix. -// -// ok will be false if (ca A - w D) had to be perturbed to make its smallest -// singular value greater than smin, otherwise ok will be true. -// -// Dlaln2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaln2(trans bool, na, nw int, smin, ca float64, a []float64, lda int, d1, d2 float64, b []float64, ldb int, wr, wi float64, x []float64, ldx int) (scale, xnorm float64, ok bool) { - // TODO(vladimir-ch): Consider splitting this function into two, one - // handling the real case (nw == 1) and the other handling the complex - // case (nw == 2). Given that Go has complex types, their signatures - // would be simpler and more natural, and the implementation not as - // convoluted. - - switch { - case na != 1 && na != 2: - panic(badNa) - case nw != 1 && nw != 2: - panic(badNw) - case lda < na: - panic(badLdA) - case len(a) < (na-1)*lda+na: - panic(shortA) - case ldb < nw: - panic(badLdB) - case len(b) < (na-1)*ldb+nw: - panic(shortB) - case ldx < nw: - panic(badLdX) - case len(x) < (na-1)*ldx+nw: - panic(shortX) - } - - smlnum := 2 * dlamchS - bignum := 1 / smlnum - smini := math.Max(smin, smlnum) - - ok = true - scale = 1 - - if na == 1 { - // 1×1 (i.e., scalar) system C X = B. - - if nw == 1 { - // Real 1×1 system. - - // C = ca A - w D. - csr := ca*a[0] - wr*d1 - cnorm := math.Abs(csr) - - // If |C| < smini, use C = smini. - if cnorm < smini { - csr = smini - cnorm = smini - ok = false - } - - // Check scaling for X = B / C. - bnorm := math.Abs(b[0]) - if cnorm < 1 && bnorm > math.Max(1, bignum*cnorm) { - scale = 1 / bnorm - } - - // Compute X. - x[0] = b[0] * scale / csr - xnorm = math.Abs(x[0]) - - return scale, xnorm, ok - } - - // Complex 1×1 system (w is complex). - - // C = ca A - w D. - csr := ca*a[0] - wr*d1 - csi := -wi * d1 - cnorm := math.Abs(csr) + math.Abs(csi) - - // If |C| < smini, use C = smini. - if cnorm < smini { - csr = smini - csi = 0 - cnorm = smini - ok = false - } - - // Check scaling for X = B / C. - bnorm := math.Abs(b[0]) + math.Abs(b[1]) - if cnorm < 1 && bnorm > math.Max(1, bignum*cnorm) { - scale = 1 / bnorm - } - - // Compute X. - cx := complex(scale*b[0], scale*b[1]) / complex(csr, csi) - x[0], x[1] = real(cx), imag(cx) - xnorm = math.Abs(x[0]) + math.Abs(x[1]) - - return scale, xnorm, ok - } - - // 2×2 system. - - // Compute the real part of - // C = ca A - w D - // or - // C = ca A^T - w D. - crv := [4]float64{ - ca*a[0] - wr*d1, - ca * a[1], - ca * a[lda], - ca*a[lda+1] - wr*d2, - } - if trans { - crv[1] = ca * a[lda] - crv[2] = ca * a[1] - } - - pivot := [4][4]int{ - {0, 1, 2, 3}, - {1, 0, 3, 2}, - {2, 3, 0, 1}, - {3, 2, 1, 0}, - } - - if nw == 1 { - // Real 2×2 system (w is real). - - // Find the largest element in C. - var cmax float64 - var icmax int - for j, v := range crv { - v = math.Abs(v) - if v > cmax { - cmax = v - icmax = j - } - } - - // If norm(C) < smini, use smini*identity. - if cmax < smini { - bnorm := math.Max(math.Abs(b[0]), math.Abs(b[ldb])) - if smini < 1 && bnorm > math.Max(1, bignum*smini) { - scale = 1 / bnorm - } - temp := scale / smini - x[0] = temp * b[0] - x[ldx] = temp * b[ldb] - xnorm = temp * bnorm - ok = false - - return scale, xnorm, ok - } - - // Gaussian elimination with complete pivoting. - // Form upper triangular matrix - // [ur11 ur12] - // [ 0 ur22] - ur11 := crv[icmax] - ur12 := crv[pivot[icmax][1]] - cr21 := crv[pivot[icmax][2]] - cr22 := crv[pivot[icmax][3]] - ur11r := 1 / ur11 - lr21 := ur11r * cr21 - ur22 := cr22 - ur12*lr21 - - // If smaller pivot < smini, use smini. - if math.Abs(ur22) < smini { - ur22 = smini - ok = false - } - - var br1, br2 float64 - if icmax > 1 { - // If the pivot lies in the second row, swap the rows. - br1 = b[ldb] - br2 = b[0] - } else { - br1 = b[0] - br2 = b[ldb] - } - br2 -= lr21 * br1 // Apply the Gaussian elimination step to the right-hand side. - - bbnd := math.Max(math.Abs(ur22*ur11r*br1), math.Abs(br2)) - if bbnd > 1 && math.Abs(ur22) < 1 && bbnd >= bignum*math.Abs(ur22) { - scale = 1 / bbnd - } - - // Solve the linear system ur*xr=br. - xr2 := br2 * scale / ur22 - xr1 := scale*br1*ur11r - ur11r*ur12*xr2 - if icmax&0x1 != 0 { - // If the pivot lies in the second column, swap the components of the solution. - x[0] = xr2 - x[ldx] = xr1 - } else { - x[0] = xr1 - x[ldx] = xr2 - } - xnorm = math.Max(math.Abs(xr1), math.Abs(xr2)) - - // Further scaling if norm(A)*norm(X) > overflow. - if xnorm > 1 && cmax > 1 && xnorm > bignum/cmax { - temp := cmax / bignum - x[0] *= temp - x[ldx] *= temp - xnorm *= temp - scale *= temp - } - - return scale, xnorm, ok - } - - // Complex 2×2 system (w is complex). - - // Find the largest element in C. - civ := [4]float64{ - -wi * d1, - 0, - 0, - -wi * d2, - } - var cmax float64 - var icmax int - for j, v := range crv { - v := math.Abs(v) - if v+math.Abs(civ[j]) > cmax { - cmax = v + math.Abs(civ[j]) - icmax = j - } - } - - // If norm(C) < smini, use smini*identity. - if cmax < smini { - br1 := math.Abs(b[0]) + math.Abs(b[1]) - br2 := math.Abs(b[ldb]) + math.Abs(b[ldb+1]) - bnorm := math.Max(br1, br2) - if smini < 1 && bnorm > 1 && bnorm > bignum*smini { - scale = 1 / bnorm - } - temp := scale / smini - x[0] = temp * b[0] - x[1] = temp * b[1] - x[ldb] = temp * b[ldb] - x[ldb+1] = temp * b[ldb+1] - xnorm = temp * bnorm - ok = false - - return scale, xnorm, ok - } - - // Gaussian elimination with complete pivoting. - ur11 := crv[icmax] - ui11 := civ[icmax] - ur12 := crv[pivot[icmax][1]] - ui12 := civ[pivot[icmax][1]] - cr21 := crv[pivot[icmax][2]] - ci21 := civ[pivot[icmax][2]] - cr22 := crv[pivot[icmax][3]] - ci22 := civ[pivot[icmax][3]] - var ( - ur11r, ui11r float64 - lr21, li21 float64 - ur12s, ui12s float64 - ur22, ui22 float64 - ) - if icmax == 0 || icmax == 3 { - // Off-diagonals of pivoted C are real. - if math.Abs(ur11) > math.Abs(ui11) { - temp := ui11 / ur11 - ur11r = 1 / (ur11 * (1 + temp*temp)) - ui11r = -temp * ur11r - } else { - temp := ur11 / ui11 - ui11r = -1 / (ui11 * (1 + temp*temp)) - ur11r = -temp * ui11r - } - lr21 = cr21 * ur11r - li21 = cr21 * ui11r - ur12s = ur12 * ur11r - ui12s = ur12 * ui11r - ur22 = cr22 - ur12*lr21 - ui22 = ci22 - ur12*li21 - } else { - // Diagonals of pivoted C are real. - ur11r = 1 / ur11 - // ui11r is already 0. - lr21 = cr21 * ur11r - li21 = ci21 * ur11r - ur12s = ur12 * ur11r - ui12s = ui12 * ur11r - ur22 = cr22 - ur12*lr21 + ui12*li21 - ui22 = -ur12*li21 - ui12*lr21 - } - u22abs := math.Abs(ur22) + math.Abs(ui22) - - // If smaller pivot < smini, use smini. - if u22abs < smini { - ur22 = smini - ui22 = 0 - ok = false - } - - var br1, bi1 float64 - var br2, bi2 float64 - if icmax > 1 { - // If the pivot lies in the second row, swap the rows. - br1 = b[ldb] - bi1 = b[ldb+1] - br2 = b[0] - bi2 = b[1] - } else { - br1 = b[0] - bi1 = b[1] - br2 = b[ldb] - bi2 = b[ldb+1] - } - br2 += -lr21*br1 + li21*bi1 - bi2 += -li21*br1 - lr21*bi1 - - bbnd1 := u22abs * (math.Abs(ur11r) + math.Abs(ui11r)) * (math.Abs(br1) + math.Abs(bi1)) - bbnd2 := math.Abs(br2) + math.Abs(bi2) - bbnd := math.Max(bbnd1, bbnd2) - if bbnd > 1 && u22abs < 1 && bbnd >= bignum*u22abs { - scale = 1 / bbnd - br1 *= scale - bi1 *= scale - br2 *= scale - bi2 *= scale - } - - cx2 := complex(br2, bi2) / complex(ur22, ui22) - xr2, xi2 := real(cx2), imag(cx2) - xr1 := ur11r*br1 - ui11r*bi1 - ur12s*xr2 + ui12s*xi2 - xi1 := ui11r*br1 + ur11r*bi1 - ui12s*xr2 - ur12s*xi2 - if icmax&0x1 != 0 { - // If the pivot lies in the second column, swap the components of the solution. - x[0] = xr2 - x[1] = xi2 - x[ldx] = xr1 - x[ldx+1] = xi1 - } else { - x[0] = xr1 - x[1] = xi1 - x[ldx] = xr2 - x[ldx+1] = xi2 - } - xnorm = math.Max(math.Abs(xr1)+math.Abs(xi1), math.Abs(xr2)+math.Abs(xi2)) - - // Further scaling if norm(A)*norm(X) > overflow. - if xnorm > 1 && cmax > 1 && xnorm > bignum/cmax { - temp := cmax / bignum - x[0] *= temp - x[1] *= temp - x[ldx] *= temp - x[ldx+1] *= temp - xnorm *= temp - scale *= temp - } - - return scale, xnorm, ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go deleted file mode 100644 index 9edfa83c4..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlange.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlange computes the matrix norm of the general m×n matrix a. The input norm -// specifies the norm computed. -// lapack.MaxAbs: the maximum absolute value of an element. -// lapack.MaxColumnSum: the maximum column sum of the absolute values of the entries. -// lapack.MaxRowSum: the maximum row sum of the absolute values of the entries. -// lapack.Frobenius: the square root of the sum of the squares of the entries. -// If norm == lapack.MaxColumnSum, work must be of length n, and this function will panic otherwise. -// There are no restrictions on work for the other matrix norms. -func (impl Implementation) Dlange(norm lapack.MatrixNorm, m, n int, a []float64, lda int, work []float64) float64 { - // TODO(btracey): These should probably be refactored to use BLAS calls. - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(badLdA) - case norm == lapack.MaxColumnSum && len(work) < n: - panic(shortWork) - } - - if norm == lapack.MaxAbs { - var value float64 - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - value = math.Max(value, math.Abs(a[i*lda+j])) - } - } - return value - } - if norm == lapack.MaxColumnSum { - if len(work) < n { - panic(shortWork) - } - for i := 0; i < n; i++ { - work[i] = 0 - } - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - var value float64 - for i := 0; i < n; i++ { - value = math.Max(value, work[i]) - } - return value - } - if norm == lapack.MaxRowSum { - var value float64 - for i := 0; i < m; i++ { - var sum float64 - for j := 0; j < n; j++ { - sum += math.Abs(a[i*lda+j]) - } - value = math.Max(value, sum) - } - return value - } - // norm == lapack.Frobenius - var value float64 - scale := 0.0 - sum := 1.0 - for i := 0; i < m; i++ { - scale, sum = impl.Dlassq(n, a[i*lda:], 1, scale, sum) - } - value = scale * math.Sqrt(sum) - return value -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go deleted file mode 100644 index 9ca1897e3..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanst.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlanst computes the specified norm of a symmetric tridiagonal matrix A. -// The diagonal elements of A are stored in d and the off-diagonal elements -// are stored in e. -func (impl Implementation) Dlanst(norm lapack.MatrixNorm, n int, d, e []float64) float64 { - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case n < 0: - panic(nLT0) - } - if n == 0 { - return 0 - } - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - } - - switch norm { - default: - panic(badNorm) - case lapack.MaxAbs: - anorm := math.Abs(d[n-1]) - for i := 0; i < n-1; i++ { - sum := math.Abs(d[i]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - sum = math.Abs(e[i]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - } - return anorm - case lapack.MaxColumnSum, lapack.MaxRowSum: - if n == 1 { - return math.Abs(d[0]) - } - anorm := math.Abs(d[0]) + math.Abs(e[0]) - sum := math.Abs(e[n-2]) + math.Abs(d[n-1]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - for i := 1; i < n-1; i++ { - sum := math.Abs(d[i]) + math.Abs(e[i]) + math.Abs(e[i-1]) - if anorm < sum || math.IsNaN(sum) { - anorm = sum - } - } - return anorm - case lapack.Frobenius: - var scale float64 - sum := 1.0 - if n > 1 { - scale, sum = impl.Dlassq(n-1, e, 1, scale, sum) - sum = 2 * sum - } - scale, sum = impl.Dlassq(n, d, 1, scale, sum) - return scale * math.Sqrt(sum) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go deleted file mode 100644 index 97ba5b243..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlansy.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlansy computes the specified norm of an n×n symmetric matrix. If -// norm == lapack.MaxColumnSum or norm == lapackMaxRowSum work must have length -// at least n, otherwise work is unused. -func (impl Implementation) Dlansy(norm lapack.MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64 { - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case (norm == lapack.MaxColumnSum || norm == lapack.MaxRowSum) && len(work) < n: - panic(shortWork) - } - - switch norm { - default: - panic(badNorm) - case lapack.MaxAbs: - if uplo == blas.Upper { - var max float64 - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - v := math.Abs(a[i*lda+j]) - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - } - return max - } - var max float64 - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - v := math.Abs(a[i*lda+j]) - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - } - return max - case lapack.MaxRowSum, lapack.MaxColumnSum: - // A symmetric matrix has the same 1-norm and ∞-norm. - for i := 0; i < n; i++ { - work[i] = 0 - } - if uplo == blas.Upper { - for i := 0; i < n; i++ { - work[i] += math.Abs(a[i*lda+i]) - for j := i + 1; j < n; j++ { - v := math.Abs(a[i*lda+j]) - work[i] += v - work[j] += v - } - } - } else { - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - v := math.Abs(a[i*lda+j]) - work[i] += v - work[j] += v - } - work[i] += math.Abs(a[i*lda+i]) - } - } - var max float64 - for i := 0; i < n; i++ { - v := work[i] - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - return max - case lapack.Frobenius: - if uplo == blas.Upper { - var sum float64 - for i := 0; i < n; i++ { - v := a[i*lda+i] - sum += v * v - for j := i + 1; j < n; j++ { - v := a[i*lda+j] - sum += 2 * v * v - } - } - return math.Sqrt(sum) - } - var sum float64 - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - v := a[i*lda+j] - sum += 2 * v * v - } - v := a[i*lda+i] - sum += v * v - } - return math.Sqrt(sum) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go deleted file mode 100644 index cc96391d9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlantr.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlantr computes the specified norm of an m×n trapezoidal matrix A. If -// norm == lapack.MaxColumnSum work must have length at least n, otherwise work -// is unused. -func (impl Implementation) Dlantr(norm lapack.MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64 { - switch { - case norm != lapack.MaxRowSum && norm != lapack.MaxColumnSum && norm != lapack.Frobenius && norm != lapack.MaxAbs: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - minmn := min(m, n) - if minmn == 0 { - return 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case norm == lapack.MaxColumnSum && len(work) < n: - panic(shortWork) - } - - switch norm { - default: - panic(badNorm) - case lapack.MaxAbs: - if diag == blas.Unit { - value := 1.0 - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - } - for i := 1; i < m; i++ { - for j := 0; j < min(i, n); j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - } - var value float64 - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - } - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - tmp := math.Abs(a[i*lda+j]) - if math.IsNaN(tmp) { - return tmp - } - if tmp > value { - value = tmp - } - } - } - return value - case lapack.MaxColumnSum: - if diag == blas.Unit { - for i := 0; i < minmn; i++ { - work[i] = 1 - } - for i := minmn; i < n; i++ { - work[i] = 0 - } - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } else { - for i := 1; i < m; i++ { - for j := 0; j < min(i, n); j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } - } else { - for i := 0; i < n; i++ { - work[i] = 0 - } - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - work[j] += math.Abs(a[i*lda+j]) - } - } - } - } - var max float64 - for _, v := range work[:n] { - if math.IsNaN(v) { - return math.NaN() - } - if v > max { - max = v - } - } - return max - case lapack.MaxRowSum: - var maxsum float64 - if diag == blas.Unit { - if uplo == blas.Upper { - for i := 0; i < m; i++ { - var sum float64 - if i < minmn { - sum = 1 - } - for j := i + 1; j < n; j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return math.NaN() - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } else { - for i := 1; i < m; i++ { - var sum float64 - if i < minmn { - sum = 1 - } - for j := 0; j < min(i, n); j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return math.NaN() - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } - } else { - if uplo == blas.Upper { - for i := 0; i < m; i++ { - var sum float64 - for j := i; j < n; j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return sum - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } else { - for i := 0; i < m; i++ { - var sum float64 - for j := 0; j <= min(i, n-1); j++ { - sum += math.Abs(a[i*lda+j]) - } - if math.IsNaN(sum) { - return sum - } - if sum > maxsum { - maxsum = sum - } - } - return maxsum - } - } - case lapack.Frobenius: - var nrm float64 - if diag == blas.Unit { - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - tmp := a[i*lda+j] - nrm += tmp * tmp - } - } - } else { - for i := 1; i < m; i++ { - for j := 0; j < min(i, n); j++ { - tmp := a[i*lda+j] - nrm += tmp * tmp - } - } - } - nrm += float64(minmn) - } else { - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - tmp := math.Abs(a[i*lda+j]) - nrm += tmp * tmp - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - tmp := math.Abs(a[i*lda+j]) - nrm += tmp * tmp - } - } - } - } - return math.Sqrt(nrm) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go deleted file mode 100644 index e5dcfb752..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlanv2.go +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlanv2 computes the Schur factorization of a real 2×2 matrix: -// [ a b ] = [ cs -sn ] * [ aa bb ] * [ cs sn ] -// [ c d ] [ sn cs ] [ cc dd ] * [-sn cs ] -// If cc is zero, aa and dd are real eigenvalues of the matrix. Otherwise it -// holds that aa = dd and bb*cc < 0, and aa ± sqrt(bb*cc) are complex conjugate -// eigenvalues. The real and imaginary parts of the eigenvalues are returned in -// (rt1r,rt1i) and (rt2r,rt2i). -func (impl Implementation) Dlanv2(a, b, c, d float64) (aa, bb, cc, dd float64, rt1r, rt1i, rt2r, rt2i float64, cs, sn float64) { - switch { - case c == 0: // Matrix is already upper triangular. - aa = a - bb = b - cc = 0 - dd = d - cs = 1 - sn = 0 - case b == 0: // Matrix is lower triangular, swap rows and columns. - aa = d - bb = -c - cc = 0 - dd = a - cs = 0 - sn = 1 - case a == d && math.Signbit(b) != math.Signbit(c): // Matrix is already in the standard Schur form. - aa = a - bb = b - cc = c - dd = d - cs = 1 - sn = 0 - default: - temp := a - d - p := temp / 2 - bcmax := math.Max(math.Abs(b), math.Abs(c)) - bcmis := math.Min(math.Abs(b), math.Abs(c)) - if b*c < 0 { - bcmis *= -1 - } - scale := math.Max(math.Abs(p), bcmax) - z := p/scale*p + bcmax/scale*bcmis - eps := dlamchP - - if z >= 4*eps { - // Real eigenvalues. Compute aa and dd. - if p > 0 { - z = p + math.Sqrt(scale)*math.Sqrt(z) - } else { - z = p - math.Sqrt(scale)*math.Sqrt(z) - } - aa = d + z - dd = d - bcmax/z*bcmis - // Compute bb and the rotation matrix. - tau := impl.Dlapy2(c, z) - cs = z / tau - sn = c / tau - bb = b - c - cc = 0 - } else { - // Complex eigenvalues, or real (almost) equal eigenvalues. - // Make diagonal elements equal. - sigma := b + c - tau := impl.Dlapy2(sigma, temp) - cs = math.Sqrt((1 + math.Abs(sigma)/tau) / 2) - sn = -p / (tau * cs) - if sigma < 0 { - sn *= -1 - } - // Compute [ aa bb ] = [ a b ] [ cs -sn ] - // [ cc dd ] [ c d ] [ sn cs ] - aa = a*cs + b*sn - bb = -a*sn + b*cs - cc = c*cs + d*sn - dd = -c*sn + d*cs - // Compute [ a b ] = [ cs sn ] [ aa bb ] - // [ c d ] [-sn cs ] [ cc dd ] - a = aa*cs + cc*sn - b = bb*cs + dd*sn - c = -aa*sn + cc*cs - d = -bb*sn + dd*cs - - temp = (a + d) / 2 - aa = temp - bb = b - cc = c - dd = temp - - if cc != 0 { - if bb != 0 { - if math.Signbit(bb) == math.Signbit(cc) { - // Real eigenvalues, reduce to - // upper triangular form. - sab := math.Sqrt(math.Abs(bb)) - sac := math.Sqrt(math.Abs(cc)) - p = sab * sac - if cc < 0 { - p *= -1 - } - tau = 1 / math.Sqrt(math.Abs(bb+cc)) - aa = temp + p - bb = bb - cc - cc = 0 - dd = temp - p - cs1 := sab * tau - sn1 := sac * tau - cs, sn = cs*cs1-sn*sn1, cs*sn1+sn+cs1 - } - } else { - bb = -cc - cc = 0 - cs, sn = -sn, cs - } - } - } - } - - // Store eigenvalues in (rt1r,rt1i) and (rt2r,rt2i). - rt1r = aa - rt2r = dd - if cc != 0 { - rt1i = math.Sqrt(math.Abs(bb)) * math.Sqrt(math.Abs(cc)) - rt2i = -rt1i - } - return -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go deleted file mode 100644 index bf98c338e..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapll.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas/blas64" - -// Dlapll returns the smallest singular value of the n×2 matrix A = [ x y ]. -// The function first computes the QR factorization of A = Q*R, and then computes -// the SVD of the 2-by-2 upper triangular matrix r. -// -// The contents of x and y are overwritten during the call. -// -// Dlapll is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlapll(n int, x []float64, incX int, y []float64, incY int) float64 { - switch { - case n < 0: - panic(nLT0) - case incX <= 0: - panic(badIncX) - case incY <= 0: - panic(badIncY) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(x) < 1+(n-1)*incX: - panic(shortX) - case len(y) < 1+(n-1)*incY: - panic(shortY) - } - - // Quick return if possible. - if n == 1 { - return 0 - } - - // Compute the QR factorization of the N-by-2 matrix [ X Y ]. - a00, tau := impl.Dlarfg(n, x[0], x[incX:], incX) - x[0] = 1 - - bi := blas64.Implementation() - c := -tau * bi.Ddot(n, x, incX, y, incY) - bi.Daxpy(n, c, x, incX, y, incY) - a11, _ := impl.Dlarfg(n-1, y[incY], y[2*incY:], incY) - - // Compute the SVD of 2-by-2 upper triangular matrix. - ssmin, _ := impl.Dlas2(a00, y[0], a11) - return ssmin -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go deleted file mode 100644 index 55f1567f3..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapmt.go +++ /dev/null @@ -1,89 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas/blas64" - -// Dlapmt rearranges the columns of the m×n matrix X as specified by the -// permutation k_0, k_1, ..., k_n-1 of the integers 0, ..., n-1. -// -// If forward is true a forward permutation is performed: -// -// X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1. -// -// otherwise a backward permutation is performed: -// -// X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1. -// -// k must have length n, otherwise Dlapmt will panic. k is zero-indexed. -func (impl Implementation) Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case ldx < max(1, n): - panic(badLdX) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - switch { - case len(x) < (m-1)*ldx+n: - panic(shortX) - case len(k) != n: - panic(badLenK) - } - - // Quick return if possible. - if n == 1 { - return - } - - for i, v := range k { - v++ - k[i] = -v - } - - bi := blas64.Implementation() - - if forward { - for j, v := range k { - if v >= 0 { - continue - } - k[j] = -v - i := -v - 1 - for k[i] < 0 { - bi.Dswap(m, x[j:], ldx, x[i:], ldx) - - k[i] = -k[i] - j = i - i = k[i] - 1 - } - } - } else { - for i, v := range k { - if v >= 0 { - continue - } - k[i] = -v - j := -v - 1 - for j != i { - bi.Dswap(m, x[j:], ldx, x[i:], ldx) - - k[j] = -k[j] - j = k[j] - 1 - } - } - } - - for i := range k { - k[i]-- - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go deleted file mode 100644 index 19f73ffab..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlapy2.go +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlapy2 is the LAPACK version of math.Hypot. -// -// Dlapy2 is an internal routine. It is exported for testing purposes. -func (Implementation) Dlapy2(x, y float64) float64 { - return math.Hypot(x, y) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go deleted file mode 100644 index d3a0def63..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqp2.go +++ /dev/null @@ -1,127 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlaqp2 computes a QR factorization with column pivoting of the block A[offset:m, 0:n] -// of the m×n matrix A. The block A[0:offset, 0:n] is accordingly pivoted, but not factorized. -// -// On exit, the upper triangle of block A[offset:m, 0:n] is the triangular factor obtained. -// The elements in block A[offset:m, 0:n] below the diagonal, together with tau, represent -// the orthogonal matrix Q as a product of elementary reflectors. -// -// offset is number of rows of the matrix A that must be pivoted but not factorized. -// offset must not be negative otherwise Dlaqp2 will panic. -// -// On exit, jpvt holds the permutation that was applied; the jth column of A*P was the -// jpvt[j] column of A. jpvt must have length n, otherwise Dlaqp2 will panic. -// -// On exit tau holds the scalar factors of the elementary reflectors. It must have length -// at least min(m-offset, n) otherwise Dlaqp2 will panic. -// -// vn1 and vn2 hold the partial and complete column norms respectively. They must have length n, -// otherwise Dlaqp2 will panic. -// -// work must have length n, otherwise Dlaqp2 will panic. -// -// Dlaqp2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqp2(m, n, offset int, a []float64, lda int, jpvt []int, tau, vn1, vn2, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case offset < 0: - panic(offsetLT0) - case offset > m: - panic(offsetGTM) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - mn := min(m-offset, n) - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(jpvt) != n: - panic(badLenJpvt) - case len(tau) < mn: - panic(shortTau) - case len(vn1) < n: - panic(shortVn1) - case len(vn2) < n: - panic(shortVn2) - case len(work) < n: - panic(shortWork) - } - - tol3z := math.Sqrt(dlamchE) - - bi := blas64.Implementation() - - // Compute factorization. - for i := 0; i < mn; i++ { - offpi := offset + i - - // Determine ith pivot column and swap if necessary. - p := i + bi.Idamax(n-i, vn1[i:], 1) - if p != i { - bi.Dswap(m, a[p:], lda, a[i:], lda) - jpvt[p], jpvt[i] = jpvt[i], jpvt[p] - vn1[p] = vn1[i] - vn2[p] = vn2[i] - } - - // Generate elementary reflector H_i. - if offpi < m-1 { - a[offpi*lda+i], tau[i] = impl.Dlarfg(m-offpi, a[offpi*lda+i], a[(offpi+1)*lda+i:], lda) - } else { - tau[i] = 0 - } - - if i < n-1 { - // Apply H_i^T to A[offset+i:m, i:n] from the left. - aii := a[offpi*lda+i] - a[offpi*lda+i] = 1 - impl.Dlarf(blas.Left, m-offpi, n-i-1, a[offpi*lda+i:], lda, tau[i], a[offpi*lda+i+1:], lda, work) - a[offpi*lda+i] = aii - } - - // Update partial column norms. - for j := i + 1; j < n; j++ { - if vn1[j] == 0 { - continue - } - - // The following marked lines follow from the - // analysis in Lapack Working Note 176. - r := math.Abs(a[offpi*lda+j]) / vn1[j] // * - temp := math.Max(0, 1-r*r) // * - r = vn1[j] / vn2[j] // * - temp2 := temp * r * r // * - if temp2 < tol3z { - var v float64 - if offpi < m-1 { - v = bi.Dnrm2(m-offpi-1, a[(offpi+1)*lda+j:], lda) - } - vn1[j] = v - vn2[j] = v - } else { - vn1[j] *= math.Sqrt(temp) // * - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go deleted file mode 100644 index dd683b62a..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqps.go +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlaqps computes a step of QR factorization with column pivoting -// of an m×n matrix A by using Blas-3. It tries to factorize nb -// columns from A starting from the row offset, and updates all -// of the matrix with Dgemm. -// -// In some cases, due to catastrophic cancellations, it cannot -// factorize nb columns. Hence, the actual number of factorized -// columns is returned in kb. -// -// Dlaqps computes a QR factorization with column pivoting of the -// block A[offset:m, 0:nb] of the m×n matrix A. The block -// A[0:offset, 0:n] is accordingly pivoted, but not factorized. -// -// On exit, the upper triangle of block A[offset:m, 0:kb] is the -// triangular factor obtained. The elements in block A[offset:m, 0:n] -// below the diagonal, together with tau, represent the orthogonal -// matrix Q as a product of elementary reflectors. -// -// offset is number of rows of the matrix A that must be pivoted but -// not factorized. offset must not be negative otherwise Dlaqps will panic. -// -// On exit, jpvt holds the permutation that was applied; the jth column -// of A*P was the jpvt[j] column of A. jpvt must have length n, -// otherwise Dlapqs will panic. -// -// On exit tau holds the scalar factors of the elementary reflectors. -// It must have length nb, otherwise Dlapqs will panic. -// -// vn1 and vn2 hold the partial and complete column norms respectively. -// They must have length n, otherwise Dlapqs will panic. -// -// auxv must have length nb, otherwise Dlaqps will panic. -// -// f and ldf represent an n×nb matrix F that is overwritten during the -// call. -// -// Dlaqps is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqps(m, n, offset, nb int, a []float64, lda int, jpvt []int, tau, vn1, vn2, auxv, f []float64, ldf int) (kb int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case offset < 0: - panic(offsetLT0) - case offset > m: - panic(offsetGTM) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case lda < max(1, n): - panic(badLdA) - case ldf < max(1, nb): - panic(badLdF) - } - - if m == 0 || n == 0 { - return 0 - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(jpvt) != n: - panic(badLenJpvt) - case len(vn1) < n: - panic(shortVn1) - case len(vn2) < n: - panic(shortVn2) - } - - if nb == 0 { - return 0 - } - - switch { - case len(tau) < nb: - panic(shortTau) - case len(auxv) < nb: - panic(shortAuxv) - case len(f) < (n-1)*ldf+nb: - panic(shortF) - } - - if offset == m { - return 0 - } - - lastrk := min(m, n+offset) - lsticc := -1 - tol3z := math.Sqrt(dlamchE) - - bi := blas64.Implementation() - - var k, rk int - for ; k < nb && lsticc == -1; k++ { - rk = offset + k - - // Determine kth pivot column and swap if necessary. - p := k + bi.Idamax(n-k, vn1[k:], 1) - if p != k { - bi.Dswap(m, a[p:], lda, a[k:], lda) - bi.Dswap(k, f[p*ldf:], 1, f[k*ldf:], 1) - jpvt[p], jpvt[k] = jpvt[k], jpvt[p] - vn1[p] = vn1[k] - vn2[p] = vn2[k] - } - - // Apply previous Householder reflectors to column K: - // - // A[rk:m, k] = A[rk:m, k] - A[rk:m, 0:k-1]*F[k, 0:k-1]^T. - if k > 0 { - bi.Dgemv(blas.NoTrans, m-rk, k, -1, - a[rk*lda:], lda, - f[k*ldf:], 1, - 1, - a[rk*lda+k:], lda) - } - - // Generate elementary reflector H_k. - if rk < m-1 { - a[rk*lda+k], tau[k] = impl.Dlarfg(m-rk, a[rk*lda+k], a[(rk+1)*lda+k:], lda) - } else { - tau[k] = 0 - } - - akk := a[rk*lda+k] - a[rk*lda+k] = 1 - - // Compute kth column of F: - // - // Compute F[k+1:n, k] = tau[k]*A[rk:m, k+1:n]^T*A[rk:m, k]. - if k < n-1 { - bi.Dgemv(blas.Trans, m-rk, n-k-1, tau[k], - a[rk*lda+k+1:], lda, - a[rk*lda+k:], lda, - 0, - f[(k+1)*ldf+k:], ldf) - } - - // Padding F[0:k, k] with zeros. - for j := 0; j < k; j++ { - f[j*ldf+k] = 0 - } - - // Incremental updating of F: - // - // F[0:n, k] := F[0:n, k] - tau[k]*F[0:n, 0:k-1]*A[rk:m, 0:k-1]^T*A[rk:m,k]. - if k > 0 { - bi.Dgemv(blas.Trans, m-rk, k, -tau[k], - a[rk*lda:], lda, - a[rk*lda+k:], lda, - 0, - auxv, 1) - bi.Dgemv(blas.NoTrans, n, k, 1, - f, ldf, - auxv, 1, - 1, - f[k:], ldf) - } - - // Update the current row of A: - // - // A[rk, k+1:n] = A[rk, k+1:n] - A[rk, 0:k]*F[k+1:n, 0:k]^T. - if k < n-1 { - bi.Dgemv(blas.NoTrans, n-k-1, k+1, -1, - f[(k+1)*ldf:], ldf, - a[rk*lda:], 1, - 1, - a[rk*lda+k+1:], 1) - } - - // Update partial column norms. - if rk < lastrk-1 { - for j := k + 1; j < n; j++ { - if vn1[j] == 0 { - continue - } - - // The following marked lines follow from the - // analysis in Lapack Working Note 176. - r := math.Abs(a[rk*lda+j]) / vn1[j] // * - temp := math.Max(0, 1-r*r) // * - r = vn1[j] / vn2[j] // * - temp2 := temp * r * r // * - if temp2 < tol3z { - // vn2 is used here as a collection of - // indices into vn2 and also a collection - // of column norms. - vn2[j] = float64(lsticc) - lsticc = j - } else { - vn1[j] *= math.Sqrt(temp) // * - } - } - } - - a[rk*lda+k] = akk - } - kb = k - rk = offset + kb - - // Apply the block reflector to the rest of the matrix: - // - // A[offset+kb+1:m, kb+1:n] := A[offset+kb+1:m, kb+1:n] - A[offset+kb+1:m, 1:kb]*F[kb+1:n, 1:kb]^T. - if kb < min(n, m-offset) { - bi.Dgemm(blas.NoTrans, blas.Trans, - m-rk, n-kb, kb, -1, - a[rk*lda:], lda, - f[kb*ldf:], ldf, - 1, - a[rk*lda+kb:], lda) - } - - // Recomputation of difficult columns. - for lsticc >= 0 { - itemp := int(vn2[lsticc]) - - // NOTE: The computation of vn1[lsticc] relies on the fact that - // Dnrm2 does not fail on vectors with norm below the value of - // sqrt(dlamchS) - v := bi.Dnrm2(m-rk, a[rk*lda+lsticc:], lda) - vn1[lsticc] = v - vn2[lsticc] = v - - lsticc = itemp - } - - return kb -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go deleted file mode 100644 index e9fbb6007..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr04.go +++ /dev/null @@ -1,478 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" -) - -// Dlaqr04 computes the eigenvalues of a block of an n×n upper Hessenberg matrix -// H, and optionally the matrices T and Z from the Schur decomposition -// H = Z T Z^T -// where T is an upper quasi-triangular matrix (the Schur form), and Z is the -// orthogonal matrix of Schur vectors. -// -// wantt indicates whether the full Schur form T is required. If wantt is false, -// then only enough of H will be updated to preserve the eigenvalues. -// -// wantz indicates whether the n×n matrix of Schur vectors Z is required. If it -// is true, the orthogonal similarity transformation will be accumulated into -// Z[iloz:ihiz+1,ilo:ihi+1], otherwise Z will not be referenced. -// -// ilo and ihi determine the block of H on which Dlaqr04 operates. It must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0, -// and the block must be isolated, that is, -// ilo == 0 or H[ilo,ilo-1] == 0, -// ihi == n-1 or H[ihi+1,ihi] == 0, -// otherwise Dlaqr04 will panic. -// -// wr and wi must have length ihi+1. -// -// iloz and ihiz specify the rows of Z to which transformations will be applied -// if wantz is true. It must hold that -// 0 <= iloz <= ilo, and ihi <= ihiz < n, -// otherwise Dlaqr04 will panic. -// -// work must have length at least lwork and lwork must be -// lwork >= 1, if n <= 11, -// lwork >= n, if n > 11, -// otherwise Dlaqr04 will panic. lwork as large as 6*n may be required for -// optimal performance. On return, work[0] will contain the optimal value of -// lwork. -// -// If lwork is -1, instead of performing Dlaqr04, the function only estimates the -// optimal workspace size and stores it into work[0]. Neither h nor z are -// accessed. -// -// recur is the non-negative recursion depth. For recur > 0, Dlaqr04 behaves -// as DLAQR0, for recur == 0 it behaves as DLAQR4. -// -// unconverged indicates whether Dlaqr04 computed all the eigenvalues of H[ilo:ihi+1,ilo:ihi+1]. -// -// If unconverged is zero and wantt is true, H will contain on return the upper -// quasi-triangular matrix T from the Schur decomposition. 2×2 diagonal blocks -// (corresponding to complex conjugate pairs of eigenvalues) will be returned in -// standard form, with H[i,i] == H[i+1,i+1] and H[i+1,i]*H[i,i+1] < 0. -// -// If unconverged is zero and if wantt is false, the contents of h on return is -// unspecified. -// -// If unconverged is zero, all the eigenvalues have been computed and their real -// and imaginary parts will be stored on return in wr[ilo:ihi+1] and -// wi[ilo:ihi+1], respectively. If two eigenvalues are computed as a complex -// conjugate pair, they are stored in consecutive elements of wr and wi, say the -// i-th and (i+1)th, with wi[i] > 0 and wi[i+1] < 0. If wantt is true, then the -// eigenvalues are stored in the same order as on the diagonal of the Schur form -// returned in H, with wr[i] = H[i,i] and, if H[i:i+2,i:i+2] is a 2×2 diagonal -// block, wi[i] = sqrt(-H[i+1,i]*H[i,i+1]) and wi[i+1] = -wi[i]. -// -// If unconverged is positive, some eigenvalues have not converged, and -// wr[unconverged:ihi+1] and wi[unconverged:ihi+1] will contain those -// eigenvalues which have been successfully computed. Failures are rare. -// -// If unconverged is positive and wantt is true, then on return -// (initial H)*U = U*(final H), (*) -// where U is an orthogonal matrix. The final H is upper Hessenberg and -// H[unconverged:ihi+1,unconverged:ihi+1] is upper quasi-triangular. -// -// If unconverged is positive and wantt is false, on return the remaining -// unconverged eigenvalues are the eigenvalues of the upper Hessenberg matrix -// H[ilo:unconverged,ilo:unconverged]. -// -// If unconverged is positive and wantz is true, then on return -// (final Z) = (initial Z)*U, -// where U is the orthogonal matrix in (*) regardless of the value of wantt. -// -// References: -// [1] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part I: -// Maintaining Well-Focused Shifts and Level 3 Performance. SIAM J. Matrix -// Anal. Appl. 23(4) (2002), pp. 929—947 -// URL: http://dx.doi.org/10.1137/S0895479801384573 -// [2] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl. 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 -// -// Dlaqr04 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqr04(wantt, wantz bool, n, ilo, ihi int, h []float64, ldh int, wr, wi []float64, iloz, ihiz int, z []float64, ldz int, work []float64, lwork int, recur int) (unconverged int) { - const ( - // Matrices of order ntiny or smaller must be processed by - // Dlahqr because of insufficient subdiagonal scratch space. - // This is a hard limit. - ntiny = 11 - // Exceptional deflation windows: try to cure rare slow - // convergence by varying the size of the deflation window after - // kexnw iterations. - kexnw = 5 - // Exceptional shifts: try to cure rare slow convergence with - // ad-hoc exceptional shifts every kexsh iterations. - kexsh = 6 - - // See https://github.com/gonum/lapack/pull/151#discussion_r68162802 - // and the surrounding discussion for an explanation where these - // constants come from. - // TODO(vladimir-ch): Similar constants for exceptional shifts - // are used also in dlahqr.go. The first constant is different - // there, it is equal to 3. Why? And does it matter? - wilk1 = 0.75 - wilk2 = -0.4375 - ) - - switch { - case n < 0: - panic(nLT0) - case ilo < 0 || max(0, n-1) < ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case ldh < max(1, n): - panic(badLdH) - case wantz && (iloz < 0 || ilo < iloz): - panic(badIloz) - case wantz && (ihiz < ihi || n <= ihiz): - panic(badIhiz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case lwork < 1 && lwork != -1: - panic(badLWork) - // TODO(vladimir-ch): Enable if and when we figure out what the minimum - // necessary lwork value is. Dlaqr04 says that the minimum is n which - // clashes with Dlaqr23's opinion about optimal work when nw <= 2 - // (independent of n). - // case lwork < n && n > ntiny && lwork != -1: - // panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - case recur < 0: - panic(recurLT0) - } - - // Quick return. - if n == 0 { - work[0] = 1 - return 0 - } - - if lwork != -1 { - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case len(wr) != ihi+1: - panic(badLenWr) - case len(wi) != ihi+1: - panic(badLenWi) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case ilo > 0 && h[ilo*ldh+ilo-1] != 0: - panic(notIsolated) - case ihi+1 < n && h[(ihi+1)*ldh+ihi] != 0: - panic(notIsolated) - } - } - - if n <= ntiny { - // Tiny matrices must use Dlahqr. - if lwork == -1 { - work[0] = 1 - return 0 - } - return impl.Dlahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz) - } - - // Use small bulge multi-shift QR with aggressive early deflation on - // larger-than-tiny matrices. - var jbcmpz string - if wantt { - jbcmpz = "S" - } else { - jbcmpz = "E" - } - if wantz { - jbcmpz += "V" - } else { - jbcmpz += "N" - } - - var fname string - if recur > 0 { - fname = "DLAQR0" - } else { - fname = "DLAQR4" - } - // nwr is the recommended deflation window size. n is greater than 11, - // so there is enough subdiagonal workspace for nwr >= 2 as required. - // (In fact, there is enough subdiagonal space for nwr >= 3.) - // TODO(vladimir-ch): If there is enough space for nwr >= 3, should we - // use it? - nwr := impl.Ilaenv(13, fname, jbcmpz, n, ilo, ihi, lwork) - nwr = max(2, nwr) - nwr = min(ihi-ilo+1, min((n-1)/3, nwr)) - - // nsr is the recommended number of simultaneous shifts. n is greater - // than 11, so there is enough subdiagonal workspace for nsr to be even - // and greater than or equal to two as required. - nsr := impl.Ilaenv(15, fname, jbcmpz, n, ilo, ihi, lwork) - nsr = min(nsr, min((n+6)/9, ihi-ilo)) - nsr = max(2, nsr&^1) - - // Workspace query call to Dlaqr23. - impl.Dlaqr23(wantt, wantz, n, ilo, ihi, nwr+1, h, ldh, iloz, ihiz, z, ldz, - wr, wi, h, ldh, n, h, ldh, n, h, ldh, work, -1, recur) - // Optimal workspace is max(Dlaqr5, Dlaqr23). - lwkopt := max(3*nsr/2, int(work[0])) - // Quick return in case of workspace query. - if lwork == -1 { - work[0] = float64(lwkopt) - return 0 - } - - // Dlahqr/Dlaqr04 crossover point. - nmin := impl.Ilaenv(12, fname, jbcmpz, n, ilo, ihi, lwork) - nmin = max(ntiny, nmin) - - // Nibble determines when to skip a multi-shift QR sweep (Dlaqr5). - nibble := impl.Ilaenv(14, fname, jbcmpz, n, ilo, ihi, lwork) - nibble = max(0, nibble) - - // Computation mode of far-from-diagonal orthogonal updates in Dlaqr5. - kacc22 := impl.Ilaenv(16, fname, jbcmpz, n, ilo, ihi, lwork) - kacc22 = max(0, min(kacc22, 2)) - - // nwmax is the largest possible deflation window for which there is - // sufficient workspace. - nwmax := min((n-1)/3, lwork/2) - nw := nwmax // Start with maximum deflation window size. - - // nsmax is the largest number of simultaneous shifts for which there is - // sufficient workspace. - nsmax := min((n+6)/9, 2*lwork/3) &^ 1 - - ndfl := 1 // Number of iterations since last deflation. - ndec := 0 // Deflation window size decrement. - - // Main loop. - var ( - itmax = max(30, 2*kexsh) * max(10, (ihi-ilo+1)) - it = 0 - ) - for kbot := ihi; kbot >= ilo; { - if it == itmax { - unconverged = kbot + 1 - break - } - it++ - - // Locate active block. - ktop := ilo - for k := kbot; k >= ilo+1; k-- { - if h[k*ldh+k-1] == 0 { - ktop = k - break - } - } - - // Select deflation window size nw. - // - // Typical Case: - // If possible and advisable, nibble the entire active block. - // If not, use size min(nwr,nwmax) or min(nwr+1,nwmax) - // depending upon which has the smaller corresponding - // subdiagonal entry (a heuristic). - // - // Exceptional Case: - // If there have been no deflations in kexnw or more - // iterations, then vary the deflation window size. At first, - // because larger windows are, in general, more powerful than - // smaller ones, rapidly increase the window to the maximum - // possible. Then, gradually reduce the window size. - nh := kbot - ktop + 1 - nwupbd := min(nh, nwmax) - if ndfl < kexnw { - nw = min(nwupbd, nwr) - } else { - nw = min(nwupbd, 2*nw) - } - if nw < nwmax { - if nw >= nh-1 { - nw = nh - } else { - kwtop := kbot - nw + 1 - if math.Abs(h[kwtop*ldh+kwtop-1]) > math.Abs(h[(kwtop-1)*ldh+kwtop-2]) { - nw++ - } - } - } - if ndfl < kexnw { - ndec = -1 - } else if ndec >= 0 || nw >= nwupbd { - ndec++ - if nw-ndec < 2 { - ndec = 0 - } - nw -= ndec - } - - // Split workspace under the subdiagonal of H into: - // - an nw×nw work array V in the lower left-hand corner, - // - an nw×nhv horizontal work array along the bottom edge (nhv - // must be at least nw but more is better), - // - an nve×nw vertical work array along the left-hand-edge - // (nhv can be any positive integer but more is better). - kv := n - nw - kt := nw - kwv := nw + 1 - nhv := n - kwv - kt - // Aggressive early deflation. - ls, ld := impl.Dlaqr23(wantt, wantz, n, ktop, kbot, nw, - h, ldh, iloz, ihiz, z, ldz, wr[:kbot+1], wi[:kbot+1], - h[kv*ldh:], ldh, nhv, h[kv*ldh+kt:], ldh, nhv, h[kwv*ldh:], ldh, work, lwork, recur) - - // Adjust kbot accounting for new deflations. - kbot -= ld - // ks points to the shifts. - ks := kbot - ls + 1 - - // Skip an expensive QR sweep if there is a (partly heuristic) - // reason to expect that many eigenvalues will deflate without - // it. Here, the QR sweep is skipped if many eigenvalues have - // just been deflated or if the remaining active block is small. - if ld > 0 && (100*ld > nw*nibble || kbot-ktop+1 <= min(nmin, nwmax)) { - // ld is positive, note progress. - ndfl = 1 - continue - } - - // ns is the nominal number of simultaneous shifts. This may be - // lowered (slightly) if Dlaqr23 did not provide that many - // shifts. - ns := min(min(nsmax, nsr), max(2, kbot-ktop)) &^ 1 - - // If there have been no deflations in a multiple of kexsh - // iterations, then try exceptional shifts. Otherwise use shifts - // provided by Dlaqr23 above or from the eigenvalues of a - // trailing principal submatrix. - if ndfl%kexsh == 0 { - ks = kbot - ns + 1 - for i := kbot; i > max(ks, ktop+1); i -= 2 { - ss := math.Abs(h[i*ldh+i-1]) + math.Abs(h[(i-1)*ldh+i-2]) - aa := wilk1*ss + h[i*ldh+i] - _, _, _, _, wr[i-1], wi[i-1], wr[i], wi[i], _, _ = - impl.Dlanv2(aa, ss, wilk2*ss, aa) - } - if ks == ktop { - wr[ks+1] = h[(ks+1)*ldh+ks+1] - wi[ks+1] = 0 - wr[ks] = wr[ks+1] - wi[ks] = wi[ks+1] - } - } else { - // If we got ns/2 or fewer shifts, use Dlahqr or recur - // into Dlaqr04 on a trailing principal submatrix to get - // more. Since ns <= nsmax <=(n+6)/9, there is enough - // space below the subdiagonal to fit an ns×ns scratch - // array. - if kbot-ks+1 <= ns/2 { - ks = kbot - ns + 1 - kt = n - ns - impl.Dlacpy(blas.All, ns, ns, h[ks*ldh+ks:], ldh, h[kt*ldh:], ldh) - if ns > nmin && recur > 0 { - ks += impl.Dlaqr04(false, false, ns, 1, ns-1, h[kt*ldh:], ldh, - wr[ks:ks+ns], wi[ks:ks+ns], 0, 0, nil, 0, work, lwork, recur-1) - } else { - ks += impl.Dlahqr(false, false, ns, 0, ns-1, h[kt*ldh:], ldh, - wr[ks:ks+ns], wi[ks:ks+ns], 0, 0, nil, 1) - } - // In case of a rare QR failure use eigenvalues - // of the trailing 2×2 principal submatrix. - if ks >= kbot { - aa := h[(kbot-1)*ldh+kbot-1] - bb := h[(kbot-1)*ldh+kbot] - cc := h[kbot*ldh+kbot-1] - dd := h[kbot*ldh+kbot] - _, _, _, _, wr[kbot-1], wi[kbot-1], wr[kbot], wi[kbot], _, _ = - impl.Dlanv2(aa, bb, cc, dd) - ks = kbot - 1 - } - } - - if kbot-ks+1 > ns { - // Sorting the shifts helps a little. Bubble - // sort keeps complex conjugate pairs together. - sorted := false - for k := kbot; k > ks; k-- { - if sorted { - break - } - sorted = true - for i := ks; i < k; i++ { - if math.Abs(wr[i])+math.Abs(wi[i]) >= math.Abs(wr[i+1])+math.Abs(wi[i+1]) { - continue - } - sorted = false - wr[i], wr[i+1] = wr[i+1], wr[i] - wi[i], wi[i+1] = wi[i+1], wi[i] - } - } - } - - // Shuffle shifts into pairs of real shifts and pairs of - // complex conjugate shifts using the fact that complex - // conjugate shifts are already adjacent to one another. - // TODO(vladimir-ch): The shuffling here could probably - // be removed but I'm not sure right now and it's safer - // to leave it. - for i := kbot; i > ks+1; i -= 2 { - if wi[i] == -wi[i-1] { - continue - } - wr[i], wr[i-1], wr[i-2] = wr[i-1], wr[i-2], wr[i] - wi[i], wi[i-1], wi[i-2] = wi[i-1], wi[i-2], wi[i] - } - } - - // If there are only two shifts and both are real, then use only one. - if kbot-ks+1 == 2 && wi[kbot] == 0 { - if math.Abs(wr[kbot]-h[kbot*ldh+kbot]) < math.Abs(wr[kbot-1]-h[kbot*ldh+kbot]) { - wr[kbot-1] = wr[kbot] - } else { - wr[kbot] = wr[kbot-1] - } - } - - // Use up to ns of the smallest magnitude shifts. If there - // aren't ns shifts available, then use them all, possibly - // dropping one to make the number of shifts even. - ns = min(ns, kbot-ks+1) &^ 1 - ks = kbot - ns + 1 - - // Split workspace under the subdiagonal into: - // - a kdu×kdu work array U in the lower left-hand-corner, - // - a kdu×nhv horizontal work array WH along the bottom edge - // (nhv must be at least kdu but more is better), - // - an nhv×kdu vertical work array WV along the left-hand-edge - // (nhv must be at least kdu but more is better). - kdu := 3*ns - 3 - ku := n - kdu - kwh := kdu - kwv = kdu + 3 - nhv = n - kwv - kdu - // Small-bulge multi-shift QR sweep. - impl.Dlaqr5(wantt, wantz, kacc22, n, ktop, kbot, ns, - wr[ks:ks+ns], wi[ks:ks+ns], h, ldh, iloz, ihiz, z, ldz, - work, 3, h[ku*ldh:], ldh, nhv, h[kwv*ldh:], ldh, nhv, h[ku*ldh+kwh:], ldh) - - // Note progress (or the lack of it). - if ld > 0 { - ndfl = 1 - } else { - ndfl++ - } - } - - work[0] = float64(lwkopt) - return unconverged -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go deleted file mode 100644 index e21373bd1..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr1.go +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlaqr1 sets v to a scalar multiple of the first column of the product -// (H - (sr1 + i*si1)*I)*(H - (sr2 + i*si2)*I) -// where H is a 2×2 or 3×3 matrix, I is the identity matrix of the same size, -// and i is the imaginary unit. Scaling is done to avoid overflows and most -// underflows. -// -// n is the order of H and must be either 2 or 3. It must hold that either sr1 = -// sr2 and si1 = -si2, or si1 = si2 = 0. The length of v must be equal to n. If -// any of these conditions is not met, Dlaqr1 will panic. -// -// Dlaqr1 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqr1(n int, h []float64, ldh int, sr1, si1, sr2, si2 float64, v []float64) { - switch { - case n != 2 && n != 3: - panic("lapack: n must be 2 or 3") - case ldh < n: - panic(badLdH) - case len(h) < (n-1)*ldh+n: - panic(shortH) - case !((sr1 == sr2 && si1 == -si2) || (si1 == 0 && si2 == 0)): - panic(badShifts) - case len(v) != n: - panic(shortV) - } - - if n == 2 { - s := math.Abs(h[0]-sr2) + math.Abs(si2) + math.Abs(h[ldh]) - if s == 0 { - v[0] = 0 - v[1] = 0 - } else { - h21s := h[ldh] / s - v[0] = h21s*h[1] + (h[0]-sr1)*((h[0]-sr2)/s) - si1*(si2/s) - v[1] = h21s * (h[0] + h[ldh+1] - sr1 - sr2) - } - return - } - - s := math.Abs(h[0]-sr2) + math.Abs(si2) + math.Abs(h[ldh]) + math.Abs(h[2*ldh]) - if s == 0 { - v[0] = 0 - v[1] = 0 - v[2] = 0 - } else { - h21s := h[ldh] / s - h31s := h[2*ldh] / s - v[0] = (h[0]-sr1)*((h[0]-sr2)/s) - si1*(si2/s) + h[1]*h21s + h[2]*h31s - v[1] = h21s*(h[0]+h[ldh+1]-sr1-sr2) + h[ldh+2]*h31s - v[2] = h31s*(h[0]+h[2*ldh+2]-sr1-sr2) + h21s*h[2*ldh+1] - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go deleted file mode 100644 index ff299a73a..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr23.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlaqr23 performs the orthogonal similarity transformation of an n×n upper -// Hessenberg matrix to detect and deflate fully converged eigenvalues from a -// trailing principal submatrix using aggressive early deflation [1]. -// -// On return, H will be overwritten by a new Hessenberg matrix that is a -// perturbation of an orthogonal similarity transformation of H. It is hoped -// that on output H will have many zero subdiagonal entries. -// -// If wantt is true, the matrix H will be fully updated so that the -// quasi-triangular Schur factor can be computed. If wantt is false, then only -// enough of H will be updated to preserve the eigenvalues. -// -// If wantz is true, the orthogonal similarity transformation will be -// accumulated into Z[iloz:ihiz+1,ktop:kbot+1], otherwise Z is not referenced. -// -// ktop and kbot determine a block [ktop:kbot+1,ktop:kbot+1] along the diagonal -// of H. It must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo == 0 and ihi == -1, if n == 0, -// and the block must be isolated, that is, it must hold that -// ktop == 0 or H[ktop,ktop-1] == 0, -// kbot == n-1 or H[kbot+1,kbot] == 0, -// otherwise Dlaqr23 will panic. -// -// nw is the deflation window size. It must hold that -// 0 <= nw <= kbot-ktop+1, -// otherwise Dlaqr23 will panic. -// -// iloz and ihiz specify the rows of the n×n matrix Z to which transformations -// will be applied if wantz is true. It must hold that -// 0 <= iloz <= ktop, and kbot <= ihiz < n, -// otherwise Dlaqr23 will panic. -// -// sr and si must have length kbot+1, otherwise Dlaqr23 will panic. -// -// v and ldv represent an nw×nw work matrix. -// t and ldt represent an nw×nh work matrix, and nh must be at least nw. -// wv and ldwv represent an nv×nw work matrix. -// -// work must have length at least lwork and lwork must be at least max(1,2*nw), -// otherwise Dlaqr23 will panic. Larger values of lwork may result in greater -// efficiency. On return, work[0] will contain the optimal value of lwork. -// -// If lwork is -1, instead of performing Dlaqr23, the function only estimates the -// optimal workspace size and stores it into work[0]. Neither h nor z are -// accessed. -// -// recur is the non-negative recursion depth. For recur > 0, Dlaqr23 behaves -// as DLAQR3, for recur == 0 it behaves as DLAQR2. -// -// On return, ns and nd will contain respectively the number of unconverged -// (i.e., approximate) eigenvalues and converged eigenvalues that are stored in -// sr and si. -// -// On return, the real and imaginary parts of approximate eigenvalues that may -// be used for shifts will be stored respectively in sr[kbot-nd-ns+1:kbot-nd+1] -// and si[kbot-nd-ns+1:kbot-nd+1]. -// -// On return, the real and imaginary parts of converged eigenvalues will be -// stored respectively in sr[kbot-nd+1:kbot+1] and si[kbot-nd+1:kbot+1]. -// -// References: -// [1] K. Braman, R. Byers, R. Mathias. The Multishift QR Algorithm. Part II: -// Aggressive Early Deflation. SIAM J. Matrix Anal. Appl 23(4) (2002), pp. 948—973 -// URL: http://dx.doi.org/10.1137/S0895479801384585 -// -func (impl Implementation) Dlaqr23(wantt, wantz bool, n, ktop, kbot, nw int, h []float64, ldh int, iloz, ihiz int, z []float64, ldz int, sr, si []float64, v []float64, ldv int, nh int, t []float64, ldt int, nv int, wv []float64, ldwv int, work []float64, lwork int, recur int) (ns, nd int) { - switch { - case n < 0: - panic(nLT0) - case ktop < 0 || max(0, n-1) < ktop: - panic(badKtop) - case kbot < min(ktop, n-1) || n <= kbot: - panic(badKbot) - case nw < 0 || kbot-ktop+1+1 < nw: - panic(badNw) - case ldh < max(1, n): - panic(badLdH) - case wantz && (iloz < 0 || ktop < iloz): - panic(badIloz) - case wantz && (ihiz < kbot || n <= ihiz): - panic(badIhiz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case ldv < max(1, nw): - panic(badLdV) - case nh < nw: - panic(badNh) - case ldt < max(1, nh): - panic(badLdT) - case nv < 0: - panic(nvLT0) - case ldwv < max(1, nw): - panic(badLdWV) - case lwork < max(1, 2*nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - case recur < 0: - panic(recurLT0) - } - - // Quick return for zero window size. - if nw == 0 { - work[0] = 1 - return 0, 0 - } - - // LAPACK code does not enforce the documented behavior - // nw <= kbot-ktop+1 - // but we do (we panic above). - jw := nw - lwkopt := max(1, 2*nw) - if jw > 2 { - // Workspace query call to Dgehrd. - impl.Dgehrd(jw, 0, jw-2, t, ldt, work, work, -1) - lwk1 := int(work[0]) - // Workspace query call to Dormhr. - impl.Dormhr(blas.Right, blas.NoTrans, jw, jw, 0, jw-2, t, ldt, work, v, ldv, work, -1) - lwk2 := int(work[0]) - if recur > 0 { - // Workspace query call to Dlaqr04. - impl.Dlaqr04(true, true, jw, 0, jw-1, t, ldt, sr, si, 0, jw-1, v, ldv, work, -1, recur-1) - lwk3 := int(work[0]) - // Optimal workspace. - lwkopt = max(jw+max(lwk1, lwk2), lwk3) - } else { - // Optimal workspace. - lwkopt = jw + max(lwk1, lwk2) - } - } - // Quick return in case of workspace query. - if lwork == -1 { - work[0] = float64(lwkopt) - return 0, 0 - } - - // Check input slices only if not doing workspace query. - switch { - case len(h) < (n-1)*ldh+n: - panic(shortH) - case len(v) < (nw-1)*ldv+nw: - panic(shortV) - case len(t) < (nw-1)*ldt+nh: - panic(shortT) - case len(wv) < (nv-1)*ldwv+nw: - panic(shortWV) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - case len(sr) != kbot+1: - panic(badLenSr) - case len(si) != kbot+1: - panic(badLenSi) - case ktop > 0 && h[ktop*ldh+ktop-1] != 0: - panic(notIsolated) - case kbot+1 < n && h[(kbot+1)*ldh+kbot] != 0: - panic(notIsolated) - } - - // Machine constants. - ulp := dlamchP - smlnum := float64(n) / ulp * dlamchS - - // Setup deflation window. - var s float64 - kwtop := kbot - jw + 1 - if kwtop != ktop { - s = h[kwtop*ldh+kwtop-1] - } - if kwtop == kbot { - // 1×1 deflation window. - sr[kwtop] = h[kwtop*ldh+kwtop] - si[kwtop] = 0 - ns = 1 - nd = 0 - if math.Abs(s) <= math.Max(smlnum, ulp*math.Abs(h[kwtop*ldh+kwtop])) { - ns = 0 - nd = 1 - if kwtop > ktop { - h[kwtop*ldh+kwtop-1] = 0 - } - } - work[0] = 1 - return ns, nd - } - - // Convert to spike-triangular form. In case of a rare QR failure, this - // routine continues to do aggressive early deflation using that part of - // the deflation window that converged using infqr here and there to - // keep track. - impl.Dlacpy(blas.Upper, jw, jw, h[kwtop*ldh+kwtop:], ldh, t, ldt) - bi := blas64.Implementation() - bi.Dcopy(jw-1, h[(kwtop+1)*ldh+kwtop:], ldh+1, t[ldt:], ldt+1) - impl.Dlaset(blas.All, jw, jw, 0, 1, v, ldv) - nmin := impl.Ilaenv(12, "DLAQR3", "SV", jw, 0, jw-1, lwork) - var infqr int - if recur > 0 && jw > nmin { - infqr = impl.Dlaqr04(true, true, jw, 0, jw-1, t, ldt, sr[kwtop:], si[kwtop:], 0, jw-1, v, ldv, work, lwork, recur-1) - } else { - infqr = impl.Dlahqr(true, true, jw, 0, jw-1, t, ldt, sr[kwtop:], si[kwtop:], 0, jw-1, v, ldv) - } - // Note that ilo == 0 which conveniently coincides with the success - // value of infqr, that is, infqr as an index always points to the first - // converged eigenvalue. - - // Dtrexc needs a clean margin near the diagonal. - for j := 0; j < jw-3; j++ { - t[(j+2)*ldt+j] = 0 - t[(j+3)*ldt+j] = 0 - } - if jw >= 3 { - t[(jw-1)*ldt+jw-3] = 0 - } - - ns = jw - ilst := infqr - // Deflation detection loop. - for ilst < ns { - bulge := false - if ns >= 2 { - bulge = t[(ns-1)*ldt+ns-2] != 0 - } - if !bulge { - // Real eigenvalue. - abst := math.Abs(t[(ns-1)*ldt+ns-1]) - if abst == 0 { - abst = math.Abs(s) - } - if math.Abs(s*v[ns-1]) <= math.Max(smlnum, ulp*abst) { - // Deflatable. - ns-- - } else { - // Undeflatable, move it up out of the way. - // Dtrexc can not fail in this case. - _, ilst, _ = impl.Dtrexc(lapack.UpdateSchur, jw, t, ldt, v, ldv, ns-1, ilst, work) - ilst++ - } - continue - } - // Complex conjugate pair. - abst := math.Abs(t[(ns-1)*ldt+ns-1]) + math.Sqrt(math.Abs(t[(ns-1)*ldt+ns-2]))*math.Sqrt(math.Abs(t[(ns-2)*ldt+ns-1])) - if abst == 0 { - abst = math.Abs(s) - } - if math.Max(math.Abs(s*v[ns-1]), math.Abs(s*v[ns-2])) <= math.Max(smlnum, ulp*abst) { - // Deflatable. - ns -= 2 - } else { - // Undeflatable, move them up out of the way. - // Dtrexc does the right thing with ilst in case of a - // rare exchange failure. - _, ilst, _ = impl.Dtrexc(lapack.UpdateSchur, jw, t, ldt, v, ldv, ns-1, ilst, work) - ilst += 2 - } - } - - // Return to Hessenberg form. - if ns == 0 { - s = 0 - } - if ns < jw { - // Sorting diagonal blocks of T improves accuracy for graded - // matrices. Bubble sort deals well with exchange failures. - sorted := false - i := ns - for !sorted { - sorted = true - kend := i - 1 - i = infqr - var k int - if i == ns-1 || t[(i+1)*ldt+i] == 0 { - k = i + 1 - } else { - k = i + 2 - } - for k <= kend { - var evi float64 - if k == i+1 { - evi = math.Abs(t[i*ldt+i]) - } else { - evi = math.Abs(t[i*ldt+i]) + math.Sqrt(math.Abs(t[(i+1)*ldt+i]))*math.Sqrt(math.Abs(t[i*ldt+i+1])) - } - - var evk float64 - if k == kend || t[(k+1)*ldt+k] == 0 { - evk = math.Abs(t[k*ldt+k]) - } else { - evk = math.Abs(t[k*ldt+k]) + math.Sqrt(math.Abs(t[(k+1)*ldt+k]))*math.Sqrt(math.Abs(t[k*ldt+k+1])) - } - - if evi >= evk { - i = k - } else { - sorted = false - _, ilst, ok := impl.Dtrexc(lapack.UpdateSchur, jw, t, ldt, v, ldv, i, k, work) - if ok { - i = ilst - } else { - i = k - } - } - if i == kend || t[(i+1)*ldt+i] == 0 { - k = i + 1 - } else { - k = i + 2 - } - } - } - } - - // Restore shift/eigenvalue array from T. - for i := jw - 1; i >= infqr; { - if i == infqr || t[i*ldt+i-1] == 0 { - sr[kwtop+i] = t[i*ldt+i] - si[kwtop+i] = 0 - i-- - continue - } - aa := t[(i-1)*ldt+i-1] - bb := t[(i-1)*ldt+i] - cc := t[i*ldt+i-1] - dd := t[i*ldt+i] - _, _, _, _, sr[kwtop+i-1], si[kwtop+i-1], sr[kwtop+i], si[kwtop+i], _, _ = impl.Dlanv2(aa, bb, cc, dd) - i -= 2 - } - - if ns < jw || s == 0 { - if ns > 1 && s != 0 { - // Reflect spike back into lower triangle. - bi.Dcopy(ns, v[:ns], 1, work[:ns], 1) - _, tau := impl.Dlarfg(ns, work[0], work[1:ns], 1) - work[0] = 1 - impl.Dlaset(blas.Lower, jw-2, jw-2, 0, 0, t[2*ldt:], ldt) - impl.Dlarf(blas.Left, ns, jw, work[:ns], 1, tau, t, ldt, work[jw:]) - impl.Dlarf(blas.Right, ns, ns, work[:ns], 1, tau, t, ldt, work[jw:]) - impl.Dlarf(blas.Right, jw, ns, work[:ns], 1, tau, v, ldv, work[jw:]) - impl.Dgehrd(jw, 0, ns-1, t, ldt, work[:jw-1], work[jw:], lwork-jw) - } - - // Copy updated reduced window into place. - if kwtop > 0 { - h[kwtop*ldh+kwtop-1] = s * v[0] - } - impl.Dlacpy(blas.Upper, jw, jw, t, ldt, h[kwtop*ldh+kwtop:], ldh) - bi.Dcopy(jw-1, t[ldt:], ldt+1, h[(kwtop+1)*ldh+kwtop:], ldh+1) - - // Accumulate orthogonal matrix in order to update H and Z, if - // requested. - if ns > 1 && s != 0 { - // work[:ns-1] contains the elementary reflectors stored - // by a call to Dgehrd above. - impl.Dormhr(blas.Right, blas.NoTrans, jw, ns, 0, ns-1, - t, ldt, work[:ns-1], v, ldv, work[jw:], lwork-jw) - } - - // Update vertical slab in H. - var ltop int - if !wantt { - ltop = ktop - } - for krow := ltop; krow < kwtop; krow += nv { - kln := min(nv, kwtop-krow) - bi.Dgemm(blas.NoTrans, blas.NoTrans, kln, jw, jw, - 1, h[krow*ldh+kwtop:], ldh, v, ldv, - 0, wv, ldwv) - impl.Dlacpy(blas.All, kln, jw, wv, ldwv, h[krow*ldh+kwtop:], ldh) - } - - // Update horizontal slab in H. - if wantt { - for kcol := kbot + 1; kcol < n; kcol += nh { - kln := min(nh, n-kcol) - bi.Dgemm(blas.Trans, blas.NoTrans, jw, kln, jw, - 1, v, ldv, h[kwtop*ldh+kcol:], ldh, - 0, t, ldt) - impl.Dlacpy(blas.All, jw, kln, t, ldt, h[kwtop*ldh+kcol:], ldh) - } - } - - // Update vertical slab in Z. - if wantz { - for krow := iloz; krow <= ihiz; krow += nv { - kln := min(nv, ihiz-krow+1) - bi.Dgemm(blas.NoTrans, blas.NoTrans, kln, jw, jw, - 1, z[krow*ldz+kwtop:], ldz, v, ldv, - 0, wv, ldwv) - impl.Dlacpy(blas.All, kln, jw, wv, ldwv, z[krow*ldz+kwtop:], ldz) - } - } - } - - // The number of deflations. - nd = jw - ns - // Shifts are converged eigenvalues that could not be deflated. - // Subtracting infqr from the spike length takes care of the case of a - // rare QR failure while calculating eigenvalues of the deflation - // window. - ns -= infqr - work[0] = float64(lwkopt) - return ns, nd -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go deleted file mode 100644 index c198f229a..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaqr5.go +++ /dev/null @@ -1,644 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlaqr5 performs a single small-bulge multi-shift QR sweep on an isolated -// block of a Hessenberg matrix. -// -// wantt and wantz determine whether the quasi-triangular Schur factor and the -// orthogonal Schur factor, respectively, will be computed. -// -// kacc22 specifies the computation mode of far-from-diagonal orthogonal -// updates. Permitted values are: -// 0: Dlaqr5 will not accumulate reflections and will not use matrix-matrix -// multiply to update far-from-diagonal matrix entries. -// 1: Dlaqr5 will accumulate reflections and use matrix-matrix multiply to -// update far-from-diagonal matrix entries. -// 2: Dlaqr5 will accumulate reflections, use matrix-matrix multiply to update -// far-from-diagonal matrix entries, and take advantage of 2×2 block -// structure during matrix multiplies. -// For other values of kacc2 Dlaqr5 will panic. -// -// n is the order of the Hessenberg matrix H. -// -// ktop and kbot are indices of the first and last row and column of an isolated -// diagonal block upon which the QR sweep will be applied. It must hold that -// ktop == 0, or 0 < ktop <= n-1 and H[ktop, ktop-1] == 0, and -// kbot == n-1, or 0 <= kbot < n-1 and H[kbot+1, kbot] == 0, -// otherwise Dlaqr5 will panic. -// -// nshfts is the number of simultaneous shifts. It must be positive and even, -// otherwise Dlaqr5 will panic. -// -// sr and si contain the real and imaginary parts, respectively, of the shifts -// of origin that define the multi-shift QR sweep. On return both slices may be -// reordered by Dlaqr5. Their length must be equal to nshfts, otherwise Dlaqr5 -// will panic. -// -// h and ldh represent the Hessenberg matrix H of size n×n. On return -// multi-shift QR sweep with shifts sr+i*si has been applied to the isolated -// diagonal block in rows and columns ktop through kbot, inclusive. -// -// iloz and ihiz specify the rows of Z to which transformations will be applied -// if wantz is true. It must hold that 0 <= iloz <= ihiz < n, otherwise Dlaqr5 -// will panic. -// -// z and ldz represent the matrix Z of size n×n. If wantz is true, the QR sweep -// orthogonal similarity transformation is accumulated into -// z[iloz:ihiz,iloz:ihiz] from the right, otherwise z not referenced. -// -// v and ldv represent an auxiliary matrix V of size (nshfts/2)×3. Note that V -// is transposed with respect to the reference netlib implementation. -// -// u and ldu represent an auxiliary matrix of size (3*nshfts-3)×(3*nshfts-3). -// -// wh and ldwh represent an auxiliary matrix of size (3*nshfts-3)×nh. -// -// wv and ldwv represent an auxiliary matrix of size nv×(3*nshfts-3). -// -// Dlaqr5 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaqr5(wantt, wantz bool, kacc22 int, n, ktop, kbot, nshfts int, sr, si []float64, h []float64, ldh int, iloz, ihiz int, z []float64, ldz int, v []float64, ldv int, u []float64, ldu int, nv int, wv []float64, ldwv int, nh int, wh []float64, ldwh int) { - switch { - case kacc22 != 0 && kacc22 != 1 && kacc22 != 2: - panic(badKacc22) - case n < 0: - panic(nLT0) - case ktop < 0 || n <= ktop: - panic(badKtop) - case kbot < 0 || n <= kbot: - panic(badKbot) - - case nshfts < 0: - panic(nshftsLT0) - case nshfts&0x1 != 0: - panic(nshftsOdd) - case len(sr) != nshfts: - panic(badLenSr) - case len(si) != nshfts: - panic(badLenSi) - - case ldh < max(1, n): - panic(badLdH) - case len(h) < (n-1)*ldh+n: - panic(shortH) - - case wantz && ihiz >= n: - panic(badIhiz) - case wantz && iloz < 0 || ihiz < iloz: - panic(badIloz) - case ldz < 1, wantz && ldz < n: - panic(badLdZ) - case wantz && len(z) < (n-1)*ldz+n: - panic(shortZ) - - case ldv < 3: - // V is transposed w.r.t. reference lapack. - panic(badLdV) - case len(v) < (nshfts/2-1)*ldv+3: - panic(shortV) - - case ldu < max(1, 3*nshfts-3): - panic(badLdU) - case len(u) < (3*nshfts-3-1)*ldu+3*nshfts-3: - panic(shortU) - - case nv < 0: - panic(nvLT0) - case ldwv < max(1, 3*nshfts-3): - panic(badLdWV) - case len(wv) < (nv-1)*ldwv+3*nshfts-3: - panic(shortWV) - - case nh < 0: - panic(nhLT0) - case ldwh < max(1, nh): - panic(badLdWH) - case len(wh) < (3*nshfts-3-1)*ldwh+nh: - panic(shortWH) - - case ktop > 0 && h[ktop*ldh+ktop-1] != 0: - panic(notIsolated) - case kbot < n-1 && h[(kbot+1)*ldh+kbot] != 0: - panic(notIsolated) - } - - // If there are no shifts, then there is nothing to do. - if nshfts < 2 { - return - } - // If the active block is empty or 1×1, then there is nothing to do. - if ktop >= kbot { - return - } - - // Shuffle shifts into pairs of real shifts and pairs of complex - // conjugate shifts assuming complex conjugate shifts are already - // adjacent to one another. - for i := 0; i < nshfts-2; i += 2 { - if si[i] == -si[i+1] { - continue - } - sr[i], sr[i+1], sr[i+2] = sr[i+1], sr[i+2], sr[i] - si[i], si[i+1], si[i+2] = si[i+1], si[i+2], si[i] - } - - // Note: lapack says that nshfts must be even but allows it to be odd - // anyway. We panic above if nshfts is not even, so reducing it by one - // is unnecessary. The only caller Dlaqr04 uses only even nshfts. - // - // The original comment and code from lapack-3.6.0/SRC/dlaqr5.f:341: - // * ==== NSHFTS is supposed to be even, but if it is odd, - // * . then simply reduce it by one. The shuffle above - // * . ensures that the dropped shift is real and that - // * . the remaining shifts are paired. ==== - // * - // NS = NSHFTS - MOD( NSHFTS, 2 ) - ns := nshfts - - safmin := dlamchS - ulp := dlamchP - smlnum := safmin * float64(n) / ulp - - // Use accumulated reflections to update far-from-diagonal entries? - accum := kacc22 == 1 || kacc22 == 2 - // If so, exploit the 2×2 block structure? - blk22 := ns > 2 && kacc22 == 2 - - // Clear trash. - if ktop+2 <= kbot { - h[(ktop+2)*ldh+ktop] = 0 - } - - // nbmps = number of 2-shift bulges in the chain. - nbmps := ns / 2 - - // kdu = width of slab. - kdu := 6*nbmps - 3 - - // Create and chase chains of nbmps bulges. - for incol := 3*(1-nbmps) + ktop - 1; incol <= kbot-2; incol += 3*nbmps - 2 { - ndcol := incol + kdu - if accum { - impl.Dlaset(blas.All, kdu, kdu, 0, 1, u, ldu) - } - - // Near-the-diagonal bulge chase. The following loop performs - // the near-the-diagonal part of a small bulge multi-shift QR - // sweep. Each 6*nbmps-2 column diagonal chunk extends from - // column incol to column ndcol (including both column incol and - // column ndcol). The following loop chases a 3*nbmps column - // long chain of nbmps bulges 3*nbmps-2 columns to the right. - // (incol may be less than ktop and ndcol may be greater than - // kbot indicating phantom columns from which to chase bulges - // before they are actually introduced or to which to chase - // bulges beyond column kbot.) - for krcol := incol; krcol <= min(incol+3*nbmps-3, kbot-2); krcol++ { - // Bulges number mtop to mbot are active double implicit - // shift bulges. There may or may not also be small 2×2 - // bulge, if there is room. The inactive bulges (if any) - // must wait until the active bulges have moved down the - // diagonal to make room. The phantom matrix paradigm - // described above helps keep track. - - mtop := max(0, ((ktop-1)-krcol+2)/3) - mbot := min(nbmps, (kbot-krcol)/3) - 1 - m22 := mbot + 1 - bmp22 := (mbot < nbmps-1) && (krcol+3*m22 == kbot-2) - - // Generate reflections to chase the chain right one - // column. (The minimum value of k is ktop-1.) - for m := mtop; m <= mbot; m++ { - k := krcol + 3*m - if k == ktop-1 { - impl.Dlaqr1(3, h[ktop*ldh+ktop:], ldh, - sr[2*m], si[2*m], sr[2*m+1], si[2*m+1], - v[m*ldv:m*ldv+3]) - alpha := v[m*ldv] - _, v[m*ldv] = impl.Dlarfg(3, alpha, v[m*ldv+1:m*ldv+3], 1) - continue - } - beta := h[(k+1)*ldh+k] - v[m*ldv+1] = h[(k+2)*ldh+k] - v[m*ldv+2] = h[(k+3)*ldh+k] - beta, v[m*ldv] = impl.Dlarfg(3, beta, v[m*ldv+1:m*ldv+3], 1) - - // A bulge may collapse because of vigilant deflation or - // destructive underflow. In the underflow case, try the - // two-small-subdiagonals trick to try to reinflate the - // bulge. - if h[(k+3)*ldh+k] != 0 || h[(k+3)*ldh+k+1] != 0 || h[(k+3)*ldh+k+2] == 0 { - // Typical case: not collapsed (yet). - h[(k+1)*ldh+k] = beta - h[(k+2)*ldh+k] = 0 - h[(k+3)*ldh+k] = 0 - continue - } - - // Atypical case: collapsed. Attempt to reintroduce - // ignoring H[k+1,k] and H[k+2,k]. If the fill - // resulting from the new reflector is too large, - // then abandon it. Otherwise, use the new one. - var vt [3]float64 - impl.Dlaqr1(3, h[(k+1)*ldh+k+1:], ldh, sr[2*m], - si[2*m], sr[2*m+1], si[2*m+1], vt[:]) - alpha := vt[0] - _, vt[0] = impl.Dlarfg(3, alpha, vt[1:3], 1) - refsum := vt[0] * (h[(k+1)*ldh+k] + vt[1]*h[(k+2)*ldh+k]) - - dsum := math.Abs(h[k*ldh+k]) + math.Abs(h[(k+1)*ldh+k+1]) + math.Abs(h[(k+2)*ldh+k+2]) - if math.Abs(h[(k+2)*ldh+k]-refsum*vt[1])+math.Abs(refsum*vt[2]) > ulp*dsum { - // Starting a new bulge here would create - // non-negligible fill. Use the old one with - // trepidation. - h[(k+1)*ldh+k] = beta - h[(k+2)*ldh+k] = 0 - h[(k+3)*ldh+k] = 0 - continue - } else { - // Starting a new bulge here would create - // only negligible fill. Replace the old - // reflector with the new one. - h[(k+1)*ldh+k] -= refsum - h[(k+2)*ldh+k] = 0 - h[(k+3)*ldh+k] = 0 - v[m*ldv] = vt[0] - v[m*ldv+1] = vt[1] - v[m*ldv+2] = vt[2] - } - } - - // Generate a 2×2 reflection, if needed. - if bmp22 { - k := krcol + 3*m22 - if k == ktop-1 { - impl.Dlaqr1(2, h[(k+1)*ldh+k+1:], ldh, - sr[2*m22], si[2*m22], sr[2*m22+1], si[2*m22+1], - v[m22*ldv:m22*ldv+2]) - beta := v[m22*ldv] - _, v[m22*ldv] = impl.Dlarfg(2, beta, v[m22*ldv+1:m22*ldv+2], 1) - } else { - beta := h[(k+1)*ldh+k] - v[m22*ldv+1] = h[(k+2)*ldh+k] - beta, v[m22*ldv] = impl.Dlarfg(2, beta, v[m22*ldv+1:m22*ldv+2], 1) - h[(k+1)*ldh+k] = beta - h[(k+2)*ldh+k] = 0 - } - } - - // Multiply H by reflections from the left. - var jbot int - switch { - case accum: - jbot = min(ndcol, kbot) - case wantt: - jbot = n - 1 - default: - jbot = kbot - } - for j := max(ktop, krcol); j <= jbot; j++ { - mend := min(mbot+1, (j-krcol+2)/3) - 1 - for m := mtop; m <= mend; m++ { - k := krcol + 3*m - refsum := v[m*ldv] * (h[(k+1)*ldh+j] + - v[m*ldv+1]*h[(k+2)*ldh+j] + v[m*ldv+2]*h[(k+3)*ldh+j]) - h[(k+1)*ldh+j] -= refsum - h[(k+2)*ldh+j] -= refsum * v[m*ldv+1] - h[(k+3)*ldh+j] -= refsum * v[m*ldv+2] - } - } - if bmp22 { - k := krcol + 3*m22 - for j := max(k+1, ktop); j <= jbot; j++ { - refsum := v[m22*ldv] * (h[(k+1)*ldh+j] + v[m22*ldv+1]*h[(k+2)*ldh+j]) - h[(k+1)*ldh+j] -= refsum - h[(k+2)*ldh+j] -= refsum * v[m22*ldv+1] - } - } - - // Multiply H by reflections from the right. Delay filling in the last row - // until the vigilant deflation check is complete. - var jtop int - switch { - case accum: - jtop = max(ktop, incol) - case wantt: - jtop = 0 - default: - jtop = ktop - } - for m := mtop; m <= mbot; m++ { - if v[m*ldv] == 0 { - continue - } - k := krcol + 3*m - for j := jtop; j <= min(kbot, k+3); j++ { - refsum := v[m*ldv] * (h[j*ldh+k+1] + - v[m*ldv+1]*h[j*ldh+k+2] + v[m*ldv+2]*h[j*ldh+k+3]) - h[j*ldh+k+1] -= refsum - h[j*ldh+k+2] -= refsum * v[m*ldv+1] - h[j*ldh+k+3] -= refsum * v[m*ldv+2] - } - if accum { - // Accumulate U. (If necessary, update Z later with an - // efficient matrix-matrix multiply.) - kms := k - incol - for j := max(0, ktop-incol-1); j < kdu; j++ { - refsum := v[m*ldv] * (u[j*ldu+kms] + - v[m*ldv+1]*u[j*ldu+kms+1] + v[m*ldv+2]*u[j*ldu+kms+2]) - u[j*ldu+kms] -= refsum - u[j*ldu+kms+1] -= refsum * v[m*ldv+1] - u[j*ldu+kms+2] -= refsum * v[m*ldv+2] - } - } else if wantz { - // U is not accumulated, so update Z now by multiplying by - // reflections from the right. - for j := iloz; j <= ihiz; j++ { - refsum := v[m*ldv] * (z[j*ldz+k+1] + - v[m*ldv+1]*z[j*ldz+k+2] + v[m*ldv+2]*z[j*ldz+k+3]) - z[j*ldz+k+1] -= refsum - z[j*ldz+k+2] -= refsum * v[m*ldv+1] - z[j*ldz+k+3] -= refsum * v[m*ldv+2] - } - } - } - - // Special case: 2×2 reflection (if needed). - if bmp22 && v[m22*ldv] != 0 { - k := krcol + 3*m22 - for j := jtop; j <= min(kbot, k+3); j++ { - refsum := v[m22*ldv] * (h[j*ldh+k+1] + v[m22*ldv+1]*h[j*ldh+k+2]) - h[j*ldh+k+1] -= refsum - h[j*ldh+k+2] -= refsum * v[m22*ldv+1] - } - if accum { - kms := k - incol - for j := max(0, ktop-incol-1); j < kdu; j++ { - refsum := v[m22*ldv] * (u[j*ldu+kms] + v[m22*ldv+1]*u[j*ldu+kms+1]) - u[j*ldu+kms] -= refsum - u[j*ldu+kms+1] -= refsum * v[m22*ldv+1] - } - } else if wantz { - for j := iloz; j <= ihiz; j++ { - refsum := v[m22*ldv] * (z[j*ldz+k+1] + v[m22*ldv+1]*z[j*ldz+k+2]) - z[j*ldz+k+1] -= refsum - z[j*ldz+k+2] -= refsum * v[m22*ldv+1] - } - } - } - - // Vigilant deflation check. - mstart := mtop - if krcol+3*mstart < ktop { - mstart++ - } - mend := mbot - if bmp22 { - mend++ - } - if krcol == kbot-2 { - mend++ - } - for m := mstart; m <= mend; m++ { - k := min(kbot-1, krcol+3*m) - - // The following convergence test requires that the tradition - // small-compared-to-nearby-diagonals criterion and the Ahues & - // Tisseur (LAWN 122, 1997) criteria both be satisfied. The latter - // improves accuracy in some examples. Falling back on an alternate - // convergence criterion when tst1 or tst2 is zero (as done here) is - // traditional but probably unnecessary. - - if h[(k+1)*ldh+k] == 0 { - continue - } - tst1 := math.Abs(h[k*ldh+k]) + math.Abs(h[(k+1)*ldh+k+1]) - if tst1 == 0 { - if k >= ktop+1 { - tst1 += math.Abs(h[k*ldh+k-1]) - } - if k >= ktop+2 { - tst1 += math.Abs(h[k*ldh+k-2]) - } - if k >= ktop+3 { - tst1 += math.Abs(h[k*ldh+k-3]) - } - if k <= kbot-2 { - tst1 += math.Abs(h[(k+2)*ldh+k+1]) - } - if k <= kbot-3 { - tst1 += math.Abs(h[(k+3)*ldh+k+1]) - } - if k <= kbot-4 { - tst1 += math.Abs(h[(k+4)*ldh+k+1]) - } - } - if math.Abs(h[(k+1)*ldh+k]) <= math.Max(smlnum, ulp*tst1) { - h12 := math.Max(math.Abs(h[(k+1)*ldh+k]), math.Abs(h[k*ldh+k+1])) - h21 := math.Min(math.Abs(h[(k+1)*ldh+k]), math.Abs(h[k*ldh+k+1])) - h11 := math.Max(math.Abs(h[(k+1)*ldh+k+1]), math.Abs(h[k*ldh+k]-h[(k+1)*ldh+k+1])) - h22 := math.Min(math.Abs(h[(k+1)*ldh+k+1]), math.Abs(h[k*ldh+k]-h[(k+1)*ldh+k+1])) - scl := h11 + h12 - tst2 := h22 * (h11 / scl) - if tst2 == 0 || h21*(h12/scl) <= math.Max(smlnum, ulp*tst2) { - h[(k+1)*ldh+k] = 0 - } - } - } - - // Fill in the last row of each bulge. - mend = min(nbmps, (kbot-krcol-1)/3) - 1 - for m := mtop; m <= mend; m++ { - k := krcol + 3*m - refsum := v[m*ldv] * v[m*ldv+2] * h[(k+4)*ldh+k+3] - h[(k+4)*ldh+k+1] = -refsum - h[(k+4)*ldh+k+2] = -refsum * v[m*ldv+1] - h[(k+4)*ldh+k+3] -= refsum * v[m*ldv+2] - } - } - - // Use U (if accumulated) to update far-from-diagonal entries in H. - // If required, use U to update Z as well. - if !accum { - continue - } - var jtop, jbot int - if wantt { - jtop = 0 - jbot = n - 1 - } else { - jtop = ktop - jbot = kbot - } - bi := blas64.Implementation() - if !blk22 || incol < ktop || kbot < ndcol || ns <= 2 { - // Updates not exploiting the 2×2 block structure of U. k0 and nu keep track - // of the location and size of U in the special cases of introducing bulges - // and chasing bulges off the bottom. In these special cases and in case the - // number of shifts is ns = 2, there is no 2×2 block structure to exploit. - - k0 := max(0, ktop-incol-1) - nu := kdu - max(0, ndcol-kbot) - k0 - - // Horizontal multiply. - for jcol := min(ndcol, kbot) + 1; jcol <= jbot; jcol += nh { - jlen := min(nh, jbot-jcol+1) - bi.Dgemm(blas.Trans, blas.NoTrans, nu, jlen, nu, - 1, u[k0*ldu+k0:], ldu, - h[(incol+k0+1)*ldh+jcol:], ldh, - 0, wh, ldwh) - impl.Dlacpy(blas.All, nu, jlen, wh, ldwh, h[(incol+k0+1)*ldh+jcol:], ldh) - } - - // Vertical multiply. - for jrow := jtop; jrow <= max(ktop, incol)-1; jrow += nv { - jlen := min(nv, max(ktop, incol)-jrow) - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, nu, nu, - 1, h[jrow*ldh+incol+k0+1:], ldh, - u[k0*ldu+k0:], ldu, - 0, wv, ldwv) - impl.Dlacpy(blas.All, jlen, nu, wv, ldwv, h[jrow*ldh+incol+k0+1:], ldh) - } - - // Z multiply (also vertical). - if wantz { - for jrow := iloz; jrow <= ihiz; jrow += nv { - jlen := min(nv, ihiz-jrow+1) - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, nu, nu, - 1, z[jrow*ldz+incol+k0+1:], ldz, - u[k0*ldu+k0:], ldu, - 0, wv, ldwv) - impl.Dlacpy(blas.All, jlen, nu, wv, ldwv, z[jrow*ldz+incol+k0+1:], ldz) - } - } - - continue - } - - // Updates exploiting U's 2×2 block structure. - - // i2, i4, j2, j4 are the last rows and columns of the blocks. - i2 := (kdu + 1) / 2 - i4 := kdu - j2 := i4 - i2 - j4 := kdu - - // kzs and knz deal with the band of zeros along the diagonal of one of the - // triangular blocks. - kzs := (j4 - j2) - (ns + 1) - knz := ns + 1 - - // Horizontal multiply. - for jcol := min(ndcol, kbot) + 1; jcol <= jbot; jcol += nh { - jlen := min(nh, jbot-jcol+1) - - // Copy bottom of H to top+kzs of scratch (the first kzs - // rows get multiplied by zero). - impl.Dlacpy(blas.All, knz, jlen, h[(incol+1+j2)*ldh+jcol:], ldh, wh[kzs*ldwh:], ldwh) - - // Multiply by U21^T. - impl.Dlaset(blas.All, kzs, jlen, 0, 0, wh, ldwh) - bi.Dtrmm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, knz, jlen, - 1, u[j2*ldu+kzs:], ldu, wh[kzs*ldwh:], ldwh) - - // Multiply top of H by U11^T. - bi.Dgemm(blas.Trans, blas.NoTrans, i2, jlen, j2, - 1, u, ldu, h[(incol+1)*ldh+jcol:], ldh, - 1, wh, ldwh) - - // Copy top of H to bottom of WH. - impl.Dlacpy(blas.All, j2, jlen, h[(incol+1)*ldh+jcol:], ldh, wh[i2*ldwh:], ldwh) - - // Multiply by U21^T. - bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, j2, jlen, - 1, u[i2:], ldu, wh[i2*ldwh:], ldwh) - - // Multiply by U22. - bi.Dgemm(blas.Trans, blas.NoTrans, i4-i2, jlen, j4-j2, - 1, u[j2*ldu+i2:], ldu, h[(incol+1+j2)*ldh+jcol:], ldh, - 1, wh[i2*ldwh:], ldwh) - - // Copy it back. - impl.Dlacpy(blas.All, kdu, jlen, wh, ldwh, h[(incol+1)*ldh+jcol:], ldh) - } - - // Vertical multiply. - for jrow := jtop; jrow <= max(incol, ktop)-1; jrow += nv { - jlen := min(nv, max(incol, ktop)-jrow) - - // Copy right of H to scratch (the first kzs columns get multiplied - // by zero). - impl.Dlacpy(blas.All, jlen, knz, h[jrow*ldh+incol+1+j2:], ldh, wv[kzs:], ldwv) - - // Multiply by U21. - impl.Dlaset(blas.All, jlen, kzs, 0, 0, wv, ldwv) - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.NonUnit, jlen, knz, - 1, u[j2*ldu+kzs:], ldu, wv[kzs:], ldwv) - - // Multiply by U11. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i2, j2, - 1, h[jrow*ldh+incol+1:], ldh, u, ldu, - 1, wv, ldwv) - - // Copy left of H to right of scratch. - impl.Dlacpy(blas.All, jlen, j2, h[jrow*ldh+incol+1:], ldh, wv[i2:], ldwv) - - // Multiply by U21. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.NonUnit, jlen, i4-i2, - 1, u[i2:], ldu, wv[i2:], ldwv) - - // Multiply by U22. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i4-i2, j4-j2, - 1, h[jrow*ldh+incol+1+j2:], ldh, u[j2*ldu+i2:], ldu, - 1, wv[i2:], ldwv) - - // Copy it back. - impl.Dlacpy(blas.All, jlen, kdu, wv, ldwv, h[jrow*ldh+incol+1:], ldh) - } - - if !wantz { - continue - } - // Multiply Z (also vertical). - for jrow := iloz; jrow <= ihiz; jrow += nv { - jlen := min(nv, ihiz-jrow+1) - - // Copy right of Z to left of scratch (first kzs columns get - // multiplied by zero). - impl.Dlacpy(blas.All, jlen, knz, z[jrow*ldz+incol+1+j2:], ldz, wv[kzs:], ldwv) - - // Multiply by U12. - impl.Dlaset(blas.All, jlen, kzs, 0, 0, wv, ldwv) - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.NonUnit, jlen, knz, - 1, u[j2*ldu+kzs:], ldu, wv[kzs:], ldwv) - - // Multiply by U11. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i2, j2, - 1, z[jrow*ldz+incol+1:], ldz, u, ldu, - 1, wv, ldwv) - - // Copy left of Z to right of scratch. - impl.Dlacpy(blas.All, jlen, j2, z[jrow*ldz+incol+1:], ldz, wv[i2:], ldwv) - - // Multiply by U21. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.NonUnit, jlen, i4-i2, - 1, u[i2:], ldu, wv[i2:], ldwv) - - // Multiply by U22. - bi.Dgemm(blas.NoTrans, blas.NoTrans, jlen, i4-i2, j4-j2, - 1, z[jrow*ldz+incol+1+j2:], ldz, u[j2*ldu+i2:], ldu, - 1, wv[i2:], ldwv) - - // Copy the result back to Z. - impl.Dlacpy(blas.All, jlen, kdu, wv, ldwv, z[jrow*ldz+incol+1:], ldz) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go deleted file mode 100644 index 9fc97a328..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarf.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlarf applies an elementary reflector to a general rectangular matrix c. -// This computes -// c = h * c if side == Left -// c = c * h if side == right -// where -// h = 1 - tau * v * v^T -// and c is an m * n matrix. -// -// work is temporary storage of length at least m if side == Left and at least -// n if side == Right. This function will panic if this length requirement is not met. -// -// Dlarf is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlarf(side blas.Side, m, n int, v []float64, incv int, tau float64, c []float64, ldc int, work []float64) { - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case incv == 0: - panic(zeroIncV) - case ldc < max(1, n): - panic(badLdC) - } - - if m == 0 || n == 0 { - return - } - - applyleft := side == blas.Left - lenV := n - if applyleft { - lenV = m - } - - switch { - case len(v) < 1+(lenV-1)*abs(incv): - panic(shortV) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case (applyleft && len(work) < n) || (!applyleft && len(work) < m): - panic(shortWork) - } - - lastv := 0 // last non-zero element of v - lastc := 0 // last non-zero row/column of c - if tau != 0 { - var i int - if applyleft { - lastv = m - 1 - } else { - lastv = n - 1 - } - if incv > 0 { - i = lastv * incv - } - - // Look for the last non-zero row in v. - for lastv >= 0 && v[i] == 0 { - lastv-- - i -= incv - } - if applyleft { - // Scan for the last non-zero column in C[0:lastv, :] - lastc = impl.Iladlc(lastv+1, n, c, ldc) - } else { - // Scan for the last non-zero row in C[:, 0:lastv] - lastc = impl.Iladlr(m, lastv+1, c, ldc) - } - } - if lastv == -1 || lastc == -1 { - return - } - // Sometimes 1-indexing is nicer ... - bi := blas64.Implementation() - if applyleft { - // Form H * C - // w[0:lastc+1] = c[1:lastv+1, 1:lastc+1]^T * v[1:lastv+1,1] - bi.Dgemv(blas.Trans, lastv+1, lastc+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0: lastv, 0: lastc] = c[...] - w[0:lastv, 1] * v[1:lastc, 1]^T - bi.Dger(lastv+1, lastc+1, -tau, v, incv, work, 1, c, ldc) - return - } - // Form C*H - // w[0:lastc+1,1] := c[0:lastc+1,0:lastv+1] * v[0:lastv+1,1] - bi.Dgemv(blas.NoTrans, lastc+1, lastv+1, 1, c, ldc, v, incv, 0, work, 1) - // c[0:lastc+1,0:lastv+1] = c[...] - w[0:lastc+1,0] * v[0:lastv+1,0]^T - bi.Dger(lastc+1, lastv+1, -tau, work, 1, v, incv, c, ldc) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go deleted file mode 100644 index 4dd8e063a..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfb.go +++ /dev/null @@ -1,449 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlarfb applies a block reflector to a matrix. -// -// In the call to Dlarfb, the mxn c is multiplied by the implicitly defined matrix h as follows: -// c = h * c if side == Left and trans == NoTrans -// c = c * h if side == Right and trans == NoTrans -// c = h^T * c if side == Left and trans == Trans -// c = c * h^T if side == Right and trans == Trans -// h is a product of elementary reflectors. direct sets the direction of multiplication -// h = h_1 * h_2 * ... * h_k if direct == Forward -// h = h_k * h_k-1 * ... * h_1 if direct == Backward -// The combination of direct and store defines the orientation of the elementary -// reflectors. In all cases the ones on the diagonal are implicitly represented. -// -// If direct == lapack.Forward and store == lapack.ColumnWise -// V = [ 1 ] -// [v1 1 ] -// [v1 v2 1] -// [v1 v2 v3] -// [v1 v2 v3] -// If direct == lapack.Forward and store == lapack.RowWise -// V = [ 1 v1 v1 v1 v1] -// [ 1 v2 v2 v2] -// [ 1 v3 v3] -// If direct == lapack.Backward and store == lapack.ColumnWise -// V = [v1 v2 v3] -// [v1 v2 v3] -// [ 1 v2 v3] -// [ 1 v3] -// [ 1] -// If direct == lapack.Backward and store == lapack.RowWise -// V = [v1 v1 1 ] -// [v2 v2 v2 1 ] -// [v3 v3 v3 v3 1] -// An elementary reflector can be explicitly constructed by extracting the -// corresponding elements of v, placing a 1 where the diagonal would be, and -// placing zeros in the remaining elements. -// -// t is a k×k matrix containing the block reflector, and this function will panic -// if t is not of sufficient size. See Dlarft for more information. -// -// work is a temporary storage matrix with stride ldwork. -// work must be of size at least n×k side == Left and m×k if side == Right, and -// this function will panic if this size is not met. -// -// Dlarfb is an internal routine. It is exported for testing purposes. -func (Implementation) Dlarfb(side blas.Side, trans blas.Transpose, direct lapack.Direct, store lapack.StoreV, m, n, k int, v []float64, ldv int, t []float64, ldt int, c []float64, ldc int, work []float64, ldwork int) { - nv := m - if side == blas.Right { - nv = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case direct != lapack.Forward && direct != lapack.Backward: - panic(badDirect) - case store != lapack.ColumnWise && store != lapack.RowWise: - panic(badStoreV) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case store == lapack.ColumnWise && ldv < max(1, k): - panic(badLdV) - case store == lapack.RowWise && ldv < max(1, nv): - panic(badLdV) - case ldt < max(1, k): - panic(badLdT) - case ldc < max(1, n): - panic(badLdC) - case ldwork < max(1, k): - panic(badLdWork) - } - - if m == 0 || n == 0 { - return - } - - nw := n - if side == blas.Right { - nw = m - } - switch { - case store == lapack.ColumnWise && len(v) < (nv-1)*ldv+k: - panic(shortV) - case store == lapack.RowWise && len(v) < (k-1)*ldv+nv: - panic(shortV) - case len(t) < (k-1)*ldt+k: - panic(shortT) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(work) < (nw-1)*ldwork+k: - panic(shortWork) - } - - bi := blas64.Implementation() - - transt := blas.Trans - if trans == blas.Trans { - transt = blas.NoTrans - } - // TODO(btracey): This follows the original Lapack code where the - // elements are copied into the columns of the working array. The - // loops should go in the other direction so the data is written - // into the rows of work so the copy is not strided. A bigger change - // would be to replace work with work^T, but benchmarks would be - // needed to see if the change is merited. - if store == lapack.ColumnWise { - if direct == lapack.Forward { - // V1 is the first k rows of C. V2 is the remaining rows. - if side == blas.Left { - // W = C^T V = C1^T V1 + C2^T V2 (stored in work). - - // W = C1. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[j*ldc:], 1, work[j:], ldwork) - } - // W = W * V1. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, - n, k, 1, - v, ldv, - work, ldwork) - if m > k { - // W = W + C2^T V2. - bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, - 1, c[k*ldc:], ldc, v[k*ldv:], ldv, - 1, work, ldwork) - } - // W = W * T^T or W * T. - bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= V * W^T. - if m > k { - // C2 -= V2 * W^T. - bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, - -1, v[k*ldv:], ldv, work, ldwork, - 1, c[k*ldc:], ldc) - } - // W *= V1^T. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, - 1, v, ldv, - work, ldwork) - // C1 -= W^T. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[j*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C = C * H or C * H^T, where C = (C1 C2). - - // W = C1. - for i := 0; i < k; i++ { - bi.Dcopy(m, c[i:], ldc, work[i:], ldwork) - } - // W *= V1. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, k, n-k, - 1, c[k:], ldc, v[k*ldv:], ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m, n-k, k, - -1, work, ldwork, v[k*ldv:], ldv, - 1, c[k:], ldc) - } - // C -= W * V^T. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - // C -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+j] -= work[i*ldwork+j] - } - } - return - } - // V = (V1) - // = (V2) (last k rows) - // Where V2 is unit upper triangular. - if side == blas.Left { - // Form H * C or - // W = C^T V. - - // W = C2^T. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) - } - // W *= V2. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, n, k, - 1, v[(m-k)*ldv:], ldv, - work, ldwork) - if m > k { - // W += C1^T * V1. - bi.Dgemm(blas.Trans, blas.NoTrans, n, k, m-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= V * W^T. - if m > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m-k, n, k, - -1, v, ldv, work, ldwork, - 1, c, ldc) - } - // W *= V2^T. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, - 1, v[(m-k)*ldv:], ldv, - work, ldwork) - // C2 -= W^T. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[(m-k+j)*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V. - - // W = C2. - for j := 0; j < k; j++ { - bi.Dcopy(m, c[n-k+j:], ldc, work[j:], ldwork) - } - - // W = W * V2. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, m, k, - 1, v[(n-k)*ldv:], ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, k, n-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - // C -= W * V^T. - if n > k { - // C1 -= W * V1^T. - bi.Dgemm(blas.NoTrans, blas.Trans, m, n-k, k, - -1, work, ldwork, v, ldv, - 1, c, ldc) - } - // W *= V2^T. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, - 1, v[(n-k)*ldv:], ldv, - work, ldwork) - // C2 -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+n-k+j] -= work[i*ldwork+j] - } - } - return - } - // Store = Rowwise. - if direct == lapack.Forward { - // V = (V1 V2) where v1 is unit upper triangular. - if side == blas.Left { - // Form H * C or H^T * C where C = (C1; C2). - // W = C^T * V^T. - - // W = C1^T. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[j*ldc:], 1, work[j:], ldwork) - } - // W *= V1^T. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, n, k, - 1, v, ldv, - work, ldwork) - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, n, k, m-k, - 1, c[k*ldc:], ldc, v[k:], ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Upper, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= V^T * W^T. - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, - -1, v[k:], ldv, work, ldwork, - 1, c[k*ldc:], ldc) - } - // W *= V1. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, n, k, - 1, v, ldv, - work, ldwork) - // C1 -= W^T. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[j*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V^T. - - // W = C1. - for j := 0; j < k; j++ { - bi.Dcopy(m, c[j:], ldc, work[j:], ldwork) - } - // W *= V1^T. - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m, k, n-k, - 1, c[k:], ldc, v[k:], ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Upper, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - // C -= W * V. - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n-k, k, - -1, work, ldwork, v[k:], ldv, - 1, c[k:], ldc) - } - // W *= V1. - bi.Dtrmm(blas.Right, blas.Upper, blas.NoTrans, blas.Unit, m, k, - 1, v, ldv, - work, ldwork) - // C1 -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+j] -= work[i*ldwork+j] - } - } - return - } - // V = (V1 V2) where V2 is the last k columns and is lower unit triangular. - if side == blas.Left { - // Form H * C or H^T C where C = (C1 ; C2). - // W = C^T * V^T. - - // W = C2^T. - for j := 0; j < k; j++ { - bi.Dcopy(n, c[(m-k+j)*ldc:], 1, work[j:], ldwork) - } - // W *= V2^T. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, n, k, - 1, v[m-k:], ldv, - work, ldwork) - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, n, k, m-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Lower, transt, blas.NonUnit, n, k, - 1, t, ldt, - work, ldwork) - // C -= V^T * W^T. - if m > k { - bi.Dgemm(blas.Trans, blas.Trans, m-k, n, k, - -1, v, ldv, work, ldwork, - 1, c, ldc) - } - // W *= V2. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, k, - 1, v[m-k:], ldv, - work, ldwork) - // C2 -= W^T. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < n; i++ { - for j := 0; j < k; j++ { - c[(m-k+j)*ldc+i] -= work[i*ldwork+j] - } - } - return - } - // Form C * H or C * H^T where C = (C1 C2). - // W = C * V^T. - // W = C2. - for j := 0; j < k; j++ { - bi.Dcopy(m, c[n-k+j:], ldc, work[j:], ldwork) - } - // W *= V2^T. - bi.Dtrmm(blas.Right, blas.Lower, blas.Trans, blas.Unit, m, k, - 1, v[n-k:], ldv, - work, ldwork) - if n > k { - bi.Dgemm(blas.NoTrans, blas.Trans, m, k, n-k, - 1, c, ldc, v, ldv, - 1, work, ldwork) - } - // W *= T or T^T. - bi.Dtrmm(blas.Right, blas.Lower, trans, blas.NonUnit, m, k, - 1, t, ldt, - work, ldwork) - // C -= W * V. - if n > k { - bi.Dgemm(blas.NoTrans, blas.NoTrans, m, n-k, k, - -1, work, ldwork, v, ldv, - 1, c, ldc) - } - // W *= V2. - bi.Dtrmm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, m, k, - 1, v[n-k:], ldv, - work, ldwork) - // C1 -= W. - // TODO(btracey): This should use blas.Axpy. - for i := 0; i < m; i++ { - for j := 0; j < k; j++ { - c[i*ldc+n-k+j] -= work[i*ldwork+j] - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go deleted file mode 100644 index e037fdd6b..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfg.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlarfg generates an elementary reflector for a Householder matrix. It creates -// a real elementary reflector of order n such that -// H * (alpha) = (beta) -// ( x) ( 0) -// H^T * H = I -// H is represented in the form -// H = 1 - tau * (1; v) * (1 v^T) -// where tau is a real scalar. -// -// On entry, x contains the vector x, on exit it contains v. -// -// Dlarfg is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlarfg(n int, alpha float64, x []float64, incX int) (beta, tau float64) { - switch { - case n < 0: - panic(nLT0) - case incX <= 0: - panic(badIncX) - } - - if n <= 1 { - return alpha, 0 - } - - if len(x) < 1+(n-2)*abs(incX) { - panic(shortX) - } - - bi := blas64.Implementation() - - xnorm := bi.Dnrm2(n-1, x, incX) - if xnorm == 0 { - return alpha, 0 - } - beta = -math.Copysign(impl.Dlapy2(alpha, xnorm), alpha) - safmin := dlamchS / dlamchE - knt := 0 - if math.Abs(beta) < safmin { - // xnorm and beta may be inaccurate, scale x and recompute. - rsafmn := 1 / safmin - for { - knt++ - bi.Dscal(n-1, rsafmn, x, incX) - beta *= rsafmn - alpha *= rsafmn - if math.Abs(beta) >= safmin { - break - } - } - xnorm = bi.Dnrm2(n-1, x, incX) - beta = -math.Copysign(impl.Dlapy2(alpha, xnorm), alpha) - } - tau = (beta - alpha) / beta - bi.Dscal(n-1, 1/(alpha-beta), x, incX) - for j := 0; j < knt; j++ { - beta *= safmin - } - return beta, tau -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go deleted file mode 100644 index 8f03eb8b3..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarft.go +++ /dev/null @@ -1,166 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlarft forms the triangular factor T of a block reflector H, storing the answer -// in t. -// H = I - V * T * V^T if store == lapack.ColumnWise -// H = I - V^T * T * V if store == lapack.RowWise -// H is defined by a product of the elementary reflectors where -// H = H_0 * H_1 * ... * H_{k-1} if direct == lapack.Forward -// H = H_{k-1} * ... * H_1 * H_0 if direct == lapack.Backward -// -// t is a k×k triangular matrix. t is upper triangular if direct = lapack.Forward -// and lower triangular otherwise. This function will panic if t is not of -// sufficient size. -// -// store describes the storage of the elementary reflectors in v. See -// Dlarfb for a description of layout. -// -// tau contains the scalar factors of the elementary reflectors H_i. -// -// Dlarft is an internal routine. It is exported for testing purposes. -func (Implementation) Dlarft(direct lapack.Direct, store lapack.StoreV, n, k int, v []float64, ldv int, tau []float64, t []float64, ldt int) { - mv, nv := n, k - if store == lapack.RowWise { - mv, nv = k, n - } - switch { - case direct != lapack.Forward && direct != lapack.Backward: - panic(badDirect) - case store != lapack.RowWise && store != lapack.ColumnWise: - panic(badStoreV) - case n < 0: - panic(nLT0) - case k < 1: - panic(kLT1) - case ldv < max(1, nv): - panic(badLdV) - case len(tau) < k: - panic(shortTau) - case ldt < max(1, k): - panic(shortT) - } - - if n == 0 { - return - } - - switch { - case len(v) < (mv-1)*ldv+nv: - panic(shortV) - case len(t) < (k-1)*ldt+k: - panic(shortT) - } - - bi := blas64.Implementation() - - // TODO(btracey): There are a number of minor obvious loop optimizations here. - // TODO(btracey): It may be possible to rearrange some of the code so that - // index of 1 is more common in the Dgemv. - if direct == lapack.Forward { - prevlastv := n - 1 - for i := 0; i < k; i++ { - prevlastv = max(i, prevlastv) - if tau[i] == 0 { - for j := 0; j <= i; j++ { - t[j*ldt+i] = 0 - } - continue - } - var lastv int - if store == lapack.ColumnWise { - // skip trailing zeros - for lastv = n - 1; lastv >= i+1; lastv-- { - if v[lastv*ldv+i] != 0 { - break - } - } - for j := 0; j < i; j++ { - t[j*ldt+i] = -tau[i] * v[i*ldv+j] - } - j := min(lastv, prevlastv) - bi.Dgemv(blas.Trans, j-i, i, - -tau[i], v[(i+1)*ldv:], ldv, v[(i+1)*ldv+i:], ldv, - 1, t[i:], ldt) - } else { - for lastv = n - 1; lastv >= i+1; lastv-- { - if v[i*ldv+lastv] != 0 { - break - } - } - for j := 0; j < i; j++ { - t[j*ldt+i] = -tau[i] * v[j*ldv+i] - } - j := min(lastv, prevlastv) - bi.Dgemv(blas.NoTrans, i, j-i, - -tau[i], v[i+1:], ldv, v[i*ldv+i+1:], 1, - 1, t[i:], ldt) - } - bi.Dtrmv(blas.Upper, blas.NoTrans, blas.NonUnit, i, t, ldt, t[i:], ldt) - t[i*ldt+i] = tau[i] - if i > 1 { - prevlastv = max(prevlastv, lastv) - } else { - prevlastv = lastv - } - } - return - } - prevlastv := 0 - for i := k - 1; i >= 0; i-- { - if tau[i] == 0 { - for j := i; j < k; j++ { - t[j*ldt+i] = 0 - } - continue - } - var lastv int - if i < k-1 { - if store == lapack.ColumnWise { - for lastv = 0; lastv < i; lastv++ { - if v[lastv*ldv+i] != 0 { - break - } - } - for j := i + 1; j < k; j++ { - t[j*ldt+i] = -tau[i] * v[(n-k+i)*ldv+j] - } - j := max(lastv, prevlastv) - bi.Dgemv(blas.Trans, n-k+i-j, k-i-1, - -tau[i], v[j*ldv+i+1:], ldv, v[j*ldv+i:], ldv, - 1, t[(i+1)*ldt+i:], ldt) - } else { - for lastv = 0; lastv < i; lastv++ { - if v[i*ldv+lastv] != 0 { - break - } - } - for j := i + 1; j < k; j++ { - t[j*ldt+i] = -tau[i] * v[j*ldv+n-k+i] - } - j := max(lastv, prevlastv) - bi.Dgemv(blas.NoTrans, k-i-1, n-k+i-j, - -tau[i], v[(i+1)*ldv+j:], ldv, v[i*ldv+j:], 1, - 1, t[(i+1)*ldt+i:], ldt) - } - bi.Dtrmv(blas.Lower, blas.NoTrans, blas.NonUnit, k-i-1, - t[(i+1)*ldt+i+1:], ldt, - t[(i+1)*ldt+i:], ldt) - if i > 0 { - prevlastv = min(prevlastv, lastv) - } else { - prevlastv = lastv - } - } - t[i*ldt+i] = tau[i] - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go deleted file mode 100644 index d7928c8cf..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlarfx.go +++ /dev/null @@ -1,550 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dlarfx applies an elementary reflector H to a real m×n matrix C, from either -// the left or the right, with loop unrolling when the reflector has order less -// than 11. -// -// H is represented in the form -// H = I - tau * v * v^T, -// where tau is a real scalar and v is a real vector. If tau = 0, then H is -// taken to be the identity matrix. -// -// v must have length equal to m if side == blas.Left, and equal to n if side == -// blas.Right, otherwise Dlarfx will panic. -// -// c and ldc represent the m×n matrix C. On return, C is overwritten by the -// matrix H * C if side == blas.Left, or C * H if side == blas.Right. -// -// work must have length at least n if side == blas.Left, and at least m if side -// == blas.Right, otherwise Dlarfx will panic. work is not referenced if H has -// order < 11. -// -// Dlarfx is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlarfx(side blas.Side, m, n int, v []float64, tau float64, c []float64, ldc int, work []float64) { - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - nh := m - lwork := n - if side == blas.Right { - nh = n - lwork = m - } - switch { - case len(v) < nh: - panic(shortV) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case nh > 10 && len(work) < lwork: - panic(shortWork) - } - - if tau == 0 { - return - } - - if side == blas.Left { - // Form H * C, where H has order m. - switch m { - default: // Code for general m. - impl.Dlarf(side, m, n, v, 1, tau, c, ldc, work) - return - - case 0: // No-op for zero size matrix. - return - - case 1: // Special code for 1×1 Householder matrix. - t0 := 1 - tau*v[0]*v[0] - for j := 0; j < n; j++ { - c[j] *= t0 - } - return - - case 2: // Special code for 2×2 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - } - return - - case 3: // Special code for 3×3 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - } - return - - case 4: // Special code for 4×4 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - } - return - - case 5: // Special code for 5×5 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - } - return - - case 6: // Special code for 6×6 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - } - return - - case 7: // Special code for 7×7 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - } - return - - case 8: // Special code for 8×8 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] + v7*c[7*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - c[7*ldc+j] -= sum * t7 - } - return - - case 9: // Special code for 9×9 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] + v7*c[7*ldc+j] + v8*c[8*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - c[7*ldc+j] -= sum * t7 - c[8*ldc+j] -= sum * t8 - } - return - - case 10: // Special code for 10×10 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - v9 := v[9] - t9 := tau * v9 - for j := 0; j < n; j++ { - sum := v0*c[j] + v1*c[ldc+j] + v2*c[2*ldc+j] + v3*c[3*ldc+j] + v4*c[4*ldc+j] + - v5*c[5*ldc+j] + v6*c[6*ldc+j] + v7*c[7*ldc+j] + v8*c[8*ldc+j] + v9*c[9*ldc+j] - c[j] -= sum * t0 - c[ldc+j] -= sum * t1 - c[2*ldc+j] -= sum * t2 - c[3*ldc+j] -= sum * t3 - c[4*ldc+j] -= sum * t4 - c[5*ldc+j] -= sum * t5 - c[6*ldc+j] -= sum * t6 - c[7*ldc+j] -= sum * t7 - c[8*ldc+j] -= sum * t8 - c[9*ldc+j] -= sum * t9 - } - return - } - } - - // Form C * H, where H has order n. - switch n { - default: // Code for general n. - impl.Dlarf(side, m, n, v, 1, tau, c, ldc, work) - return - - case 0: // No-op for zero size matrix. - return - - case 1: // Special code for 1×1 Householder matrix. - t0 := 1 - tau*v[0]*v[0] - for j := 0; j < m; j++ { - c[j*ldc] *= t0 - } - return - - case 2: // Special code for 2×2 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - } - return - - case 3: // Special code for 3×3 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - } - return - - case 4: // Special code for 4×4 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - } - return - - case 5: // Special code for 5×5 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - } - return - - case 6: // Special code for 6×6 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + v5*cs[5] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - } - return - - case 7: // Special code for 7×7 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - } - return - - case 8: // Special code for 8×8 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] + v7*cs[7] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - cs[7] -= sum * t7 - } - return - - case 9: // Special code for 9×9 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] + v7*cs[7] + v8*cs[8] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - cs[7] -= sum * t7 - cs[8] -= sum * t8 - } - return - - case 10: // Special code for 10×10 Householder matrix. - v0 := v[0] - t0 := tau * v0 - v1 := v[1] - t1 := tau * v1 - v2 := v[2] - t2 := tau * v2 - v3 := v[3] - t3 := tau * v3 - v4 := v[4] - t4 := tau * v4 - v5 := v[5] - t5 := tau * v5 - v6 := v[6] - t6 := tau * v6 - v7 := v[7] - t7 := tau * v7 - v8 := v[8] - t8 := tau * v8 - v9 := v[9] - t9 := tau * v9 - for j := 0; j < m; j++ { - cs := c[j*ldc:] - sum := v0*cs[0] + v1*cs[1] + v2*cs[2] + v3*cs[3] + v4*cs[4] + - v5*cs[5] + v6*cs[6] + v7*cs[7] + v8*cs[8] + v9*cs[9] - cs[0] -= sum * t0 - cs[1] -= sum * t1 - cs[2] -= sum * t2 - cs[3] -= sum * t3 - cs[4] -= sum * t4 - cs[5] -= sum * t5 - cs[6] -= sum * t6 - cs[7] -= sum * t7 - cs[8] -= sum * t8 - cs[9] -= sum * t9 - } - return - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go deleted file mode 100644 index ad6454613..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlartg.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlartg generates a plane rotation so that -// [ cs sn] * [f] = [r] -// [-sn cs] [g] = [0] -// This is a more accurate version of BLAS drotg, with the other differences that -// if g = 0, then cs = 1 and sn = 0, and if f = 0 and g != 0, then cs = 0 and sn = 1. -// If abs(f) > abs(g), cs will be positive. -// -// Dlartg is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlartg(f, g float64) (cs, sn, r float64) { - safmn2 := math.Pow(dlamchB, math.Trunc(math.Log(dlamchS/dlamchE)/math.Log(dlamchB)/2)) - safmx2 := 1 / safmn2 - if g == 0 { - cs = 1 - sn = 0 - r = f - return cs, sn, r - } - if f == 0 { - cs = 0 - sn = 1 - r = g - return cs, sn, r - } - f1 := f - g1 := g - scale := math.Max(math.Abs(f1), math.Abs(g1)) - if scale >= safmx2 { - var count int - for { - count++ - f1 *= safmn2 - g1 *= safmn2 - scale = math.Max(math.Abs(f1), math.Abs(g1)) - if scale < safmx2 { - break - } - } - r = math.Sqrt(f1*f1 + g1*g1) - cs = f1 / r - sn = g1 / r - for i := 0; i < count; i++ { - r *= safmx2 - } - } else if scale <= safmn2 { - var count int - for { - count++ - f1 *= safmx2 - g1 *= safmx2 - scale = math.Max(math.Abs(f1), math.Abs(g1)) - if scale >= safmn2 { - break - } - } - r = math.Sqrt(f1*f1 + g1*g1) - cs = f1 / r - sn = g1 / r - for i := 0; i < count; i++ { - r *= safmn2 - } - } else { - r = math.Sqrt(f1*f1 + g1*g1) - cs = f1 / r - sn = g1 / r - } - if math.Abs(f) > math.Abs(g) && cs < 0 { - cs *= -1 - sn *= -1 - r *= -1 - } - return cs, sn, r -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go deleted file mode 100644 index 9922b4aa7..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlas2.go +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlas2 computes the singular values of the 2×2 matrix defined by -// [F G] -// [0 H] -// The smaller and larger singular values are returned in that order. -// -// Dlas2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlas2(f, g, h float64) (ssmin, ssmax float64) { - fa := math.Abs(f) - ga := math.Abs(g) - ha := math.Abs(h) - fhmin := math.Min(fa, ha) - fhmax := math.Max(fa, ha) - if fhmin == 0 { - if fhmax == 0 { - return 0, ga - } - v := math.Min(fhmax, ga) / math.Max(fhmax, ga) - return 0, math.Max(fhmax, ga) * math.Sqrt(1+v*v) - } - if ga < fhmax { - as := 1 + fhmin/fhmax - at := (fhmax - fhmin) / fhmax - au := (ga / fhmax) * (ga / fhmax) - c := 2 / (math.Sqrt(as*as+au) + math.Sqrt(at*at+au)) - return fhmin * c, fhmax / c - } - au := fhmax / ga - if au == 0 { - return fhmin * fhmax / ga, ga - } - as := 1 + fhmin/fhmax - at := (fhmax - fhmin) / fhmax - c := 1 / (math.Sqrt(1+(as*au)*(as*au)) + math.Sqrt(1+(at*au)*(at*au))) - return 2 * (fhmin * c) * au, ga / (c + c) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go deleted file mode 100644 index 61c4eb79c..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlascl.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlascl multiplies an m×n matrix by the scalar cto/cfrom. -// -// cfrom must not be zero, and cto and cfrom must not be NaN, otherwise Dlascl -// will panic. -// -// Dlascl is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlascl(kind lapack.MatrixType, kl, ku int, cfrom, cto float64, m, n int, a []float64, lda int) { - switch kind { - default: - panic(badMatrixType) - case 'H', 'B', 'Q', 'Z': // See dlascl.f. - panic("not implemented") - case lapack.General, lapack.UpperTri, lapack.LowerTri: - if lda < max(1, n) { - panic(badLdA) - } - } - switch { - case cfrom == 0: - panic(zeroCFrom) - case math.IsNaN(cfrom): - panic(nanCFrom) - case math.IsNaN(cto): - panic(nanCTo) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - } - - if n == 0 || m == 0 { - return - } - - switch kind { - case lapack.General, lapack.UpperTri, lapack.LowerTri: - if len(a) < (m-1)*lda+n { - panic(shortA) - } - } - - smlnum := dlamchS - bignum := 1 / smlnum - cfromc := cfrom - ctoc := cto - cfrom1 := cfromc * smlnum - for { - var done bool - var mul, ctol float64 - if cfrom1 == cfromc { - // cfromc is inf. - mul = ctoc / cfromc - done = true - ctol = ctoc - } else { - ctol = ctoc / bignum - if ctol == ctoc { - // ctoc is either 0 or inf. - mul = ctoc - done = true - cfromc = 1 - } else if math.Abs(cfrom1) > math.Abs(ctoc) && ctoc != 0 { - mul = smlnum - done = false - cfromc = cfrom1 - } else if math.Abs(ctol) > math.Abs(cfromc) { - mul = bignum - done = false - ctoc = ctol - } else { - mul = ctoc / cfromc - done = true - } - } - switch kind { - case lapack.General: - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = a[i*lda+j] * mul - } - } - case lapack.UpperTri: - for i := 0; i < m; i++ { - for j := i; j < n; j++ { - a[i*lda+j] = a[i*lda+j] * mul - } - } - case lapack.LowerTri: - for i := 0; i < m; i++ { - for j := 0; j <= min(i, n-1); j++ { - a[i*lda+j] = a[i*lda+j] * mul - } - } - } - if done { - break - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go deleted file mode 100644 index b4e63916f..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaset.go +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dlaset sets the off-diagonal elements of A to alpha, and the diagonal -// elements to beta. If uplo == blas.Upper, only the elements in the upper -// triangular part are set. If uplo == blas.Lower, only the elements in the -// lower triangular part are set. If uplo is otherwise, all of the elements of A -// are set. -// -// Dlaset is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaset(uplo blas.Uplo, m, n int, alpha, beta float64, a []float64, lda int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - minmn := min(m, n) - if minmn == 0 { - return - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - if uplo == blas.Upper { - for i := 0; i < m; i++ { - for j := i + 1; j < n; j++ { - a[i*lda+j] = alpha - } - } - } else if uplo == blas.Lower { - for i := 0; i < m; i++ { - for j := 0; j < min(i+1, n); j++ { - a[i*lda+j] = alpha - } - } - } else { - for i := 0; i < m; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = alpha - } - } - } - for i := 0; i < minmn; i++ { - a[i*lda+i] = beta - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go deleted file mode 100644 index 1f1d1dc42..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq1.go +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dlasq1 computes the singular values of an n×n bidiagonal matrix with diagonal -// d and off-diagonal e. On exit, d contains the singular values in decreasing -// order, and e is overwritten. d must have length at least n, e must have -// length at least n-1, and the input work must have length at least 4*n. Dlasq1 -// will panic if these conditions are not met. -// -// Dlasq1 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq1(n int, d, e, work []float64) (info int) { - if n < 0 { - panic(nLT0) - } - - if n == 0 { - return info - } - - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case len(work) < 4*n: - panic(shortWork) - } - - if n == 1 { - d[0] = math.Abs(d[0]) - return info - } - - if n == 2 { - d[1], d[0] = impl.Dlas2(d[0], e[0], d[1]) - return info - } - - // Estimate the largest singular value. - var sigmx float64 - for i := 0; i < n-1; i++ { - d[i] = math.Abs(d[i]) - sigmx = math.Max(sigmx, math.Abs(e[i])) - } - d[n-1] = math.Abs(d[n-1]) - // Early return if sigmx is zero (matrix is already diagonal). - if sigmx == 0 { - impl.Dlasrt(lapack.SortDecreasing, n, d) - return info - } - - for i := 0; i < n; i++ { - sigmx = math.Max(sigmx, d[i]) - } - - // Copy D and E into WORK (in the Z format) and scale (squaring the - // input data makes scaling by a power of the radix pointless). - - eps := dlamchP - safmin := dlamchS - scale := math.Sqrt(eps / safmin) - bi := blas64.Implementation() - bi.Dcopy(n, d, 1, work, 2) - bi.Dcopy(n-1, e, 1, work[1:], 2) - impl.Dlascl(lapack.General, 0, 0, sigmx, scale, 2*n-1, 1, work, 1) - - // Compute the q's and e's. - for i := 0; i < 2*n-1; i++ { - work[i] *= work[i] - } - work[2*n-1] = 0 - - info = impl.Dlasq2(n, work) - if info == 0 { - for i := 0; i < n; i++ { - d[i] = math.Sqrt(work[i]) - } - impl.Dlascl(lapack.General, 0, 0, scale, sigmx, n, 1, d, 1) - } else if info == 2 { - // Maximum number of iterations exceeded. Move data from work - // into D and E so the calling subroutine can try to finish. - for i := 0; i < n; i++ { - d[i] = math.Sqrt(work[2*i]) - e[i] = math.Sqrt(work[2*i+1]) - } - impl.Dlascl(lapack.General, 0, 0, scale, sigmx, n, 1, d, 1) - impl.Dlascl(lapack.General, 0, 0, scale, sigmx, n, 1, e, 1) - } - return info -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go deleted file mode 100644 index fd24a5509..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq2.go +++ /dev/null @@ -1,369 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dlasq2 computes all the eigenvalues of the symmetric positive -// definite tridiagonal matrix associated with the qd array Z. Eigevalues -// are computed to high relative accuracy avoiding denormalization, underflow -// and overflow. -// -// To see the relation of Z to the tridiagonal matrix, let L be a -// unit lower bidiagonal matrix with sub-diagonals Z(2,4,6,,..) and -// let U be an upper bidiagonal matrix with 1's above and diagonal -// Z(1,3,5,,..). The tridiagonal is L*U or, if you prefer, the -// symmetric tridiagonal to which it is similar. -// -// info returns a status error. The return codes mean as follows: -// 0: The algorithm completed successfully. -// 1: A split was marked by a positive value in e. -// 2: Current block of Z not diagonalized after 100*n iterations (in inner -// while loop). On exit Z holds a qd array with the same eigenvalues as -// the given Z. -// 3: Termination criterion of outer while loop not met (program created more -// than N unreduced blocks). -// -// z must have length at least 4*n, and must not contain any negative elements. -// Dlasq2 will panic otherwise. -// -// Dlasq2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq2(n int, z []float64) (info int) { - if n < 0 { - panic(nLT0) - } - - if n == 0 { - return info - } - - if len(z) < 4*n { - panic(shortZ) - } - - if n == 1 { - if z[0] < 0 { - panic(negZ) - } - return info - } - - const cbias = 1.5 - - eps := dlamchP - safmin := dlamchS - tol := eps * 100 - tol2 := tol * tol - if n == 2 { - if z[1] < 0 || z[2] < 0 { - panic(negZ) - } else if z[2] > z[0] { - z[0], z[2] = z[2], z[0] - } - z[4] = z[0] + z[1] + z[2] - if z[1] > z[2]*tol2 { - t := 0.5 * (z[0] - z[2] + z[1]) - s := z[2] * (z[1] / t) - if s <= t { - s = z[2] * (z[1] / (t * (1 + math.Sqrt(1+s/t)))) - } else { - s = z[2] * (z[1] / (t + math.Sqrt(t)*math.Sqrt(t+s))) - } - t = z[0] + s + z[1] - z[2] *= z[0] / t - z[0] = t - } - z[1] = z[2] - z[5] = z[1] + z[0] - return info - } - // Check for negative data and compute sums of q's and e's. - z[2*n-1] = 0 - emin := z[1] - var d, e, qmax float64 - var i1, n1 int - for k := 0; k < 2*(n-1); k += 2 { - if z[k] < 0 || z[k+1] < 0 { - panic(negZ) - } - d += z[k] - e += z[k+1] - qmax = math.Max(qmax, z[k]) - emin = math.Min(emin, z[k+1]) - } - if z[2*(n-1)] < 0 { - panic(negZ) - } - d += z[2*(n-1)] - // Check for diagonality. - if e == 0 { - for k := 1; k < n; k++ { - z[k] = z[2*k] - } - impl.Dlasrt(lapack.SortDecreasing, n, z) - z[2*(n-1)] = d - return info - } - trace := d + e - // Check for zero data. - if trace == 0 { - z[2*(n-1)] = 0 - return info - } - // Rearrange data for locality: Z=(q1,qq1,e1,ee1,q2,qq2,e2,ee2,...). - for k := 2 * n; k >= 2; k -= 2 { - z[2*k-1] = 0 - z[2*k-2] = z[k-1] - z[2*k-3] = 0 - z[2*k-4] = z[k-2] - } - i0 := 0 - n0 := n - 1 - - // Reverse the qd-array, if warranted. - // z[4*i0-3] --> z[4*(i0+1)-3-1] --> z[4*i0] - if cbias*z[4*i0] < z[4*n0] { - ipn4Out := 4 * (i0 + n0 + 2) - for i4loop := 4 * (i0 + 1); i4loop <= 2*(i0+n0+1); i4loop += 4 { - i4 := i4loop - 1 - ipn4 := ipn4Out - 1 - z[i4-3], z[ipn4-i4-4] = z[ipn4-i4-4], z[i4-3] - z[i4-1], z[ipn4-i4-6] = z[ipn4-i4-6], z[i4-1] - } - } - - // Initial split checking via dqd and Li's test. - pp := 0 - for k := 0; k < 2; k++ { - d = z[4*n0+pp] - for i4loop := 4*n0 + pp; i4loop >= 4*(i0+1)+pp; i4loop -= 4 { - i4 := i4loop - 1 - if z[i4-1] <= tol2*d { - z[i4-1] = math.Copysign(0, -1) - d = z[i4-3] - } else { - d = z[i4-3] * (d / (d + z[i4-1])) - } - } - // dqd maps Z to ZZ plus Li's test. - emin = z[4*(i0+1)+pp] - d = z[4*i0+pp] - for i4loop := 4*(i0+1) + pp; i4loop <= 4*n0+pp; i4loop += 4 { - i4 := i4loop - 1 - z[i4-2*pp-2] = d + z[i4-1] - if z[i4-1] <= tol2*d { - z[i4-1] = math.Copysign(0, -1) - z[i4-2*pp-2] = d - z[i4-2*pp] = 0 - d = z[i4+1] - } else if safmin*z[i4+1] < z[i4-2*pp-2] && safmin*z[i4-2*pp-2] < z[i4+1] { - tmp := z[i4+1] / z[i4-2*pp-2] - z[i4-2*pp] = z[i4-1] * tmp - d *= tmp - } else { - z[i4-2*pp] = z[i4+1] * (z[i4-1] / z[i4-2*pp-2]) - d = z[i4+1] * (d / z[i4-2*pp-2]) - } - emin = math.Min(emin, z[i4-2*pp]) - } - z[4*(n0+1)-pp-3] = d - - // Now find qmax. - qmax = z[4*(i0+1)-pp-3] - for i4loop := 4*(i0+1) - pp + 2; i4loop <= 4*(n0+1)+pp-2; i4loop += 4 { - i4 := i4loop - 1 - qmax = math.Max(qmax, z[i4]) - } - // Prepare for the next iteration on K. - pp = 1 - pp - } - - // Initialise variables to pass to DLASQ3. - var ttype int - var dmin1, dmin2, dn, dn1, dn2, g, tau float64 - var tempq float64 - iter := 2 - var nFail int - nDiv := 2 * (n0 - i0) - var i4 int -outer: - for iwhila := 1; iwhila <= n+1; iwhila++ { - // Test for completion. - if n0 < 0 { - // Move q's to the front. - for k := 1; k < n; k++ { - z[k] = z[4*k] - } - // Sort and compute sum of eigenvalues. - impl.Dlasrt(lapack.SortDecreasing, n, z) - e = 0 - for k := n - 1; k >= 0; k-- { - e += z[k] - } - // Store trace, sum(eigenvalues) and information on performance. - z[2*n] = trace - z[2*n+1] = e - z[2*n+2] = float64(iter) - z[2*n+3] = float64(nDiv) / float64(n*n) - z[2*n+4] = 100 * float64(nFail) / float64(iter) - return info - } - - // While array unfinished do - // e[n0] holds the value of sigma when submatrix in i0:n0 - // splits from the rest of the array, but is negated. - var desig float64 - var sigma float64 - if n0 != n-1 { - sigma = -z[4*(n0+1)-2] - } - if sigma < 0 { - info = 1 - return info - } - // Find last unreduced submatrix's top index i0, find qmax and - // emin. Find Gershgorin-type bound if Q's much greater than E's. - var emax float64 - if n0 > i0 { - emin = math.Abs(z[4*(n0+1)-6]) - } else { - emin = 0 - } - qmin := z[4*(n0+1)-4] - qmax = qmin - zSmall := false - for i4loop := 4 * (n0 + 1); i4loop >= 8; i4loop -= 4 { - i4 = i4loop - 1 - if z[i4-5] <= 0 { - zSmall = true - break - } - if qmin >= 4*emax { - qmin = math.Min(qmin, z[i4-3]) - emax = math.Max(emax, z[i4-5]) - } - qmax = math.Max(qmax, z[i4-7]+z[i4-5]) - emin = math.Min(emin, z[i4-5]) - } - if !zSmall { - i4 = 3 - } - i0 = (i4+1)/4 - 1 - pp = 0 - if n0-i0 > 1 { - dee := z[4*i0] - deemin := dee - kmin := i0 - for i4loop := 4*(i0+1) + 1; i4loop <= 4*(n0+1)-3; i4loop += 4 { - i4 := i4loop - 1 - dee = z[i4] * (dee / (dee + z[i4-2])) - if dee <= deemin { - deemin = dee - kmin = (i4+4)/4 - 1 - } - } - if (kmin-i0)*2 < n0-kmin && deemin <= 0.5*z[4*n0] { - ipn4Out := 4 * (i0 + n0 + 2) - pp = 2 - for i4loop := 4 * (i0 + 1); i4loop <= 2*(i0+n0+1); i4loop += 4 { - i4 := i4loop - 1 - ipn4 := ipn4Out - 1 - z[i4-3], z[ipn4-i4-4] = z[ipn4-i4-4], z[i4-3] - z[i4-2], z[ipn4-i4-3] = z[ipn4-i4-3], z[i4-2] - z[i4-1], z[ipn4-i4-6] = z[ipn4-i4-6], z[i4-1] - z[i4], z[ipn4-i4-5] = z[ipn4-i4-5], z[i4] - } - } - } - // Put -(initial shift) into DMIN. - dmin := -math.Max(0, qmin-2*math.Sqrt(qmin)*math.Sqrt(emax)) - - // Now i0:n0 is unreduced. - // PP = 0 for ping, PP = 1 for pong. - // PP = 2 indicates that flipping was applied to the Z array and - // and that the tests for deflation upon entry in Dlasq3 - // should not be performed. - nbig := 100 * (n0 - i0 + 1) - for iwhilb := 0; iwhilb < nbig; iwhilb++ { - if i0 > n0 { - continue outer - } - - // While submatrix unfinished take a good dqds step. - i0, n0, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau = - impl.Dlasq3(i0, n0, z, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau) - - pp = 1 - pp - // When emin is very small check for splits. - if pp == 0 && n0-i0 >= 3 { - if z[4*(n0+1)-1] <= tol2*qmax || z[4*(n0+1)-2] <= tol2*sigma { - splt := i0 - 1 - qmax = z[4*i0] - emin = z[4*(i0+1)-2] - oldemn := z[4*(i0+1)-1] - for i4loop := 4 * (i0 + 1); i4loop <= 4*(n0-2); i4loop += 4 { - i4 := i4loop - 1 - if z[i4] <= tol2*z[i4-3] || z[i4-1] <= tol2*sigma { - z[i4-1] = -sigma - splt = i4 / 4 - qmax = 0 - emin = z[i4+3] - oldemn = z[i4+4] - } else { - qmax = math.Max(qmax, z[i4+1]) - emin = math.Min(emin, z[i4-1]) - oldemn = math.Min(oldemn, z[i4]) - } - } - z[4*(n0+1)-2] = emin - z[4*(n0+1)-1] = oldemn - i0 = splt + 1 - } - } - } - // Maximum number of iterations exceeded, restore the shift - // sigma and place the new d's and e's in a qd array. - // This might need to be done for several blocks. - info = 2 - i1 = i0 - for { - tempq = z[4*i0] - z[4*i0] += sigma - for k := i0 + 1; k <= n0; k++ { - tempe := z[4*(k+1)-6] - z[4*(k+1)-6] *= tempq / z[4*(k+1)-8] - tempq = z[4*k] - z[4*k] += sigma + tempe - z[4*(k+1)-6] - } - // Prepare to do this on the previous block if there is one. - if i1 <= 0 { - break - } - n1 = i1 - 1 - for i1 >= 1 && z[4*(i1+1)-6] >= 0 { - i1 -= 1 - } - sigma = -z[4*(n1+1)-2] - } - for k := 0; k < n; k++ { - z[2*k] = z[4*k] - // Only the block 1..N0 is unfinished. The rest of the e's - // must be essentially zero, although sometimes other data - // has been stored in them. - if k < n0 { - z[2*(k+1)-1] = z[4*(k+1)-1] - } else { - z[2*(k+1)] = 0 - } - } - return info - } - info = 3 - return info -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go deleted file mode 100644 index a05e94ef1..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq3.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlasq3 checks for deflation, computes a shift (tau) and calls dqds. -// In case of failure it changes shifts, and tries again until output -// is positive. -// -// Dlasq3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq3(i0, n0 int, z []float64, pp int, dmin, sigma, desig, qmax float64, nFail, iter, nDiv int, ttype int, dmin1, dmin2, dn, dn1, dn2, g, tau float64) ( - i0Out, n0Out, ppOut int, dminOut, sigmaOut, desigOut, qmaxOut float64, nFailOut, iterOut, nDivOut, ttypeOut int, dmin1Out, dmin2Out, dnOut, dn1Out, dn2Out, gOut, tauOut float64) { - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1 && pp != 2: - panic(badPp) - } - - const cbias = 1.5 - - n0in := n0 - eps := dlamchP - tol := eps * 100 - tol2 := tol * tol - var nn int - var t float64 - for { - if n0 < i0 { - return i0, n0, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau - } - if n0 == i0 { - z[4*(n0+1)-4] = z[4*(n0+1)+pp-4] + sigma - n0-- - continue - } - nn = 4*(n0+1) + pp - 1 - if n0 != i0+1 { - // Check whether e[n0-1] is negligible, 1 eigenvalue. - if z[nn-5] > tol2*(sigma+z[nn-3]) && z[nn-2*pp-4] > tol2*z[nn-7] { - // Check whether e[n0-2] is negligible, 2 eigenvalues. - if z[nn-9] > tol2*sigma && z[nn-2*pp-8] > tol2*z[nn-11] { - break - } - } else { - z[4*(n0+1)-4] = z[4*(n0+1)+pp-4] + sigma - n0-- - continue - } - } - if z[nn-3] > z[nn-7] { - z[nn-3], z[nn-7] = z[nn-7], z[nn-3] - } - t = 0.5 * (z[nn-7] - z[nn-3] + z[nn-5]) - if z[nn-5] > z[nn-3]*tol2 && t != 0 { - s := z[nn-3] * (z[nn-5] / t) - if s <= t { - s = z[nn-3] * (z[nn-5] / (t * (1 + math.Sqrt(1+s/t)))) - } else { - s = z[nn-3] * (z[nn-5] / (t + math.Sqrt(t)*math.Sqrt(t+s))) - } - t = z[nn-7] + (s + z[nn-5]) - z[nn-3] *= z[nn-7] / t - z[nn-7] = t - } - z[4*(n0+1)-8] = z[nn-7] + sigma - z[4*(n0+1)-4] = z[nn-3] + sigma - n0 -= 2 - } - if pp == 2 { - pp = 0 - } - - // Reverse the qd-array, if warranted. - if dmin <= 0 || n0 < n0in { - if cbias*z[4*(i0+1)+pp-4] < z[4*(n0+1)+pp-4] { - ipn4Out := 4 * (i0 + n0 + 2) - for j4loop := 4 * (i0 + 1); j4loop <= 2*((i0+1)+(n0+1)-1); j4loop += 4 { - ipn4 := ipn4Out - 1 - j4 := j4loop - 1 - - z[j4-3], z[ipn4-j4-4] = z[ipn4-j4-4], z[j4-3] - z[j4-2], z[ipn4-j4-3] = z[ipn4-j4-3], z[j4-2] - z[j4-1], z[ipn4-j4-6] = z[ipn4-j4-6], z[j4-1] - z[j4], z[ipn4-j4-5] = z[ipn4-j4-5], z[j4] - } - if n0-i0 <= 4 { - z[4*(n0+1)+pp-2] = z[4*(i0+1)+pp-2] - z[4*(n0+1)-pp-1] = z[4*(i0+1)-pp-1] - } - dmin2 = math.Min(dmin2, z[4*(i0+1)-pp-2]) - z[4*(n0+1)+pp-2] = math.Min(math.Min(z[4*(n0+1)+pp-2], z[4*(i0+1)+pp-2]), z[4*(i0+1)+pp+2]) - z[4*(n0+1)-pp-1] = math.Min(math.Min(z[4*(n0+1)-pp-1], z[4*(i0+1)-pp-1]), z[4*(i0+1)-pp+3]) - qmax = math.Max(math.Max(qmax, z[4*(i0+1)+pp-4]), z[4*(i0+1)+pp]) - dmin = math.Copysign(0, -1) // Fortran code has -zero, but -0 in go is 0 - } - } - - // Choose a shift. - tau, ttype, g = impl.Dlasq4(i0, n0, z, pp, n0in, dmin, dmin1, dmin2, dn, dn1, dn2, tau, ttype, g) - - // Call dqds until dmin > 0. -loop: - for { - i0, n0, pp, tau, sigma, dmin, dmin1, dmin2, dn, dn1, dn2 = impl.Dlasq5(i0, n0, z, pp, tau, sigma) - - nDiv += n0 - i0 + 2 - iter++ - switch { - case dmin >= 0 && dmin1 >= 0: - // Success. - goto done - - case dmin < 0 && dmin1 > 0 && z[4*n0-pp-1] < tol*(sigma+dn1) && math.Abs(dn) < tol*sigma: - // Convergence hidden by negative dn. - z[4*n0-pp+1] = 0 - dmin = 0 - goto done - - case dmin < 0: - // Tau too big. Select new Tau and try again. - nFail++ - if ttype < -22 { - // Failed twice. Play it safe. - tau = 0 - } else if dmin1 > 0 { - // Late failure. Gives excellent shift. - tau = (tau + dmin) * (1 - 2*eps) - ttype -= 11 - } else { - // Early failure. Divide by 4. - tau = tau / 4 - ttype -= 12 - } - - case math.IsNaN(dmin): - if tau == 0 { - break loop - } - tau = 0 - - default: - // Possible underflow. Play it safe. - break loop - } - } - - // Risk of underflow. - dmin, dmin1, dmin2, dn, dn1, dn2 = impl.Dlasq6(i0, n0, z, pp) - nDiv += n0 - i0 + 2 - iter++ - tau = 0 - -done: - if tau < sigma { - desig += tau - t = sigma + desig - desig -= t - sigma - } else { - t = sigma + tau - desig += sigma - (t - tau) - } - sigma = t - return i0, n0, pp, dmin, sigma, desig, qmax, nFail, iter, nDiv, ttype, dmin1, dmin2, dn, dn1, dn2, g, tau -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go deleted file mode 100644 index f6dbb31b9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq4.go +++ /dev/null @@ -1,249 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlasq4 computes an approximation to the smallest eigenvalue using values of d -// from the previous transform. -// i0, n0, and n0in are zero-indexed. -// -// Dlasq4 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq4(i0, n0 int, z []float64, pp int, n0in int, dmin, dmin1, dmin2, dn, dn1, dn2, tau float64, ttype int, g float64) (tauOut float64, ttypeOut int, gOut float64) { - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1: - panic(badPp) - } - - const ( - cnst1 = 0.563 - cnst2 = 1.01 - cnst3 = 1.05 - - cnstthird = 0.333 // TODO(btracey): Fix? - ) - // A negative dmin forces the shift to take that absolute value - // ttype records the type of shift. - if dmin <= 0 { - tau = -dmin - ttype = -1 - return tau, ttype, g - } - nn := 4*(n0+1) + pp - 1 // -1 for zero indexing - s := math.NaN() // Poison s so that failure to take a path below is obvious - if n0in == n0 { - // No eigenvalues deflated. - if dmin == dn || dmin == dn1 { - b1 := math.Sqrt(z[nn-3]) * math.Sqrt(z[nn-5]) - b2 := math.Sqrt(z[nn-7]) * math.Sqrt(z[nn-9]) - a2 := z[nn-7] + z[nn-5] - if dmin == dn && dmin1 == dn1 { - gap2 := dmin2 - a2 - dmin2/4 - var gap1 float64 - if gap2 > 0 && gap2 > b2 { - gap1 = a2 - dn - (b2/gap2)*b2 - } else { - gap1 = a2 - dn - (b1 + b2) - } - if gap1 > 0 && gap1 > b1 { - s = math.Max(dn-(b1/gap1)*b1, 0.5*dmin) - ttype = -2 - } else { - s = 0 - if dn > b1 { - s = dn - b1 - } - if a2 > b1+b2 { - s = math.Min(s, a2-(b1+b2)) - } - s = math.Max(s, cnstthird*dmin) - ttype = -3 - } - } else { - ttype = -4 - s = dmin / 4 - var gam float64 - var np int - if dmin == dn { - gam = dn - a2 = 0 - if z[nn-5] > z[nn-7] { - return tau, ttype, g - } - b2 = z[nn-5] / z[nn-7] - np = nn - 9 - } else { - np = nn - 2*pp - gam = dn1 - if z[np-4] > z[np-2] { - return tau, ttype, g - } - a2 = z[np-4] / z[np-2] - if z[nn-9] > z[nn-11] { - return tau, ttype, g - } - b2 = z[nn-9] / z[nn-11] - np = nn - 13 - } - // Approximate contribution to norm squared from i < nn-1. - a2 += b2 - for i4loop := np + 1; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - if b2 == 0 { - break - } - b1 = b2 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b2 *= z[i4] / z[i4-2] - a2 += b2 - if 100*math.Max(b2, b1) < a2 || cnst1 < a2 { - break - } - } - a2 *= cnst3 - // Rayleigh quotient residual bound. - if a2 < cnst1 { - s = gam * (1 - math.Sqrt(a2)) / (1 + a2) - } - } - } else if dmin == dn2 { - ttype = -5 - s = dmin / 4 - // Compute contribution to norm squared from i > nn-2. - np := nn - 2*pp - b1 := z[np-2] - b2 := z[np-6] - gam := dn2 - if z[np-8] > b2 || z[np-4] > b1 { - return tau, ttype, g - } - a2 := (z[np-8] / b2) * (1 + z[np-4]/b1) - // Approximate contribution to norm squared from i < nn-2. - if n0-i0 > 2 { - b2 = z[nn-13] / z[nn-15] - a2 += b2 - for i4loop := (nn + 1) - 17; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - if b2 == 0 { - break - } - b1 = b2 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b2 *= z[i4] / z[i4-2] - a2 += b2 - if 100*math.Max(b2, b1) < a2 || cnst1 < a2 { - break - } - } - a2 *= cnst3 - } - if a2 < cnst1 { - s = gam * (1 - math.Sqrt(a2)) / (1 + a2) - } - } else { - // Case 6, no information to guide us. - if ttype == -6 { - g += cnstthird * (1 - g) - } else if ttype == -18 { - g = cnstthird / 4 - } else { - g = 1.0 / 4 - } - s = g * dmin - ttype = -6 - } - } else if n0in == (n0 + 1) { - // One eigenvalue just deflated. Use DMIN1, DN1 for DMIN and DN. - if dmin1 == dn1 && dmin2 == dn2 { - ttype = -7 - s = cnstthird * dmin1 - if z[nn-5] > z[nn-7] { - return tau, ttype, g - } - b1 := z[nn-5] / z[nn-7] - b2 := b1 - if b2 != 0 { - for i4loop := 4*(n0+1) - 9 + pp; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - a2 := b1 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b1 *= z[i4] / z[i4-2] - b2 += b1 - if 100*math.Max(b1, a2) < b2 { - break - } - } - } - b2 = math.Sqrt(cnst3 * b2) - a2 := dmin1 / (1 + b2*b2) - gap2 := 0.5*dmin2 - a2 - if gap2 > 0 && gap2 > b2*a2 { - s = math.Max(s, a2*(1-cnst2*a2*(b2/gap2)*b2)) - } else { - s = math.Max(s, a2*(1-cnst2*b2)) - ttype = -8 - } - } else { - s = dmin1 / 4 - if dmin1 == dn1 { - s = 0.5 * dmin1 - } - ttype = -9 - } - } else if n0in == (n0 + 2) { - // Two eigenvalues deflated. Use DMIN2, DN2 for DMIN and DN. - if dmin2 == dn2 && 2*z[nn-5] < z[nn-7] { - ttype = -10 - s = cnstthird * dmin2 - if z[nn-5] > z[nn-7] { - return tau, ttype, g - } - b1 := z[nn-5] / z[nn-7] - b2 := b1 - if b2 != 0 { - for i4loop := 4*(n0+1) - 9 + pp; i4loop >= 4*(i0+1)-1+pp; i4loop -= 4 { - i4 := i4loop - 1 - if z[i4] > z[i4-2] { - return tau, ttype, g - } - b1 *= z[i4] / z[i4-2] - b2 += b1 - if 100*b1 < b2 { - break - } - } - } - b2 = math.Sqrt(cnst3 * b2) - a2 := dmin2 / (1 + b2*b2) - gap2 := z[nn-7] + z[nn-9] - math.Sqrt(z[nn-11])*math.Sqrt(z[nn-9]) - a2 - if gap2 > 0 && gap2 > b2*a2 { - s = math.Max(s, a2*(1-cnst2*a2*(b2/gap2)*b2)) - } else { - s = math.Max(s, a2*(1-cnst2*b2)) - } - } else { - s = dmin2 / 4 - ttype = -11 - } - } else if n0in > n0+2 { - // Case 12, more than two eigenvalues deflated. No information. - s = 0 - ttype = -12 - } - tau = s - return tau, ttype, g -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go deleted file mode 100644 index d3826d918..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq5.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlasq5 computes one dqds transform in ping-pong form. -// i0 and n0 are zero-indexed. -// -// Dlasq5 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq5(i0, n0 int, z []float64, pp int, tau, sigma float64) (i0Out, n0Out, ppOut int, tauOut, sigmaOut, dmin, dmin1, dmin2, dn, dnm1, dnm2 float64) { - // The lapack function has inputs for ieee and eps, but Go requires ieee so - // these are unnecessary. - - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1: - panic(badPp) - } - - if n0-i0-1 <= 0 { - return i0, n0, pp, tau, sigma, dmin, dmin1, dmin2, dn, dnm1, dnm2 - } - - eps := dlamchP - dthresh := eps * (sigma + tau) - if tau < dthresh*0.5 { - tau = 0 - } - var j4 int - var emin float64 - if tau != 0 { - j4 = 4*i0 + pp - emin = z[j4+4] - d := z[j4] - tau - dmin = d - // In the reference there are code paths that actually return this value. - // dmin1 = -z[j4] - if pp == 0 { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-2] = d + z[j4-1] - tmp := z[j4+1] / z[j4-2] - d = d*tmp - tau - dmin = math.Min(dmin, d) - z[j4] = z[j4-1] * tmp - emin = math.Min(z[j4], emin) - } - } else { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-3] = d + z[j4] - tmp := z[j4+2] / z[j4-3] - d = d*tmp - tau - dmin = math.Min(dmin, d) - z[j4-1] = z[j4] * tmp - emin = math.Min(z[j4-1], emin) - } - } - // Unroll the last two steps. - dnm2 = d - dmin2 = dmin - j4 = 4*((n0+1)-2) - pp - 1 - j4p2 := j4 + 2*pp - 1 - z[j4-2] = dnm2 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dnm1 = z[j4p2+2]*(dnm2/z[j4-2]) - tau - dmin = math.Min(dmin, dnm1) - - dmin1 = dmin - j4 += 4 - j4p2 = j4 + 2*pp - 1 - z[j4-2] = dnm1 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dn = z[j4p2+2]*(dnm1/z[j4-2]) - tau - dmin = math.Min(dmin, dn) - } else { - // This is the version that sets d's to zero if they are small enough. - j4 = 4*(i0+1) + pp - 4 - emin = z[j4+4] - d := z[j4] - tau - dmin = d - // In the reference there are code paths that actually return this value. - // dmin1 = -z[j4] - if pp == 0 { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-2] = d + z[j4-1] - tmp := z[j4+1] / z[j4-2] - d = d*tmp - tau - if d < dthresh { - d = 0 - } - dmin = math.Min(dmin, d) - z[j4] = z[j4-1] * tmp - emin = math.Min(z[j4], emin) - } - } else { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-3] = d + z[j4] - tmp := z[j4+2] / z[j4-3] - d = d*tmp - tau - if d < dthresh { - d = 0 - } - dmin = math.Min(dmin, d) - z[j4-1] = z[j4] * tmp - emin = math.Min(z[j4-1], emin) - } - } - // Unroll the last two steps. - dnm2 = d - dmin2 = dmin - j4 = 4*((n0+1)-2) - pp - 1 - j4p2 := j4 + 2*pp - 1 - z[j4-2] = dnm2 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dnm1 = z[j4p2+2]*(dnm2/z[j4-2]) - tau - dmin = math.Min(dmin, dnm1) - - dmin1 = dmin - j4 += 4 - j4p2 = j4 + 2*pp - 1 - z[j4-2] = dnm1 + z[j4p2] - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dn = z[j4p2+2]*(dnm1/z[j4-2]) - tau - dmin = math.Min(dmin, dn) - } - z[j4+2] = dn - z[4*(n0+1)-pp-1] = emin - return i0, n0, pp, tau, sigma, dmin, dmin1, dmin2, dn, dnm1, dnm2 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go deleted file mode 100644 index 54bf58756..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasq6.go +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlasq6 computes one dqd transform in ping-pong form with protection against -// overflow and underflow. z has length at least 4*(n0+1) and holds the qd array. -// i0 is the zero-based first index. -// n0 is the zero-based last index. -// -// Dlasq6 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasq6(i0, n0 int, z []float64, pp int) (dmin, dmin1, dmin2, dn, dnm1, dnm2 float64) { - switch { - case i0 < 0: - panic(i0LT0) - case n0 < 0: - panic(n0LT0) - case len(z) < 4*n0: - panic(shortZ) - case pp != 0 && pp != 1: - panic(badPp) - } - - if n0-i0-1 <= 0 { - return dmin, dmin1, dmin2, dn, dnm1, dnm2 - } - - safmin := dlamchS - j4 := 4*(i0+1) + pp - 4 // -4 rather than -3 for zero indexing - emin := z[j4+4] - d := z[j4] - dmin = d - if pp == 0 { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 // Translate back to zero-indexed. - z[j4-2] = d + z[j4-1] - if z[j4-2] == 0 { - z[j4] = 0 - d = z[j4+1] - dmin = d - emin = 0 - } else if safmin*z[j4+1] < z[j4-2] && safmin*z[j4-2] < z[j4+1] { - tmp := z[j4+1] / z[j4-2] - z[j4] = z[j4-1] * tmp - d *= tmp - } else { - z[j4] = z[j4+1] * (z[j4-1] / z[j4-2]) - d = z[j4+1] * (d / z[j4-2]) - } - dmin = math.Min(dmin, d) - emin = math.Min(emin, z[j4]) - } - } else { - for j4loop := 4 * (i0 + 1); j4loop <= 4*((n0+1)-3); j4loop += 4 { - j4 := j4loop - 1 - z[j4-3] = d + z[j4] - if z[j4-3] == 0 { - z[j4-1] = 0 - d = z[j4+2] - dmin = d - emin = 0 - } else if safmin*z[j4+2] < z[j4-3] && safmin*z[j4-3] < z[j4+2] { - tmp := z[j4+2] / z[j4-3] - z[j4-1] = z[j4] * tmp - d *= tmp - } else { - z[j4-1] = z[j4+2] * (z[j4] / z[j4-3]) - d = z[j4+2] * (d / z[j4-3]) - } - dmin = math.Min(dmin, d) - emin = math.Min(emin, z[j4-1]) - } - } - // Unroll last two steps. - dnm2 = d - dmin2 = dmin - j4 = 4*(n0-1) - pp - 1 - j4p2 := j4 + 2*pp - 1 - z[j4-2] = dnm2 + z[j4p2] - if z[j4-2] == 0 { - z[j4] = 0 - dnm1 = z[j4p2+2] - dmin = dnm1 - emin = 0 - } else if safmin*z[j4p2+2] < z[j4-2] && safmin*z[j4-2] < z[j4p2+2] { - tmp := z[j4p2+2] / z[j4-2] - z[j4] = z[j4p2] * tmp - dnm1 = dnm2 * tmp - } else { - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dnm1 = z[j4p2+2] * (dnm2 / z[j4-2]) - } - dmin = math.Min(dmin, dnm1) - dmin1 = dmin - j4 += 4 - j4p2 = j4 + 2*pp - 1 - z[j4-2] = dnm1 + z[j4p2] - if z[j4-2] == 0 { - z[j4] = 0 - dn = z[j4p2+2] - dmin = dn - emin = 0 - } else if safmin*z[j4p2+2] < z[j4-2] && safmin*z[j4-2] < z[j4p2+2] { - tmp := z[j4p2+2] / z[j4-2] - z[j4] = z[j4p2] * tmp - dn = dnm1 * tmp - } else { - z[j4] = z[j4p2+2] * (z[j4p2] / z[j4-2]) - dn = z[j4p2+2] * (dnm1 / z[j4-2]) - } - dmin = math.Min(dmin, dn) - z[j4+2] = dn - z[4*(n0+1)-pp-1] = emin - return dmin, dmin1, dmin2, dn, dnm1, dnm2 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go deleted file mode 100644 index a7dbe002d..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasr.go +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dlasr applies a sequence of plane rotations to the m×n matrix A. This series -// of plane rotations is implicitly represented by a matrix P. P is multiplied -// by a depending on the value of side -- A = P * A if side == lapack.Left, -// A = A * P^T if side == lapack.Right. -// -// The exact value of P depends on the value of pivot, but in all cases P is -// implicitly represented by a series of 2×2 rotation matrices. The entries of -// rotation matrix k are defined by s[k] and c[k] -// R(k) = [ c[k] s[k]] -// [-s[k] s[k]] -// If direct == lapack.Forward, the rotation matrices are applied as -// P = P(z-1) * ... * P(2) * P(1), while if direct == lapack.Backward they are -// applied as P = P(1) * P(2) * ... * P(n). -// -// pivot defines the mapping of the elements in R(k) to P(k). -// If pivot == lapack.Variable, the rotation is performed for the (k, k+1) plane. -// P(k) = [1 ] -// [ ... ] -// [ 1 ] -// [ c[k] s[k] ] -// [ -s[k] c[k] ] -// [ 1 ] -// [ ... ] -// [ 1] -// if pivot == lapack.Top, the rotation is performed for the (1, k+1) plane, -// P(k) = [c[k] s[k] ] -// [ 1 ] -// [ ... ] -// [ 1 ] -// [-s[k] c[k] ] -// [ 1 ] -// [ ... ] -// [ 1] -// and if pivot == lapack.Bottom, the rotation is performed for the (k, z) plane. -// P(k) = [1 ] -// [ ... ] -// [ 1 ] -// [ c[k] s[k]] -// [ 1 ] -// [ ... ] -// [ 1 ] -// [ -s[k] c[k]] -// s and c have length m - 1 if side == blas.Left, and n - 1 if side == blas.Right. -// -// Dlasr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasr(side blas.Side, pivot lapack.Pivot, direct lapack.Direct, m, n int, c, s, a []float64, lda int) { - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case pivot != lapack.Variable && pivot != lapack.Top && pivot != lapack.Bottom: - panic(badPivot) - case direct != lapack.Forward && direct != lapack.Backward: - panic(badDirect) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 { - return - } - - if side == blas.Left { - if len(c) < m-1 { - panic(shortC) - } - if len(s) < m-1 { - panic(shortS) - } - } else { - if len(c) < n-1 { - panic(shortC) - } - if len(s) < n-1 { - panic(shortS) - } - } - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - if side == blas.Left { - if pivot == lapack.Variable { - if direct == lapack.Forward { - for j := 0; j < m-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp2 := a[j*lda+i] - tmp := a[(j+1)*lda+i] - a[(j+1)*lda+i] = ctmp*tmp - stmp*tmp2 - a[j*lda+i] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := m - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp2 := a[j*lda+i] - tmp := a[(j+1)*lda+i] - a[(j+1)*lda+i] = ctmp*tmp - stmp*tmp2 - a[j*lda+i] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } else if pivot == lapack.Top { - if direct == lapack.Forward { - for j := 1; j < m; j++ { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[i] - a[j*lda+i] = ctmp*tmp - stmp*tmp2 - a[i] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := m - 1; j >= 1; j-- { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[i] - a[j*lda+i] = ctmp*tmp - stmp*tmp2 - a[i] = stmp*tmp + ctmp*tmp2 - } - } - } - } - } - return - } - if direct == lapack.Forward { - for j := 0; j < m-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[(m-1)*lda+i] - a[j*lda+i] = stmp*tmp2 + ctmp*tmp - a[(m-1)*lda+i] = ctmp*tmp2 - stmp*tmp - } - } - } - return - } - for j := m - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < n; i++ { - tmp := a[j*lda+i] - tmp2 := a[(m-1)*lda+i] - a[j*lda+i] = stmp*tmp2 + ctmp*tmp - a[(m-1)*lda+i] = ctmp*tmp2 - stmp*tmp - } - } - } - return - } - if pivot == lapack.Variable { - if direct == lapack.Forward { - for j := 0; j < n-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j+1] - tmp2 := a[i*lda+j] - a[i*lda+j+1] = ctmp*tmp - stmp*tmp2 - a[i*lda+j] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := n - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j+1] - tmp2 := a[i*lda+j] - a[i*lda+j+1] = ctmp*tmp - stmp*tmp2 - a[i*lda+j] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } else if pivot == lapack.Top { - if direct == lapack.Forward { - for j := 1; j < n; j++ { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda] - a[i*lda+j] = ctmp*tmp - stmp*tmp2 - a[i*lda] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - for j := n - 1; j >= 1; j-- { - ctmp := c[j-1] - stmp := s[j-1] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda] - a[i*lda+j] = ctmp*tmp - stmp*tmp2 - a[i*lda] = stmp*tmp + ctmp*tmp2 - } - } - } - return - } - if direct == lapack.Forward { - for j := 0; j < n-1; j++ { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda+n-1] - a[i*lda+j] = stmp*tmp2 + ctmp*tmp - a[i*lda+n-1] = ctmp*tmp2 - stmp*tmp - } - - } - } - return - } - for j := n - 2; j >= 0; j-- { - ctmp := c[j] - stmp := s[j] - if ctmp != 1 || stmp != 0 { - for i := 0; i < m; i++ { - tmp := a[i*lda+j] - tmp2 := a[i*lda+n-1] - a[i*lda+j] = stmp*tmp2 + ctmp*tmp - a[i*lda+n-1] = ctmp*tmp2 - stmp*tmp - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go deleted file mode 100644 index be472805b..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasrt.go +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "sort" - - "gonum.org/v1/gonum/lapack" -) - -// Dlasrt sorts the numbers in the input slice d. If s == lapack.SortIncreasing, -// the elements are sorted in increasing order. If s == lapack.SortDecreasing, -// the elements are sorted in decreasing order. For other values of s Dlasrt -// will panic. -// -// Dlasrt is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasrt(s lapack.Sort, n int, d []float64) { - switch { - case n < 0: - panic(nLT0) - case len(d) < n: - panic(shortD) - } - - d = d[:n] - switch s { - default: - panic(badSort) - case lapack.SortIncreasing: - sort.Float64s(d) - case lapack.SortDecreasing: - sort.Sort(sort.Reverse(sort.Float64Slice(d))) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go deleted file mode 100644 index 9c2dc7729..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlassq.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlassq updates a sum of squares in scaled form. The input parameters scale and -// sumsq represent the current scale and total sum of squares. These values are -// updated with the information in the first n elements of the vector specified -// by x and incX. -// -// Dlassq is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlassq(n int, x []float64, incx int, scale float64, sumsq float64) (scl, smsq float64) { - switch { - case n < 0: - panic(nLT0) - case incx <= 0: - panic(badIncX) - case len(x) < 1+(n-1)*incx: - panic(shortX) - } - - if n == 0 { - return scale, sumsq - } - - for ix := 0; ix <= (n-1)*incx; ix += incx { - absxi := math.Abs(x[ix]) - if absxi > 0 || math.IsNaN(absxi) { - if scale < absxi { - sumsq = 1 + sumsq*(scale/absxi)*(scale/absxi) - scale = absxi - } else { - sumsq += (absxi / scale) * (absxi / scale) - } - } - } - return scale, sumsq -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go deleted file mode 100644 index 204af1931..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasv2.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Dlasv2 computes the singular value decomposition of a 2×2 matrix. -// [ csl snl] [f g] [csr -snr] = [ssmax 0] -// [-snl csl] [0 h] [snr csr] = [ 0 ssmin] -// ssmax is the larger absolute singular value, and ssmin is the smaller absolute -// singular value. [cls, snl] and [csr, snr] are the left and right singular vectors. -// -// Dlasv2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasv2(f, g, h float64) (ssmin, ssmax, snr, csr, snl, csl float64) { - ft := f - fa := math.Abs(ft) - ht := h - ha := math.Abs(h) - // pmax points to the largest element of the matrix in terms of absolute value. - // 1 if F, 2 if G, 3 if H. - pmax := 1 - swap := ha > fa - if swap { - pmax = 3 - ft, ht = ht, ft - fa, ha = ha, fa - } - gt := g - ga := math.Abs(gt) - var clt, crt, slt, srt float64 - if ga == 0 { - ssmin = ha - ssmax = fa - clt = 1 - crt = 1 - slt = 0 - srt = 0 - } else { - gasmall := true - if ga > fa { - pmax = 2 - if (fa / ga) < dlamchE { - gasmall = false - ssmax = ga - if ha > 1 { - ssmin = fa / (ga / ha) - } else { - ssmin = (fa / ga) * ha - } - clt = 1 - slt = ht / gt - srt = 1 - crt = ft / gt - } - } - if gasmall { - d := fa - ha - l := d / fa - if d == fa { // deal with inf - l = 1 - } - m := gt / ft - t := 2 - l - s := math.Hypot(t, m) - var r float64 - if l == 0 { - r = math.Abs(m) - } else { - r = math.Hypot(l, m) - } - a := 0.5 * (s + r) - ssmin = ha / a - ssmax = fa * a - if m == 0 { - if l == 0 { - t = math.Copysign(2, ft) * math.Copysign(1, gt) - } else { - t = gt/math.Copysign(d, ft) + m/t - } - } else { - t = (m/(s+t) + m/(r+l)) * (1 + a) - } - l = math.Hypot(t, 2) - crt = 2 / l - srt = t / l - clt = (crt + srt*m) / a - slt = (ht / ft) * srt / a - } - } - if swap { - csl = srt - snl = crt - csr = slt - snr = clt - } else { - csl = clt - snl = slt - csr = crt - snr = srt - } - var tsign float64 - switch pmax { - case 1: - tsign = math.Copysign(1, csr) * math.Copysign(1, csl) * math.Copysign(1, f) - case 2: - tsign = math.Copysign(1, snr) * math.Copysign(1, csl) * math.Copysign(1, g) - case 3: - tsign = math.Copysign(1, snr) * math.Copysign(1, snl) * math.Copysign(1, h) - } - ssmax = math.Copysign(ssmax, tsign) - ssmin = math.Copysign(ssmin, tsign*math.Copysign(1, f)*math.Copysign(1, h)) - return ssmin, ssmax, snr, csr, snl, csl -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go deleted file mode 100644 index b207d1218..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlaswp.go +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas/blas64" - -// Dlaswp swaps the rows k1 to k2 of a rectangular matrix A according to the -// indices in ipiv so that row k is swapped with ipiv[k]. -// -// n is the number of columns of A and incX is the increment for ipiv. If incX -// is 1, the swaps are applied from k1 to k2. If incX is -1, the swaps are -// applied in reverse order from k2 to k1. For other values of incX Dlaswp will -// panic. ipiv must have length k2+1, otherwise Dlaswp will panic. -// -// The indices k1, k2, and the elements of ipiv are zero-based. -// -// Dlaswp is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlaswp(n int, a []float64, lda int, k1, k2 int, ipiv []int, incX int) { - switch { - case n < 0: - panic(nLT0) - case k2 < 0: - panic(badK2) - case k1 < 0 || k2 < k1: - panic(badK1) - case lda < max(1, n): - panic(badLdA) - case len(a) < (k2-1)*lda+n: - panic(shortA) - case len(ipiv) != k2+1: - panic(badLenIpiv) - case incX != 1 && incX != -1: - panic(absIncNotOne) - } - - if n == 0 { - return - } - - bi := blas64.Implementation() - if incX == 1 { - for k := k1; k <= k2; k++ { - bi.Dswap(n, a[k*lda:], 1, a[ipiv[k]*lda:], 1) - } - return - } - for k := k2; k >= k1; k-- { - bi.Dswap(n, a[k*lda:], 1, a[ipiv[k]*lda:], 1) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go deleted file mode 100644 index abfe60e58..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlasy2.go +++ /dev/null @@ -1,290 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlasy2 solves the Sylvester matrix equation where the matrices are of order 1 -// or 2. It computes the unknown n1×n2 matrix X so that -// TL*X + sgn*X*TR = scale*B, if tranl == false and tranr == false, -// TL^T*X + sgn*X*TR = scale*B, if tranl == true and tranr == false, -// TL*X + sgn*X*TR^T = scale*B, if tranl == false and tranr == true, -// TL^T*X + sgn*X*TR^T = scale*B, if tranl == true and tranr == true, -// where TL is n1×n1, TR is n2×n2, B is n1×n2, and 1 <= n1,n2 <= 2. -// -// isgn must be 1 or -1, and n1 and n2 must be 0, 1, or 2, but these conditions -// are not checked. -// -// Dlasy2 returns three values, a scale factor that is chosen less than or equal -// to 1 to prevent the solution overflowing, the infinity norm of the solution, -// and an indicator of success. If ok is false, TL and TR have eigenvalues that -// are too close, so TL or TR is perturbed to get a non-singular equation. -// -// Dlasy2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlasy2(tranl, tranr bool, isgn, n1, n2 int, tl []float64, ldtl int, tr []float64, ldtr int, b []float64, ldb int, x []float64, ldx int) (scale, xnorm float64, ok bool) { - // TODO(vladimir-ch): Add input validation checks conditionally skipped - // using the build tag mechanism. - - ok = true - // Quick return if possible. - if n1 == 0 || n2 == 0 { - return scale, xnorm, ok - } - - // Set constants to control overflow. - eps := dlamchP - smlnum := dlamchS / eps - sgn := float64(isgn) - - if n1 == 1 && n2 == 1 { - // 1×1 case: TL11*X + sgn*X*TR11 = B11. - tau1 := tl[0] + sgn*tr[0] - bet := math.Abs(tau1) - if bet <= smlnum { - tau1 = smlnum - bet = smlnum - ok = false - } - scale = 1 - gam := math.Abs(b[0]) - if smlnum*gam > bet { - scale = 1 / gam - } - x[0] = b[0] * scale / tau1 - xnorm = math.Abs(x[0]) - return scale, xnorm, ok - } - - if n1+n2 == 3 { - // 1×2 or 2×1 case. - var ( - smin float64 - tmp [4]float64 // tmp is used as a 2×2 row-major matrix. - btmp [2]float64 - ) - if n1 == 1 && n2 == 2 { - // 1×2 case: TL11*[X11 X12] + sgn*[X11 X12]*op[TR11 TR12] = [B11 B12]. - // [TR21 TR22] - smin = math.Abs(tl[0]) - smin = math.Max(smin, math.Max(math.Abs(tr[0]), math.Abs(tr[1]))) - smin = math.Max(smin, math.Max(math.Abs(tr[ldtr]), math.Abs(tr[ldtr+1]))) - smin = math.Max(eps*smin, smlnum) - tmp[0] = tl[0] + sgn*tr[0] - tmp[3] = tl[0] + sgn*tr[ldtr+1] - if tranr { - tmp[1] = sgn * tr[1] - tmp[2] = sgn * tr[ldtr] - } else { - tmp[1] = sgn * tr[ldtr] - tmp[2] = sgn * tr[1] - } - btmp[0] = b[0] - btmp[1] = b[1] - } else { - // 2×1 case: op[TL11 TL12]*[X11] + sgn*[X11]*TR11 = [B11]. - // [TL21 TL22]*[X21] [X21] [B21] - smin = math.Abs(tr[0]) - smin = math.Max(smin, math.Max(math.Abs(tl[0]), math.Abs(tl[1]))) - smin = math.Max(smin, math.Max(math.Abs(tl[ldtl]), math.Abs(tl[ldtl+1]))) - smin = math.Max(eps*smin, smlnum) - tmp[0] = tl[0] + sgn*tr[0] - tmp[3] = tl[ldtl+1] + sgn*tr[0] - if tranl { - tmp[1] = tl[ldtl] - tmp[2] = tl[1] - } else { - tmp[1] = tl[1] - tmp[2] = tl[ldtl] - } - btmp[0] = b[0] - btmp[1] = b[ldb] - } - - // Solve 2×2 system using complete pivoting. - // Set pivots less than smin to smin. - - bi := blas64.Implementation() - ipiv := bi.Idamax(len(tmp), tmp[:], 1) - // Compute the upper triangular matrix [u11 u12]. - // [ 0 u22] - u11 := tmp[ipiv] - if math.Abs(u11) <= smin { - ok = false - u11 = smin - } - locu12 := [4]int{1, 0, 3, 2} // Index in tmp of the element on the same row as the pivot. - u12 := tmp[locu12[ipiv]] - locl21 := [4]int{2, 3, 0, 1} // Index in tmp of the element on the same column as the pivot. - l21 := tmp[locl21[ipiv]] / u11 - locu22 := [4]int{3, 2, 1, 0} // Index in tmp of the remaining element. - u22 := tmp[locu22[ipiv]] - l21*u12 - if math.Abs(u22) <= smin { - ok = false - u22 = smin - } - if ipiv&0x2 != 0 { // true for ipiv equal to 2 and 3. - // The pivot was in the second row, swap the elements of - // the right-hand side. - btmp[0], btmp[1] = btmp[1], btmp[0]-l21*btmp[1] - } else { - btmp[1] -= l21 * btmp[0] - } - scale = 1 - if 2*smlnum*math.Abs(btmp[1]) > math.Abs(u22) || 2*smlnum*math.Abs(btmp[0]) > math.Abs(u11) { - scale = 0.5 / math.Max(math.Abs(btmp[0]), math.Abs(btmp[1])) - btmp[0] *= scale - btmp[1] *= scale - } - // Solve the system [u11 u12] [x21] = [ btmp[0] ]. - // [ 0 u22] [x22] [ btmp[1] ] - x22 := btmp[1] / u22 - x21 := btmp[0]/u11 - (u12/u11)*x22 - if ipiv&0x1 != 0 { // true for ipiv equal to 1 and 3. - // The pivot was in the second column, swap the elements - // of the solution. - x21, x22 = x22, x21 - } - x[0] = x21 - if n1 == 1 { - x[1] = x22 - xnorm = math.Abs(x[0]) + math.Abs(x[1]) - } else { - x[ldx] = x22 - xnorm = math.Max(math.Abs(x[0]), math.Abs(x[ldx])) - } - return scale, xnorm, ok - } - - // 2×2 case: op[TL11 TL12]*[X11 X12] + SGN*[X11 X12]*op[TR11 TR12] = [B11 B12]. - // [TL21 TL22] [X21 X22] [X21 X22] [TR21 TR22] [B21 B22] - // - // Solve equivalent 4×4 system using complete pivoting. - // Set pivots less than smin to smin. - - smin := math.Max(math.Abs(tr[0]), math.Abs(tr[1])) - smin = math.Max(smin, math.Max(math.Abs(tr[ldtr]), math.Abs(tr[ldtr+1]))) - smin = math.Max(smin, math.Max(math.Abs(tl[0]), math.Abs(tl[1]))) - smin = math.Max(smin, math.Max(math.Abs(tl[ldtl]), math.Abs(tl[ldtl+1]))) - smin = math.Max(eps*smin, smlnum) - - var t [4][4]float64 - t[0][0] = tl[0] + sgn*tr[0] - t[1][1] = tl[0] + sgn*tr[ldtr+1] - t[2][2] = tl[ldtl+1] + sgn*tr[0] - t[3][3] = tl[ldtl+1] + sgn*tr[ldtr+1] - if tranl { - t[0][2] = tl[ldtl] - t[1][3] = tl[ldtl] - t[2][0] = tl[1] - t[3][1] = tl[1] - } else { - t[0][2] = tl[1] - t[1][3] = tl[1] - t[2][0] = tl[ldtl] - t[3][1] = tl[ldtl] - } - if tranr { - t[0][1] = sgn * tr[1] - t[1][0] = sgn * tr[ldtr] - t[2][3] = sgn * tr[1] - t[3][2] = sgn * tr[ldtr] - } else { - t[0][1] = sgn * tr[ldtr] - t[1][0] = sgn * tr[1] - t[2][3] = sgn * tr[ldtr] - t[3][2] = sgn * tr[1] - } - - var btmp [4]float64 - btmp[0] = b[0] - btmp[1] = b[1] - btmp[2] = b[ldb] - btmp[3] = b[ldb+1] - - // Perform elimination. - var jpiv [4]int // jpiv records any column swaps for pivoting. - for i := 0; i < 3; i++ { - var ( - xmax float64 - ipsv, jpsv int - ) - for ip := i; ip < 4; ip++ { - for jp := i; jp < 4; jp++ { - if math.Abs(t[ip][jp]) >= xmax { - xmax = math.Abs(t[ip][jp]) - ipsv = ip - jpsv = jp - } - } - } - if ipsv != i { - // The pivot is not in the top row of the unprocessed - // block, swap rows ipsv and i of t and btmp. - t[ipsv], t[i] = t[i], t[ipsv] - btmp[ipsv], btmp[i] = btmp[i], btmp[ipsv] - } - if jpsv != i { - // The pivot is not in the left column of the - // unprocessed block, swap columns jpsv and i of t. - for k := 0; k < 4; k++ { - t[k][jpsv], t[k][i] = t[k][i], t[k][jpsv] - } - } - jpiv[i] = jpsv - if math.Abs(t[i][i]) < smin { - ok = false - t[i][i] = smin - } - for k := i + 1; k < 4; k++ { - t[k][i] /= t[i][i] - btmp[k] -= t[k][i] * btmp[i] - for j := i + 1; j < 4; j++ { - t[k][j] -= t[k][i] * t[i][j] - } - } - } - if math.Abs(t[3][3]) < smin { - ok = false - t[3][3] = smin - } - scale = 1 - if 8*smlnum*math.Abs(btmp[0]) > math.Abs(t[0][0]) || - 8*smlnum*math.Abs(btmp[1]) > math.Abs(t[1][1]) || - 8*smlnum*math.Abs(btmp[2]) > math.Abs(t[2][2]) || - 8*smlnum*math.Abs(btmp[3]) > math.Abs(t[3][3]) { - - maxbtmp := math.Max(math.Abs(btmp[0]), math.Abs(btmp[1])) - maxbtmp = math.Max(maxbtmp, math.Max(math.Abs(btmp[2]), math.Abs(btmp[3]))) - scale = 1 / 8 / maxbtmp - btmp[0] *= scale - btmp[1] *= scale - btmp[2] *= scale - btmp[3] *= scale - } - // Compute the solution of the upper triangular system t * tmp = btmp. - var tmp [4]float64 - for i := 3; i >= 0; i-- { - temp := 1 / t[i][i] - tmp[i] = btmp[i] * temp - for j := i + 1; j < 4; j++ { - tmp[i] -= temp * t[i][j] * tmp[j] - } - } - for i := 2; i >= 0; i-- { - if jpiv[i] != i { - tmp[i], tmp[jpiv[i]] = tmp[jpiv[i]], tmp[i] - } - } - x[0] = tmp[0] - x[1] = tmp[1] - x[ldx] = tmp[2] - x[ldx+1] = tmp[3] - xnorm = math.Max(math.Abs(tmp[0])+math.Abs(tmp[1]), math.Abs(tmp[2])+math.Abs(tmp[3])) - return scale, xnorm, ok -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go deleted file mode 100644 index 018efc98c..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrd.go +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlatrd reduces nb rows and columns of a real n×n symmetric matrix A to symmetric -// tridiagonal form. It computes the orthonormal similarity transformation -// Q^T * A * Q -// and returns the matrices V and W to apply to the unreduced part of A. If -// uplo == blas.Upper, the upper triangle is supplied and the last nb rows are -// reduced. If uplo == blas.Lower, the lower triangle is supplied and the first -// nb rows are reduced. -// -// a contains the symmetric matrix on entry with active triangular half specified -// by uplo. On exit, the nb columns have been reduced to tridiagonal form. The -// diagonal contains the diagonal of the reduced matrix, the off-diagonal is -// set to 1, and the remaining elements contain the data to construct Q. -// -// If uplo == blas.Upper, with n = 5 and nb = 2 on exit a is -// [ a a a v4 v5] -// [ a a v4 v5] -// [ a 1 v5] -// [ d 1] -// [ d] -// -// If uplo == blas.Lower, with n = 5 and nb = 2, on exit a is -// [ d ] -// [ 1 d ] -// [v1 1 a ] -// [v1 v2 a a ] -// [v1 v2 a a a] -// -// e contains the superdiagonal elements of the reduced matrix. If uplo == blas.Upper, -// e[n-nb:n-1] contains the last nb columns of the reduced matrix, while if -// uplo == blas.Lower, e[:nb] contains the first nb columns of the reduced matrix. -// e must have length at least n-1, and Dlatrd will panic otherwise. -// -// tau contains the scalar factors of the elementary reflectors needed to construct Q. -// The reflectors are stored in tau[n-nb:n-1] if uplo == blas.Upper, and in -// tau[:nb] if uplo == blas.Lower. tau must have length n-1, and Dlatrd will panic -// otherwise. -// -// w is an n×nb matrix. On exit it contains the data to update the unreduced part -// of A. -// -// The matrix Q is represented as a product of elementary reflectors. Each reflector -// H has the form -// I - tau * v * v^T -// If uplo == blas.Upper, -// Q = H_{n-1} * H_{n-2} * ... * H_{n-nb} -// where v[:i-1] is stored in A[:i-1,i], v[i-1] = 1, and v[i:n] = 0. -// -// If uplo == blas.Lower, -// Q = H_0 * H_1 * ... * H_{nb-1} -// where v[:i+1] = 0, v[i+1] = 1, and v[i+2:n] is stored in A[i+2:n,i]. -// -// The vectors v form the n×nb matrix V which is used with W to apply a -// symmetric rank-2 update to the unreduced part of A -// A = A - V * W^T - W * V^T -// -// Dlatrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlatrd(uplo blas.Uplo, n, nb int, a []float64, lda int, e, tau, w []float64, ldw int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case nb < 0: - panic(nbLT0) - case nb > n: - panic(nbGTN) - case lda < max(1, n): - panic(badLdA) - case ldw < max(1, nb): - panic(badLdW) - } - - if n == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(w) < (n-1)*ldw+nb: - panic(shortW) - case len(e) < n-1: - panic(shortE) - case len(tau) < n-1: - panic(shortTau) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - for i := n - 1; i >= n-nb; i-- { - iw := i - n + nb - if i < n-1 { - // Update A(0:i, i). - bi.Dgemv(blas.NoTrans, i+1, n-i-1, -1, a[i+1:], lda, - w[i*ldw+iw+1:], 1, 1, a[i:], lda) - bi.Dgemv(blas.NoTrans, i+1, n-i-1, -1, w[iw+1:], ldw, - a[i*lda+i+1:], 1, 1, a[i:], lda) - } - if i > 0 { - // Generate elementary reflector H_i to annihilate A(0:i-2,i). - e[i-1], tau[i-1] = impl.Dlarfg(i, a[(i-1)*lda+i], a[i:], lda) - a[(i-1)*lda+i] = 1 - - // Compute W(0:i-1, i). - bi.Dsymv(blas.Upper, i, 1, a, lda, a[i:], lda, 0, w[iw:], ldw) - if i < n-1 { - bi.Dgemv(blas.Trans, i, n-i-1, 1, w[iw+1:], ldw, - a[i:], lda, 0, w[(i+1)*ldw+iw:], ldw) - bi.Dgemv(blas.NoTrans, i, n-i-1, -1, a[i+1:], lda, - w[(i+1)*ldw+iw:], ldw, 1, w[iw:], ldw) - bi.Dgemv(blas.Trans, i, n-i-1, 1, a[i+1:], lda, - a[i:], lda, 0, w[(i+1)*ldw+iw:], ldw) - bi.Dgemv(blas.NoTrans, i, n-i-1, -1, w[iw+1:], ldw, - w[(i+1)*ldw+iw:], ldw, 1, w[iw:], ldw) - } - bi.Dscal(i, tau[i-1], w[iw:], ldw) - alpha := -0.5 * tau[i-1] * bi.Ddot(i, w[iw:], ldw, a[i:], lda) - bi.Daxpy(i, alpha, a[i:], lda, w[iw:], ldw) - } - } - } else { - // Reduce first nb columns of lower triangle. - for i := 0; i < nb; i++ { - // Update A(i:n, i) - bi.Dgemv(blas.NoTrans, n-i, i, -1, a[i*lda:], lda, - w[i*ldw:], 1, 1, a[i*lda+i:], lda) - bi.Dgemv(blas.NoTrans, n-i, i, -1, w[i*ldw:], ldw, - a[i*lda:], 1, 1, a[i*lda+i:], lda) - if i < n-1 { - // Generate elementary reflector H_i to annihilate A(i+2:n,i). - e[i], tau[i] = impl.Dlarfg(n-i-1, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) - a[(i+1)*lda+i] = 1 - - // Compute W(i+1:n,i). - bi.Dsymv(blas.Lower, n-i-1, 1, a[(i+1)*lda+i+1:], lda, - a[(i+1)*lda+i:], lda, 0, w[(i+1)*ldw+i:], ldw) - bi.Dgemv(blas.Trans, n-i-1, i, 1, w[(i+1)*ldw:], ldw, - a[(i+1)*lda+i:], lda, 0, w[i:], ldw) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, a[(i+1)*lda:], lda, - w[i:], ldw, 1, w[(i+1)*ldw+i:], ldw) - bi.Dgemv(blas.Trans, n-i-1, i, 1, a[(i+1)*lda:], lda, - a[(i+1)*lda+i:], lda, 0, w[i:], ldw) - bi.Dgemv(blas.NoTrans, n-i-1, i, -1, w[(i+1)*ldw:], ldw, - w[i:], ldw, 1, w[(i+1)*ldw+i:], ldw) - bi.Dscal(n-i-1, tau[i], w[(i+1)*ldw+i:], ldw) - alpha := -0.5 * tau[i] * bi.Ddot(n-i-1, w[(i+1)*ldw+i:], ldw, - a[(i+1)*lda+i:], lda) - bi.Daxpy(n-i-1, alpha, a[(i+1)*lda+i:], lda, - w[(i+1)*ldw+i:], ldw) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go deleted file mode 100644 index dc445c6fe..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlatrs.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlatrs solves a triangular system of equations scaled to prevent overflow. It -// solves -// A * x = scale * b if trans == blas.NoTrans -// A^T * x = scale * b if trans == blas.Trans -// where the scale s is set for numeric stability. -// -// A is an n×n triangular matrix. On entry, the slice x contains the values of -// b, and on exit it contains the solution vector x. -// -// If normin == true, cnorm is an input and cnorm[j] contains the norm of the off-diagonal -// part of the j^th column of A. If trans == blas.NoTrans, cnorm[j] must be greater -// than or equal to the infinity norm, and greater than or equal to the one-norm -// otherwise. If normin == false, then cnorm is treated as an output, and is set -// to contain the 1-norm of the off-diagonal part of the j^th column of A. -// -// Dlatrs is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dlatrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, normin bool, n int, a []float64, lda int, x []float64, cnorm []float64) (scale float64) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case diag != blas.Unit && diag != blas.NonUnit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return 0 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(x) < n: - panic(shortX) - case len(cnorm) < n: - panic(shortCNorm) - } - - upper := uplo == blas.Upper - nonUnit := diag == blas.NonUnit - - smlnum := dlamchS / dlamchP - bignum := 1 / smlnum - scale = 1 - - bi := blas64.Implementation() - - if !normin { - if upper { - cnorm[0] = 0 - for j := 1; j < n; j++ { - cnorm[j] = bi.Dasum(j, a[j:], lda) - } - } else { - for j := 0; j < n-1; j++ { - cnorm[j] = bi.Dasum(n-j-1, a[(j+1)*lda+j:], lda) - } - cnorm[n-1] = 0 - } - } - // Scale the column norms by tscal if the maximum element in cnorm is greater than bignum. - imax := bi.Idamax(n, cnorm, 1) - tmax := cnorm[imax] - var tscal float64 - if tmax <= bignum { - tscal = 1 - } else { - tscal = 1 / (smlnum * tmax) - bi.Dscal(n, tscal, cnorm, 1) - } - - // Compute a bound on the computed solution vector to see if bi.Dtrsv can be used. - j := bi.Idamax(n, x, 1) - xmax := math.Abs(x[j]) - xbnd := xmax - var grow float64 - var jfirst, jlast, jinc int - if trans == blas.NoTrans { - if upper { - jfirst = n - 1 - jlast = -1 - jinc = -1 - } else { - jfirst = 0 - jlast = n - jinc = 1 - } - // Compute the growth in A * x = b. - if tscal != 1 { - grow = 0 - goto Solve - } - if nonUnit { - grow = 1 / math.Max(xbnd, smlnum) - xbnd = grow - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - tjj := math.Abs(a[j*lda+j]) - xbnd = math.Min(xbnd, math.Min(1, tjj)*grow) - if tjj+cnorm[j] >= smlnum { - grow *= tjj / (tjj + cnorm[j]) - } else { - grow = 0 - } - } - grow = xbnd - } else { - grow = math.Min(1, 1/math.Max(xbnd, smlnum)) - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - grow *= 1 / (1 + cnorm[j]) - } - } - } else { - if upper { - jfirst = 0 - jlast = n - jinc = 1 - } else { - jfirst = n - 1 - jlast = -1 - jinc = -1 - } - if tscal != 1 { - grow = 0 - goto Solve - } - if nonUnit { - grow = 1 / (math.Max(xbnd, smlnum)) - xbnd = grow - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - xj := 1 + cnorm[j] - grow = math.Min(grow, xbnd/xj) - tjj := math.Abs(a[j*lda+j]) - if xj > tjj { - xbnd *= tjj / xj - } - } - grow = math.Min(grow, xbnd) - } else { - grow = math.Min(1, 1/math.Max(xbnd, smlnum)) - for j := jfirst; j != jlast; j += jinc { - if grow <= smlnum { - goto Solve - } - xj := 1 + cnorm[j] - grow /= xj - } - } - } - -Solve: - if grow*tscal > smlnum { - // Use the Level 2 BLAS solve if the reciprocal of the bound on - // elements of X is not too small. - bi.Dtrsv(uplo, trans, diag, n, a, lda, x, 1) - if tscal != 1 { - bi.Dscal(n, 1/tscal, cnorm, 1) - } - return scale - } - - // Use a Level 1 BLAS solve, scaling intermediate results. - if xmax > bignum { - scale = bignum / xmax - bi.Dscal(n, scale, x, 1) - xmax = bignum - } - if trans == blas.NoTrans { - for j := jfirst; j != jlast; j += jinc { - xj := math.Abs(x[j]) - var tjj, tjjs float64 - if nonUnit { - tjjs = a[j*lda+j] * tscal - } else { - tjjs = tscal - if tscal == 1 { - goto Skip1 - } - } - tjj = math.Abs(tjjs) - if tjj > smlnum { - if tjj < 1 { - if xj > tjj*bignum { - rec := 1 / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - } - x[j] /= tjjs - xj = math.Abs(x[j]) - } else if tjj > 0 { - if xj > tjj*bignum { - rec := (tjj * bignum) / xj - if cnorm[j] > 1 { - rec /= cnorm[j] - } - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - x[j] /= tjjs - xj = math.Abs(x[j]) - } else { - for i := 0; i < n; i++ { - x[i] = 0 - } - x[j] = 1 - xj = 1 - scale = 0 - xmax = 0 - } - Skip1: - if xj > 1 { - rec := 1 / xj - if cnorm[j] > (bignum-xmax)*rec { - rec *= 0.5 - bi.Dscal(n, rec, x, 1) - scale *= rec - } - } else if xj*cnorm[j] > bignum-xmax { - bi.Dscal(n, 0.5, x, 1) - scale *= 0.5 - } - if upper { - if j > 0 { - bi.Daxpy(j, -x[j]*tscal, a[j:], lda, x, 1) - i := bi.Idamax(j, x, 1) - xmax = math.Abs(x[i]) - } - } else { - if j < n-1 { - bi.Daxpy(n-j-1, -x[j]*tscal, a[(j+1)*lda+j:], lda, x[j+1:], 1) - i := j + bi.Idamax(n-j-1, x[j+1:], 1) - xmax = math.Abs(x[i]) - } - } - } - } else { - for j := jfirst; j != jlast; j += jinc { - xj := math.Abs(x[j]) - uscal := tscal - rec := 1 / math.Max(xmax, 1) - var tjjs float64 - if cnorm[j] > (bignum-xj)*rec { - rec *= 0.5 - if nonUnit { - tjjs = a[j*lda+j] * tscal - } else { - tjjs = tscal - } - tjj := math.Abs(tjjs) - if tjj > 1 { - rec = math.Min(1, rec*tjj) - uscal /= tjjs - } - if rec < 1 { - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - } - var sumj float64 - if uscal == 1 { - if upper { - sumj = bi.Ddot(j, a[j:], lda, x, 1) - } else if j < n-1 { - sumj = bi.Ddot(n-j-1, a[(j+1)*lda+j:], lda, x[j+1:], 1) - } - } else { - if upper { - for i := 0; i < j; i++ { - sumj += (a[i*lda+j] * uscal) * x[i] - } - } else if j < n { - for i := j + 1; i < n; i++ { - sumj += (a[i*lda+j] * uscal) * x[i] - } - } - } - if uscal == tscal { - x[j] -= sumj - xj := math.Abs(x[j]) - var tjjs float64 - if nonUnit { - tjjs = a[j*lda+j] * tscal - } else { - tjjs = tscal - if tscal == 1 { - goto Skip2 - } - } - tjj := math.Abs(tjjs) - if tjj > smlnum { - if tjj < 1 { - if xj > tjj*bignum { - rec = 1 / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - } - x[j] /= tjjs - } else if tjj > 0 { - if xj > tjj*bignum { - rec = (tjj * bignum) / xj - bi.Dscal(n, rec, x, 1) - scale *= rec - xmax *= rec - } - x[j] /= tjjs - } else { - for i := 0; i < n; i++ { - x[i] = 0 - } - x[j] = 1 - scale = 0 - xmax = 0 - } - } else { - x[j] = x[j]/tjjs - sumj - } - Skip2: - xmax = math.Max(xmax, math.Abs(x[j])) - } - } - scale /= tscal - if tscal != 1 { - bi.Dscal(n, 1/tscal, cnorm, 1) - } - return scale -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go deleted file mode 100644 index ecce22cc6..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauu2.go +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlauu2 computes the product -// U * U^T if uplo is blas.Upper -// L^T * L if uplo is blas.Lower -// where U or L is stored in the upper or lower triangular part of A. -// Only the upper or lower triangle of the result is stored, overwriting -// the corresponding factor in A. -func (impl Implementation) Dlauu2(uplo blas.Uplo, n int, a []float64, lda int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - // Compute the product U*U^T. - for i := 0; i < n; i++ { - aii := a[i*lda+i] - if i < n-1 { - a[i*lda+i] = bi.Ddot(n-i, a[i*lda+i:], 1, a[i*lda+i:], 1) - bi.Dgemv(blas.NoTrans, i, n-i-1, 1, a[i+1:], lda, a[i*lda+i+1:], 1, - aii, a[i:], lda) - } else { - bi.Dscal(i+1, aii, a[i:], lda) - } - } - } else { - // Compute the product L^T*L. - for i := 0; i < n; i++ { - aii := a[i*lda+i] - if i < n-1 { - a[i*lda+i] = bi.Ddot(n-i, a[i*lda+i:], lda, a[i*lda+i:], lda) - bi.Dgemv(blas.Trans, n-i-1, i, 1, a[(i+1)*lda:], lda, a[(i+1)*lda+i:], lda, - aii, a[i*lda:], 1) - } else { - bi.Dscal(i+1, aii, a[i*lda:], 1) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go deleted file mode 100644 index 67ecaddf4..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dlauum.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dlauum computes the product -// U * U^T if uplo is blas.Upper -// L^T * L if uplo is blas.Lower -// where U or L is stored in the upper or lower triangular part of A. -// Only the upper or lower triangle of the result is stored, overwriting -// the corresponding factor in A. -func (impl Implementation) Dlauum(uplo blas.Uplo, n int, a []float64, lda int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - // Determine the block size. - opts := "U" - if uplo == blas.Lower { - opts = "L" - } - nb := impl.Ilaenv(1, "DLAUUM", opts, n, -1, -1, -1) - - if nb <= 1 || n <= nb { - // Use unblocked code. - impl.Dlauu2(uplo, n, a, lda) - return - } - - // Use blocked code. - bi := blas64.Implementation() - if uplo == blas.Upper { - // Compute the product U*U^T. - for i := 0; i < n; i += nb { - ib := min(nb, n-i) - bi.Dtrmm(blas.Right, blas.Upper, blas.Trans, blas.NonUnit, - i, ib, 1, a[i*lda+i:], lda, a[i:], lda) - impl.Dlauu2(blas.Upper, ib, a[i*lda+i:], lda) - if n-i-ib > 0 { - bi.Dgemm(blas.NoTrans, blas.Trans, i, ib, n-i-ib, - 1, a[i+ib:], lda, a[i*lda+i+ib:], lda, 1, a[i:], lda) - bi.Dsyrk(blas.Upper, blas.NoTrans, ib, n-i-ib, - 1, a[i*lda+i+ib:], lda, 1, a[i*lda+i:], lda) - } - } - } else { - // Compute the product L^T*L. - for i := 0; i < n; i += nb { - ib := min(nb, n-i) - bi.Dtrmm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, - ib, i, 1, a[i*lda+i:], lda, a[i*lda:], lda) - impl.Dlauu2(blas.Lower, ib, a[i*lda+i:], lda) - if n-i-ib > 0 { - bi.Dgemm(blas.Trans, blas.NoTrans, ib, i, n-i-ib, - 1, a[(i+ib)*lda+i:], lda, a[(i+ib)*lda:], lda, 1, a[i*lda:], lda) - bi.Dsyrk(blas.Lower, blas.Trans, ib, n-i-ib, - 1, a[(i+ib)*lda+i:], lda, 1, a[i*lda+i:], lda) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/doc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/doc.go deleted file mode 100644 index 579428927..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package gonum is a pure-go implementation of the LAPACK API. The LAPACK API defines -// a set of algorithms for advanced matrix operations. -// -// The function definitions and implementations follow that of the netlib reference -// implementation. See http://www.netlib.org/lapack/explore-html/ for more -// information, and http://www.netlib.org/lapack/explore-html/d4/de1/_l_i_c_e_n_s_e_source.html -// for more license information. -// -// Slice function arguments frequently represent vectors and matrices. The data -// layout is identical to that found in https://godoc.org/gonum.org/v1/gonum/blas/gonum. -// -// Most LAPACK functions are built on top the routines defined in the BLAS API, -// and as such the computation time for many LAPACK functions is -// dominated by BLAS calls. Here, BLAS is accessed through the -// blas64 package (https://godoc.org/golang.org/v1/gonum/blas/blas64). In particular, -// this implies that an external BLAS library will be used if it is -// registered in blas64. -// -// The full LAPACK capability has not been implemented at present. The full -// API is very large, containing approximately 200 functions for double precision -// alone. Future additions will be focused on supporting the gonum matrix -// package (https://godoc.org/github.com/gonum/matrix/mat64), though pull requests -// with implementations and tests for LAPACK function are encouraged. -package gonum // import "gonum.org/v1/gonum/lapack/gonum" diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go deleted file mode 100644 index a20765a9e..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2l.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dorg2l generates an m×n matrix Q with orthonormal columns which is defined -// as the last n columns of a product of k elementary reflectors of order m. -// Q = H_{k-1} * ... * H_1 * H_0 -// See Dgelqf for more information. It must be that m >= n >= k. -// -// tau contains the scalar reflectors computed by Dgeqlf. tau must have length -// at least k, and Dorg2l will panic otherwise. -// -// work contains temporary memory, and must have length at least n. Dorg2l will -// panic otherwise. -// -// Dorg2l is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorg2l(m, n, k int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < n: - panic(shortWork) - } - - // Initialize columns 0:n-k to columns of the unit matrix. - for j := 0; j < n-k; j++ { - for l := 0; l < m; l++ { - a[l*lda+j] = 0 - } - a[(m-n+j)*lda+j] = 1 - } - - bi := blas64.Implementation() - for i := 0; i < k; i++ { - ii := n - k + i - - // Apply H_i to A[0:m-k+i, 0:n-k+i] from the left. - a[(m-n+ii)*lda+ii] = 1 - impl.Dlarf(blas.Left, m-n+ii+1, ii, a[ii:], lda, tau[i], a, lda, work) - bi.Dscal(m-n+ii, -tau[i], a[ii:], lda) - a[(m-n+ii)*lda+ii] = 1 - tau[i] - - // Set A[m-k+i:m, n-k+i+1] to zero. - for l := m - n + ii + 1; l < m; l++ { - a[l*lda+ii] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go deleted file mode 100644 index de4477571..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorg2r.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dorg2r generates an m×n matrix Q with orthonormal columns defined by the -// product of elementary reflectors as computed by Dgeqrf. -// Q = H_0 * H_1 * ... * H_{k-1} -// len(tau) >= k, 0 <= k <= n, 0 <= n <= m, len(work) >= n. -// Dorg2r will panic if these conditions are not met. -// -// Dorg2r is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorg2r(m, n, k int, a []float64, lda int, tau []float64, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < n: - panic(shortWork) - } - - bi := blas64.Implementation() - - // Initialize columns k+1:n to columns of the unit matrix. - for l := 0; l < m; l++ { - for j := k; j < n; j++ { - a[l*lda+j] = 0 - } - } - for j := k; j < n; j++ { - a[j*lda+j] = 1 - } - for i := k - 1; i >= 0; i-- { - for i := range work { - work[i] = 0 - } - if i < n-1 { - a[i*lda+i] = 1 - impl.Dlarf(blas.Left, m-i, n-i-1, a[i*lda+i:], lda, tau[i], a[i*lda+i+1:], lda, work) - } - if i < m-1 { - bi.Dscal(m-i-1, -tau[i], a[(i+1)*lda+i:], lda) - } - a[i*lda+i] = 1 - tau[i] - for l := 0; l < i; l++ { - a[l*lda+i] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go deleted file mode 100644 index 626cad5ff..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgbr.go +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/lapack" - -// Dorgbr generates one of the matrices Q or P^T computed by Dgebrd -// computed from the decomposition Dgebrd. See Dgebd2 for the description of -// Q and P^T. -// -// If vect == lapack.GenerateQ, then a is assumed to have been an m×k matrix and -// Q is of order m. If m >= k, then Dorgbr returns the first n columns of Q -// where m >= n >= k. If m < k, then Dorgbr returns Q as an m×m matrix. -// -// If vect == lapack.GeneratePT, then A is assumed to have been a k×n matrix, and -// P^T is of order n. If k < n, then Dorgbr returns the first m rows of P^T, -// where n >= m >= k. If k >= n, then Dorgbr returns P^T as an n×n matrix. -// -// Dorgbr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgbr(vect lapack.GenOrtho, m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - wantq := vect == lapack.GenerateQ - mn := min(m, n) - switch { - case vect != lapack.GenerateQ && vect != lapack.GeneratePT: - panic(badGenOrtho) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case wantq && n > m: - panic(nGTM) - case wantq && n < min(m, k): - panic("lapack: n < min(m,k)") - case !wantq && m > n: - panic(mGTN) - case !wantq && m < min(n, k): - panic("lapack: m < min(n,k)") - case lda < max(1, n) && lwork != -1: - // Normally, we follow the reference and require the leading - // dimension to be always valid, even in case of workspace - // queries. However, if a caller provided a placeholder value - // for lda (and a) when doing a workspace query that didn't - // fulfill the condition here, it would cause a panic. This is - // exactly what Dgesvd does. - panic(badLdA) - case lwork < max(1, mn) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - work[0] = 1 - if m == 0 || n == 0 { - return - } - - if wantq { - if m >= k { - impl.Dorgqr(m, n, k, a, lda, tau, work, -1) - } else if m > 1 { - impl.Dorgqr(m-1, m-1, m-1, a[lda+1:], lda, tau, work, -1) - } - } else { - if k < n { - impl.Dorglq(m, n, k, a, lda, tau, work, -1) - } else if n > 1 { - impl.Dorglq(n-1, n-1, n-1, a[lda+1:], lda, tau, work, -1) - } - } - lworkopt := int(work[0]) - lworkopt = max(lworkopt, mn) - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case wantq && len(tau) < min(m, k): - panic(shortTau) - case !wantq && len(tau) < min(n, k): - panic(shortTau) - } - - if wantq { - // Form Q, determined by a call to Dgebrd to reduce an m×k matrix. - if m >= k { - impl.Dorgqr(m, n, k, a, lda, tau, work, lwork) - } else { - // Shift the vectors which define the elementary reflectors one - // column to the right, and set the first row and column of Q to - // those of the unit matrix. - for j := m - 1; j >= 1; j-- { - a[j] = 0 - for i := j + 1; i < m; i++ { - a[i*lda+j] = a[i*lda+j-1] - } - } - a[0] = 1 - for i := 1; i < m; i++ { - a[i*lda] = 0 - } - if m > 1 { - // Form Q[1:m-1, 1:m-1] - impl.Dorgqr(m-1, m-1, m-1, a[lda+1:], lda, tau, work, lwork) - } - } - } else { - // Form P^T, determined by a call to Dgebrd to reduce a k×n matrix. - if k < n { - impl.Dorglq(m, n, k, a, lda, tau, work, lwork) - } else { - // Shift the vectors which define the elementary reflectors one - // row downward, and set the first row and column of P^T to - // those of the unit matrix. - a[0] = 1 - for i := 1; i < n; i++ { - a[i*lda] = 0 - } - for j := 1; j < n; j++ { - for i := j - 1; i >= 1; i-- { - a[i*lda+j] = a[(i-1)*lda+j] - } - a[j] = 0 - } - if n > 1 { - impl.Dorglq(n-1, n-1, n-1, a[lda+1:], lda, tau, work, lwork) - } - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go deleted file mode 100644 index 6e799d10d..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorghr.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -// Dorghr generates an n×n orthogonal matrix Q which is defined as the product -// of ihi-ilo elementary reflectors: -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// -// a and lda represent an n×n matrix that contains the elementary reflectors, as -// returned by Dgehrd. On return, a is overwritten by the n×n orthogonal matrix -// Q. Q will be equal to the identity matrix except in the submatrix -// Q[ilo+1:ihi+1,ilo+1:ihi+1]. -// -// ilo and ihi must have the same values as in the previous call of Dgehrd. It -// must hold that -// 0 <= ilo <= ihi < n, if n > 0, -// ilo = 0, ihi = -1, if n == 0. -// -// tau contains the scalar factors of the elementary reflectors, as returned by -// Dgehrd. tau must have length n-1. -// -// work must have length at least max(1,lwork) and lwork must be at least -// ihi-ilo. For optimum performance lwork must be at least (ihi-ilo)*nb where nb -// is the optimal blocksize. On return, work[0] will contain the optimal value -// of lwork. -// -// If lwork == -1, instead of performing Dorghr, only the optimal value of lwork -// will be stored into work[0]. -// -// If any requirement on input sizes is not met, Dorghr will panic. -// -// Dorghr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorghr(n, ilo, ihi int, a []float64, lda int, tau, work []float64, lwork int) { - nh := ihi - ilo - switch { - case ilo < 0 || max(1, n) <= ilo: - panic(badIlo) - case ihi < min(ilo, n-1) || n <= ihi: - panic(badIhi) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, nh) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - lwkopt := max(1, nh) * impl.Ilaenv(1, "DORGQR", " ", nh, nh, nh, -1) - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(tau) < n-1: - panic(shortTau) - } - - // Shift the vectors which define the elementary reflectors one column - // to the right. - for i := ilo + 2; i < ihi+1; i++ { - copy(a[i*lda+ilo+1:i*lda+i], a[i*lda+ilo:i*lda+i-1]) - } - // Set the first ilo+1 and the last n-ihi-1 rows and columns to those of - // the identity matrix. - for i := 0; i < ilo+1; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = 0 - } - a[i*lda+i] = 1 - } - for i := ilo + 1; i < ihi+1; i++ { - for j := 0; j <= ilo; j++ { - a[i*lda+j] = 0 - } - for j := i; j < n; j++ { - a[i*lda+j] = 0 - } - } - for i := ihi + 1; i < n; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = 0 - } - a[i*lda+i] = 1 - } - if nh > 0 { - // Generate Q[ilo+1:ihi+1,ilo+1:ihi+1]. - impl.Dorgqr(nh, nh, nh, a[(ilo+1)*lda+ilo+1:], lda, tau[ilo:ihi], work, lwork) - } - work[0] = float64(lwkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go deleted file mode 100644 index b5566b9de..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgl2.go +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dorgl2 generates an m×n matrix Q with orthonormal rows defined by the -// first m rows product of elementary reflectors as computed by Dgelqf. -// Q = H_0 * H_1 * ... * H_{k-1} -// len(tau) >= k, 0 <= k <= m, 0 <= m <= n, len(work) >= m. -// Dorgl2 will panic if these conditions are not met. -// -// Dorgl2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgl2(m, n, k int, a []float64, lda int, tau, work []float64) { - switch { - case m < 0: - panic(mLT0) - case n < m: - panic(nLTM) - case k < 0: - panic(kLT0) - case k > m: - panic(kGTM) - case lda < max(1, m): - panic(badLdA) - } - - if m == 0 { - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(work) < m: - panic(shortWork) - } - - bi := blas64.Implementation() - - if k < m { - for i := k; i < m; i++ { - for j := 0; j < n; j++ { - a[i*lda+j] = 0 - } - } - for j := k; j < m; j++ { - a[j*lda+j] = 1 - } - } - for i := k - 1; i >= 0; i-- { - if i < n-1 { - if i < m-1 { - a[i*lda+i] = 1 - impl.Dlarf(blas.Right, m-i-1, n-i, a[i*lda+i:], 1, tau[i], a[(i+1)*lda+i:], lda, work) - } - bi.Dscal(n-i-1, -tau[i], a[i*lda+i+1:], 1) - } - a[i*lda+i] = 1 - tau[i] - for l := 0; l < i; l++ { - a[i*lda+l] = 0 - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go deleted file mode 100644 index a6dd980ce..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorglq.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dorglq generates an m×n matrix Q with orthonormal columns defined by the -// product of elementary reflectors as computed by Dgelqf. -// Q = H_0 * H_1 * ... * H_{k-1} -// Dorglq is the blocked version of Dorgl2 that makes greater use of level-3 BLAS -// routines. -// -// len(tau) >= k, 0 <= k <= m, and 0 <= m <= n. -// -// work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= m, and the amount of blocking is limited by the usable length. -// If lwork == -1, instead of computing Dorglq the optimal work length is stored -// into work[0]. -// -// Dorglq will panic if the conditions on input values are not met. -// -// Dorglq is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorglq(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < m: - panic(nLTM) - case k < 0: - panic(kLT0) - case k > m: - panic(kGTM) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, m) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if m == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DORGLQ", " ", m, n, k, -1) - if lwork == -1 { - work[0] = float64(m * nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - nbmin := 2 // Minimum block size - var nx int // Crossover size from blocked to unbloked code - iws := m // Length of work needed - var ldwork int - if 1 < nb && nb < k { - nx = max(0, impl.Ilaenv(3, "DORGLQ", " ", m, n, k, -1)) - if nx < k { - ldwork = nb - iws = m * ldwork - if lwork < iws { - nb = lwork / m - ldwork = nb - nbmin = max(2, impl.Ilaenv(2, "DORGLQ", " ", m, n, k, -1)) - } - } - } - - var ki, kk int - if nbmin <= nb && nb < k && nx < k { - // The first kk rows are handled by the blocked method. - ki = ((k - nx - 1) / nb) * nb - kk = min(k, ki+nb) - for i := kk; i < m; i++ { - for j := 0; j < kk; j++ { - a[i*lda+j] = 0 - } - } - } - if kk < m { - // Perform the operation on colums kk to the end. - impl.Dorgl2(m-kk, n-kk, k-kk, a[kk*lda+kk:], lda, tau[kk:], work) - } - if kk > 0 { - // Perform the operation on column-blocks - for i := ki; i >= 0; i -= nb { - ib := min(nb, k-i) - if i+ib < m { - impl.Dlarft(lapack.Forward, lapack.RowWise, - n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - - impl.Dlarfb(blas.Right, blas.Trans, lapack.Forward, lapack.RowWise, - m-i-ib, n-i, ib, - a[i*lda+i:], lda, - work, ldwork, - a[(i+ib)*lda+i:], lda, - work[ib*ldwork:], ldwork) - } - impl.Dorgl2(ib, n-i, ib, a[i*lda+i:], lda, tau[i:], work) - for l := i; l < i+ib; l++ { - for j := 0; j < i; j++ { - a[l*lda+j] = 0 - } - } - } - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go deleted file mode 100644 index 6927ba4ca..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgql.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dorgql generates the m×n matrix Q with orthonormal columns defined as the -// last n columns of a product of k elementary reflectors of order m -// Q = H_{k-1} * ... * H_1 * H_0. -// -// It must hold that -// 0 <= k <= n <= m, -// and Dorgql will panic otherwise. -// -// On entry, the (n-k+i)-th column of A must contain the vector which defines -// the elementary reflector H_i, for i=0,...,k-1, and tau[i] must contain its -// scalar factor. On return, a contains the m×n matrix Q. -// -// tau must have length at least k, and Dorgql will panic otherwise. -// -// work must have length at least max(1,lwork), and lwork must be at least -// max(1,n), otherwise Dorgql will panic. For optimum performance lwork must -// be a sufficiently large multiple of n. -// -// If lwork == -1, instead of computing Dorgql the optimal work length is stored -// into work[0]. -// -// Dorgql is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgql(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DORGQL", " ", m, n, k, -1) - if lwork == -1 { - work[0] = float64(n * nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - nbmin := 2 - var nx, ldwork int - iws := n - if 1 < nb && nb < k { - // Determine when to cross over from blocked to unblocked code. - nx = max(0, impl.Ilaenv(3, "DORGQL", " ", m, n, k, -1)) - if nx < k { - // Determine if workspace is large enough for blocked code. - iws = n * nb - if lwork < iws { - // Not enough workspace to use optimal nb: reduce nb and determine - // the minimum value of nb. - nb = lwork / n - nbmin = max(2, impl.Ilaenv(2, "DORGQL", " ", m, n, k, -1)) - } - ldwork = nb - } - } - - var kk int - if nbmin <= nb && nb < k && nx < k { - // Use blocked code after the first block. The last kk columns are handled - // by the block method. - kk = min(k, ((k-nx+nb-1)/nb)*nb) - - // Set A(m-kk:m, 0:n-kk) to zero. - for i := m - kk; i < m; i++ { - for j := 0; j < n-kk; j++ { - a[i*lda+j] = 0 - } - } - } - - // Use unblocked code for the first or only block. - impl.Dorg2l(m-kk, n-kk, k-kk, a, lda, tau, work) - if kk > 0 { - // Use blocked code. - for i := k - kk; i < k; i += nb { - ib := min(nb, k-i) - if n-k+i > 0 { - // Form the triangular factor of the block reflector - // H = H_{i+ib-1} * ... * H_{i+1} * H_i. - impl.Dlarft(lapack.Backward, lapack.ColumnWise, m-k+i+ib, ib, - a[n-k+i:], lda, tau[i:], work, ldwork) - - // Apply H to A[0:m-k+i+ib, 0:n-k+i] from the left. - impl.Dlarfb(blas.Left, blas.NoTrans, lapack.Backward, lapack.ColumnWise, - m-k+i+ib, n-k+i, ib, a[n-k+i:], lda, work, ldwork, - a, lda, work[ib*ldwork:], ldwork) - } - - // Apply H to rows 0:m-k+i+ib of current block. - impl.Dorg2l(m-k+i+ib, ib, ib, a[n-k+i:], lda, tau[i:], work) - - // Set rows m-k+i+ib:m of current block to zero. - for j := n - k + i; j < n-k+i+ib; j++ { - for l := m - k + i + ib; l < m; l++ { - a[l*lda+j] = 0 - } - } - } - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go deleted file mode 100644 index f07fdaf46..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgqr.go +++ /dev/null @@ -1,134 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dorgqr generates an m×n matrix Q with orthonormal columns defined by the -// product of elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1} -// as computed by Dgeqrf. -// Dorgqr is the blocked version of Dorg2r that makes greater use of level-3 BLAS -// routines. -// -// The length of tau must be at least k, and the length of work must be at least n. -// It also must be that 0 <= k <= n and 0 <= n <= m. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= n, and the amount of blocking is limited by the usable -// length. If lwork == -1, instead of computing Dorgqr the optimal work length -// is stored into work[0]. -// -// Dorgqr will panic if the conditions on input values are not met. -// -// Dorgqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgqr(m, n, k int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case n > m: - panic(nGTM) - case k < 0: - panic(kLT0) - case k > n: - panic(kGTN) - case lda < max(1, n) && lwork != -1: - // Normally, we follow the reference and require the leading - // dimension to be always valid, even in case of workspace - // queries. However, if a caller provided a placeholder value - // for lda (and a) when doing a workspace query that didn't - // fulfill the condition here, it would cause a panic. This is - // exactly what Dgesvd does. - panic(badLdA) - case lwork < max(1, n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if n == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DORGQR", " ", m, n, k, -1) - // work is treated as an n×nb matrix - if lwork == -1 { - work[0] = float64(n * nb) - return - } - - switch { - case len(a) < (m-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - } - - nbmin := 2 // Minimum block size - var nx int // Crossover size from blocked to unbloked code - iws := n // Length of work needed - var ldwork int - if 1 < nb && nb < k { - nx = max(0, impl.Ilaenv(3, "DORGQR", " ", m, n, k, -1)) - if nx < k { - ldwork = nb - iws = n * ldwork - if lwork < iws { - nb = lwork / n - ldwork = nb - nbmin = max(2, impl.Ilaenv(2, "DORGQR", " ", m, n, k, -1)) - } - } - } - var ki, kk int - if nbmin <= nb && nb < k && nx < k { - // The first kk columns are handled by the blocked method. - ki = ((k - nx - 1) / nb) * nb - kk = min(k, ki+nb) - for i := 0; i < kk; i++ { - for j := kk; j < n; j++ { - a[i*lda+j] = 0 - } - } - } - if kk < n { - // Perform the operation on colums kk to the end. - impl.Dorg2r(m-kk, n-kk, k-kk, a[kk*lda+kk:], lda, tau[kk:], work) - } - if kk > 0 { - // Perform the operation on column-blocks. - for i := ki; i >= 0; i -= nb { - ib := min(nb, k-i) - if i+ib < n { - impl.Dlarft(lapack.Forward, lapack.ColumnWise, - m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work, ldwork) - - impl.Dlarfb(blas.Left, blas.NoTrans, lapack.Forward, lapack.ColumnWise, - m-i, n-i-ib, ib, - a[i*lda+i:], lda, - work, ldwork, - a[i*lda+i+ib:], lda, - work[ib*ldwork:], ldwork) - } - impl.Dorg2r(m-i, ib, ib, a[i*lda+i:], lda, tau[i:], work) - // Set rows 0:i-1 of current block to zero. - for j := i; j < i+ib; j++ { - for l := 0; l < i; l++ { - a[l*lda+j] = 0 - } - } - } - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go deleted file mode 100644 index 483fbcae9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorgtr.go +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dorgtr generates a real orthogonal matrix Q which is defined as the product -// of n-1 elementary reflectors of order n as returned by Dsytrd. -// -// The construction of Q depends on the value of uplo: -// Q = H_{n-1} * ... * H_1 * H_0 if uplo == blas.Upper -// Q = H_0 * H_1 * ... * H_{n-1} if uplo == blas.Lower -// where H_i is constructed from the elementary reflectors as computed by Dsytrd. -// See the documentation for Dsytrd for more information. -// -// tau must have length at least n-1, and Dorgtr will panic otherwise. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= max(1,n-1), and Dorgtr will panic otherwise. The amount of blocking -// is limited by the usable length. -// If lwork == -1, instead of computing Dorgtr the optimal work length is stored -// into work[0]. -// -// Dorgtr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorgtr(uplo blas.Uplo, n int, a []float64, lda int, tau, work []float64, lwork int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, n-1) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - if n == 0 { - work[0] = 1 - return - } - - var nb int - if uplo == blas.Upper { - nb = impl.Ilaenv(1, "DORGQL", " ", n-1, n-1, n-1, -1) - } else { - nb = impl.Ilaenv(1, "DORGQR", " ", n-1, n-1, n-1, -1) - } - lworkopt := max(1, n-1) * nb - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(tau) < n-1: - panic(shortTau) - } - - if uplo == blas.Upper { - // Q was determined by a call to Dsytrd with uplo == blas.Upper. - // Shift the vectors which define the elementary reflectors one column - // to the left, and set the last row and column of Q to those of the unit - // matrix. - for j := 0; j < n-1; j++ { - for i := 0; i < j; i++ { - a[i*lda+j] = a[i*lda+j+1] - } - a[(n-1)*lda+j] = 0 - } - for i := 0; i < n-1; i++ { - a[i*lda+n-1] = 0 - } - a[(n-1)*lda+n-1] = 1 - - // Generate Q[0:n-1, 0:n-1]. - impl.Dorgql(n-1, n-1, n-1, a, lda, tau, work, lwork) - } else { - // Q was determined by a call to Dsytrd with uplo == blas.Upper. - // Shift the vectors which define the elementary reflectors one column - // to the right, and set the first row and column of Q to those of the unit - // matrix. - for j := n - 1; j > 0; j-- { - a[j] = 0 - for i := j + 1; i < n; i++ { - a[i*lda+j] = a[i*lda+j-1] - } - } - a[0] = 1 - for i := 1; i < n; i++ { - a[i*lda] = 0 - } - if n > 1 { - // Generate Q[1:n, 1:n]. - impl.Dorgqr(n-1, n-1, n-1, a[lda+1:], lda, tau, work, lwork) - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go deleted file mode 100644 index 4b0bd83cc..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorm2r.go +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dorm2r multiplies a general matrix C by an orthogonal matrix from a QR factorization -// determined by Dgeqrf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans -// If side == blas.Left, a is a matrix of size m×k, and if side == blas.Right -// a is of size n×k. -// -// tau contains the Householder factors and is of length at least k and this function -// will panic otherwise. -// -// work is temporary storage of length at least n if side == blas.Left -// and at least m if side == blas.Right and this function will panic otherwise. -// -// Dorm2r is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorm2r(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) { - left := side == blas.Left - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case lda < max(1, k): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - return - } - - switch { - case left && len(a) < (m-1)*lda+k: - panic(shortA) - case !left && len(a) < (n-1)*lda+k: - panic(shortA) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(tau) < k: - panic(shortTau) - case left && len(work) < n: - panic(shortWork) - case !left && len(work) < m: - panic(shortWork) - } - - if left { - if trans == blas.NoTrans { - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], lda, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - return - } - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], lda, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - return - } - if trans == blas.NoTrans { - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], lda, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } - return - } - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], lda, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go deleted file mode 100644 index 026dc0412..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormbr.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dormbr applies a multiplicative update to the matrix C based on a -// decomposition computed by Dgebrd. -// -// Dormbr overwrites the m×n matrix C with -// Q * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.NoTrans -// C * Q if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.NoTrans -// Q^T * C if vect == lapack.ApplyQ, side == blas.Left, and trans == blas.Trans -// C * Q^T if vect == lapack.ApplyQ, side == blas.Right, and trans == blas.Trans -// -// P * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.NoTrans -// C * P if vect == lapack.ApplyP, side == blas.Right, and trans == blas.NoTrans -// P^T * C if vect == lapack.ApplyP, side == blas.Left, and trans == blas.Trans -// C * P^T if vect == lapack.ApplyP, side == blas.Right, and trans == blas.Trans -// where P and Q are the orthogonal matrices determined by Dgebrd when reducing -// a matrix A to bidiagonal form: A = Q * B * P^T. See Dgebrd for the -// definitions of Q and P. -// -// If vect == lapack.ApplyQ, A is assumed to have been an nq×k matrix, while if -// vect == lapack.ApplyP, A is assumed to have been a k×nq matrix. nq = m if -// side == blas.Left, while nq = n if side == blas.Right. -// -// tau must have length min(nq,k), and Dormbr will panic otherwise. tau contains -// the elementary reflectors to construct Q or P depending on the value of -// vect. -// -// work must have length at least max(1,lwork), and lwork must be either -1 or -// at least max(1,n) if side == blas.Left, and at least max(1,m) if side == -// blas.Right. For optimum performance lwork should be at least n*nb if side == -// blas.Left, and at least m*nb if side == blas.Right, where nb is the optimal -// block size. On return, work[0] will contain the optimal value of lwork. -// -// If lwork == -1, the function only calculates the optimal value of lwork and -// returns it in work[0]. -// -// Dormbr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormbr(vect lapack.ApplyOrtho, side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - nq := n - nw := m - if side == blas.Left { - nq = m - nw = n - } - applyQ := vect == lapack.ApplyQ - switch { - case !applyQ && vect != lapack.ApplyP: - panic(badApplyOrtho) - case side != blas.Left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case applyQ && lda < max(1, min(nq, k)): - panic(badLdA) - case !applyQ && lda < max(1, nq): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 { - work[0] = 1 - return - } - - // The current implementation does not use opts, but a future change may - // use these options so construct them. - var opts string - if side == blas.Left { - opts = "L" - } else { - opts = "R" - } - if trans == blas.Trans { - opts += "T" - } else { - opts += "N" - } - var nb int - if applyQ { - if side == blas.Left { - nb = impl.Ilaenv(1, "DORMQR", opts, m-1, n, m-1, -1) - } else { - nb = impl.Ilaenv(1, "DORMQR", opts, m, n-1, n-1, -1) - } - } else { - if side == blas.Left { - nb = impl.Ilaenv(1, "DORMLQ", opts, m-1, n, m-1, -1) - } else { - nb = impl.Ilaenv(1, "DORMLQ", opts, m, n-1, n-1, -1) - } - } - lworkopt := max(1, nw) * nb - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - minnqk := min(nq, k) - switch { - case applyQ && len(a) < (nq-1)*lda+minnqk: - panic(shortA) - case !applyQ && len(a) < (minnqk-1)*lda+nq: - panic(shortA) - case len(tau) < minnqk: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - } - - if applyQ { - // Change the operation to get Q depending on the size of the initial - // matrix to Dgebrd. The size matters due to the storage location of - // the off-diagonal elements. - if nq >= k { - impl.Dormqr(side, trans, m, n, k, a, lda, tau[:k], c, ldc, work, lwork) - } else if nq > 1 { - mi := m - ni := n - 1 - i1 := 0 - i2 := 1 - if side == blas.Left { - mi = m - 1 - ni = n - i1 = 1 - i2 = 0 - } - impl.Dormqr(side, trans, mi, ni, nq-1, a[1*lda:], lda, tau[:nq-1], c[i1*ldc+i2:], ldc, work, lwork) - } - work[0] = float64(lworkopt) - return - } - - transt := blas.Trans - if trans == blas.Trans { - transt = blas.NoTrans - } - - // Change the operation to get P depending on the size of the initial - // matrix to Dgebrd. The size matters due to the storage location of - // the off-diagonal elements. - if nq > k { - impl.Dormlq(side, transt, m, n, k, a, lda, tau, c, ldc, work, lwork) - } else if nq > 1 { - mi := m - ni := n - 1 - i1 := 0 - i2 := 1 - if side == blas.Left { - mi = m - 1 - ni = n - i1 = 1 - i2 = 0 - } - impl.Dormlq(side, transt, mi, ni, nq-1, a[1:], lda, tau, c[i1*ldc+i2:], ldc, work, lwork) - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go deleted file mode 100644 index c00f44059..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormhr.go +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dormhr multiplies an m×n general matrix C with an nq×nq orthogonal matrix Q -// Q * C, if side == blas.Left and trans == blas.NoTrans, -// Q^T * C, if side == blas.Left and trans == blas.Trans, -// C * Q, if side == blas.Right and trans == blas.NoTrans, -// C * Q^T, if side == blas.Right and trans == blas.Trans, -// where nq == m if side == blas.Left and nq == n if side == blas.Right. -// -// Q is defined implicitly as the product of ihi-ilo elementary reflectors, as -// returned by Dgehrd: -// Q = H_{ilo} H_{ilo+1} ... H_{ihi-1}. -// Q is equal to the identity matrix except in the submatrix -// Q[ilo+1:ihi+1,ilo+1:ihi+1]. -// -// ilo and ihi must have the same values as in the previous call of Dgehrd. It -// must hold that -// 0 <= ilo <= ihi < m, if m > 0 and side == blas.Left, -// ilo = 0 and ihi = -1, if m = 0 and side == blas.Left, -// 0 <= ilo <= ihi < n, if n > 0 and side == blas.Right, -// ilo = 0 and ihi = -1, if n = 0 and side == blas.Right. -// -// a and lda represent an m×m matrix if side == blas.Left and an n×n matrix if -// side == blas.Right. The matrix contains vectors which define the elementary -// reflectors, as returned by Dgehrd. -// -// tau contains the scalar factors of the elementary reflectors, as returned by -// Dgehrd. tau must have length m-1 if side == blas.Left and n-1 if side == -// blas.Right. -// -// c and ldc represent the m×n matrix C. On return, c is overwritten by the -// product with Q. -// -// work must have length at least max(1,lwork), and lwork must be at least -// max(1,n), if side == blas.Left, and max(1,m), if side == blas.Right. For -// optimum performance lwork should be at least n*nb if side == blas.Left and -// m*nb if side == blas.Right, where nb is the optimal block size. On return, -// work[0] will contain the optimal value of lwork. -// -// If lwork == -1, instead of performing Dormhr, only the optimal value of lwork -// will be stored in work[0]. -// -// If any requirement on input sizes is not met, Dormhr will panic. -// -// Dormhr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormhr(side blas.Side, trans blas.Transpose, m, n, ilo, ihi int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - nq := n // The order of Q. - nw := m // The minimum length of work. - if side == blas.Left { - nq = m - nw = n - } - switch { - case side != blas.Left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case ilo < 0 || max(1, nq) <= ilo: - panic(badIlo) - case ihi < min(ilo, nq-1) || nq <= ihi: - panic(badIhi) - case lda < max(1, nq): - panic(badLdA) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 { - work[0] = 1 - return - } - - nh := ihi - ilo - var nb int - if side == blas.Left { - opts := "LN" - if trans == blas.Trans { - opts = "LT" - } - nb = impl.Ilaenv(1, "DORMQR", opts, nh, n, nh, -1) - } else { - opts := "RN" - if trans == blas.Trans { - opts = "RT" - } - nb = impl.Ilaenv(1, "DORMQR", opts, m, nh, nh, -1) - } - lwkopt := max(1, nw) * nb - if lwork == -1 { - work[0] = float64(lwkopt) - return - } - - if nh == 0 { - work[0] = 1 - return - } - - switch { - case len(a) < (nq-1)*lda+nq: - panic(shortA) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(tau) != nq-1: - panic(badLenTau) - } - - if side == blas.Left { - impl.Dormqr(side, trans, nh, n, nh, a[(ilo+1)*lda+ilo:], lda, - tau[ilo:ihi], c[(ilo+1)*ldc:], ldc, work, lwork) - } else { - impl.Dormqr(side, trans, m, nh, nh, a[(ilo+1)*lda+ilo:], lda, - tau[ilo:ihi], c[ilo+1:], ldc, work, lwork) - } - work[0] = float64(lwkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go deleted file mode 100644 index 25aa83ac1..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dorml2.go +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dorml2 multiplies a general matrix C by an orthogonal matrix from an LQ factorization -// determined by Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans -// If side == blas.Left, a is a matrix of side k×m, and if side == blas.Right -// a is of size k×n. -// -// tau contains the Householder factors and is of length at least k and this function will -// panic otherwise. -// -// work is temporary storage of length at least n if side == blas.Left -// and at least m if side == blas.Right and this function will panic otherwise. -// -// Dorml2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dorml2(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) { - left := side == blas.Left - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case left && lda < max(1, m): - panic(badLdA) - case !left && lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - return - } - - switch { - case left && len(a) < (k-1)*lda+m: - panic(shortA) - case !left && len(a) < (k-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case left && len(work) < n: - panic(shortWork) - case !left && len(work) < m: - panic(shortWork) - } - - notrans := trans == blas.NoTrans - switch { - case left && notrans: - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], 1, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - - case left && !notrans: - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m-i, n, a[i*lda+i:], 1, tau[i], c[i*ldc:], ldc, work) - a[i*lda+i] = aii - } - - case !left && notrans: - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], 1, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } - - case !left && !notrans: - for i := 0; i < k; i++ { - aii := a[i*lda+i] - a[i*lda+i] = 1 - impl.Dlarf(side, m, n-i, a[i*lda+i:], 1, tau[i], c[i:], ldc, work) - a[i*lda+i] = aii - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go deleted file mode 100644 index 6fcfc2fb1..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormlq.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dormlq multiplies the matrix C by the orthogonal matrix Q defined by the -// slices a and tau. A and tau are as returned from Dgelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans -// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right -// A is of size k×n. This uses a blocked algorithm. -// -// work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right, -// and this function will panic otherwise. -// Dormlq uses a block algorithm, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Dormlq, -// the optimal work length will be stored into work[0]. -// -// tau contains the Householder scales and must have length at least k, and -// this function will panic otherwise. -func (impl Implementation) Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - left := side == blas.Left - nw := m - if left { - nw = n - } - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.Trans && trans != blas.NoTrans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case left && lda < max(1, m): - panic(badLdA) - case !left && lda < max(1, n): - panic(badLdA) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - work[0] = 1 - return - } - - const ( - nbmax = 64 - ldt = nbmax - tsize = nbmax * ldt - ) - opts := string(side) + string(trans) - nb := min(nbmax, impl.Ilaenv(1, "DORMLQ", opts, m, n, k, -1)) - lworkopt := max(1, nw)*nb + tsize - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case left && len(a) < (k-1)*lda+m: - panic(shortA) - case !left && len(a) < (k-1)*lda+n: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - } - - nbmin := 2 - if 1 < nb && nb < k { - iws := nw*nb + tsize - if lwork < iws { - nb = (lwork - tsize) / nw - nbmin = max(2, impl.Ilaenv(2, "DORMLQ", opts, m, n, k, -1)) - } - } - if nb < nbmin || k <= nb { - // Call unblocked code. - impl.Dorml2(side, trans, m, n, k, a, lda, tau, c, ldc, work) - work[0] = float64(lworkopt) - return - } - - t := work[:tsize] - wrk := work[tsize:] - ldwrk := nb - - notrans := trans == blas.NoTrans - transt := blas.NoTrans - if notrans { - transt = blas.Trans - } - - switch { - case left && notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m-i, n, ib, - a[i*lda+i:], lda, - t, ldt, - c[i*ldc:], ldc, - wrk, ldwrk) - } - - case left && !notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m-i, n, ib, - a[i*lda+i:], lda, - t, ldt, - c[i*ldc:], ldc, - wrk, ldwrk) - } - - case !left && notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m, n-i, ib, - a[i*lda+i:], lda, - t, ldt, - c[i:], ldc, - wrk, ldwrk) - } - - case !left && !notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.RowWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - t, ldt) - impl.Dlarfb(side, transt, lapack.Forward, lapack.RowWise, m, n-i, ib, - a[i*lda+i:], lda, - t, ldt, - c[i:], ldc, - wrk, ldwrk) - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go deleted file mode 100644 index 8ae450865..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormqr.go +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/lapack" -) - -// Dormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C, if side == blas.Left and trans == blas.NoTrans, -// C = Q^T * C, if side == blas.Left and trans == blas.Trans, -// C = C * Q, if side == blas.Right and trans == blas.NoTrans, -// C = C * Q^T, if side == blas.Right and trans == blas.Trans, -// where Q is defined as the product of k elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1}. -// -// If side == blas.Left, A is an m×k matrix and 0 <= k <= m. -// If side == blas.Right, A is an n×k matrix and 0 <= k <= n. -// The ith column of A contains the vector which defines the elementary -// reflector H_i and tau[i] contains its scalar factor. tau must have length k -// and Dormqr will panic otherwise. Dgeqrf returns A and tau in the required -// form. -// -// work must have length at least max(1,lwork), and lwork must be at least n if -// side == blas.Left and at least m if side == blas.Right, otherwise Dormqr will -// panic. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= m if side == blas.Left and lwork >= n if side == -// blas.Right, and this function will panic otherwise. Larger values of lwork -// will generally give better performance. On return, work[0] will contain the -// optimal value of lwork. -// -// If lwork is -1, instead of performing Dormqr, the optimal workspace size will -// be stored into work[0]. -func (impl Implementation) Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) { - left := side == blas.Left - nq := n - nw := m - if left { - nq = m - nw = n - } - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case lda < max(1, k): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - case lwork < max(1, nw) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - work[0] = 1 - return - } - - const ( - nbmax = 64 - ldt = nbmax - tsize = nbmax * ldt - ) - opts := string(side) + string(trans) - nb := min(nbmax, impl.Ilaenv(1, "DORMQR", opts, m, n, k, -1)) - lworkopt := max(1, nw)*nb + tsize - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (nq-1)*lda+k: - panic(shortA) - case len(tau) != k: - panic(badLenTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - } - - nbmin := 2 - if 1 < nb && nb < k { - if lwork < nw*nb+tsize { - nb = (lwork - tsize) / nw - nbmin = max(2, impl.Ilaenv(2, "DORMQR", opts, m, n, k, -1)) - } - } - - if nb < nbmin || k <= nb { - // Call unblocked code. - impl.Dorm2r(side, trans, m, n, k, a, lda, tau, c, ldc, work) - work[0] = float64(lworkopt) - return - } - - var ( - ldwork = nb - notrans = trans == blas.NoTrans - ) - switch { - case left && notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m-i, n, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i*ldc:], ldc, - work[tsize:], ldwork) - } - - case left && !notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, m-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m-i, n, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i*ldc:], ldc, - work[tsize:], ldwork) - } - - case !left && notrans: - for i := 0; i < k; i += nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m, n-i, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i:], ldc, - work[tsize:], ldwork) - } - - case !left && !notrans: - for i := ((k - 1) / nb) * nb; i >= 0; i -= nb { - ib := min(nb, k-i) - impl.Dlarft(lapack.Forward, lapack.ColumnWise, n-i, ib, - a[i*lda+i:], lda, - tau[i:], - work[:tsize], ldt) - impl.Dlarfb(side, trans, lapack.Forward, lapack.ColumnWise, m, n-i, ib, - a[i*lda+i:], lda, - work[:tsize], ldt, - c[i:], ldc, - work[tsize:], ldwork) - } - } - work[0] = float64(lworkopt) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go deleted file mode 100644 index bb03f32c7..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dormr2.go +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dormr2 multiplies a general matrix C by an orthogonal matrix from a RQ factorization -// determined by Dgerqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans -// If side == blas.Left, a is a matrix of size k×m, and if side == blas.Right -// a is of size k×n. -// -// tau contains the Householder factors and is of length at least k and this function -// will panic otherwise. -// -// work is temporary storage of length at least n if side == blas.Left -// and at least m if side == blas.Right and this function will panic otherwise. -// -// Dormr2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dormr2(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64) { - left := side == blas.Left - nq := n - nw := m - if left { - nq = m - nw = n - } - switch { - case !left && side != blas.Right: - panic(badSide) - case trans != blas.NoTrans && trans != blas.Trans: - panic(badTrans) - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case k < 0: - panic(kLT0) - case left && k > m: - panic(kGTM) - case !left && k > n: - panic(kGTN) - case lda < max(1, nq): - panic(badLdA) - case ldc < max(1, n): - panic(badLdC) - } - - // Quick return if possible. - if m == 0 || n == 0 || k == 0 { - return - } - - switch { - case len(a) < (k-1)*lda+nq: - panic(shortA) - case len(tau) < k: - panic(shortTau) - case len(c) < (m-1)*ldc+n: - panic(shortC) - case len(work) < nw: - panic(shortWork) - } - - if left { - if trans == blas.NoTrans { - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+(m-k+i)] - a[i*lda+(m-k+i)] = 1 - impl.Dlarf(side, m-k+i+1, n, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(m-k+i)] = aii - } - return - } - for i := 0; i < k; i++ { - aii := a[i*lda+(m-k+i)] - a[i*lda+(m-k+i)] = 1 - impl.Dlarf(side, m-k+i+1, n, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(m-k+i)] = aii - } - return - } - if trans == blas.NoTrans { - for i := 0; i < k; i++ { - aii := a[i*lda+(n-k+i)] - a[i*lda+(n-k+i)] = 1 - impl.Dlarf(side, m, n-k+i+1, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(n-k+i)] = aii - } - return - } - for i := k - 1; i >= 0; i-- { - aii := a[i*lda+(n-k+i)] - a[i*lda+(n-k+i)] = 1 - impl.Dlarf(side, m, n-k+i+1, a[i*lda:], 1, tau[i], c, ldc, work) - a[i*lda+(n-k+i)] = aii - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go deleted file mode 100644 index a5beb80bc..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpbtf2.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpbtf2 computes the Cholesky factorization of a symmetric positive banded -// matrix ab. The matrix ab is n×n with kd diagonal bands. The Cholesky -// factorization computed is -// A = U^T * U if ul == blas.Upper -// A = L * L^T if ul == blas.Lower -// ul also specifies the storage of ab. If ul == blas.Upper, then -// ab is stored as an upper-triangular banded matrix with kd super-diagonals, -// and if ul == blas.Lower, ab is stored as a lower-triangular banded matrix -// with kd sub-diagonals. On exit, the banded matrix U or L is stored in-place -// into ab depending on the value of ul. Dpbtf2 returns whether the factorization -// was successfully completed. -// -// The band storage scheme is illustrated below when n = 6, and kd = 2. -// The resulting Cholesky decomposition is stored in the same elements as the -// input band matrix (a11 becomes u11 or l11, etc.). -// -// ul = blas.Upper -// a11 a12 a13 -// a22 a23 a24 -// a33 a34 a35 -// a44 a45 a46 -// a55 a56 * -// a66 * * -// -// ul = blas.Lower -// * * a11 -// * a21 a22 -// a31 a32 a33 -// a42 a43 a44 -// a53 a54 a55 -// a64 a65 a66 -// -// Dpbtf2 is the unblocked version of the algorithm, see Dpbtrf for the blocked -// version. -// -// Dpbtf2 is an internal routine, exported for testing purposes. -func (Implementation) Dpbtf2(ul blas.Uplo, n, kd int, ab []float64, ldab int) (ok bool) { - switch { - case ul != blas.Upper && ul != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case kd < 0: - panic(kdLT0) - case ldab < kd+1: - panic(badLdA) - } - - if n == 0 { - return - } - - if len(ab) < (n-1)*ldab+kd { - panic(shortAB) - } - - bi := blas64.Implementation() - - kld := max(1, ldab-1) - if ul == blas.Upper { - for j := 0; j < n; j++ { - // Compute U(J,J) and test for non positive-definiteness. - ajj := ab[j*ldab] - if ajj <= 0 { - return false - } - ajj = math.Sqrt(ajj) - ab[j*ldab] = ajj - // Compute elements j+1:j+kn of row J and update the trailing submatrix - // within the band. - kn := min(kd, n-j-1) - if kn > 0 { - bi.Dscal(kn, 1/ajj, ab[j*ldab+1:], 1) - bi.Dsyr(blas.Upper, kn, -1, ab[j*ldab+1:], 1, ab[(j+1)*ldab:], kld) - } - } - return true - } - for j := 0; j < n; j++ { - // Compute L(J,J) and test for non positive-definiteness. - ajj := ab[j*ldab+kd] - if ajj <= 0 { - return false - } - ajj = math.Sqrt(ajj) - ab[j*ldab+kd] = ajj - - // Compute elements J+1:J+KN of column J and update the trailing submatrix - // within the band. - kn := min(kd, n-j-1) - if kn > 0 { - bi.Dscal(kn, 1/ajj, ab[(j+1)*ldab+kd-1:], kld) - bi.Dsyr(blas.Lower, kn, -1, ab[(j+1)*ldab+kd-1:], kld, ab[(j+1)*ldab+kd:], kld) - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go deleted file mode 100644 index 7af4c1872..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpocon.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpocon estimates the reciprocal of the condition number of a positive-definite -// matrix A given the Cholesky decomposition of A. The condition number computed -// is based on the 1-norm and the ∞-norm. -// -// anorm is the 1-norm and the ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 3*n and Dpocon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Dpocon will panic otherwise. -func (impl Implementation) Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case anorm < 0: - panic(negANorm) - } - - // Quick return if possible. - if n == 0 { - return 1 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(work) < 3*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - if anorm == 0 { - return 0 - } - - bi := blas64.Implementation() - - var ( - smlnum = dlamchS - rcond float64 - sl, su float64 - normin bool - ainvnm float64 - kase int - isave [3]int - ) - for { - ainvnm, kase = impl.Dlacn2(n, work[n:], work, iwork, ainvnm, kase, &isave) - if kase == 0 { - if ainvnm != 0 { - rcond = (1 / ainvnm) / anorm - } - return rcond - } - if uplo == blas.Upper { - sl = impl.Dlatrs(blas.Upper, blas.Trans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - normin = true - su = impl.Dlatrs(blas.Upper, blas.NoTrans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - } else { - sl = impl.Dlatrs(blas.Lower, blas.NoTrans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - normin = true - su = impl.Dlatrs(blas.Lower, blas.Trans, blas.NonUnit, normin, n, a, lda, work, work[2*n:]) - } - scale := sl * su - if scale != 1 { - ix := bi.Idamax(n, work, 1) - if scale == 0 || scale < math.Abs(work[ix])*smlnum { - return rcond - } - impl.Drscl(n, scale, work, 1) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go deleted file mode 100644 index 5d3327c2d..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotf2.go +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpotf2 computes the Cholesky decomposition of the symmetric positive definite -// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = U^T U is stored in place into a. If ul == blas.Lower, then a = L L^T -// is computed and stored in-place into a. If a is not positive definite, false -// is returned. This is the unblocked version of the algorithm. -// -// Dpotf2 is an internal routine. It is exported for testing purposes. -func (Implementation) Dpotf2(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { - switch { - case ul != blas.Upper && ul != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - - if ul == blas.Upper { - for j := 0; j < n; j++ { - ajj := a[j*lda+j] - if j != 0 { - ajj -= bi.Ddot(j, a[j:], lda, a[j:], lda) - } - if ajj <= 0 || math.IsNaN(ajj) { - a[j*lda+j] = ajj - return false - } - ajj = math.Sqrt(ajj) - a[j*lda+j] = ajj - if j < n-1 { - bi.Dgemv(blas.Trans, j, n-j-1, - -1, a[j+1:], lda, a[j:], lda, - 1, a[j*lda+j+1:], 1) - bi.Dscal(n-j-1, 1/ajj, a[j*lda+j+1:], 1) - } - } - return true - } - for j := 0; j < n; j++ { - ajj := a[j*lda+j] - if j != 0 { - ajj -= bi.Ddot(j, a[j*lda:], 1, a[j*lda:], 1) - } - if ajj <= 0 || math.IsNaN(ajj) { - a[j*lda+j] = ajj - return false - } - ajj = math.Sqrt(ajj) - a[j*lda+j] = ajj - if j < n-1 { - bi.Dgemv(blas.NoTrans, n-j-1, j, - -1, a[(j+1)*lda:], lda, a[j*lda:], 1, - 1, a[(j+1)*lda+j:], lda) - bi.Dscal(n-j-1, 1/ajj, a[(j+1)*lda+j:], lda) - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go deleted file mode 100644 index 21241687f..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrf.go +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpotrf computes the Cholesky decomposition of the symmetric positive definite -// matrix a. If ul == blas.Upper, then a is stored as an upper-triangular matrix, -// and a = U^T U is stored in place into a. If ul == blas.Lower, then a = L L^T -// is computed and stored in-place into a. If a is not positive definite, false -// is returned. This is the blocked version of the algorithm. -func (impl Implementation) Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) { - switch { - case ul != blas.Upper && ul != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - nb := impl.Ilaenv(1, "DPOTRF", string(ul), n, -1, -1, -1) - if nb <= 1 || n <= nb { - return impl.Dpotf2(ul, n, a, lda) - } - bi := blas64.Implementation() - if ul == blas.Upper { - for j := 0; j < n; j += nb { - jb := min(nb, n-j) - bi.Dsyrk(blas.Upper, blas.Trans, jb, j, - -1, a[j:], lda, - 1, a[j*lda+j:], lda) - ok = impl.Dpotf2(blas.Upper, jb, a[j*lda+j:], lda) - if !ok { - return ok - } - if j+jb < n { - bi.Dgemm(blas.Trans, blas.NoTrans, jb, n-j-jb, j, - -1, a[j:], lda, a[j+jb:], lda, - 1, a[j*lda+j+jb:], lda) - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, jb, n-j-jb, - 1, a[j*lda+j:], lda, - a[j*lda+j+jb:], lda) - } - } - return true - } - for j := 0; j < n; j += nb { - jb := min(nb, n-j) - bi.Dsyrk(blas.Lower, blas.NoTrans, jb, j, - -1, a[j*lda:], lda, - 1, a[j*lda+j:], lda) - ok := impl.Dpotf2(blas.Lower, jb, a[j*lda+j:], lda) - if !ok { - return ok - } - if j+jb < n { - bi.Dgemm(blas.NoTrans, blas.Trans, n-j-jb, jb, j, - -1, a[(j+jb)*lda:], lda, a[j*lda:], lda, - 1, a[(j+jb)*lda+j:], lda) - bi.Dtrsm(blas.Right, blas.Lower, blas.Trans, blas.NonUnit, n-j-jb, jb, - 1, a[j*lda+j:], lda, - a[(j+jb)*lda+j:], lda) - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go deleted file mode 100644 index 2394775c3..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotri.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/blas" - -// Dpotri computes the inverse of a real symmetric positive definite matrix A -// using its Cholesky factorization. -// -// On entry, a contains the triangular factor U or L from the Cholesky -// factorization A = U^T*U or A = L*L^T, as computed by Dpotrf. -// On return, a contains the upper or lower triangle of the (symmetric) -// inverse of A, overwriting the input factor U or L. -func (impl Implementation) Dpotri(uplo blas.Uplo, n int, a []float64, lda int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - // Invert the triangular Cholesky factor U or L. - ok = impl.Dtrtri(uplo, blas.NonUnit, n, a, lda) - if !ok { - return false - } - - // Form inv(U)*inv(U)^T or inv(L)^T*inv(L). - impl.Dlauum(uplo, n, a, lda) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go deleted file mode 100644 index 689e0439c..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dpotrs.go +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dpotrs solves a system of n linear equations A*X = B where A is an n×n -// symmetric positive definite matrix and B is an n×nrhs matrix. The matrix A is -// represented by its Cholesky factorization -// A = U^T*U if uplo == blas.Upper -// A = L*L^T if uplo == blas.Lower -// as computed by Dpotrf. On entry, B contains the right-hand side matrix B, on -// return it contains the solution matrix X. -func (Implementation) Dpotrs(uplo blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - // Quick return if possible. - if n == 0 || nrhs == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(b) < (n-1)*ldb+nrhs: - panic(shortB) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - // Solve U^T * U * X = B where U is stored in the upper triangle of A. - - // Solve U^T * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Upper, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve U * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Upper, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - } else { - // Solve L * L^T * X = B where L is stored in the lower triangle of A. - - // Solve L * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Lower, blas.NoTrans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - // Solve L^T * X = B, overwriting B with X. - bi.Dtrsm(blas.Left, blas.Lower, blas.Trans, blas.NonUnit, n, nrhs, 1, a, lda, b, ldb) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go b/vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go deleted file mode 100644 index b2772dbc2..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/drscl.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas/blas64" -) - -// Drscl multiplies the vector x by 1/a being careful to avoid overflow or -// underflow where possible. -// -// Drscl is an internal routine. It is exported for testing purposes. -func (impl Implementation) Drscl(n int, a float64, x []float64, incX int) { - switch { - case n < 0: - panic(nLT0) - case incX <= 0: - panic(badIncX) - } - - // Quick return if possible. - if n == 0 { - return - } - - if len(x) < 1+(n-1)*incX { - panic(shortX) - } - - bi := blas64.Implementation() - - cden := a - cnum := 1.0 - smlnum := dlamchS - bignum := 1 / smlnum - for { - cden1 := cden * smlnum - cnum1 := cnum / bignum - var mul float64 - var done bool - switch { - case cnum != 0 && math.Abs(cden1) > math.Abs(cnum): - mul = smlnum - done = false - cden = cden1 - case math.Abs(cnum1) > math.Abs(cden): - mul = bignum - done = false - cnum = cnum1 - default: - mul = cnum / cden - done = true - } - bi.Dscal(n, mul, x, incX) - if done { - break - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go deleted file mode 100644 index d6c7861ab..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsteqr.go +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dsteqr computes the eigenvalues and optionally the eigenvectors of a symmetric -// tridiagonal matrix using the implicit QL or QR method. The eigenvectors of a -// full or band symmetric matrix can also be found if Dsytrd, Dsptrd, or Dsbtrd -// have been used to reduce this matrix to tridiagonal form. -// -// d, on entry, contains the diagonal elements of the tridiagonal matrix. On exit, -// d contains the eigenvalues in ascending order. d must have length n and -// Dsteqr will panic otherwise. -// -// e, on entry, contains the off-diagonal elements of the tridiagonal matrix on -// entry, and is overwritten during the call to Dsteqr. e must have length n-1 and -// Dsteqr will panic otherwise. -// -// z, on entry, contains the n×n orthogonal matrix used in the reduction to -// tridiagonal form if compz == lapack.EVOrig. On exit, if -// compz == lapack.EVOrig, z contains the orthonormal eigenvectors of the -// original symmetric matrix, and if compz == lapack.EVTridiag, z contains the -// orthonormal eigenvectors of the symmetric tridiagonal matrix. z is not used -// if compz == lapack.EVCompNone. -// -// work must have length at least max(1, 2*n-2) if the eigenvectors are computed, -// and Dsteqr will panic otherwise. -// -// Dsteqr is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsteqr(compz lapack.EVComp, n int, d, e, z []float64, ldz int, work []float64) (ok bool) { - switch { - case compz != lapack.EVCompNone && compz != lapack.EVTridiag && compz != lapack.EVOrig: - panic(badEVComp) - case n < 0: - panic(nLT0) - case ldz < 1, compz != lapack.EVCompNone && ldz < n: - panic(badLdZ) - } - - // Quick return if possible. - if n == 0 { - return true - } - - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case compz != lapack.EVCompNone && len(z) < (n-1)*ldz+n: - panic(shortZ) - case compz != lapack.EVCompNone && len(work) < max(1, 2*n-2): - panic(shortWork) - } - - var icompz int - if compz == lapack.EVOrig { - icompz = 1 - } else if compz == lapack.EVTridiag { - icompz = 2 - } - - if n == 1 { - if icompz == 2 { - z[0] = 1 - } - return true - } - - bi := blas64.Implementation() - - eps := dlamchE - eps2 := eps * eps - safmin := dlamchS - safmax := 1 / safmin - ssfmax := math.Sqrt(safmax) / 3 - ssfmin := math.Sqrt(safmin) / eps2 - - // Compute the eigenvalues and eigenvectors of the tridiagonal matrix. - if icompz == 2 { - impl.Dlaset(blas.All, n, n, 0, 1, z, ldz) - } - const maxit = 30 - nmaxit := n * maxit - - jtot := 0 - - // Determine where the matrix splits and choose QL or QR iteration for each - // block, according to whether top or bottom diagonal element is smaller. - l1 := 0 - nm1 := n - 1 - - type scaletype int - const ( - down scaletype = iota + 1 - up - ) - var iscale scaletype - - for { - if l1 > n-1 { - // Order eigenvalues and eigenvectors. - if icompz == 0 { - impl.Dlasrt(lapack.SortIncreasing, n, d) - } else { - // TODO(btracey): Consider replacing this sort with a call to sort.Sort. - for ii := 1; ii < n; ii++ { - i := ii - 1 - k := i - p := d[i] - for j := ii; j < n; j++ { - if d[j] < p { - k = j - p = d[j] - } - } - if k != i { - d[k] = d[i] - d[i] = p - bi.Dswap(n, z[i:], ldz, z[k:], ldz) - } - } - } - return true - } - if l1 > 0 { - e[l1-1] = 0 - } - var m int - if l1 <= nm1 { - for m = l1; m < nm1; m++ { - test := math.Abs(e[m]) - if test == 0 { - break - } - if test <= (math.Sqrt(math.Abs(d[m]))*math.Sqrt(math.Abs(d[m+1])))*eps { - e[m] = 0 - break - } - } - } - l := l1 - lsv := l - lend := m - lendsv := lend - l1 = m + 1 - if lend == l { - continue - } - - // Scale submatrix in rows and columns L to Lend - anorm := impl.Dlanst(lapack.MaxAbs, lend-l+1, d[l:], e[l:]) - switch { - case anorm == 0: - continue - case anorm > ssfmax: - iscale = down - // Pretend that d and e are matrices with 1 column. - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l+1, 1, d[l:], 1) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l, 1, e[l:], 1) - case anorm < ssfmin: - iscale = up - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l+1, 1, d[l:], 1) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l, 1, e[l:], 1) - } - - // Choose between QL and QR. - if math.Abs(d[lend]) < math.Abs(d[l]) { - lend = lsv - l = lendsv - } - if lend > l { - // QL Iteration. Look for small subdiagonal element. - for { - if l != lend { - for m = l; m < lend; m++ { - v := math.Abs(e[m]) - if v*v <= (eps2*math.Abs(d[m]))*math.Abs(d[m+1])+safmin { - break - } - } - } else { - m = lend - } - if m < lend { - e[m] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found. - l++ - if l > lend { - break - } - continue - } - - // If remaining matrix is 2×2, use Dlae2 to compute its eigensystem. - if m == l+1 { - if icompz > 0 { - d[l], d[l+1], work[l], work[n-1+l] = impl.Dlaev2(d[l], e[l], d[l+1]) - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, - n, 2, work[l:], work[n-1+l:], z[l:], ldz) - } else { - d[l], d[l+1] = impl.Dlae2(d[l], e[l], d[l+1]) - } - e[l] = 0 - l += 2 - if l > lend { - break - } - continue - } - - if jtot == nmaxit { - break - } - jtot++ - - // Form shift - g := (d[l+1] - p) / (2 * e[l]) - r := impl.Dlapy2(g, 1) - g = d[m] - p + e[l]/(g+math.Copysign(r, g)) - s := 1.0 - c := 1.0 - p = 0.0 - - // Inner loop - for i := m - 1; i >= l; i-- { - f := s * e[i] - b := c * e[i] - c, s, r = impl.Dlartg(g, f) - if i != m-1 { - e[i+1] = r - } - g = d[i+1] - p - r = (d[i]-g)*s + 2*c*b - p = s * r - d[i+1] = g + p - g = c*r - b - - // If eigenvectors are desired, then save rotations. - if icompz > 0 { - work[i] = c - work[n-1+i] = -s - } - } - // If eigenvectors are desired, then apply saved rotations. - if icompz > 0 { - mm := m - l + 1 - impl.Dlasr(blas.Right, lapack.Variable, lapack.Backward, - n, mm, work[l:], work[n-1+l:], z[l:], ldz) - } - d[l] -= p - e[l] = g - } - } else { - // QR Iteration. - // Look for small superdiagonal element. - for { - if l != lend { - for m = l; m > lend; m-- { - v := math.Abs(e[m-1]) - if v*v <= (eps2*math.Abs(d[m])*math.Abs(d[m-1]) + safmin) { - break - } - } - } else { - m = lend - } - if m > lend { - e[m-1] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found - l-- - if l < lend { - break - } - continue - } - - // If remaining matrix is 2×2, use Dlae2 to compute its eigenvalues. - if m == l-1 { - if icompz > 0 { - d[l-1], d[l], work[m], work[n-1+m] = impl.Dlaev2(d[l-1], e[l-1], d[l]) - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, - n, 2, work[m:], work[n-1+m:], z[l-1:], ldz) - } else { - d[l-1], d[l] = impl.Dlae2(d[l-1], e[l-1], d[l]) - } - e[l-1] = 0 - l -= 2 - if l < lend { - break - } - continue - } - if jtot == nmaxit { - break - } - jtot++ - - // Form shift. - g := (d[l-1] - p) / (2 * e[l-1]) - r := impl.Dlapy2(g, 1) - g = d[m] - p + (e[l-1])/(g+math.Copysign(r, g)) - s := 1.0 - c := 1.0 - p = 0.0 - - // Inner loop. - for i := m; i < l; i++ { - f := s * e[i] - b := c * e[i] - c, s, r = impl.Dlartg(g, f) - if i != m { - e[i-1] = r - } - g = d[i] - p - r = (d[i+1]-g)*s + 2*c*b - p = s * r - d[i] = g + p - g = c*r - b - - // If eigenvectors are desired, then save rotations. - if icompz > 0 { - work[i] = c - work[n-1+i] = s - } - } - - // If eigenvectors are desired, then apply saved rotations. - if icompz > 0 { - mm := l - m + 1 - impl.Dlasr(blas.Right, lapack.Variable, lapack.Forward, - n, mm, work[m:], work[n-1+m:], z[m:], ldz) - } - d[l] -= p - e[l-1] = g - } - } - - // Undo scaling if necessary. - switch iscale { - case down: - // Pretend that d and e are matrices with 1 column. - impl.Dlascl(lapack.General, 0, 0, ssfmax, anorm, lendsv-lsv+1, 1, d[lsv:], 1) - impl.Dlascl(lapack.General, 0, 0, ssfmax, anorm, lendsv-lsv, 1, e[lsv:], 1) - case up: - impl.Dlascl(lapack.General, 0, 0, ssfmin, anorm, lendsv-lsv+1, 1, d[lsv:], 1) - impl.Dlascl(lapack.General, 0, 0, ssfmin, anorm, lendsv-lsv, 1, e[lsv:], 1) - } - - // Check for no convergence to an eigenvalue after a total of n*maxit iterations. - if jtot >= nmaxit { - break - } - } - for i := 0; i < n-1; i++ { - if e[i] != 0 { - return false - } - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go deleted file mode 100644 index dc1e178df..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsterf.go +++ /dev/null @@ -1,285 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/lapack" -) - -// Dsterf computes all eigenvalues of a symmetric tridiagonal matrix using the -// Pal-Walker-Kahan variant of the QL or QR algorithm. -// -// d contains the diagonal elements of the tridiagonal matrix on entry, and -// contains the eigenvalues in ascending order on exit. d must have length at -// least n, or Dsterf will panic. -// -// e contains the off-diagonal elements of the tridiagonal matrix on entry, and is -// overwritten during the call to Dsterf. e must have length of at least n-1 or -// Dsterf will panic. -// -// Dsterf is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsterf(n int, d, e []float64) (ok bool) { - if n < 0 { - panic(nLT0) - } - - // Quick return if possible. - if n == 0 { - return true - } - - switch { - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - } - - if n == 1 { - return true - } - - const ( - none = 0 // The values are not scaled. - down = 1 // The values are scaled below ssfmax threshold. - up = 2 // The values are scaled below ssfmin threshold. - ) - - // Determine the unit roundoff for this environment. - eps := dlamchE - eps2 := eps * eps - safmin := dlamchS - safmax := 1 / safmin - ssfmax := math.Sqrt(safmax) / 3 - ssfmin := math.Sqrt(safmin) / eps2 - - // Compute the eigenvalues of the tridiagonal matrix. - maxit := 30 - nmaxit := n * maxit - jtot := 0 - - l1 := 0 - - for { - if l1 > n-1 { - impl.Dlasrt(lapack.SortIncreasing, n, d) - return true - } - if l1 > 0 { - e[l1-1] = 0 - } - var m int - for m = l1; m < n-1; m++ { - if math.Abs(e[m]) <= math.Sqrt(math.Abs(d[m]))*math.Sqrt(math.Abs(d[m+1]))*eps { - e[m] = 0 - break - } - } - - l := l1 - lsv := l - lend := m - lendsv := lend - l1 = m + 1 - if lend == 0 { - continue - } - - // Scale submatrix in rows and columns l to lend. - anorm := impl.Dlanst(lapack.MaxAbs, lend-l+1, d[l:], e[l:]) - iscale := none - if anorm == 0 { - continue - } - if anorm > ssfmax { - iscale = down - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l+1, 1, d[l:], n) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmax, lend-l, 1, e[l:], n) - } else if anorm < ssfmin { - iscale = up - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l+1, 1, d[l:], n) - impl.Dlascl(lapack.General, 0, 0, anorm, ssfmin, lend-l, 1, e[l:], n) - } - - el := e[l:lend] - for i, v := range el { - el[i] *= v - } - - // Choose between QL and QR iteration. - if math.Abs(d[lend]) < math.Abs(d[l]) { - lend = lsv - l = lendsv - } - if lend >= l { - // QL Iteration. - // Look for small sub-diagonal element. - for { - if l != lend { - for m = l; m < lend; m++ { - if math.Abs(e[m]) <= eps2*(math.Abs(d[m]*d[m+1])) { - break - } - } - } else { - m = lend - } - if m < lend { - e[m] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found. - l++ - if l > lend { - break - } - continue - } - // If remaining matrix is 2 by 2, use Dlae2 to compute its eigenvalues. - if m == l+1 { - d[l], d[l+1] = impl.Dlae2(d[l], math.Sqrt(e[l]), d[l+1]) - e[l] = 0 - l += 2 - if l > lend { - break - } - continue - } - if jtot == nmaxit { - break - } - jtot++ - - // Form shift. - rte := math.Sqrt(e[l]) - sigma := (d[l+1] - p) / (2 * rte) - r := impl.Dlapy2(sigma, 1) - sigma = p - (rte / (sigma + math.Copysign(r, sigma))) - - c := 1.0 - s := 0.0 - gamma := d[m] - sigma - p = gamma * gamma - - // Inner loop. - for i := m - 1; i >= l; i-- { - bb := e[i] - r := p + bb - if i != m-1 { - e[i+1] = s * r - } - oldc := c - c = p / r - s = bb / r - oldgam := gamma - alpha := d[i] - gamma = c*(alpha-sigma) - s*oldgam - d[i+1] = oldgam + (alpha - gamma) - if c != 0 { - p = (gamma * gamma) / c - } else { - p = oldc * bb - } - } - e[l] = s * p - d[l] = sigma + gamma - } - } else { - for { - // QR Iteration. - // Look for small super-diagonal element. - for m = l; m > lend; m-- { - if math.Abs(e[m-1]) <= eps2*math.Abs(d[m]*d[m-1]) { - break - } - } - if m > lend { - e[m-1] = 0 - } - p := d[l] - if m == l { - // Eigenvalue found. - l-- - if l < lend { - break - } - continue - } - - // If remaining matrix is 2 by 2, use Dlae2 to compute its eigenvalues. - if m == l-1 { - d[l], d[l-1] = impl.Dlae2(d[l], math.Sqrt(e[l-1]), d[l-1]) - e[l-1] = 0 - l -= 2 - if l < lend { - break - } - continue - } - if jtot == nmaxit { - break - } - jtot++ - - // Form shift. - rte := math.Sqrt(e[l-1]) - sigma := (d[l-1] - p) / (2 * rte) - r := impl.Dlapy2(sigma, 1) - sigma = p - (rte / (sigma + math.Copysign(r, sigma))) - - c := 1.0 - s := 0.0 - gamma := d[m] - sigma - p = gamma * gamma - - // Inner loop. - for i := m; i < l; i++ { - bb := e[i] - r := p + bb - if i != m { - e[i-1] = s * r - } - oldc := c - c = p / r - s = bb / r - oldgam := gamma - alpha := d[i+1] - gamma = c*(alpha-sigma) - s*oldgam - d[i] = oldgam + alpha - gamma - if c != 0 { - p = (gamma * gamma) / c - } else { - p = oldc * bb - } - } - e[l-1] = s * p - d[l] = sigma + gamma - } - } - - // Undo scaling if necessary - switch iscale { - case down: - impl.Dlascl(lapack.General, 0, 0, ssfmax, anorm, lendsv-lsv+1, 1, d[lsv:], n) - case up: - impl.Dlascl(lapack.General, 0, 0, ssfmin, anorm, lendsv-lsv+1, 1, d[lsv:], n) - } - - // Check for no convergence to an eigenvalue after a total of n*maxit iterations. - if jtot >= nmaxit { - break - } - } - for _, v := range e[:n-1] { - if v != 0 { - return false - } - } - impl.Dlasrt(lapack.SortIncreasing, n, d) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go deleted file mode 100644 index 5f57f3a5c..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsyev.go +++ /dev/null @@ -1,130 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dsyev computes all eigenvalues and, optionally, the eigenvectors of a real -// symmetric matrix A. -// -// w contains the eigenvalues in ascending order upon return. w must have length -// at least n, and Dsyev will panic otherwise. -// -// On entry, a contains the elements of the symmetric matrix A in the triangular -// portion specified by uplo. If jobz == lapack.EVCompute, a contains the -// orthonormal eigenvectors of A on exit, otherwise jobz must be lapack.EVNone -// and on exit the specified triangular region is overwritten. -// -// work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= 3*n-1, and Dsyev will panic otherwise. The amount of blocking is -// limited by the usable length. If lwork == -1, instead of computing Dsyev the -// optimal work length is stored into work[0]. -func (impl Implementation) Dsyev(jobz lapack.EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool) { - switch { - case jobz != lapack.EVNone && jobz != lapack.EVCompute: - panic(badEVJob) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < max(1, 3*n-1) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - return true - } - - var opts string - if uplo == blas.Upper { - opts = "U" - } else { - opts = "L" - } - nb := impl.Ilaenv(1, "DSYTRD", opts, n, -1, -1, -1) - lworkopt := max(1, (nb+2)*n) - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(w) < n: - panic(shortW) - } - - if n == 1 { - w[0] = a[0] - work[0] = 2 - if jobz == lapack.EVCompute { - a[0] = 1 - } - return true - } - - safmin := dlamchS - eps := dlamchP - smlnum := safmin / eps - bignum := 1 / smlnum - rmin := math.Sqrt(smlnum) - rmax := math.Sqrt(bignum) - - // Scale matrix to allowable range, if necessary. - anrm := impl.Dlansy(lapack.MaxAbs, uplo, n, a, lda, work) - scaled := false - var sigma float64 - if anrm > 0 && anrm < rmin { - scaled = true - sigma = rmin / anrm - } else if anrm > rmax { - scaled = true - sigma = rmax / anrm - } - if scaled { - kind := lapack.LowerTri - if uplo == blas.Upper { - kind = lapack.UpperTri - } - impl.Dlascl(kind, 0, 0, 1, sigma, n, n, a, lda) - } - var inde int - indtau := inde + n - indwork := indtau + n - llwork := lwork - indwork - impl.Dsytrd(uplo, n, a, lda, w, work[inde:], work[indtau:], work[indwork:], llwork) - - // For eigenvalues only, call Dsterf. For eigenvectors, first call Dorgtr - // to generate the orthogonal matrix, then call Dsteqr. - if jobz == lapack.EVNone { - ok = impl.Dsterf(n, w, work[inde:]) - } else { - impl.Dorgtr(uplo, n, a, lda, work[indtau:], work[indwork:], llwork) - ok = impl.Dsteqr(lapack.EVComp(jobz), n, w, work[inde:], a, lda, work[indtau:]) - } - if !ok { - return false - } - - // If the matrix was scaled, then rescale eigenvalues appropriately. - if scaled { - bi := blas64.Implementation() - bi.Dscal(n, 1/sigma, w, 1) - } - work[0] = float64(lworkopt) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go deleted file mode 100644 index 23cfd0577..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytd2.go +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dsytd2 reduces a symmetric n×n matrix A to symmetric tridiagonal form T by -// an orthogonal similarity transformation -// Q^T * A * Q = T -// On entry, the matrix is contained in the specified triangle of a. On exit, -// if uplo == blas.Upper, the diagonal and first super-diagonal of a are -// overwritten with the elements of T. The elements above the first super-diagonal -// are overwritten with the elementary reflectors that are used with -// the elements written to tau in order to construct Q. If uplo == blas.Lower, -// the elements are written in the lower triangular region. -// -// d must have length at least n. e and tau must have length at least n-1. Dsytd2 -// will panic if these sizes are not met. -// -// Q is represented as a product of elementary reflectors. -// If uplo == blas.Upper -// Q = H_{n-2} * ... * H_1 * H_0 -// and if uplo == blas.Lower -// Q = H_0 * H_1 * ... * H_{n-2} -// where -// H_i = I - tau * v * v^T -// where tau is stored in tau[i], and v is stored in a. -// -// If uplo == blas.Upper, v[0:i-1] is stored in A[0:i-1,i+1], v[i] = 1, and -// v[i+1:] = 0. The elements of a are -// [ d e v2 v3 v4] -// [ d e v3 v4] -// [ d e v4] -// [ d e] -// [ d] -// If uplo == blas.Lower, v[0:i+1] = 0, v[i+1] = 1, and v[i+2:] is stored in -// A[i+2:n,i]. -// The elements of a are -// [ d ] -// [ e d ] -// [v1 e d ] -// [v1 v2 e d ] -// [v1 v2 v3 e d] -// -// Dsytd2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsytd2(uplo blas.Uplo, n int, a []float64, lda int, d, e, tau []float64) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - // Quick return if possible. - if n == 0 { - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case len(tau) < n-1: - panic(shortTau) - } - - bi := blas64.Implementation() - - if uplo == blas.Upper { - // Reduce the upper triangle of A. - for i := n - 2; i >= 0; i-- { - // Generate elementary reflector H_i = I - tau * v * v^T to - // annihilate A[i:i-1, i+1]. - var taui float64 - a[i*lda+i+1], taui = impl.Dlarfg(i+1, a[i*lda+i+1], a[i+1:], lda) - e[i] = a[i*lda+i+1] - if taui != 0 { - // Apply H_i from both sides to A[0:i,0:i]. - a[i*lda+i+1] = 1 - - // Compute x := tau * A * v storing x in tau[0:i]. - bi.Dsymv(uplo, i+1, taui, a, lda, a[i+1:], lda, 0, tau, 1) - - // Compute w := x - 1/2 * tau * (x^T * v) * v. - alpha := -0.5 * taui * bi.Ddot(i+1, tau, 1, a[i+1:], lda) - bi.Daxpy(i+1, alpha, a[i+1:], lda, tau, 1) - - // Apply the transformation as a rank-2 update - // A = A - v * w^T - w * v^T. - bi.Dsyr2(uplo, i+1, -1, a[i+1:], lda, tau, 1, a, lda) - a[i*lda+i+1] = e[i] - } - d[i+1] = a[(i+1)*lda+i+1] - tau[i] = taui - } - d[0] = a[0] - return - } - // Reduce the lower triangle of A. - for i := 0; i < n-1; i++ { - // Generate elementary reflector H_i = I - tau * v * v^T to - // annihilate A[i+2:n, i]. - var taui float64 - a[(i+1)*lda+i], taui = impl.Dlarfg(n-i-1, a[(i+1)*lda+i], a[min(i+2, n-1)*lda+i:], lda) - e[i] = a[(i+1)*lda+i] - if taui != 0 { - // Apply H_i from both sides to A[i+1:n, i+1:n]. - a[(i+1)*lda+i] = 1 - - // Compute x := tau * A * v, storing y in tau[i:n-1]. - bi.Dsymv(uplo, n-i-1, taui, a[(i+1)*lda+i+1:], lda, a[(i+1)*lda+i:], lda, 0, tau[i:], 1) - - // Compute w := x - 1/2 * tau * (x^T * v) * v. - alpha := -0.5 * taui * bi.Ddot(n-i-1, tau[i:], 1, a[(i+1)*lda+i:], lda) - bi.Daxpy(n-i-1, alpha, a[(i+1)*lda+i:], lda, tau[i:], 1) - - // Apply the transformation as a rank-2 update - // A = A - v * w^T - w * v^T. - bi.Dsyr2(uplo, n-i-1, -1, a[(i+1)*lda+i:], lda, tau[i:], 1, a[(i+1)*lda+i+1:], lda) - a[(i+1)*lda+i] = e[i] - } - d[i] = a[i*lda+i] - tau[i] = taui - } - d[n-1] = a[(n-1)*lda+n-1] -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go deleted file mode 100644 index df47568e9..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dsytrd.go +++ /dev/null @@ -1,172 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dsytrd reduces a symmetric n×n matrix A to symmetric tridiagonal form by an -// orthogonal similarity transformation -// Q^T * A * Q = T -// where Q is an orthonormal matrix and T is symmetric and tridiagonal. -// -// On entry, a contains the elements of the input matrix in the triangle specified -// by uplo. On exit, the diagonal and sub/super-diagonal are overwritten by the -// corresponding elements of the tridiagonal matrix T. The remaining elements in -// the triangle, along with the array tau, contain the data to construct Q as -// the product of elementary reflectors. -// -// If uplo == blas.Upper, Q is constructed with -// Q = H_{n-2} * ... * H_1 * H_0 -// where -// H_i = I - tau_i * v * v^T -// v is constructed as v[i+1:n] = 0, v[i] = 1, v[0:i-1] is stored in A[0:i-1, i+1]. -// The elements of A are -// [ d e v1 v2 v3] -// [ d e v2 v3] -// [ d e v3] -// [ d e] -// [ e] -// -// If uplo == blas.Lower, Q is constructed with -// Q = H_0 * H_1 * ... * H_{n-2} -// where -// H_i = I - tau_i * v * v^T -// v is constructed as v[0:i+1] = 0, v[i+1] = 1, v[i+2:n] is stored in A[i+2:n, i]. -// The elements of A are -// [ d ] -// [ e d ] -// [v0 e d ] -// [v0 v1 e d ] -// [v0 v1 v2 e d] -// -// d must have length n, and e and tau must have length n-1. Dsytrd will panic if -// these conditions are not met. -// -// work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= 1, and Dsytrd will panic otherwise. The amount of blocking is -// limited by the usable length. -// If lwork == -1, instead of computing Dsytrd the optimal work length is stored -// into work[0]. -// -// Dsytrd is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dsytrd(uplo blas.Uplo, n int, a []float64, lda int, d, e, tau, work []float64, lwork int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - case lwork < 1 && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return - } - - nb := impl.Ilaenv(1, "DSYTRD", string(uplo), n, -1, -1, -1) - lworkopt := n * nb - if lwork == -1 { - work[0] = float64(lworkopt) - return - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(d) < n: - panic(shortD) - case len(e) < n-1: - panic(shortE) - case len(tau) < n-1: - panic(shortTau) - } - - bi := blas64.Implementation() - - nx := n - iws := 1 - var ldwork int - if 1 < nb && nb < n { - // Determine when to cross over from blocked to unblocked code. The last - // block is always handled by unblocked code. - nx = max(nb, impl.Ilaenv(3, "DSYTRD", string(uplo), n, -1, -1, -1)) - if nx < n { - // Determine if workspace is large enough for blocked code. - ldwork = nb - iws = n * ldwork - if lwork < iws { - // Not enough workspace to use optimal nb: determine the minimum - // value of nb and reduce nb or force use of unblocked code by - // setting nx = n. - nb = max(lwork/n, 1) - nbmin := impl.Ilaenv(2, "DSYTRD", string(uplo), n, -1, -1, -1) - if nb < nbmin { - nx = n - } - } - } else { - nx = n - } - } else { - nb = 1 - } - ldwork = nb - - if uplo == blas.Upper { - // Reduce the upper triangle of A. Columns 0:kk are handled by the - // unblocked method. - var i int - kk := n - ((n-nx+nb-1)/nb)*nb - for i = n - nb; i >= kk; i -= nb { - // Reduce columns i:i+nb to tridiagonal form and form the matrix W - // which is needed to update the unreduced part of the matrix. - impl.Dlatrd(uplo, i+nb, nb, a, lda, e, tau, work, ldwork) - - // Update the unreduced submatrix A[0:i-1,0:i-1], using an update - // of the form A = A - V*W^T - W*V^T. - bi.Dsyr2k(uplo, blas.NoTrans, i, nb, -1, a[i:], lda, work, ldwork, 1, a, lda) - - // Copy superdiagonal elements back into A, and diagonal elements into D. - for j := i; j < i+nb; j++ { - a[(j-1)*lda+j] = e[j-1] - d[j] = a[j*lda+j] - } - } - // Use unblocked code to reduce the last or only block - // check that i == kk. - impl.Dsytd2(uplo, kk, a, lda, d, e, tau) - } else { - var i int - // Reduce the lower triangle of A. - for i = 0; i < n-nx; i += nb { - // Reduce columns 0:i+nb to tridiagonal form and form the matrix W - // which is needed to update the unreduced part of the matrix. - impl.Dlatrd(uplo, n-i, nb, a[i*lda+i:], lda, e[i:], tau[i:], work, ldwork) - - // Update the unreduced submatrix A[i+ib:n, i+ib:n], using an update - // of the form A = A + V*W^T - W*V^T. - bi.Dsyr2k(uplo, blas.NoTrans, n-i-nb, nb, -1, a[(i+nb)*lda+i:], lda, - work[nb*ldwork:], ldwork, 1, a[(i+nb)*lda+i+nb:], lda) - - // Copy subdiagonal elements back into A, and diagonal elements into D. - for j := i; j < i+nb; j++ { - a[(j+1)*lda+j] = e[j] - d[j] = a[j*lda+j] - } - } - // Use unblocked code to reduce the last or only block. - impl.Dsytd2(uplo, n-i, a[i*lda+i:], lda, d[i:], e[i:], tau[i:]) - } - work[0] = float64(iws) -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go deleted file mode 100644 index d70d19623..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtgsja.go +++ /dev/null @@ -1,373 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dtgsja computes the generalized singular value decomposition (GSVD) -// of two real upper triangular or trapezoidal matrices A and B. -// -// A and B have the following forms, which may be obtained by the -// preprocessing subroutine Dggsvp from a general m×n matrix A and p×n -// matrix B: -// -// n-k-l k l -// A = k [ 0 A12 A13 ] if m-k-l >= 0; -// l [ 0 0 A23 ] -// m-k-l [ 0 0 0 ] -// -// n-k-l k l -// A = k [ 0 A12 A13 ] if m-k-l < 0; -// m-k [ 0 0 A23 ] -// -// n-k-l k l -// B = l [ 0 0 B13 ] -// p-l [ 0 0 0 ] -// -// where the k×k matrix A12 and l×l matrix B13 are non-singular -// upper triangular. A23 is l×l upper triangular if m-k-l >= 0, -// otherwise A23 is (m-k)×l upper trapezoidal. -// -// On exit, -// -// U^T*A*Q = D1*[ 0 R ], V^T*B*Q = D2*[ 0 R ], -// -// where U, V and Q are orthogonal matrices. -// R is a non-singular upper triangular matrix, and D1 and D2 are -// diagonal matrices, which are of the following structures: -// -// If m-k-l >= 0, -// -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] -// -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] -// -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l -// -// where -// -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. -// -// R is stored in -// A[0:k+l, n-k-l:n] -// on exit. -// -// If m-k-l < 0, -// -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] -// -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] -// -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] -// -// where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. -// -// R = [ R11 R12 R13 ] is stored in A[0:m, n-k-l:n] -// [ 0 R22 R23 ] -// and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. -// -// The computation of the orthogonal transformation matrices U, V or Q -// is optional. These matrices may either be formed explicitly, or they -// may be post-multiplied into input matrices U1, V1, or Q1. -// -// Dtgsja essentially uses a variant of Kogbetliantz algorithm to reduce -// min(l,m-k)×l triangular or trapezoidal matrix A23 and l×l -// matrix B13 to the form: -// -// U1^T*A13*Q1 = C1*R1; V1^T*B13*Q1 = S1*R1, -// -// where U1, V1 and Q1 are orthogonal matrices. C1 and S1 are diagonal -// matrices satisfying -// -// C1^2 + S1^2 = I, -// -// and R1 is an l×l non-singular upper triangular matrix. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDUnit Use unit-initialized matrix -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// k and l specify the sub-blocks in the input matrices A and B: -// A23 = A[k:min(k+l,m), n-l:n) and B13 = B[0:l, n-l:n] -// of A and B, whose GSVD is going to be computed by Dtgsja. -// -// tola and tolb are the convergence criteria for the Jacobi-Kogbetliantz -// iteration procedure. Generally, they are the same as used in the preprocessing -// step, for example, -// tola = max(m, n)*norm(A)*eps, -// tolb = max(p, n)*norm(B)*eps, -// where eps is the machine epsilon. -// -// work must have length at least 2*n, otherwise Dtgsja will panic. -// -// alpha and beta must have length n or Dtgsja will panic. On exit, alpha and -// beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, -// if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), -// if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. -// if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. -// -// On exit, A[n-k:n, 0:min(k+l,m)] contains the triangular matrix R or part of R -// and if necessary, B[m-k:l, n+m-k-l:n] contains a part of R. -// -// Dtgsja returns whether the routine converged and the number of iteration cycles -// that were run. -// -// Dtgsja is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtgsja(jobU, jobV, jobQ lapack.GSVDJob, m, p, n, k, l int, a []float64, lda int, b []float64, ldb int, tola, tolb float64, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64) (cycles int, ok bool) { - const maxit = 40 - - initu := jobU == lapack.GSVDUnit - wantu := initu || jobU == lapack.GSVDU - - initv := jobV == lapack.GSVDUnit - wantv := initv || jobV == lapack.GSVDV - - initq := jobQ == lapack.GSVDUnit - wantq := initq || jobQ == lapack.GSVDQ - - switch { - case !initu && !wantu && jobU != lapack.GSVDNone: - panic(badGSVDJob + "U") - case !initv && !wantv && jobV != lapack.GSVDNone: - panic(badGSVDJob + "V") - case !initq && !wantq && jobQ != lapack.GSVDNone: - panic(badGSVDJob + "Q") - case m < 0: - panic(mLT0) - case p < 0: - panic(pLT0) - case n < 0: - panic(nLT0) - - case lda < max(1, n): - panic(badLdA) - case len(a) < (m-1)*lda+n: - panic(shortA) - - case ldb < max(1, n): - panic(badLdB) - case len(b) < (p-1)*ldb+n: - panic(shortB) - - case len(alpha) != n: - panic(badLenAlpha) - case len(beta) != n: - panic(badLenBeta) - - case ldu < 1, wantu && ldu < m: - panic(badLdU) - case wantu && len(u) < (m-1)*ldu+m: - panic(shortU) - - case ldv < 1, wantv && ldv < p: - panic(badLdV) - case wantv && len(v) < (p-1)*ldv+p: - panic(shortV) - - case ldq < 1, wantq && ldq < n: - panic(badLdQ) - case wantq && len(q) < (n-1)*ldq+n: - panic(shortQ) - - case len(work) < 2*n: - panic(shortWork) - } - - // Initialize U, V and Q, if necessary - if initu { - impl.Dlaset(blas.All, m, m, 0, 1, u, ldu) - } - if initv { - impl.Dlaset(blas.All, p, p, 0, 1, v, ldv) - } - if initq { - impl.Dlaset(blas.All, n, n, 0, 1, q, ldq) - } - - bi := blas64.Implementation() - minTol := math.Min(tola, tolb) - - // Loop until convergence. - upper := false - for cycles = 1; cycles <= maxit; cycles++ { - upper = !upper - - for i := 0; i < l-1; i++ { - for j := i + 1; j < l; j++ { - var a1, a2, a3 float64 - if k+i < m { - a1 = a[(k+i)*lda+n-l+i] - } - if k+j < m { - a3 = a[(k+j)*lda+n-l+j] - } - - b1 := b[i*ldb+n-l+i] - b3 := b[j*ldb+n-l+j] - - var b2 float64 - if upper { - if k+i < m { - a2 = a[(k+i)*lda+n-l+j] - } - b2 = b[i*ldb+n-l+j] - } else { - if k+j < m { - a2 = a[(k+j)*lda+n-l+i] - } - b2 = b[j*ldb+n-l+i] - } - - csu, snu, csv, snv, csq, snq := impl.Dlags2(upper, a1, a2, a3, b1, b2, b3) - - // Update (k+i)-th and (k+j)-th rows of matrix A: U^T*A. - if k+j < m { - bi.Drot(l, a[(k+j)*lda+n-l:], 1, a[(k+i)*lda+n-l:], 1, csu, snu) - } - - // Update i-th and j-th rows of matrix B: V^T*B. - bi.Drot(l, b[j*ldb+n-l:], 1, b[i*ldb+n-l:], 1, csv, snv) - - // Update (n-l+i)-th and (n-l+j)-th columns of matrices - // A and B: A*Q and B*Q. - bi.Drot(min(k+l, m), a[n-l+j:], lda, a[n-l+i:], lda, csq, snq) - bi.Drot(l, b[n-l+j:], ldb, b[n-l+i:], ldb, csq, snq) - - if upper { - if k+i < m { - a[(k+i)*lda+n-l+j] = 0 - } - b[i*ldb+n-l+j] = 0 - } else { - if k+j < m { - a[(k+j)*lda+n-l+i] = 0 - } - b[j*ldb+n-l+i] = 0 - } - - // Update orthogonal matrices U, V, Q, if desired. - if wantu && k+j < m { - bi.Drot(m, u[k+j:], ldu, u[k+i:], ldu, csu, snu) - } - if wantv { - bi.Drot(p, v[j:], ldv, v[i:], ldv, csv, snv) - } - if wantq { - bi.Drot(n, q[n-l+j:], ldq, q[n-l+i:], ldq, csq, snq) - } - } - } - - if !upper { - // The matrices A13 and B13 were lower triangular at the start - // of the cycle, and are now upper triangular. - // - // Convergence test: test the parallelism of the corresponding - // rows of A and B. - var error float64 - for i := 0; i < min(l, m-k); i++ { - bi.Dcopy(l-i, a[(k+i)*lda+n-l+i:], 1, work, 1) - bi.Dcopy(l-i, b[i*ldb+n-l+i:], 1, work[l:], 1) - ssmin := impl.Dlapll(l-i, work, 1, work[l:], 1) - error = math.Max(error, ssmin) - } - if math.Abs(error) <= minTol { - // The algorithm has converged. - // Compute the generalized singular value pairs (alpha, beta) - // and set the triangular matrix R to array A. - for i := 0; i < k; i++ { - alpha[i] = 1 - beta[i] = 0 - } - - for i := 0; i < min(l, m-k); i++ { - a1 := a[(k+i)*lda+n-l+i] - b1 := b[i*ldb+n-l+i] - - if a1 != 0 { - gamma := b1 / a1 - - // Change sign if necessary. - if gamma < 0 { - bi.Dscal(l-i, -1, b[i*ldb+n-l+i:], 1) - if wantv { - bi.Dscal(p, -1, v[i:], ldv) - } - } - beta[k+i], alpha[k+i], _ = impl.Dlartg(math.Abs(gamma), 1) - - if alpha[k+i] >= beta[k+i] { - bi.Dscal(l-i, 1/alpha[k+i], a[(k+i)*lda+n-l+i:], 1) - } else { - bi.Dscal(l-i, 1/beta[k+i], b[i*ldb+n-l+i:], 1) - bi.Dcopy(l-i, b[i*ldb+n-l+i:], 1, a[(k+i)*lda+n-l+i:], 1) - } - } else { - alpha[k+i] = 0 - beta[k+i] = 1 - bi.Dcopy(l-i, b[i*ldb+n-l+i:], 1, a[(k+i)*lda+n-l+i:], 1) - } - } - - for i := m; i < k+l; i++ { - alpha[i] = 0 - beta[i] = 1 - } - if k+l < n { - for i := k + l; i < n; i++ { - alpha[i] = 0 - beta[i] = 0 - } - } - - return cycles, true - } - } - } - - // The algorithm has not converged after maxit cycles. - return cycles, false -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go deleted file mode 100644 index 899c95dd5..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrcon.go +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dtrcon estimates the reciprocal of the condition number of a triangular matrix A. -// The condition number computed may be based on the 1-norm or the ∞-norm. -// -// work is a temporary data slice of length at least 3*n and Dtrcon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Dtrcon will panic otherwise. -func (impl Implementation) Dtrcon(norm lapack.MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64 { - switch { - case norm != lapack.MaxColumnSum && norm != lapack.MaxRowSum: - panic(badNorm) - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return 1 - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(work) < 3*n: - panic(shortWork) - case len(iwork) < n: - panic(shortIWork) - } - - bi := blas64.Implementation() - - var rcond float64 - smlnum := dlamchS * float64(n) - - anorm := impl.Dlantr(norm, uplo, diag, n, n, a, lda, work) - - if anorm <= 0 { - return rcond - } - var ainvnm float64 - var normin bool - kase1 := 2 - if norm == lapack.MaxColumnSum { - kase1 = 1 - } - var kase int - isave := new([3]int) - var scale float64 - for { - ainvnm, kase = impl.Dlacn2(n, work[n:], work, iwork, ainvnm, kase, isave) - if kase == 0 { - if ainvnm != 0 { - rcond = (1 / anorm) / ainvnm - } - return rcond - } - if kase == kase1 { - scale = impl.Dlatrs(uplo, blas.NoTrans, diag, normin, n, a, lda, work, work[2*n:]) - } else { - scale = impl.Dlatrs(uplo, blas.Trans, diag, normin, n, a, lda, work, work[2*n:]) - } - normin = true - if scale != 1 { - ix := bi.Idamax(n, work, 1) - xnorm := math.Abs(work[ix]) - if scale == 0 || scale < xnorm*smlnum { - return rcond - } - impl.Drscl(n, scale, work, 1) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go deleted file mode 100644 index 17121b8db..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrevc3.go +++ /dev/null @@ -1,885 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" -) - -// Dtrevc3 computes some or all of the right and/or left eigenvectors of an n×n -// upper quasi-triangular matrix T in Schur canonical form. Matrices of this -// type are produced by the Schur factorization of a real general matrix A -// A = Q T Q^T, -// as computed by Dhseqr. -// -// The right eigenvector x of T corresponding to an -// eigenvalue λ is defined by -// T x = λ x, -// and the left eigenvector y is defined by -// y^T T = λ y^T. -// -// The eigenvalues are read directly from the diagonal blocks of T. -// -// This routine returns the matrices X and/or Y of right and left eigenvectors -// of T, or the products Q*X and/or Q*Y, where Q is an input matrix. If Q is the -// orthogonal factor that reduces a matrix A to Schur form T, then Q*X and Q*Y -// are the matrices of right and left eigenvectors of A. -// -// If side == lapack.EVRight, only right eigenvectors will be computed. -// If side == lapack.EVLeft, only left eigenvectors will be computed. -// If side == lapack.EVBoth, both right and left eigenvectors will be computed. -// For other values of side, Dtrevc3 will panic. -// -// If howmny == lapack.EVAll, all right and/or left eigenvectors will be -// computed. -// If howmny == lapack.EVAllMulQ, all right and/or left eigenvectors will be -// computed and multiplied from left by the matrices in VR and/or VL. -// If howmny == lapack.EVSelected, right and/or left eigenvectors will be -// computed as indicated by selected. -// For other values of howmny, Dtrevc3 will panic. -// -// selected specifies which eigenvectors will be computed. It must have length n -// if howmny == lapack.EVSelected, and it is not referenced otherwise. -// If w_j is a real eigenvalue, the corresponding real eigenvector will be -// computed if selected[j] is true. -// If w_j and w_{j+1} are the real and imaginary parts of a complex eigenvalue, -// the corresponding complex eigenvector is computed if either selected[j] or -// selected[j+1] is true, and on return selected[j] will be set to true and -// selected[j+1] will be set to false. -// -// VL and VR are n×mm matrices. If howmny is lapack.EVAll or -// lapack.AllEVMulQ, mm must be at least n. If howmny is -// lapack.EVSelected, mm must be large enough to store the selected -// eigenvectors. Each selected real eigenvector occupies one column and each -// selected complex eigenvector occupies two columns. If mm is not sufficiently -// large, Dtrevc3 will panic. -// -// On entry, if howmny is lapack.EVAllMulQ, it is assumed that VL (if side -// is lapack.EVLeft or lapack.EVBoth) contains an n×n matrix QL, -// and that VR (if side is lapack.EVLeft or lapack.EVBoth) contains -// an n×n matrix QR. QL and QR are typically the orthogonal matrix Q of Schur -// vectors returned by Dhseqr. -// -// On return, if side is lapack.EVLeft or lapack.EVBoth, -// VL will contain: -// if howmny == lapack.EVAll, the matrix Y of left eigenvectors of T, -// if howmny == lapack.EVAllMulQ, the matrix Q*Y, -// if howmny == lapack.EVSelected, the left eigenvectors of T specified by -// selected, stored consecutively in the -// columns of VL, in the same order as their -// eigenvalues. -// VL is not referenced if side == lapack.EVRight. -// -// On return, if side is lapack.EVRight or lapack.EVBoth, -// VR will contain: -// if howmny == lapack.EVAll, the matrix X of right eigenvectors of T, -// if howmny == lapack.EVAllMulQ, the matrix Q*X, -// if howmny == lapack.EVSelected, the left eigenvectors of T specified by -// selected, stored consecutively in the -// columns of VR, in the same order as their -// eigenvalues. -// VR is not referenced if side == lapack.EVLeft. -// -// Complex eigenvectors corresponding to a complex eigenvalue are stored in VL -// and VR in two consecutive columns, the first holding the real part, and the -// second the imaginary part. -// -// Each eigenvector will be normalized so that the element of largest magnitude -// has magnitude 1. Here the magnitude of a complex number (x,y) is taken to be -// |x| + |y|. -// -// work must have length at least lwork and lwork must be at least max(1,3*n), -// otherwise Dtrevc3 will panic. For optimum performance, lwork should be at -// least n+2*n*nb, where nb is the optimal blocksize. -// -// If lwork == -1, instead of performing Dtrevc3, the function only estimates -// the optimal workspace size based on n and stores it into work[0]. -// -// Dtrevc3 returns the number of columns in VL and/or VR actually used to store -// the eigenvectors. -// -// Dtrevc3 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrevc3(side lapack.EVSide, howmny lapack.EVHowMany, selected []bool, n int, t []float64, ldt int, vl []float64, ldvl int, vr []float64, ldvr int, mm int, work []float64, lwork int) (m int) { - bothv := side == lapack.EVBoth - rightv := side == lapack.EVRight || bothv - leftv := side == lapack.EVLeft || bothv - switch { - case !rightv && !leftv: - panic(badEVSide) - case howmny != lapack.EVAll && howmny != lapack.EVAllMulQ && howmny != lapack.EVSelected: - panic(badEVHowMany) - case n < 0: - panic(nLT0) - case ldt < max(1, n): - panic(badLdT) - case mm < 0: - panic(mmLT0) - case ldvl < 1: - // ldvl and ldvr are also checked below after the computation of - // m (number of columns of VL and VR) in case of howmny == EVSelected. - panic(badLdVL) - case ldvr < 1: - panic(badLdVR) - case lwork < max(1, 3*n) && lwork != -1: - panic(badLWork) - case len(work) < max(1, lwork): - panic(shortWork) - } - - // Quick return if possible. - if n == 0 { - work[0] = 1 - return 0 - } - - // Normally we don't check slice lengths until after the workspace - // query. However, even in case of the workspace query we need to - // compute and return the value of m, and since the computation accesses t, - // we put the length check of t here. - if len(t) < (n-1)*ldt+n { - panic(shortT) - } - - if howmny == lapack.EVSelected { - if len(selected) != n { - panic(badLenSelected) - } - // Set m to the number of columns required to store the selected - // eigenvectors, and standardize the slice selected. - // Each selected real eigenvector occupies one column and each - // selected complex eigenvector occupies two columns. - for j := 0; j < n; { - if j == n-1 || t[(j+1)*ldt+j] == 0 { - // Diagonal 1×1 block corresponding to a - // real eigenvalue. - if selected[j] { - m++ - } - j++ - } else { - // Diagonal 2×2 block corresponding to a - // complex eigenvalue. - if selected[j] || selected[j+1] { - selected[j] = true - selected[j+1] = false - m += 2 - } - j += 2 - } - } - } else { - m = n - } - if mm < m { - panic(badMm) - } - - // Quick return in case of a workspace query. - nb := impl.Ilaenv(1, "DTREVC", string(side)+string(howmny), n, -1, -1, -1) - if lwork == -1 { - work[0] = float64(n + 2*n*nb) - return m - } - - // Quick return if no eigenvectors were selected. - if m == 0 { - return 0 - } - - switch { - case leftv && ldvl < mm: - panic(badLdVL) - case leftv && len(vl) < (n-1)*ldvl+mm: - panic(shortVL) - - case rightv && ldvr < mm: - panic(badLdVR) - case rightv && len(vr) < (n-1)*ldvr+mm: - panic(shortVR) - } - - // Use blocked version of back-transformation if sufficient workspace. - // Zero-out the workspace to avoid potential NaN propagation. - const ( - nbmin = 8 - nbmax = 128 - ) - if howmny == lapack.EVAllMulQ && lwork >= n+2*n*nbmin { - nb = min((lwork-n)/(2*n), nbmax) - impl.Dlaset(blas.All, n, 1+2*nb, 0, 0, work[:n+2*nb*n], 1+2*nb) - } else { - nb = 1 - } - - // Set the constants to control overflow. - ulp := dlamchP - smlnum := float64(n) / ulp * dlamchS - bignum := (1 - ulp) / smlnum - - // Split work into a vector of column norms and an n×2*nb matrix b. - norms := work[:n] - ldb := 2 * nb - b := work[n : n+n*ldb] - - // Compute 1-norm of each column of strictly upper triangular part of T - // to control overflow in triangular solver. - norms[0] = 0 - for j := 1; j < n; j++ { - var cn float64 - for i := 0; i < j; i++ { - cn += math.Abs(t[i*ldt+j]) - } - norms[j] = cn - } - - bi := blas64.Implementation() - - var ( - x [4]float64 - - iv int // Index of column in current block. - is int - - // ip is used below to specify the real or complex eigenvalue: - // ip == 0, real eigenvalue, - // 1, first of conjugate complex pair (wr,wi), - // -1, second of conjugate complex pair (wr,wi). - ip int - iscomplex [nbmax]int // Stores ip for each column in current block. - ) - - if side == lapack.EVLeft { - goto leftev - } - - // Compute right eigenvectors. - - // For complex right vector, iv-1 is for real part and iv for complex - // part. Non-blocked version always uses iv=1, blocked version starts - // with iv=nb-1 and goes down to 0 or 1. - iv = max(2, nb) - 1 - ip = 0 - is = m - 1 - for ki := n - 1; ki >= 0; ki-- { - if ip == -1 { - // Previous iteration (ki+1) was second of - // conjugate pair, so this ki is first of - // conjugate pair. - ip = 1 - continue - } - - if ki == 0 || t[ki*ldt+ki-1] == 0 { - // Last column or zero on sub-diagonal, so this - // ki must be real eigenvalue. - ip = 0 - } else { - // Non-zero on sub-diagonal, so this ki is - // second of conjugate pair. - ip = -1 - } - - if howmny == lapack.EVSelected { - if ip == 0 { - if !selected[ki] { - continue - } - } else if !selected[ki-1] { - continue - } - } - - // Compute the ki-th eigenvalue (wr,wi). - wr := t[ki*ldt+ki] - var wi float64 - if ip != 0 { - wi = math.Sqrt(math.Abs(t[ki*ldt+ki-1])) * math.Sqrt(math.Abs(t[(ki-1)*ldt+ki])) - } - smin := math.Max(ulp*(math.Abs(wr)+math.Abs(wi)), smlnum) - - if ip == 0 { - // Real right eigenvector. - - b[ki*ldb+iv] = 1 - // Form right-hand side. - for k := 0; k < ki; k++ { - b[k*ldb+iv] = -t[k*ldt+ki] - } - // Solve upper quasi-triangular system: - // [ T[0:ki,0:ki] - wr ]*X = scale*b. - for j := ki - 1; j >= 0; { - if j == 0 || t[j*ldt+j-1] == 0 { - // 1×1 diagonal block. - scale, xnorm, _ := impl.Dlaln2(false, 1, 1, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:1], 2) - // Scale X[0,0] to avoid overflow when updating the - // right-hand side. - if xnorm > 1 && norms[j] > bignum/xnorm { - x[0] /= xnorm - scale /= xnorm - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[j*ldb+iv] = x[0] - // Update right-hand side. - bi.Daxpy(j, -x[0], t[j:], ldt, b[iv:], ldb) - j-- - } else { - // 2×2 diagonal block. - scale, xnorm, _ := impl.Dlaln2(false, 2, 1, smin, 1, t[(j-1)*ldt+j-1:], ldt, - 1, 1, b[(j-1)*ldb+iv:], ldb, wr, 0, x[:3], 2) - // Scale X[0,0] and X[1,0] to avoid overflow - // when updating the right-hand side. - if xnorm > 1 { - beta := math.Max(norms[j-1], norms[j]) - if beta > bignum/xnorm { - x[0] /= xnorm - x[2] /= xnorm - scale /= xnorm - } - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[(j-1)*ldb+iv] = x[0] - b[j*ldb+iv] = x[2] - // Update right-hand side. - bi.Daxpy(j-1, -x[0], t[j-1:], ldt, b[iv:], ldb) - bi.Daxpy(j-1, -x[2], t[j:], ldt, b[iv:], ldb) - j -= 2 - } - } - // Copy the vector x or Q*x to VR and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VR and normalize. - bi.Dcopy(ki+1, b[iv:], ldb, vr[is:], ldvr) - ii := bi.Idamax(ki+1, vr[is:], ldvr) - remax := 1 / math.Abs(vr[ii*ldvr+is]) - bi.Dscal(ki+1, remax, vr[is:], ldvr) - for k := ki + 1; k < n; k++ { - vr[k*ldvr+is] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with GEMV, Q*x. - if ki > 0 { - bi.Dgemv(blas.NoTrans, n, ki, 1, vr, ldvr, b[iv:], ldb, - b[ki*ldb+iv], vr[ki:], ldvr) - } - ii := bi.Idamax(n, vr[ki:], ldvr) - remax := 1 / math.Abs(vr[ii*ldvr+ki]) - bi.Dscal(n, remax, vr[ki:], ldvr) - default: - // Version 2: back-transform block of vectors with GEMM. - // Zero out below vector. - for k := ki + 1; k < n; k++ { - b[k*ldb+iv] = 0 - } - iscomplex[iv] = ip - // Back-transform and normalization is done below. - } - } else { - // Complex right eigenvector. - - // Initial solve - // [ ( T[ki-1,ki-1] T[ki-1,ki] ) - (wr + i*wi) ]*X = 0. - // [ ( T[ki, ki-1] T[ki, ki] ) ] - if math.Abs(t[(ki-1)*ldt+ki]) >= math.Abs(t[ki*ldt+ki-1]) { - b[(ki-1)*ldb+iv-1] = 1 - b[ki*ldb+iv] = wi / t[(ki-1)*ldt+ki] - } else { - b[(ki-1)*ldb+iv-1] = -wi / t[ki*ldt+ki-1] - b[ki*ldb+iv] = 1 - } - b[ki*ldb+iv-1] = 0 - b[(ki-1)*ldb+iv] = 0 - // Form right-hand side. - for k := 0; k < ki-1; k++ { - b[k*ldb+iv-1] = -b[(ki-1)*ldb+iv-1] * t[k*ldt+ki-1] - b[k*ldb+iv] = -b[ki*ldb+iv] * t[k*ldt+ki] - } - // Solve upper quasi-triangular system: - // [ T[0:ki-1,0:ki-1] - (wr+i*wi) ]*X = scale*(b1+i*b2) - for j := ki - 2; j >= 0; { - if j == 0 || t[j*ldt+j-1] == 0 { - // 1×1 diagonal block. - - scale, xnorm, _ := impl.Dlaln2(false, 1, 2, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv-1:], ldb, wr, wi, x[:2], 2) - // Scale X[0,0] and X[0,1] to avoid - // overflow when updating the right-hand side. - if xnorm > 1 && norms[j] > bignum/xnorm { - x[0] /= xnorm - x[1] /= xnorm - scale /= xnorm - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv-1:], ldb) - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[j*ldb+iv-1] = x[0] - b[j*ldb+iv] = x[1] - // Update the right-hand side. - bi.Daxpy(j, -x[0], t[j:], ldt, b[iv-1:], ldb) - bi.Daxpy(j, -x[1], t[j:], ldt, b[iv:], ldb) - j-- - } else { - // 2×2 diagonal block. - - scale, xnorm, _ := impl.Dlaln2(false, 2, 2, smin, 1, t[(j-1)*ldt+j-1:], ldt, - 1, 1, b[(j-1)*ldb+iv-1:], ldb, wr, wi, x[:], 2) - // Scale X to avoid overflow when updating - // the right-hand side. - if xnorm > 1 { - beta := math.Max(norms[j-1], norms[j]) - if beta > bignum/xnorm { - rec := 1 / xnorm - x[0] *= rec - x[1] *= rec - x[2] *= rec - x[3] *= rec - scale *= rec - } - } - // Scale if necessary. - if scale != 1 { - bi.Dscal(ki+1, scale, b[iv-1:], ldb) - bi.Dscal(ki+1, scale, b[iv:], ldb) - } - b[(j-1)*ldb+iv-1] = x[0] - b[(j-1)*ldb+iv] = x[1] - b[j*ldb+iv-1] = x[2] - b[j*ldb+iv] = x[3] - // Update the right-hand side. - bi.Daxpy(j-1, -x[0], t[j-1:], ldt, b[iv-1:], ldb) - bi.Daxpy(j-1, -x[1], t[j-1:], ldt, b[iv:], ldb) - bi.Daxpy(j-1, -x[2], t[j:], ldt, b[iv-1:], ldb) - bi.Daxpy(j-1, -x[3], t[j:], ldt, b[iv:], ldb) - j -= 2 - } - } - - // Copy the vector x or Q*x to VR and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VR and normalize. - bi.Dcopy(ki+1, b[iv-1:], ldb, vr[is-1:], ldvr) - bi.Dcopy(ki+1, b[iv:], ldb, vr[is:], ldvr) - emax := 0.0 - for k := 0; k <= ki; k++ { - emax = math.Max(emax, math.Abs(vr[k*ldvr+is-1])+math.Abs(vr[k*ldvr+is])) - } - remax := 1 / emax - bi.Dscal(ki+1, remax, vr[is-1:], ldvr) - bi.Dscal(ki+1, remax, vr[is:], ldvr) - for k := ki + 1; k < n; k++ { - vr[k*ldvr+is-1] = 0 - vr[k*ldvr+is] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with GEMV, Q*x. - if ki-1 > 0 { - bi.Dgemv(blas.NoTrans, n, ki-1, 1, vr, ldvr, b[iv-1:], ldb, - b[(ki-1)*ldb+iv-1], vr[ki-1:], ldvr) - bi.Dgemv(blas.NoTrans, n, ki-1, 1, vr, ldvr, b[iv:], ldb, - b[ki*ldb+iv], vr[ki:], ldvr) - } else { - bi.Dscal(n, b[(ki-1)*ldb+iv-1], vr[ki-1:], ldvr) - bi.Dscal(n, b[ki*ldb+iv], vr[ki:], ldvr) - } - emax := 0.0 - for k := 0; k < n; k++ { - emax = math.Max(emax, math.Abs(vr[k*ldvr+ki-1])+math.Abs(vr[k*ldvr+ki])) - } - remax := 1 / emax - bi.Dscal(n, remax, vr[ki-1:], ldvr) - bi.Dscal(n, remax, vr[ki:], ldvr) - default: - // Version 2: back-transform block of vectors with GEMM. - // Zero out below vector. - for k := ki + 1; k < n; k++ { - b[k*ldb+iv-1] = 0 - b[k*ldb+iv] = 0 - } - iscomplex[iv-1] = -ip - iscomplex[iv] = ip - iv-- - // Back-transform and normalization is done below. - } - } - if nb > 1 { - // Blocked version of back-transform. - - // For complex case, ki2 includes both vectors (ki-1 and ki). - ki2 := ki - if ip != 0 { - ki2-- - } - // Columns iv:nb of b are valid vectors. - // When the number of vectors stored reaches nb-1 or nb, - // or if this was last vector, do the Gemm. - if iv < 2 || ki2 == 0 { - bi.Dgemm(blas.NoTrans, blas.NoTrans, n, nb-iv, ki2+nb-iv, - 1, vr, ldvr, b[iv:], ldb, - 0, b[nb+iv:], ldb) - // Normalize vectors. - var remax float64 - for k := iv; k < nb; k++ { - if iscomplex[k] == 0 { - // Real eigenvector. - ii := bi.Idamax(n, b[nb+k:], ldb) - remax = 1 / math.Abs(b[ii*ldb+nb+k]) - } else if iscomplex[k] == 1 { - // First eigenvector of conjugate pair. - emax := 0.0 - for ii := 0; ii < n; ii++ { - emax = math.Max(emax, math.Abs(b[ii*ldb+nb+k])+math.Abs(b[ii*ldb+nb+k+1])) - } - remax = 1 / emax - // Second eigenvector of conjugate pair - // will reuse this value of remax. - } - bi.Dscal(n, remax, b[nb+k:], ldb) - } - impl.Dlacpy(blas.All, n, nb-iv, b[nb+iv:], ldb, vr[ki2:], ldvr) - iv = nb - 1 - } else { - iv-- - } - } - is-- - if ip != 0 { - is-- - } - } - - if side == lapack.EVRight { - return m - } - -leftev: - // Compute left eigenvectors. - - // For complex left vector, iv is for real part and iv+1 for complex - // part. Non-blocked version always uses iv=0. Blocked version starts - // with iv=0, goes up to nb-2 or nb-1. - iv = 0 - ip = 0 - is = 0 - for ki := 0; ki < n; ki++ { - if ip == 1 { - // Previous iteration ki-1 was first of conjugate pair, - // so this ki is second of conjugate pair. - ip = -1 - continue - } - - if ki == n-1 || t[(ki+1)*ldt+ki] == 0 { - // Last column or zero on sub-diagonal, so this ki must - // be real eigenvalue. - ip = 0 - } else { - // Non-zero on sub-diagonal, so this ki is first of - // conjugate pair. - ip = 1 - } - if howmny == lapack.EVSelected && !selected[ki] { - continue - } - - // Compute the ki-th eigenvalue (wr,wi). - wr := t[ki*ldt+ki] - var wi float64 - if ip != 0 { - wi = math.Sqrt(math.Abs(t[ki*ldt+ki+1])) * math.Sqrt(math.Abs(t[(ki+1)*ldt+ki])) - } - smin := math.Max(ulp*(math.Abs(wr)+math.Abs(wi)), smlnum) - - if ip == 0 { - // Real left eigenvector. - - b[ki*ldb+iv] = 1 - // Form right-hand side. - for k := ki + 1; k < n; k++ { - b[k*ldb+iv] = -t[ki*ldt+k] - } - // Solve transposed quasi-triangular system: - // [ T[ki+1:n,ki+1:n] - wr ]^T * X = scale*b - vmax := 1.0 - vcrit := bignum - for j := ki + 1; j < n; { - if j == n-1 || t[(j+1)*ldt+j] == 0 { - // 1×1 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side. - if norms[j] > vcrit { - rec := 1 / vmax - bi.Dscal(n-ki, rec, b[ki*ldb+iv:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) - // Solve [ T[j,j] - wr ]^T * X = b. - scale, _, _ := impl.Dlaln2(false, 1, 1, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:1], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - } - b[j*ldb+iv] = x[0] - vmax = math.Max(math.Abs(b[j*ldb+iv]), vmax) - vcrit = bignum / vmax - j++ - } else { - // 2×2 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side. - beta := math.Max(norms[j], norms[j+1]) - if beta > vcrit { - bi.Dscal(n-ki+1, 1/vmax, b[ki*ldb+iv:], 1) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j:], ldt, b[(ki+1)*ldb+iv:], ldb) - b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-1, t[(ki+1)*ldt+j+1:], ldt, b[(ki+1)*ldb+iv:], ldb) - // Solve - // [ T[j,j]-wr T[j,j+1] ]^T * X = scale*[ b1 ] - // [ T[j+1,j] T[j+1,j+1]-wr ] [ b2 ] - scale, _, _ := impl.Dlaln2(true, 2, 1, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, 0, x[:3], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - } - b[j*ldb+iv] = x[0] - b[(j+1)*ldb+iv] = x[2] - vmax = math.Max(vmax, math.Max(math.Abs(b[j*ldb+iv]), math.Abs(b[(j+1)*ldb+iv]))) - vcrit = bignum / vmax - j += 2 - } - } - // Copy the vector x or Q*x to VL and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VL and normalize. - bi.Dcopy(n-ki, b[ki*ldb+iv:], ldb, vl[ki*ldvl+is:], ldvl) - ii := bi.Idamax(n-ki, vl[ki*ldvl+is:], ldvl) + ki - remax := 1 / math.Abs(vl[ii*ldvl+is]) - bi.Dscal(n-ki, remax, vl[ki*ldvl+is:], ldvl) - for k := 0; k < ki; k++ { - vl[k*ldvl+is] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with Gemv, Q*x. - if n-ki-1 > 0 { - bi.Dgemv(blas.NoTrans, n, n-ki-1, - 1, vl[ki+1:], ldvl, b[(ki+1)*ldb+iv:], ldb, - b[ki*ldb+iv], vl[ki:], ldvl) - } - ii := bi.Idamax(n, vl[ki:], ldvl) - remax := 1 / math.Abs(vl[ii*ldvl+ki]) - bi.Dscal(n, remax, vl[ki:], ldvl) - default: - // Version 2: back-transform block of vectors with Gemm - // zero out above vector. - for k := 0; k < ki; k++ { - b[k*ldb+iv] = 0 - } - iscomplex[iv] = ip - // Back-transform and normalization is done below. - } - } else { - // Complex left eigenvector. - - // Initial solve: - // [ [ T[ki,ki] T[ki,ki+1] ]^T - (wr - i* wi) ]*X = 0. - // [ [ T[ki+1,ki] T[ki+1,ki+1] ] ] - if math.Abs(t[ki*ldt+ki+1]) >= math.Abs(t[(ki+1)*ldt+ki]) { - b[ki*ldb+iv] = wi / t[ki*ldt+ki+1] - b[(ki+1)*ldb+iv+1] = 1 - } else { - b[ki*ldb+iv] = 1 - b[(ki+1)*ldb+iv+1] = -wi / t[(ki+1)*ldt+ki] - } - b[(ki+1)*ldb+iv] = 0 - b[ki*ldb+iv+1] = 0 - // Form right-hand side. - for k := ki + 2; k < n; k++ { - b[k*ldb+iv] = -b[ki*ldb+iv] * t[ki*ldt+k] - b[k*ldb+iv+1] = -b[(ki+1)*ldb+iv+1] * t[(ki+1)*ldt+k] - } - // Solve transposed quasi-triangular system: - // [ T[ki+2:n,ki+2:n]^T - (wr-i*wi) ]*X = b1+i*b2 - vmax := 1.0 - vcrit := bignum - for j := ki + 2; j < n; { - if j == n-1 || t[(j+1)*ldt+j] == 0 { - // 1×1 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side elements. - if norms[j] > vcrit { - rec := 1 / vmax - bi.Dscal(n-ki, rec, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, rec, b[ki*ldb+iv+1:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv:], ldb) - b[j*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv+1:], ldb) - // Solve [ T[j,j]-(wr-i*wi) ]*(X11+i*X12) = b1+i*b2. - scale, _, _ := impl.Dlaln2(false, 1, 2, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, -wi, x[:2], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, scale, b[ki*ldb+iv+1:], ldb) - } - b[j*ldb+iv] = x[0] - b[j*ldb+iv+1] = x[1] - vmax = math.Max(vmax, math.Max(math.Abs(b[j*ldb+iv]), math.Abs(b[j*ldb+iv+1]))) - vcrit = bignum / vmax - j++ - } else { - // 2×2 diagonal block. - - // Scale if necessary to avoid overflow - // when forming the right-hand side elements. - if math.Max(norms[j], norms[j+1]) > vcrit { - rec := 1 / vmax - bi.Dscal(n-ki, rec, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, rec, b[ki*ldb+iv+1:], ldb) - vmax = 1 - } - b[j*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv:], ldb) - b[j*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j:], ldt, b[(ki+2)*ldb+iv+1:], ldb) - b[(j+1)*ldb+iv] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv:], ldb) - b[(j+1)*ldb+iv+1] -= bi.Ddot(j-ki-2, t[(ki+2)*ldt+j+1:], ldt, b[(ki+2)*ldb+iv+1:], ldb) - // Solve 2×2 complex linear equation - // [ [T[j,j] T[j,j+1] ]^T - (wr-i*wi)*I ]*X = scale*b - // [ [T[j+1,j] T[j+1,j+1]] ] - scale, _, _ := impl.Dlaln2(true, 2, 2, smin, 1, t[j*ldt+j:], ldt, - 1, 1, b[j*ldb+iv:], ldb, wr, -wi, x[:], 2) - // Scale if necessary. - if scale != 1 { - bi.Dscal(n-ki, scale, b[ki*ldb+iv:], ldb) - bi.Dscal(n-ki, scale, b[ki*ldb+iv+1:], ldb) - } - b[j*ldb+iv] = x[0] - b[j*ldb+iv+1] = x[1] - b[(j+1)*ldb+iv] = x[2] - b[(j+1)*ldb+iv+1] = x[3] - vmax01 := math.Max(math.Abs(x[0]), math.Abs(x[1])) - vmax23 := math.Max(math.Abs(x[2]), math.Abs(x[3])) - vmax = math.Max(vmax, math.Max(vmax01, vmax23)) - vcrit = bignum / vmax - j += 2 - } - } - // Copy the vector x or Q*x to VL and normalize. - switch { - case howmny != lapack.EVAllMulQ: - // No back-transform: copy x to VL and normalize. - bi.Dcopy(n-ki, b[ki*ldb+iv:], ldb, vl[ki*ldvl+is:], ldvl) - bi.Dcopy(n-ki, b[ki*ldb+iv+1:], ldb, vl[ki*ldvl+is+1:], ldvl) - emax := 0.0 - for k := ki; k < n; k++ { - emax = math.Max(emax, math.Abs(vl[k*ldvl+is])+math.Abs(vl[k*ldvl+is+1])) - } - remax := 1 / emax - bi.Dscal(n-ki, remax, vl[ki*ldvl+is:], ldvl) - bi.Dscal(n-ki, remax, vl[ki*ldvl+is+1:], ldvl) - for k := 0; k < ki; k++ { - vl[k*ldvl+is] = 0 - vl[k*ldvl+is+1] = 0 - } - case nb == 1: - // Version 1: back-transform each vector with GEMV, Q*x. - if n-ki-2 > 0 { - bi.Dgemv(blas.NoTrans, n, n-ki-2, - 1, vl[ki+2:], ldvl, b[(ki+2)*ldb+iv:], ldb, - b[ki*ldb+iv], vl[ki:], ldvl) - bi.Dgemv(blas.NoTrans, n, n-ki-2, - 1, vl[ki+2:], ldvl, b[(ki+2)*ldb+iv+1:], ldb, - b[(ki+1)*ldb+iv+1], vl[ki+1:], ldvl) - } else { - bi.Dscal(n, b[ki*ldb+iv], vl[ki:], ldvl) - bi.Dscal(n, b[(ki+1)*ldb+iv+1], vl[ki+1:], ldvl) - } - emax := 0.0 - for k := 0; k < n; k++ { - emax = math.Max(emax, math.Abs(vl[k*ldvl+ki])+math.Abs(vl[k*ldvl+ki+1])) - } - remax := 1 / emax - bi.Dscal(n, remax, vl[ki:], ldvl) - bi.Dscal(n, remax, vl[ki+1:], ldvl) - default: - // Version 2: back-transform block of vectors with GEMM. - // Zero out above vector. - // Could go from ki-nv+1 to ki-1. - for k := 0; k < ki; k++ { - b[k*ldb+iv] = 0 - b[k*ldb+iv+1] = 0 - } - iscomplex[iv] = ip - iscomplex[iv+1] = -ip - iv++ - // Back-transform and normalization is done below. - } - } - if nb > 1 { - // Blocked version of back-transform. - // For complex case, ki2 includes both vectors ki and ki+1. - ki2 := ki - if ip != 0 { - ki2++ - } - // Columns [0:iv] of work are valid vectors. When the - // number of vectors stored reaches nb-1 or nb, or if - // this was last vector, do the Gemm. - if iv >= nb-2 || ki2 == n-1 { - bi.Dgemm(blas.NoTrans, blas.NoTrans, n, iv+1, n-ki2+iv, - 1, vl[ki2-iv:], ldvl, b[(ki2-iv)*ldb:], ldb, - 0, b[nb:], ldb) - // Normalize vectors. - var remax float64 - for k := 0; k <= iv; k++ { - if iscomplex[k] == 0 { - // Real eigenvector. - ii := bi.Idamax(n, b[nb+k:], ldb) - remax = 1 / math.Abs(b[ii*ldb+nb+k]) - } else if iscomplex[k] == 1 { - // First eigenvector of conjugate pair. - emax := 0.0 - for ii := 0; ii < n; ii++ { - emax = math.Max(emax, math.Abs(b[ii*ldb+nb+k])+math.Abs(b[ii*ldb+nb+k+1])) - } - remax = 1 / emax - // Second eigenvector of conjugate pair - // will reuse this value of remax. - } - bi.Dscal(n, remax, b[nb+k:], ldb) - } - impl.Dlacpy(blas.All, n, iv+1, b[nb:], ldb, vl[ki2-iv:], ldvl) - iv = 0 - } else { - iv++ - } - } - is++ - if ip != 0 { - is++ - } - } - - return m -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go deleted file mode 100644 index 9f3f90bad..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrexc.go +++ /dev/null @@ -1,230 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/lapack" - -// Dtrexc reorders the real Schur factorization of a n×n real matrix -// A = Q*T*Q^T -// so that the diagonal block of T with row index ifst is moved to row ilst. -// -// On entry, T must be in Schur canonical form, that is, block upper triangular -// with 1×1 and 2×2 diagonal blocks; each 2×2 diagonal block has its diagonal -// elements equal and its off-diagonal elements of opposite sign. -// -// On return, T will be reordered by an orthogonal similarity transformation Z -// as Z^T*T*Z, and will be again in Schur canonical form. -// -// If compq is lapack.UpdateSchur, on return the matrix Q of Schur vectors will be -// updated by post-multiplying it with Z. -// If compq is lapack.UpdateSchurNone, the matrix Q is not referenced and will not be -// updated. -// For other values of compq Dtrexc will panic. -// -// ifst and ilst specify the reordering of the diagonal blocks of T. The block -// with row index ifst is moved to row ilst, by a sequence of transpositions -// between adjacent blocks. -// -// If ifst points to the second row of a 2×2 block, ifstOut will point to the -// first row, otherwise it will be equal to ifst. -// -// ilstOut will point to the first row of the block in its final position. If ok -// is true, ilstOut may differ from ilst by +1 or -1. -// -// It must hold that -// 0 <= ifst < n, and 0 <= ilst < n, -// otherwise Dtrexc will panic. -// -// If ok is false, two adjacent blocks were too close to swap because the -// problem is very ill-conditioned. T may have been partially reordered, and -// ilstOut will point to the first row of the block at the position to which it -// has been moved. -// -// work must have length at least n, otherwise Dtrexc will panic. -// -// Dtrexc is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrexc(compq lapack.UpdateSchurComp, n int, t []float64, ldt int, q []float64, ldq int, ifst, ilst int, work []float64) (ifstOut, ilstOut int, ok bool) { - switch { - case compq != lapack.UpdateSchur && compq != lapack.UpdateSchurNone: - panic(badUpdateSchurComp) - case n < 0: - panic(nLT0) - case ldt < max(1, n): - panic(badLdT) - case ldq < 1, compq == lapack.UpdateSchur && ldq < n: - panic(badLdQ) - case (ifst < 0 || n <= ifst) && n > 0: - panic(badIfst) - case (ilst < 0 || n <= ilst) && n > 0: - panic(badIlst) - } - - // Quick return if possible. - if n == 0 { - return ifst, ilst, true - } - - switch { - case len(t) < (n-1)*ldt+n: - panic(shortT) - case compq == lapack.UpdateSchur && len(q) < (n-1)*ldq+n: - panic(shortQ) - case len(work) < n: - panic(shortWork) - } - - // Quick return if possible. - if n == 1 { - return ifst, ilst, true - } - - // Determine the first row of specified block - // and find out it is 1×1 or 2×2. - if ifst > 0 && t[ifst*ldt+ifst-1] != 0 { - ifst-- - } - nbf := 1 // Size of the first block. - if ifst+1 < n && t[(ifst+1)*ldt+ifst] != 0 { - nbf = 2 - } - // Determine the first row of the final block - // and find out it is 1×1 or 2×2. - if ilst > 0 && t[ilst*ldt+ilst-1] != 0 { - ilst-- - } - nbl := 1 // Size of the last block. - if ilst+1 < n && t[(ilst+1)*ldt+ilst] != 0 { - nbl = 2 - } - - ok = true - wantq := compq == lapack.UpdateSchur - - switch { - case ifst == ilst: - return ifst, ilst, true - - case ifst < ilst: - // Update ilst. - switch { - case nbf == 2 && nbl == 1: - ilst-- - case nbf == 1 && nbl == 2: - ilst++ - } - here := ifst - for here < ilst { - // Swap block with next one below. - if nbf == 1 || nbf == 2 { - // Current block either 1×1 or 2×2. - nbnext := 1 // Size of the next block. - if here+nbf+1 < n && t[(here+nbf+1)*ldt+here+nbf] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, nbf, nbnext, work) - if !ok { - return ifst, here, false - } - here += nbnext - // Test if 2×2 block breaks into two 1×1 blocks. - if nbf == 2 && t[(here+1)*ldt+here] == 0 { - nbf = 3 - } - continue - } - - // Current block consists of two 1×1 blocks each of - // which must be swapped individually. - nbnext := 1 // Size of the next block. - if here+3 < n && t[(here+3)*ldt+here+2] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here+1, 1, nbnext, work) - if !ok { - return ifst, here, false - } - if nbnext == 1 { - // Swap two 1×1 blocks, no problems possible. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, nbnext, work) - here++ - continue - } - // Recompute nbnext in case 2×2 split. - if t[(here+2)*ldt+here+1] == 0 { - nbnext = 1 - } - if nbnext == 2 { - // 2×2 block did not split. - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, nbnext, work) - if !ok { - return ifst, here, false - } - } else { - // 2×2 block did split. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, 1, work) - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here+1, 1, 1, work) - } - here += 2 - } - return ifst, here, true - - default: // ifst > ilst - here := ifst - for here > ilst { - // Swap block with next one above. - if nbf == 1 || nbf == 2 { - // Current block either 1×1 or 2×2. - nbnext := 1 - if here-2 >= 0 && t[(here-1)*ldt+here-2] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-nbnext, nbnext, nbf, work) - if !ok { - return ifst, here, false - } - here -= nbnext - // Test if 2×2 block breaks into two 1×1 blocks. - if nbf == 2 && t[(here+1)*ldt+here] == 0 { - nbf = 3 - } - continue - } - - // Current block consists of two 1×1 blocks each of - // which must be swapped individually. - nbnext := 1 - if here-2 >= 0 && t[(here-1)*ldt+here-2] != 0 { - nbnext = 2 - } - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-nbnext, nbnext, 1, work) - if !ok { - return ifst, here, false - } - if nbnext == 1 { - // Swap two 1×1 blocks, no problems possible. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, nbnext, 1, work) - here-- - continue - } - // Recompute nbnext in case 2×2 split. - if t[here*ldt+here-1] == 0 { - nbnext = 1 - } - if nbnext == 2 { - // 2×2 block did not split. - ok = impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-1, 2, 1, work) - if !ok { - return ifst, here, false - } - } else { - // 2×2 block did split. - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here, 1, 1, work) - impl.Dlaexc(wantq, n, t, ldt, q, ldq, here-1, 1, 1, work) - } - here -= 2 - } - return ifst, here, true - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go deleted file mode 100644 index efc24b65e..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrti2.go +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dtrti2 computes the inverse of a triangular matrix, storing the result in place -// into a. This is the BLAS level 2 version of the algorithm. -// -// Dtrti2 is an internal routine. It is exported for testing purposes. -func (impl Implementation) Dtrti2(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - bi := blas64.Implementation() - - nonUnit := diag == blas.NonUnit - // TODO(btracey): Replace this with a row-major ordering. - if uplo == blas.Upper { - for j := 0; j < n; j++ { - var ajj float64 - if nonUnit { - ajj = 1 / a[j*lda+j] - a[j*lda+j] = ajj - ajj *= -1 - } else { - ajj = -1 - } - bi.Dtrmv(blas.Upper, blas.NoTrans, diag, j, a, lda, a[j:], lda) - bi.Dscal(j, ajj, a[j:], lda) - } - return - } - for j := n - 1; j >= 0; j-- { - var ajj float64 - if nonUnit { - ajj = 1 / a[j*lda+j] - a[j*lda+j] = ajj - ajj *= -1 - } else { - ajj = -1 - } - if j < n-1 { - bi.Dtrmv(blas.Lower, blas.NoTrans, diag, n-j-1, a[(j+1)*lda+j+1:], lda, a[(j+1)*lda+j:], lda) - bi.Dscal(n-j-1, ajj, a[(j+1)*lda+j:], lda) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go deleted file mode 100644 index 6ec3663c3..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtri.go +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dtrtri computes the inverse of a triangular matrix, storing the result in place -// into a. This is the BLAS level 3 version of the algorithm which builds upon -// Dtrti2 to operate on matrix blocks instead of only individual columns. -// -// Dtrtri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -func (impl Implementation) Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 { - return true - } - - if len(a) < (n-1)*lda+n { - panic(shortA) - } - - if diag == blas.NonUnit { - for i := 0; i < n; i++ { - if a[i*lda+i] == 0 { - return false - } - } - } - - bi := blas64.Implementation() - - nb := impl.Ilaenv(1, "DTRTRI", "UD", n, -1, -1, -1) - if nb <= 1 || nb > n { - impl.Dtrti2(uplo, diag, n, a, lda) - return true - } - if uplo == blas.Upper { - for j := 0; j < n; j += nb { - jb := min(nb, n-j) - bi.Dtrmm(blas.Left, blas.Upper, blas.NoTrans, diag, j, jb, 1, a, lda, a[j:], lda) - bi.Dtrsm(blas.Right, blas.Upper, blas.NoTrans, diag, j, jb, -1, a[j*lda+j:], lda, a[j:], lda) - impl.Dtrti2(blas.Upper, diag, jb, a[j*lda+j:], lda) - } - return true - } - nn := ((n - 1) / nb) * nb - for j := nn; j >= 0; j -= nb { - jb := min(nb, n-j) - if j+jb <= n-1 { - bi.Dtrmm(blas.Left, blas.Lower, blas.NoTrans, diag, n-j-jb, jb, 1, a[(j+jb)*lda+j+jb:], lda, a[(j+jb)*lda+j:], lda) - bi.Dtrsm(blas.Right, blas.Lower, blas.NoTrans, diag, n-j-jb, jb, -1, a[j*lda+j:], lda, a[(j+jb)*lda+j:], lda) - } - impl.Dtrti2(blas.Lower, diag, jb, a[j*lda+j:], lda) - } - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go b/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go deleted file mode 100644 index 1752dc5c8..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/dtrtrs.go +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -// Dtrtrs solves a triangular system of the form A * X = B or A^T * X = B. Dtrtrs -// returns whether the solve completed successfully. If A is singular, no solve is performed. -func (impl Implementation) Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) { - switch { - case uplo != blas.Upper && uplo != blas.Lower: - panic(badUplo) - case trans != blas.NoTrans && trans != blas.Trans && trans != blas.ConjTrans: - panic(badTrans) - case diag != blas.NonUnit && diag != blas.Unit: - panic(badDiag) - case n < 0: - panic(nLT0) - case nrhs < 0: - panic(nrhsLT0) - case lda < max(1, n): - panic(badLdA) - case ldb < max(1, nrhs): - panic(badLdB) - } - - if n == 0 { - return true - } - - switch { - case len(a) < (n-1)*lda+n: - panic(shortA) - case len(b) < (n-1)*ldb+nrhs: - panic(shortB) - } - - // Check for singularity. - nounit := diag == blas.NonUnit - if nounit { - for i := 0; i < n; i++ { - if a[i*lda+i] == 0 { - return false - } - } - } - bi := blas64.Implementation() - bi.Dtrsm(blas.Left, uplo, trans, diag, n, nrhs, 1, a, lda, b, ldb) - return true -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/errors.go b/vendor/gonum.org/v1/gonum/lapack/gonum/errors.go deleted file mode 100644 index 3c0cb68ef..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/errors.go +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -// This list is duplicated in netlib/lapack/netlib. Keep in sync. -const ( - // Panic strings for bad enumeration values. - badApplyOrtho = "lapack: bad ApplyOrtho" - badBalanceJob = "lapack: bad BalanceJob" - badDiag = "lapack: bad Diag" - badDirect = "lapack: bad Direct" - badEVComp = "lapack: bad EVComp" - badEVHowMany = "lapack: bad EVHowMany" - badEVJob = "lapack: bad EVJob" - badEVSide = "lapack: bad EVSide" - badGSVDJob = "lapack: bad GSVDJob" - badGenOrtho = "lapack: bad GenOrtho" - badLeftEVJob = "lapack: bad LeftEVJob" - badMatrixType = "lapack: bad MatrixType" - badNorm = "lapack: bad Norm" - badPivot = "lapack: bad Pivot" - badRightEVJob = "lapack: bad RightEVJob" - badSVDJob = "lapack: bad SVDJob" - badSchurComp = "lapack: bad SchurComp" - badSchurJob = "lapack: bad SchurJob" - badSide = "lapack: bad Side" - badSort = "lapack: bad Sort" - badStoreV = "lapack: bad StoreV" - badTrans = "lapack: bad Trans" - badUpdateSchurComp = "lapack: bad UpdateSchurComp" - badUplo = "lapack: bad Uplo" - bothSVDOver = "lapack: both jobU and jobVT are lapack.SVDOverwrite" - - // Panic strings for bad numerical and string values. - badIfst = "lapack: ifst out of range" - badIhi = "lapack: ihi out of range" - badIhiz = "lapack: ihiz out of range" - badIlo = "lapack: ilo out of range" - badIloz = "lapack: iloz out of range" - badIlst = "lapack: ilst out of range" - badIsave = "lapack: bad isave value" - badIspec = "lapack: bad ispec value" - badJ1 = "lapack: j1 out of range" - badJpvt = "lapack: bad element of jpvt" - badK1 = "lapack: k1 out of range" - badK2 = "lapack: k2 out of range" - badKacc22 = "lapack: invalid value of kacc22" - badKbot = "lapack: kbot out of range" - badKtop = "lapack: ktop out of range" - badLWork = "lapack: insufficient declared workspace length" - badMm = "lapack: mm out of range" - badN1 = "lapack: bad value of n1" - badN2 = "lapack: bad value of n2" - badNa = "lapack: bad value of na" - badName = "lapack: bad name" - badNh = "lapack: bad value of nh" - badNw = "lapack: bad value of nw" - badPp = "lapack: bad value of pp" - badShifts = "lapack: bad shifts" - i0LT0 = "lapack: i0 < 0" - kGTM = "lapack: k > m" - kGTN = "lapack: k > n" - kLT0 = "lapack: k < 0" - kLT1 = "lapack: k < 1" - kdLT0 = "lapack: kd < 0" - mGTN = "lapack: m > n" - mLT0 = "lapack: m < 0" - mmLT0 = "lapack: mm < 0" - n0LT0 = "lapack: n0 < 0" - nGTM = "lapack: n > m" - nLT0 = "lapack: n < 0" - nLT1 = "lapack: n < 1" - nLTM = "lapack: n < m" - nanCFrom = "lapack: cfrom is NaN" - nanCTo = "lapack: cto is NaN" - nbGTM = "lapack: nb > m" - nbGTN = "lapack: nb > n" - nbLT0 = "lapack: nb < 0" - nccLT0 = "lapack: ncc < 0" - ncvtLT0 = "lapack: ncvt < 0" - negANorm = "lapack: anorm < 0" - negZ = "lapack: negative z value" - nhLT0 = "lapack: nh < 0" - notIsolated = "lapack: block is not isolated" - nrhsLT0 = "lapack: nrhs < 0" - nruLT0 = "lapack: nru < 0" - nshftsLT0 = "lapack: nshfts < 0" - nshftsOdd = "lapack: nshfts must be even" - nvLT0 = "lapack: nv < 0" - offsetGTM = "lapack: offset > m" - offsetLT0 = "lapack: offset < 0" - pLT0 = "lapack: p < 0" - recurLT0 = "lapack: recur < 0" - zeroCFrom = "lapack: zero cfrom" - - // Panic strings for bad slice lengths. - badLenAlpha = "lapack: bad length of alpha" - badLenBeta = "lapack: bad length of beta" - badLenIpiv = "lapack: bad length of ipiv" - badLenJpvt = "lapack: bad length of jpvt" - badLenK = "lapack: bad length of k" - badLenSelected = "lapack: bad length of selected" - badLenSi = "lapack: bad length of si" - badLenSr = "lapack: bad length of sr" - badLenTau = "lapack: bad length of tau" - badLenWi = "lapack: bad length of wi" - badLenWr = "lapack: bad length of wr" - - // Panic strings for insufficient slice lengths. - shortA = "lapack: insufficient length of a" - shortAB = "lapack: insufficient length of ab" - shortAuxv = "lapack: insufficient length of auxv" - shortB = "lapack: insufficient length of b" - shortC = "lapack: insufficient length of c" - shortCNorm = "lapack: insufficient length of cnorm" - shortD = "lapack: insufficient length of d" - shortE = "lapack: insufficient length of e" - shortF = "lapack: insufficient length of f" - shortH = "lapack: insufficient length of h" - shortIWork = "lapack: insufficient length of iwork" - shortIsgn = "lapack: insufficient length of isgn" - shortQ = "lapack: insufficient length of q" - shortS = "lapack: insufficient length of s" - shortScale = "lapack: insufficient length of scale" - shortT = "lapack: insufficient length of t" - shortTau = "lapack: insufficient length of tau" - shortTauP = "lapack: insufficient length of tauP" - shortTauQ = "lapack: insufficient length of tauQ" - shortU = "lapack: insufficient length of u" - shortV = "lapack: insufficient length of v" - shortVL = "lapack: insufficient length of vl" - shortVR = "lapack: insufficient length of vr" - shortVT = "lapack: insufficient length of vt" - shortVn1 = "lapack: insufficient length of vn1" - shortVn2 = "lapack: insufficient length of vn2" - shortW = "lapack: insufficient length of w" - shortWH = "lapack: insufficient length of wh" - shortWV = "lapack: insufficient length of wv" - shortWi = "lapack: insufficient length of wi" - shortWork = "lapack: insufficient length of work" - shortWr = "lapack: insufficient length of wr" - shortX = "lapack: insufficient length of x" - shortY = "lapack: insufficient length of y" - shortZ = "lapack: insufficient length of z" - - // Panic strings for bad leading dimensions of matrices. - badLdA = "lapack: bad leading dimension of A" - badLdB = "lapack: bad leading dimension of B" - badLdC = "lapack: bad leading dimension of C" - badLdF = "lapack: bad leading dimension of F" - badLdH = "lapack: bad leading dimension of H" - badLdQ = "lapack: bad leading dimension of Q" - badLdT = "lapack: bad leading dimension of T" - badLdU = "lapack: bad leading dimension of U" - badLdV = "lapack: bad leading dimension of V" - badLdVL = "lapack: bad leading dimension of VL" - badLdVR = "lapack: bad leading dimension of VR" - badLdVT = "lapack: bad leading dimension of VT" - badLdW = "lapack: bad leading dimension of W" - badLdWH = "lapack: bad leading dimension of WH" - badLdWV = "lapack: bad leading dimension of WV" - badLdWork = "lapack: bad leading dimension of Work" - badLdX = "lapack: bad leading dimension of X" - badLdY = "lapack: bad leading dimension of Y" - badLdZ = "lapack: bad leading dimension of Z" - - // Panic strings for bad vector increments. - absIncNotOne = "lapack: increment not one or negative one" - badIncX = "lapack: incX <= 0" - badIncY = "lapack: incY <= 0" - zeroIncV = "lapack: incv == 0" -) diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go b/vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go deleted file mode 100644 index b251d7269..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlc.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -// Iladlc scans a matrix for its last non-zero column. Returns -1 if the matrix -// is all zeros. -// -// Iladlc is an internal routine. It is exported for testing purposes. -func (Implementation) Iladlc(m, n int, a []float64, lda int) int { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 || m == 0 { - return -1 - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - // Test common case where corner is non-zero. - if a[n-1] != 0 || a[(m-1)*lda+(n-1)] != 0 { - return n - 1 - } - - // Scan each row tracking the highest column seen. - highest := -1 - for i := 0; i < m; i++ { - for j := n - 1; j >= 0; j-- { - if a[i*lda+j] != 0 { - highest = max(highest, j) - break - } - } - } - return highest -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go b/vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go deleted file mode 100644 index b73fe18ea..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/iladlr.go +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -// Iladlr scans a matrix for its last non-zero row. Returns -1 if the matrix -// is all zeros. -// -// Iladlr is an internal routine. It is exported for testing purposes. -func (Implementation) Iladlr(m, n int, a []float64, lda int) int { - switch { - case m < 0: - panic(mLT0) - case n < 0: - panic(nLT0) - case lda < max(1, n): - panic(badLdA) - } - - if n == 0 || m == 0 { - return -1 - } - - if len(a) < (m-1)*lda+n { - panic(shortA) - } - - // Check the common case where the corner is non-zero - if a[(m-1)*lda] != 0 || a[(m-1)*lda+n-1] != 0 { - return m - 1 - } - for i := m - 1; i >= 0; i-- { - for j := 0; j < n; j++ { - if a[i*lda+j] != 0 { - return i - } - } - } - return -1 -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go b/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go deleted file mode 100644 index c134d21bb..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/ilaenv.go +++ /dev/null @@ -1,387 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -// Ilaenv returns algorithm tuning parameters for the algorithm given by the -// input string. ispec specifies the parameter to return: -// 1: The optimal block size for a blocked algorithm. -// 2: The minimum block size for a blocked algorithm. -// 3: The block size of unprocessed data at which a blocked algorithm should -// crossover to an unblocked version. -// 4: The number of shifts. -// 5: The minimum column dimension for blocking to be used. -// 6: The crossover point for SVD (to use QR factorization or not). -// 7: The number of processors. -// 8: The crossover point for multi-shift in QR and QZ methods for non-symmetric eigenvalue problems. -// 9: Maximum size of the subproblems in divide-and-conquer algorithms. -// 10: ieee NaN arithmetic can be trusted not to trap. -// 11: infinity arithmetic can be trusted not to trap. -// 12...16: parameters for Dhseqr and related functions. See Iparmq for more -// information. -// -// Ilaenv is an internal routine. It is exported for testing purposes. -func (impl Implementation) Ilaenv(ispec int, name string, opts string, n1, n2, n3, n4 int) int { - // TODO(btracey): Replace this with a constant lookup? A list of constants? - sname := name[0] == 'S' || name[0] == 'D' - cname := name[0] == 'C' || name[0] == 'Z' - if !sname && !cname { - panic(badName) - } - c2 := name[1:3] - c3 := name[3:6] - c4 := c3[1:3] - - switch ispec { - default: - panic(badIspec) - case 1: - switch c2 { - default: - panic(badName) - case "GE": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 64 - } - return 64 - case "QRF", "RQF", "LQF", "QLF": - if sname { - return 32 - } - return 32 - case "HRD": - if sname { - return 32 - } - return 32 - case "BRD": - if sname { - return 32 - } - return 32 - case "TRI": - if sname { - return 64 - } - return 64 - } - case "PO": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 64 - } - return 64 - } - case "SY": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 64 - } - return 64 - case "TRD": - return 32 - case "GST": - return 64 - } - case "HE": - switch c3 { - default: - panic(badName) - case "TRF": - return 64 - case "TRD": - return 32 - case "GST": - return 64 - } - case "OR": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - case 'M': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - } - case "UN": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - case 'M': - switch c3[1:] { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 32 - } - } - case "GB": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - if n4 <= 64 { - return 1 - } - return 32 - } - if n4 <= 64 { - return 1 - } - return 32 - } - case "PB": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - if n4 <= 64 { - return 1 - } - return 32 - } - if n4 <= 64 { - return 1 - } - return 32 - } - case "TR": - switch c3 { - default: - panic(badName) - case "TRI": - if sname { - return 64 - } - return 64 - case "EVC": - if sname { - return 64 - } - return 64 - } - case "LA": - switch c3 { - default: - panic(badName) - case "UUM": - if sname { - return 64 - } - return 64 - } - case "ST": - if sname && c3 == "EBZ" { - return 1 - } - panic(badName) - } - case 2: - switch c2 { - default: - panic(badName) - case "GE": - switch c3 { - default: - panic(badName) - case "QRF", "RQF", "LQF", "QLF": - if sname { - return 2 - } - return 2 - case "HRD": - if sname { - return 2 - } - return 2 - case "BRD": - if sname { - return 2 - } - return 2 - case "TRI": - if sname { - return 2 - } - return 2 - } - case "SY": - switch c3 { - default: - panic(badName) - case "TRF": - if sname { - return 8 - } - return 8 - case "TRD": - if sname { - return 2 - } - panic(badName) - } - case "HE": - if c3 == "TRD" { - return 2 - } - panic(badName) - case "OR": - if !sname { - panic(badName) - } - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - case 'M': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - } - case "UN": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - case 'M': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 2 - } - } - } - case 3: - switch c2 { - default: - panic(badName) - case "GE": - switch c3 { - default: - panic(badName) - case "QRF", "RQF", "LQF", "QLF": - if sname { - return 128 - } - return 128 - case "HRD": - if sname { - return 128 - } - return 128 - case "BRD": - if sname { - return 128 - } - return 128 - } - case "SY": - if sname && c3 == "TRD" { - return 32 - } - panic(badName) - case "HE": - if c3 == "TRD" { - return 32 - } - panic(badName) - case "OR": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 128 - } - } - case "UN": - switch c3[0] { - default: - panic(badName) - case 'G': - switch c4 { - default: - panic(badName) - case "QR", "RQ", "LQ", "QL", "HR", "TR", "BR": - return 128 - } - } - } - case 4: - // Used by xHSEQR - return 6 - case 5: - // Not used - return 2 - case 6: - // Used by xGELSS and xGESVD - return int(float64(min(n1, n2)) * 1.6) - case 7: - // Not used - return 1 - case 8: - // Used by xHSEQR - return 50 - case 9: - // used by xGELSD and xGESDD - return 25 - case 10: - // Go guarantees ieee - return 1 - case 11: - // Go guarantees ieee - return 1 - case 12, 13, 14, 15, 16: - // Dhseqr and related functions for eigenvalue problems. - return impl.Iparmq(ispec, name, opts, n1, n2, n3, n4) - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go b/vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go deleted file mode 100644 index 3800f11ce..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/iparmq.go +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "math" - -// Iparmq returns problem and machine dependent parameters useful for Dhseqr and -// related subroutines for eigenvalue problems. -// -// ispec specifies the parameter to return: -// 12: Crossover point between Dlahqr and Dlaqr0. Will be at least 11. -// 13: Deflation window size. -// 14: Nibble crossover point. Determines when to skip a multi-shift QR sweep. -// 15: Number of simultaneous shifts in a multishift QR iteration. -// 16: Select structured matrix multiply. -// For other values of ispec Iparmq will panic. -// -// name is the name of the calling function. name must be in uppercase but this -// is not checked. -// -// opts is not used and exists for future use. -// -// n is the order of the Hessenberg matrix H. -// -// ilo and ihi specify the block [ilo:ihi+1,ilo:ihi+1] that is being processed. -// -// lwork is the amount of workspace available. -// -// Except for ispec input parameters are not checked. -// -// Iparmq is an internal routine. It is exported for testing purposes. -func (Implementation) Iparmq(ispec int, name, opts string, n, ilo, ihi, lwork int) int { - nh := ihi - ilo + 1 - ns := 2 - switch { - case nh >= 30: - ns = 4 - case nh >= 60: - ns = 10 - case nh >= 150: - ns = max(10, nh/int(math.Log(float64(nh))/math.Ln2)) - case nh >= 590: - ns = 64 - case nh >= 3000: - ns = 128 - case nh >= 6000: - ns = 256 - } - ns = max(2, ns-(ns%2)) - - switch ispec { - default: - panic(badIspec) - - case 12: - // Matrices of order smaller than nmin get sent to Dlahqr, the - // classic double shift algorithm. This must be at least 11. - const nmin = 75 - return nmin - - case 13: - const knwswp = 500 - if nh <= knwswp { - return ns - } - return 3 * ns / 2 - - case 14: - // Skip a computationally expensive multi-shift QR sweep with - // Dlaqr5 whenever aggressive early deflation finds at least - // nibble*(window size)/100 deflations. The default, small, - // value reflects the expectation that the cost of looking - // through the deflation window with Dlaqr3 will be - // substantially smaller. - const nibble = 14 - return nibble - - case 15: - return ns - - case 16: - if len(name) != 6 { - panic(badName) - } - const ( - k22min = 14 - kacmin = 14 - ) - var acc22 int - switch { - case name[1:] == "GGHRD" || name[1:] == "GGHD3": - acc22 = 1 - if nh >= k22min { - acc22 = 2 - } - case name[3:] == "EXC": - if nh >= kacmin { - acc22 = 1 - } - if nh >= k22min { - acc22 = 2 - } - case name[1:] == "HSEQR" || name[1:5] == "LAQR": - if ns >= kacmin { - acc22 = 1 - } - if ns >= k22min { - acc22 = 2 - } - } - return acc22 - } -} diff --git a/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go b/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go deleted file mode 100644 index 434da02d2..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/gonum/lapack.go +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package gonum - -import "gonum.org/v1/gonum/lapack" - -// Implementation is the native Go implementation of LAPACK routines. It -// is built on top of calls to the return of blas64.Implementation(), so while -// this code is in pure Go, the underlying BLAS implementation may not be. -type Implementation struct{} - -var _ lapack.Float64 = Implementation{} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -func abs(a int) int { - if a < 0 { - return -a - } - return a -} - -const ( - // dlamchE is the machine epsilon. For IEEE this is 2^{-53}. - dlamchE = 1.0 / (1 << 53) - - // dlamchB is the radix of the machine (the base of the number system). - dlamchB = 2 - - // dlamchP is base * eps. - dlamchP = dlamchB * dlamchE - - // dlamchS is the "safe minimum", that is, the lowest number such that - // 1/dlamchS does not overflow, or also the smallest normal number. - // For IEEE this is 2^{-1022}. - dlamchS = 1.0 / (1 << 256) / (1 << 256) / (1 << 256) / (1 << 254) -) diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack.go b/vendor/gonum.org/v1/gonum/lapack/lapack.go deleted file mode 100644 index eef14c17a..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/lapack.go +++ /dev/null @@ -1,213 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lapack - -import "gonum.org/v1/gonum/blas" - -// Complex128 defines the public complex128 LAPACK API supported by gonum/lapack. -type Complex128 interface{} - -// Float64 defines the public float64 LAPACK API supported by gonum/lapack. -type Float64 interface { - Dgecon(norm MatrixNorm, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 - Dgeev(jobvl LeftEVJob, jobvr RightEVJob, n int, a []float64, lda int, wr, wi []float64, vl []float64, ldvl int, vr []float64, ldvr int, work []float64, lwork int) (first int) - Dgels(trans blas.Transpose, m, n, nrhs int, a []float64, lda int, b []float64, ldb int, work []float64, lwork int) bool - Dgelqf(m, n int, a []float64, lda int, tau, work []float64, lwork int) - Dgeqrf(m, n int, a []float64, lda int, tau, work []float64, lwork int) - Dgesvd(jobU, jobVT SVDJob, m, n int, a []float64, lda int, s, u []float64, ldu int, vt []float64, ldvt int, work []float64, lwork int) (ok bool) - Dgetrf(m, n int, a []float64, lda int, ipiv []int) (ok bool) - Dgetri(n int, a []float64, lda int, ipiv []int, work []float64, lwork int) (ok bool) - Dgetrs(trans blas.Transpose, n, nrhs int, a []float64, lda int, ipiv []int, b []float64, ldb int) - Dggsvd3(jobU, jobV, jobQ GSVDJob, m, n, p int, a []float64, lda int, b []float64, ldb int, alpha, beta, u []float64, ldu int, v []float64, ldv int, q []float64, ldq int, work []float64, lwork int, iwork []int) (k, l int, ok bool) - Dlantr(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, m, n int, a []float64, lda int, work []float64) float64 - Dlange(norm MatrixNorm, m, n int, a []float64, lda int, work []float64) float64 - Dlansy(norm MatrixNorm, uplo blas.Uplo, n int, a []float64, lda int, work []float64) float64 - Dlapmt(forward bool, m, n int, x []float64, ldx int, k []int) - Dormqr(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) - Dormlq(side blas.Side, trans blas.Transpose, m, n, k int, a []float64, lda int, tau, c []float64, ldc int, work []float64, lwork int) - Dpocon(uplo blas.Uplo, n int, a []float64, lda int, anorm float64, work []float64, iwork []int) float64 - Dpotrf(ul blas.Uplo, n int, a []float64, lda int) (ok bool) - Dpotri(ul blas.Uplo, n int, a []float64, lda int) (ok bool) - Dpotrs(ul blas.Uplo, n, nrhs int, a []float64, lda int, b []float64, ldb int) - Dsyev(jobz EVJob, uplo blas.Uplo, n int, a []float64, lda int, w, work []float64, lwork int) (ok bool) - Dtrcon(norm MatrixNorm, uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int, work []float64, iwork []int) float64 - Dtrtri(uplo blas.Uplo, diag blas.Diag, n int, a []float64, lda int) (ok bool) - Dtrtrs(uplo blas.Uplo, trans blas.Transpose, diag blas.Diag, n, nrhs int, a []float64, lda int, b []float64, ldb int) (ok bool) -} - -// Direct specifies the direction of the multiplication for the Householder matrix. -type Direct byte - -const ( - Forward Direct = 'F' // Reflectors are right-multiplied, H_0 * H_1 * ... * H_{k-1}. - Backward Direct = 'B' // Reflectors are left-multiplied, H_{k-1} * ... * H_1 * H_0. -) - -// Sort is the sorting order. -type Sort byte - -const ( - SortIncreasing Sort = 'I' - SortDecreasing Sort = 'D' -) - -// StoreV indicates the storage direction of elementary reflectors. -type StoreV byte - -const ( - ColumnWise StoreV = 'C' // Reflector stored in a column of the matrix. - RowWise StoreV = 'R' // Reflector stored in a row of the matrix. -) - -// MatrixNorm represents the kind of matrix norm to compute. -type MatrixNorm byte - -const ( - MaxAbs MatrixNorm = 'M' // max(abs(A(i,j))) - MaxColumnSum MatrixNorm = 'O' // Maximum absolute column sum (one norm) - MaxRowSum MatrixNorm = 'I' // Maximum absolute row sum (infinity norm) - Frobenius MatrixNorm = 'F' // Frobenius norm (sqrt of sum of squares) -) - -// MatrixType represents the kind of matrix represented in the data. -type MatrixType byte - -const ( - General MatrixType = 'G' // A general dense matrix. - UpperTri MatrixType = 'U' // An upper triangular matrix. - LowerTri MatrixType = 'L' // A lower triangular matrix. -) - -// Pivot specifies the pivot type for plane rotations. -type Pivot byte - -const ( - Variable Pivot = 'V' - Top Pivot = 'T' - Bottom Pivot = 'B' -) - -// ApplyOrtho specifies which orthogonal matrix is applied in Dormbr. -type ApplyOrtho byte - -const ( - ApplyP ApplyOrtho = 'P' // Apply P or P^T. - ApplyQ ApplyOrtho = 'Q' // Apply Q or Q^T. -) - -// GenOrtho specifies which orthogonal matrix is generated in Dorgbr. -type GenOrtho byte - -const ( - GeneratePT GenOrtho = 'P' // Generate P^T. - GenerateQ GenOrtho = 'Q' // Generate Q. -) - -// SVDJob specifies the singular vector computation type for SVD. -type SVDJob byte - -const ( - SVDAll SVDJob = 'A' // Compute all columns of the orthogonal matrix U or V. - SVDStore SVDJob = 'S' // Compute the singular vectors and store them in the orthogonal matrix U or V. - SVDOverwrite SVDJob = 'O' // Compute the singular vectors and overwrite them on the input matrix A. - SVDNone SVDJob = 'N' // Do not compute singular vectors. -) - -// GSVDJob specifies the singular vector computation type for Generalized SVD. -type GSVDJob byte - -const ( - GSVDU GSVDJob = 'U' // Compute orthogonal matrix U. - GSVDV GSVDJob = 'V' // Compute orthogonal matrix V. - GSVDQ GSVDJob = 'Q' // Compute orthogonal matrix Q. - GSVDUnit GSVDJob = 'I' // Use unit-initialized matrix. - GSVDNone GSVDJob = 'N' // Do not compute orthogonal matrix. -) - -// EVComp specifies how eigenvectors are computed in Dsteqr. -type EVComp byte - -const ( - EVOrig EVComp = 'V' // Compute eigenvectors of the original symmetric matrix. - EVTridiag EVComp = 'I' // Compute eigenvectors of the tridiagonal matrix. - EVCompNone EVComp = 'N' // Do not compute eigenvectors. -) - -// EVJob specifies whether eigenvectors are computed in Dsyev. -type EVJob byte - -const ( - EVCompute EVJob = 'V' // Compute eigenvectors. - EVNone EVJob = 'N' // Do not compute eigenvectors. -) - -// LeftEVJob specifies whether left eigenvectors are computed in Dgeev. -type LeftEVJob byte - -const ( - LeftEVCompute LeftEVJob = 'V' // Compute left eigenvectors. - LeftEVNone LeftEVJob = 'N' // Do not compute left eigenvectors. -) - -// RightEVJob specifies whether right eigenvectors are computed in Dgeev. -type RightEVJob byte - -const ( - RightEVCompute RightEVJob = 'V' // Compute right eigenvectors. - RightEVNone RightEVJob = 'N' // Do not compute right eigenvectors. -) - -// BalanceJob specifies matrix balancing operation. -type BalanceJob byte - -const ( - Permute BalanceJob = 'P' - Scale BalanceJob = 'S' - PermuteScale BalanceJob = 'B' - BalanceNone BalanceJob = 'N' -) - -// SchurJob specifies whether the Schur form is computed in Dhseqr. -type SchurJob byte - -const ( - EigenvaluesOnly SchurJob = 'E' - EigenvaluesAndSchur SchurJob = 'S' -) - -// SchurComp specifies whether and how the Schur vectors are computed in Dhseqr. -type SchurComp byte - -const ( - SchurOrig SchurComp = 'V' // Compute Schur vectors of the original matrix. - SchurHess SchurComp = 'I' // Compute Schur vectors of the upper Hessenberg matrix. - SchurNone SchurComp = 'N' // Do not compute Schur vectors. -) - -// UpdateSchurComp specifies whether the matrix of Schur vectors is updated in Dtrexc. -type UpdateSchurComp byte - -const ( - UpdateSchur UpdateSchurComp = 'V' // Update the matrix of Schur vectors. - UpdateSchurNone UpdateSchurComp = 'N' // Do not update the matrix of Schur vectors. -) - -// EVSide specifies what eigenvectors are computed in Dtrevc3. -type EVSide byte - -const ( - EVRight EVSide = 'R' // Compute only right eigenvectors. - EVLeft EVSide = 'L' // Compute only left eigenvectors. - EVBoth EVSide = 'B' // Compute both right and left eigenvectors. -) - -// EVHowMany specifies which eigenvectors are computed in Dtrevc3 and how. -type EVHowMany byte - -const ( - EVAll EVHowMany = 'A' // Compute all right and/or left eigenvectors. - EVAllMulQ EVHowMany = 'B' // Compute all right and/or left eigenvectors multiplied by an input matrix. - EVSelected EVHowMany = 'S' // Compute selected right and/or left eigenvectors. -) diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go b/vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go deleted file mode 100644 index da19e3ec7..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/lapack64/doc.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package lapack64 provides a set of convenient wrapper functions for LAPACK -// calls, as specified in the netlib standard (www.netlib.org). -// -// The native Go routines are used by default, and the Use function can be used -// to set an alternative implementation. -// -// If the type of matrix (General, Symmetric, etc.) is known and fixed, it is -// used in the wrapper signature. In many cases, however, the type of the matrix -// changes during the call to the routine, for example the matrix is symmetric on -// entry and is triangular on exit. In these cases the correct types should be checked -// in the documentation. -// -// The full set of Lapack functions is very large, and it is not clear that a -// full implementation is desirable, let alone feasible. Please open up an issue -// if there is a specific function you need and/or are willing to implement. -package lapack64 // import "gonum.org/v1/gonum/lapack/lapack64" diff --git a/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go b/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go deleted file mode 100644 index 208ee1f43..000000000 --- a/vendor/gonum.org/v1/gonum/lapack/lapack64/lapack64.go +++ /dev/null @@ -1,581 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package lapack64 - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/gonum" -) - -var lapack64 lapack.Float64 = gonum.Implementation{} - -// Use sets the LAPACK float64 implementation to be used by subsequent BLAS calls. -// The default implementation is native.Implementation. -func Use(l lapack.Float64) { - lapack64 = l -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -// Potrf computes the Cholesky factorization of a. -// The factorization has the form -// A = U^T * U if a.Uplo == blas.Upper, or -// A = L * L^T if a.Uplo == blas.Lower, -// where U is an upper triangular matrix and L is lower triangular. -// The triangular matrix is returned in t, and the underlying data between -// a and t is shared. The returned bool indicates whether a is positive -// definite and the factorization could be finished. -func Potrf(a blas64.Symmetric) (t blas64.Triangular, ok bool) { - ok = lapack64.Dpotrf(a.Uplo, a.N, a.Data, max(1, a.Stride)) - t.Uplo = a.Uplo - t.N = a.N - t.Data = a.Data - t.Stride = a.Stride - t.Diag = blas.NonUnit - return -} - -// Potri computes the inverse of a real symmetric positive definite matrix A -// using its Cholesky factorization. -// -// On entry, t contains the triangular factor U or L from the Cholesky -// factorization A = U^T*U or A = L*L^T, as computed by Potrf. -// -// On return, the upper or lower triangle of the (symmetric) inverse of A is -// stored in t, overwriting the input factor U or L, and also returned in a. The -// underlying data between a and t is shared. -// -// The returned bool indicates whether the inverse was computed successfully. -func Potri(t blas64.Triangular) (a blas64.Symmetric, ok bool) { - ok = lapack64.Dpotri(t.Uplo, t.N, t.Data, max(1, t.Stride)) - a.Uplo = t.Uplo - a.N = t.N - a.Data = t.Data - a.Stride = t.Stride - return -} - -// Potrs solves a system of n linear equations A*X = B where A is an n×n -// symmetric positive definite matrix and B is an n×nrhs matrix, using the -// Cholesky factorization A = U^T*U or A = L*L^T. t contains the corresponding -// triangular factor as returned by Potrf. On entry, B contains the right-hand -// side matrix B, on return it contains the solution matrix X. -func Potrs(t blas64.Triangular, b blas64.General) { - lapack64.Dpotrs(t.Uplo, t.N, b.Cols, t.Data, max(1, t.Stride), b.Data, max(1, b.Stride)) -} - -// Gecon estimates the reciprocal of the condition number of the n×n matrix A -// given the LU decomposition of the matrix. The condition number computed may -// be based on the 1-norm or the ∞-norm. -// -// a contains the result of the LU decomposition of A as computed by Getrf. -// -// anorm is the corresponding 1-norm or ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 4*n and Gecon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Gecon will panic otherwise. -func Gecon(norm lapack.MatrixNorm, a blas64.General, anorm float64, work []float64, iwork []int) float64 { - return lapack64.Dgecon(norm, a.Cols, a.Data, max(1, a.Stride), anorm, work, iwork) -} - -// Gels finds a minimum-norm solution based on the matrices A and B using the -// QR or LQ factorization. Gels returns false if the matrix -// A is singular, and true if this solution was successfully found. -// -// The minimization problem solved depends on the input parameters. -// -// 1. If m >= n and trans == blas.NoTrans, Gels finds X such that || A*X - B||_2 -// is minimized. -// 2. If m < n and trans == blas.NoTrans, Gels finds the minimum norm solution of -// A * X = B. -// 3. If m >= n and trans == blas.Trans, Gels finds the minimum norm solution of -// A^T * X = B. -// 4. If m < n and trans == blas.Trans, Gels finds X such that || A*X - B||_2 -// is minimized. -// Note that the least-squares solutions (cases 1 and 3) perform the minimization -// per column of B. This is not the same as finding the minimum-norm matrix. -// -// The matrix A is a general matrix of size m×n and is modified during this call. -// The input matrix B is of size max(m,n)×nrhs, and serves two purposes. On entry, -// the elements of b specify the input matrix B. B has size m×nrhs if -// trans == blas.NoTrans, and n×nrhs if trans == blas.Trans. On exit, the -// leading submatrix of b contains the solution vectors X. If trans == blas.NoTrans, -// this submatrix is of size n×nrhs, and of size m×nrhs otherwise. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= max(m,n) + max(m,n,nrhs), and this function will panic -// otherwise. A longer work will enable blocked algorithms to be called. -// In the special case that lwork == -1, work[0] will be set to the optimal working -// length. -func Gels(trans blas.Transpose, a blas64.General, b blas64.General, work []float64, lwork int) bool { - return lapack64.Dgels(trans, a.Rows, a.Cols, b.Cols, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride), work, lwork) -} - -// Geqrf computes the QR factorization of the m×n matrix A using a blocked -// algorithm. A is modified to contain the information to construct Q and R. -// The upper triangle of a contains the matrix R. The lower triangular elements -// (not including the diagonal) contain the elementary reflectors. tau is modified -// to contain the reflector scales. tau must have length at least min(m,n), and -// this function will panic otherwise. -// -// The ith elementary reflector can be explicitly constructed by first extracting -// the -// v[j] = 0 j < i -// v[j] = 1 j == i -// v[j] = a[j*lda+i] j > i -// and computing H_i = I - tau[i] * v * v^T. -// -// The orthonormal matrix Q can be constucted from a product of these elementary -// reflectors, Q = H_0 * H_1 * ... * H_{k-1}, where k = min(m,n). -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m and this function will panic otherwise. -// Geqrf is a blocked QR factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Geqrf, -// the optimal work length will be stored into work[0]. -func Geqrf(a blas64.General, tau, work []float64, lwork int) { - lapack64.Dgeqrf(a.Rows, a.Cols, a.Data, max(1, a.Stride), tau, work, lwork) -} - -// Gelqf computes the LQ factorization of the m×n matrix A using a blocked -// algorithm. A is modified to contain the information to construct L and Q. The -// lower triangle of a contains the matrix L. The elements above the diagonal -// and the slice tau represent the matrix Q. tau is modified to contain the -// reflector scales. tau must have length at least min(m,n), and this function -// will panic otherwise. -// -// See Geqrf for a description of the elementary reflectors and orthonormal -// matrix Q. Q is constructed as a product of these elementary reflectors, -// Q = H_{k-1} * ... * H_1 * H_0. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m and this function will panic otherwise. -// Gelqf is a blocked LQ factorization, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Gelqf, -// the optimal work length will be stored into work[0]. -func Gelqf(a blas64.General, tau, work []float64, lwork int) { - lapack64.Dgelqf(a.Rows, a.Cols, a.Data, max(1, a.Stride), tau, work, lwork) -} - -// Gesvd computes the singular value decomposition of the input matrix A. -// -// The singular value decomposition is -// A = U * Sigma * V^T -// where Sigma is an m×n diagonal matrix containing the singular values of A, -// U is an m×m orthogonal matrix and V is an n×n orthogonal matrix. The first -// min(m,n) columns of U and V are the left and right singular vectors of A -// respectively. -// -// jobU and jobVT are options for computing the singular vectors. The behavior -// is as follows -// jobU == lapack.SVDAll All m columns of U are returned in u -// jobU == lapack.SVDStore The first min(m,n) columns are returned in u -// jobU == lapack.SVDOverwrite The first min(m,n) columns of U are written into a -// jobU == lapack.SVDNone The columns of U are not computed. -// The behavior is the same for jobVT and the rows of V^T. At most one of jobU -// and jobVT can equal lapack.SVDOverwrite, and Gesvd will panic otherwise. -// -// On entry, a contains the data for the m×n matrix A. During the call to Gesvd -// the data is overwritten. On exit, A contains the appropriate singular vectors -// if either job is lapack.SVDOverwrite. -// -// s is a slice of length at least min(m,n) and on exit contains the singular -// values in decreasing order. -// -// u contains the left singular vectors on exit, stored columnwise. If -// jobU == lapack.SVDAll, u is of size m×m. If jobU == lapack.SVDStore u is -// of size m×min(m,n). If jobU == lapack.SVDOverwrite or lapack.SVDNone, u is -// not used. -// -// vt contains the left singular vectors on exit, stored rowwise. If -// jobV == lapack.SVDAll, vt is of size n×m. If jobVT == lapack.SVDStore vt is -// of size min(m,n)×n. If jobVT == lapack.SVDOverwrite or lapack.SVDNone, vt is -// not used. -// -// work is a slice for storing temporary memory, and lwork is the usable size of -// the slice. lwork must be at least max(5*min(m,n), 3*min(m,n)+max(m,n)). -// If lwork == -1, instead of performing Gesvd, the optimal work length will be -// stored into work[0]. Gesvd will panic if the working memory has insufficient -// storage. -// -// Gesvd returns whether the decomposition successfully completed. -func Gesvd(jobU, jobVT lapack.SVDJob, a, u, vt blas64.General, s, work []float64, lwork int) (ok bool) { - return lapack64.Dgesvd(jobU, jobVT, a.Rows, a.Cols, a.Data, max(1, a.Stride), s, u.Data, max(1, u.Stride), vt.Data, max(1, vt.Stride), work, lwork) -} - -// Getrf computes the LU decomposition of the m×n matrix A. -// The LU decomposition is a factorization of A into -// A = P * L * U -// where P is a permutation matrix, L is a unit lower triangular matrix, and -// U is a (usually) non-unit upper triangular matrix. On exit, L and U are stored -// in place into a. -// -// ipiv is a permutation vector. It indicates that row i of the matrix was -// changed with ipiv[i]. ipiv must have length at least min(m,n), and will panic -// otherwise. ipiv is zero-indexed. -// -// Getrf is the blocked version of the algorithm. -// -// Getrf returns whether the matrix A is singular. The LU decomposition will -// be computed regardless of the singularity of A, but division by zero -// will occur if the false is returned and the result is used to solve a -// system of equations. -func Getrf(a blas64.General, ipiv []int) bool { - return lapack64.Dgetrf(a.Rows, a.Cols, a.Data, max(1, a.Stride), ipiv) -} - -// Getri computes the inverse of the matrix A using the LU factorization computed -// by Getrf. On entry, a contains the PLU decomposition of A as computed by -// Getrf and on exit contains the reciprocal of the original matrix. -// -// Getri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= n and this function will panic otherwise. -// Getri is a blocked inversion, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Getri, -// the optimal work length will be stored into work[0]. -func Getri(a blas64.General, ipiv []int, work []float64, lwork int) (ok bool) { - return lapack64.Dgetri(a.Cols, a.Data, max(1, a.Stride), ipiv, work, lwork) -} - -// Getrs solves a system of equations using an LU factorization. -// The system of equations solved is -// A * X = B if trans == blas.Trans -// A^T * X = B if trans == blas.NoTrans -// A is a general n×n matrix with stride lda. B is a general matrix of size n×nrhs. -// -// On entry b contains the elements of the matrix B. On exit, b contains the -// elements of X, the solution to the system of equations. -// -// a and ipiv contain the LU factorization of A and the permutation indices as -// computed by Getrf. ipiv is zero-indexed. -func Getrs(trans blas.Transpose, a blas64.General, b blas64.General, ipiv []int) { - lapack64.Dgetrs(trans, a.Cols, b.Cols, a.Data, max(1, a.Stride), ipiv, b.Data, max(1, b.Stride)) -} - -// Ggsvd3 computes the generalized singular value decomposition (GSVD) -// of an m×n matrix A and p×n matrix B: -// U^T*A*Q = D1*[ 0 R ] -// -// V^T*B*Q = D2*[ 0 R ] -// where U, V and Q are orthogonal matrices. -// -// Ggsvd3 returns k and l, the dimensions of the sub-blocks. k+l -// is the effective numerical rank of the (m+p)×n matrix [ A^T B^T ]^T. -// R is a (k+l)×(k+l) nonsingular upper triangular matrix, D1 and -// D2 are m×(k+l) and p×(k+l) diagonal matrices and of the following -// structures, respectively: -// -// If m-k-l >= 0, -// -// k l -// D1 = k [ I 0 ] -// l [ 0 C ] -// m-k-l [ 0 0 ] -// -// k l -// D2 = l [ 0 S ] -// p-l [ 0 0 ] -// -// n-k-l k l -// [ 0 R ] = k [ 0 R11 R12 ] k -// l [ 0 0 R22 ] l -// -// where -// -// C = diag( alpha_k, ... , alpha_{k+l} ), -// S = diag( beta_k, ... , beta_{k+l} ), -// C^2 + S^2 = I. -// -// R is stored in -// A[0:k+l, n-k-l:n] -// on exit. -// -// If m-k-l < 0, -// -// k m-k k+l-m -// D1 = k [ I 0 0 ] -// m-k [ 0 C 0 ] -// -// k m-k k+l-m -// D2 = m-k [ 0 S 0 ] -// k+l-m [ 0 0 I ] -// p-l [ 0 0 0 ] -// -// n-k-l k m-k k+l-m -// [ 0 R ] = k [ 0 R11 R12 R13 ] -// m-k [ 0 0 R22 R23 ] -// k+l-m [ 0 0 0 R33 ] -// -// where -// C = diag( alpha_k, ... , alpha_m ), -// S = diag( beta_k, ... , beta_m ), -// C^2 + S^2 = I. -// -// R = [ R11 R12 R13 ] is stored in A[1:m, n-k-l+1:n] -// [ 0 R22 R23 ] -// and R33 is stored in -// B[m-k:l, n+m-k-l:n] on exit. -// -// Ggsvd3 computes C, S, R, and optionally the orthogonal transformation -// matrices U, V and Q. -// -// jobU, jobV and jobQ are options for computing the orthogonal matrices. The behavior -// is as follows -// jobU == lapack.GSVDU Compute orthogonal matrix U -// jobU == lapack.GSVDNone Do not compute orthogonal matrix. -// The behavior is the same for jobV and jobQ with the exception that instead of -// lapack.GSVDU these accept lapack.GSVDV and lapack.GSVDQ respectively. -// The matrices U, V and Q must be m×m, p×p and n×n respectively unless the -// relevant job parameter is lapack.GSVDNone. -// -// alpha and beta must have length n or Ggsvd3 will panic. On exit, alpha and -// beta contain the generalized singular value pairs of A and B -// alpha[0:k] = 1, -// beta[0:k] = 0, -// if m-k-l >= 0, -// alpha[k:k+l] = diag(C), -// beta[k:k+l] = diag(S), -// if m-k-l < 0, -// alpha[k:m]= C, alpha[m:k+l]= 0 -// beta[k:m] = S, beta[m:k+l] = 1. -// if k+l < n, -// alpha[k+l:n] = 0 and -// beta[k+l:n] = 0. -// -// On exit, iwork contains the permutation required to sort alpha descending. -// -// iwork must have length n, work must have length at least max(1, lwork), and -// lwork must be -1 or greater than n, otherwise Ggsvd3 will panic. If -// lwork is -1, work[0] holds the optimal lwork on return, but Ggsvd3 does -// not perform the GSVD. -func Ggsvd3(jobU, jobV, jobQ lapack.GSVDJob, a, b blas64.General, alpha, beta []float64, u, v, q blas64.General, work []float64, lwork int, iwork []int) (k, l int, ok bool) { - return lapack64.Dggsvd3(jobU, jobV, jobQ, a.Rows, a.Cols, b.Rows, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride), alpha, beta, u.Data, max(1, u.Stride), v.Data, max(1, v.Stride), q.Data, max(1, q.Stride), work, lwork, iwork) -} - -// Lange computes the matrix norm of the general m×n matrix A. The input norm -// specifies the norm computed. -// lapack.MaxAbs: the maximum absolute value of an element. -// lapack.MaxColumnSum: the maximum column sum of the absolute values of the entries. -// lapack.MaxRowSum: the maximum row sum of the absolute values of the entries. -// lapack.Frobenius: the square root of the sum of the squares of the entries. -// If norm == lapack.MaxColumnSum, work must be of length n, and this function will panic otherwise. -// There are no restrictions on work for the other matrix norms. -func Lange(norm lapack.MatrixNorm, a blas64.General, work []float64) float64 { - return lapack64.Dlange(norm, a.Rows, a.Cols, a.Data, max(1, a.Stride), work) -} - -// Lansy computes the specified norm of an n×n symmetric matrix. If -// norm == lapack.MaxColumnSum or norm == lapackMaxRowSum work must have length -// at least n and this function will panic otherwise. -// There are no restrictions on work for the other matrix norms. -func Lansy(norm lapack.MatrixNorm, a blas64.Symmetric, work []float64) float64 { - return lapack64.Dlansy(norm, a.Uplo, a.N, a.Data, max(1, a.Stride), work) -} - -// Lantr computes the specified norm of an m×n trapezoidal matrix A. If -// norm == lapack.MaxColumnSum work must have length at least n and this function -// will panic otherwise. There are no restrictions on work for the other matrix norms. -func Lantr(norm lapack.MatrixNorm, a blas64.Triangular, work []float64) float64 { - return lapack64.Dlantr(norm, a.Uplo, a.Diag, a.N, a.N, a.Data, max(1, a.Stride), work) -} - -// Lapmt rearranges the columns of the m×n matrix X as specified by the -// permutation k_0, k_1, ..., k_{n-1} of the integers 0, ..., n-1. -// -// If forward is true a forward permutation is performed: -// -// X[0:m, k[j]] is moved to X[0:m, j] for j = 0, 1, ..., n-1. -// -// otherwise a backward permutation is performed: -// -// X[0:m, j] is moved to X[0:m, k[j]] for j = 0, 1, ..., n-1. -// -// k must have length n, otherwise Lapmt will panic. k is zero-indexed. -func Lapmt(forward bool, x blas64.General, k []int) { - lapack64.Dlapmt(forward, x.Rows, x.Cols, x.Data, max(1, x.Stride), k) -} - -// Ormlq multiplies the matrix C by the othogonal matrix Q defined by -// A and tau. A and tau are as returned from Gelqf. -// C = Q * C if side == blas.Left and trans == blas.NoTrans -// C = Q^T * C if side == blas.Left and trans == blas.Trans -// C = C * Q if side == blas.Right and trans == blas.NoTrans -// C = C * Q^T if side == blas.Right and trans == blas.Trans -// If side == blas.Left, A is a matrix of side k×m, and if side == blas.Right -// A is of size k×n. This uses a blocked algorithm. -// -// Work is temporary storage, and lwork specifies the usable memory length. -// At minimum, lwork >= m if side == blas.Left and lwork >= n if side == blas.Right, -// and this function will panic otherwise. -// Ormlq uses a block algorithm, but the block size is limited -// by the temporary space available. If lwork == -1, instead of performing Ormlq, -// the optimal work length will be stored into work[0]. -// -// Tau contains the Householder scales and must have length at least k, and -// this function will panic otherwise. -func Ormlq(side blas.Side, trans blas.Transpose, a blas64.General, tau []float64, c blas64.General, work []float64, lwork int) { - lapack64.Dormlq(side, trans, c.Rows, c.Cols, a.Rows, a.Data, max(1, a.Stride), tau, c.Data, max(1, c.Stride), work, lwork) -} - -// Ormqr multiplies an m×n matrix C by an orthogonal matrix Q as -// C = Q * C, if side == blas.Left and trans == blas.NoTrans, -// C = Q^T * C, if side == blas.Left and trans == blas.Trans, -// C = C * Q, if side == blas.Right and trans == blas.NoTrans, -// C = C * Q^T, if side == blas.Right and trans == blas.Trans, -// where Q is defined as the product of k elementary reflectors -// Q = H_0 * H_1 * ... * H_{k-1}. -// -// If side == blas.Left, A is an m×k matrix and 0 <= k <= m. -// If side == blas.Right, A is an n×k matrix and 0 <= k <= n. -// The ith column of A contains the vector which defines the elementary -// reflector H_i and tau[i] contains its scalar factor. tau must have length k -// and Ormqr will panic otherwise. Geqrf returns A and tau in the required -// form. -// -// work must have length at least max(1,lwork), and lwork must be at least n if -// side == blas.Left and at least m if side == blas.Right, otherwise Ormqr will -// panic. -// -// work is temporary storage, and lwork specifies the usable memory length. At -// minimum, lwork >= m if side == blas.Left and lwork >= n if side == -// blas.Right, and this function will panic otherwise. Larger values of lwork -// will generally give better performance. On return, work[0] will contain the -// optimal value of lwork. -// -// If lwork is -1, instead of performing Ormqr, the optimal workspace size will -// be stored into work[0]. -func Ormqr(side blas.Side, trans blas.Transpose, a blas64.General, tau []float64, c blas64.General, work []float64, lwork int) { - lapack64.Dormqr(side, trans, c.Rows, c.Cols, a.Cols, a.Data, max(1, a.Stride), tau, c.Data, max(1, c.Stride), work, lwork) -} - -// Pocon estimates the reciprocal of the condition number of a positive-definite -// matrix A given the Cholesky decmposition of A. The condition number computed -// is based on the 1-norm and the ∞-norm. -// -// anorm is the 1-norm and the ∞-norm of the original matrix A. -// -// work is a temporary data slice of length at least 3*n and Pocon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Pocon will panic otherwise. -func Pocon(a blas64.Symmetric, anorm float64, work []float64, iwork []int) float64 { - return lapack64.Dpocon(a.Uplo, a.N, a.Data, max(1, a.Stride), anorm, work, iwork) -} - -// Syev computes all eigenvalues and, optionally, the eigenvectors of a real -// symmetric matrix A. -// -// w contains the eigenvalues in ascending order upon return. w must have length -// at least n, and Syev will panic otherwise. -// -// On entry, a contains the elements of the symmetric matrix A in the triangular -// portion specified by uplo. If jobz == lapack.EVCompute, a contains the -// orthonormal eigenvectors of A on exit, otherwise jobz must be lapack.EVNone -// and on exit the specified triangular region is overwritten. -// -// Work is temporary storage, and lwork specifies the usable memory length. At minimum, -// lwork >= 3*n-1, and Syev will panic otherwise. The amount of blocking is -// limited by the usable length. If lwork == -1, instead of computing Syev the -// optimal work length is stored into work[0]. -func Syev(jobz lapack.EVJob, a blas64.Symmetric, w, work []float64, lwork int) (ok bool) { - return lapack64.Dsyev(jobz, a.Uplo, a.N, a.Data, max(1, a.Stride), w, work, lwork) -} - -// Trcon estimates the reciprocal of the condition number of a triangular matrix A. -// The condition number computed may be based on the 1-norm or the ∞-norm. -// -// work is a temporary data slice of length at least 3*n and Trcon will panic otherwise. -// -// iwork is a temporary data slice of length at least n and Trcon will panic otherwise. -func Trcon(norm lapack.MatrixNorm, a blas64.Triangular, work []float64, iwork []int) float64 { - return lapack64.Dtrcon(norm, a.Uplo, a.Diag, a.N, a.Data, max(1, a.Stride), work, iwork) -} - -// Trtri computes the inverse of a triangular matrix, storing the result in place -// into a. -// -// Trtri will not perform the inversion if the matrix is singular, and returns -// a boolean indicating whether the inversion was successful. -func Trtri(a blas64.Triangular) (ok bool) { - return lapack64.Dtrtri(a.Uplo, a.Diag, a.N, a.Data, max(1, a.Stride)) -} - -// Trtrs solves a triangular system of the form A * X = B or A^T * X = B. Trtrs -// returns whether the solve completed successfully. If A is singular, no solve is performed. -func Trtrs(trans blas.Transpose, a blas64.Triangular, b blas64.General) (ok bool) { - return lapack64.Dtrtrs(a.Uplo, trans, a.Diag, a.N, b.Cols, a.Data, max(1, a.Stride), b.Data, max(1, b.Stride)) -} - -// Geev computes the eigenvalues and, optionally, the left and/or right -// eigenvectors for an n×n real nonsymmetric matrix A. -// -// The right eigenvector v_j of A corresponding to an eigenvalue λ_j -// is defined by -// A v_j = λ_j v_j, -// and the left eigenvector u_j corresponding to an eigenvalue λ_j is defined by -// u_j^H A = λ_j u_j^H, -// where u_j^H is the conjugate transpose of u_j. -// -// On return, A will be overwritten and the left and right eigenvectors will be -// stored, respectively, in the columns of the n×n matrices VL and VR in the -// same order as their eigenvalues. If the j-th eigenvalue is real, then -// u_j = VL[:,j], -// v_j = VR[:,j], -// and if it is not real, then j and j+1 form a complex conjugate pair and the -// eigenvectors can be recovered as -// u_j = VL[:,j] + i*VL[:,j+1], -// u_{j+1} = VL[:,j] - i*VL[:,j+1], -// v_j = VR[:,j] + i*VR[:,j+1], -// v_{j+1} = VR[:,j] - i*VR[:,j+1], -// where i is the imaginary unit. The computed eigenvectors are normalized to -// have Euclidean norm equal to 1 and largest component real. -// -// Left eigenvectors will be computed only if jobvl == lapack.LeftEVCompute, -// otherwise jobvl must be lapack.LeftEVNone. -// Right eigenvectors will be computed only if jobvr == lapack.RightEVCompute, -// otherwise jobvr must be lapack.RightEVNone. -// For other values of jobvl and jobvr Geev will panic. -// -// On return, wr and wi will contain the real and imaginary parts, respectively, -// of the computed eigenvalues. Complex conjugate pairs of eigenvalues appear -// consecutively with the eigenvalue having the positive imaginary part first. -// wr and wi must have length n, and Geev will panic otherwise. -// -// work must have length at least lwork and lwork must be at least max(1,4*n) if -// the left or right eigenvectors are computed, and at least max(1,3*n) if no -// eigenvectors are computed. For good performance, lwork must generally be -// larger. On return, optimal value of lwork will be stored in work[0]. -// -// If lwork == -1, instead of performing Geev, the function only calculates the -// optimal vaule of lwork and stores it into work[0]. -// -// On return, first will be the index of the first valid eigenvalue. -// If first == 0, all eigenvalues and eigenvectors have been computed. -// If first is positive, Geev failed to compute all the eigenvalues, no -// eigenvectors have been computed and wr[first:] and wi[first:] contain those -// eigenvalues which have converged. -func Geev(jobvl lapack.LeftEVJob, jobvr lapack.RightEVJob, a blas64.General, wr, wi []float64, vl, vr blas64.General, work []float64, lwork int) (first int) { - n := a.Rows - if a.Cols != n { - panic("lapack64: matrix not square") - } - if jobvl == lapack.LeftEVCompute && (vl.Rows != n || vl.Cols != n) { - panic("lapack64: bad size of VL") - } - if jobvr == lapack.RightEVCompute && (vr.Rows != n || vr.Cols != n) { - panic("lapack64: bad size of VR") - } - return lapack64.Dgeev(jobvl, jobvr, n, a.Data, max(1, a.Stride), wr, wi, vl.Data, max(1, vl.Stride), vr.Data, max(1, vr.Stride), work, lwork) -} diff --git a/vendor/gonum.org/v1/gonum/mat/README.md b/vendor/gonum.org/v1/gonum/mat/README.md deleted file mode 100644 index 0f77e470e..000000000 --- a/vendor/gonum.org/v1/gonum/mat/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Gonum matrix [![GoDoc](https://godoc.org/gonum.org/v1/gonum/mat?status.svg)](https://godoc.org/gonum.org/v1/gonum/mat) - -Package mat is a matrix package for the Go language. diff --git a/vendor/gonum.org/v1/gonum/mat/band.go b/vendor/gonum.org/v1/gonum/mat/band.go deleted file mode 100644 index 72ebefddd..000000000 --- a/vendor/gonum.org/v1/gonum/mat/band.go +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - bandDense *BandDense - _ Matrix = bandDense - _ Banded = bandDense - _ RawBander = bandDense - - _ NonZeroDoer = bandDense - _ RowNonZeroDoer = bandDense - _ ColNonZeroDoer = bandDense -) - -// BandDense represents a band matrix in dense storage format. -type BandDense struct { - mat blas64.Band -} - -// Banded is a band matrix representation. -type Banded interface { - Matrix - // Bandwidth returns the lower and upper bandwidth values for - // the matrix. The total bandwidth of the matrix is kl+ku+1. - Bandwidth() (kl, ku int) - - // TBand is the equivalent of the T() method in the Matrix - // interface but guarantees the transpose is of banded type. - TBand() Banded -} - -// A RawBander can return a blas64.Band representation of the receiver. -// Changes to the blas64.Band.Data slice will be reflected in the original -// matrix, changes to the Rows, Cols, KL, KU and Stride fields will not. -type RawBander interface { - RawBand() blas64.Band -} - -// A MutableBanded can set elements of a band matrix. -type MutableBanded interface { - Banded - SetBand(i, j int, v float64) -} - -var ( - _ Matrix = TransposeBand{} - _ Banded = TransposeBand{} - _ UntransposeBander = TransposeBand{} -) - -// TransposeBand is a type for performing an implicit transpose of a band -// matrix. It implements the Banded interface, returning values from the -// transpose of the matrix within. -type TransposeBand struct { - Banded Banded -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Banded field. -func (t TransposeBand) At(i, j int) float64 { - return t.Banded.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. -func (t TransposeBand) Dims() (r, c int) { - c, r = t.Banded.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Banded field. -func (t TransposeBand) T() Matrix { - return t.Banded -} - -// Bandwidth returns the lower and upper bandwidth values for -// the transposed matrix. -func (t TransposeBand) Bandwidth() (kl, ku int) { - kl, ku = t.Banded.Bandwidth() - return ku, kl -} - -// TBand performs an implicit transpose by returning the Banded field. -func (t TransposeBand) TBand() Banded { - return t.Banded -} - -// Untranspose returns the Banded field. -func (t TransposeBand) Untranspose() Matrix { - return t.Banded -} - -// UntransposeBand returns the Banded field. -func (t TransposeBand) UntransposeBand() Banded { - return t.Banded -} - -// NewBandDense creates a new Band matrix with r rows and c columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == min(r, c+kl)*(kl+ku+1), -// data is used as the backing slice, and changes to the elements of the returned -// BandDense will be reflected in data. If neither of these is true, NewBandDense -// will panic. kl must be at least zero and less r, and ku must be at least zero and -// less than c, otherwise NewBandDense will panic. -// NewBandDense will panic if either r or c is zero. -// -// The data must be arranged in row-major order constructed by removing the zeros -// from the rows outside the band and aligning the diagonals. For example, the matrix -// 1 2 3 0 0 0 -// 4 5 6 7 0 0 -// 0 8 9 10 11 0 -// 0 0 12 13 14 15 -// 0 0 0 16 17 18 -// 0 0 0 0 19 20 -// becomes (* entries are never accessed) -// * 1 2 3 -// 4 5 6 7 -// 8 9 10 11 -// 12 13 14 15 -// 16 17 18 * -// 19 20 * * -// which is passed to NewBandDense as []float64{*, 1, 2, 3, 4, ...} with kl=1 and ku=2. -// Only the values in the band portion of the matrix are used. -func NewBandDense(r, c, kl, ku int, data []float64) *BandDense { - if r <= 0 || c <= 0 || kl < 0 || ku < 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if kl+1 > r || ku+1 > c { - panic("mat: band out of range") - } - bc := kl + ku + 1 - if data != nil && len(data) != min(r, c+kl)*bc { - panic(ErrShape) - } - if data == nil { - data = make([]float64, min(r, c+kl)*bc) - } - return &BandDense{ - mat: blas64.Band{ - Rows: r, - Cols: c, - KL: kl, - KU: ku, - Stride: bc, - Data: data, - }, - } -} - -// NewDiagonalRect is a convenience function that returns a diagonal matrix represented by a -// BandDense. The length of data must be min(r, c) otherwise NewDiagonalRect will panic. -func NewDiagonalRect(r, c int, data []float64) *BandDense { - return NewBandDense(r, c, 0, 0, data) -} - -// Dims returns the number of rows and columns in the matrix. -func (b *BandDense) Dims() (r, c int) { - return b.mat.Rows, b.mat.Cols -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -func (b *BandDense) Bandwidth() (kl, ku int) { - return b.mat.KL, b.mat.KU -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (b *BandDense) T() Matrix { - return Transpose{b} -} - -// TBand performs an implicit transpose by returning the receiver inside a TransposeBand. -func (b *BandDense) TBand() Banded { - return TransposeBand{b} -} - -// RawBand returns the underlying blas64.Band used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Band. -func (b *BandDense) RawBand() blas64.Band { - return b.mat -} - -// SetRawBand sets the underlying blas64.Band used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -func (b *BandDense) SetRawBand(mat blas64.Band) { - b.mat = mat -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (b *BandDense) DiagView() Diagonal { - n := min(b.mat.Rows, b.mat.Cols) - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: b.mat.Stride, - Data: b.mat.Data[b.mat.KL : (n-1)*b.mat.Stride+b.mat.KL+1], - }, - } -} - -// DoNonZero calls the function fn for each of the non-zero elements of b. The function fn -// takes a row/column index and the element value of b at (i, j). -func (b *BandDense) DoNonZero(fn func(i, j int, v float64)) { - for i := 0; i < min(b.mat.Rows, b.mat.Cols+b.mat.KL); i++ { - for j := max(0, i-b.mat.KL); j < min(b.mat.Cols, i+b.mat.KU+1); j++ { - v := b.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// DoRowNonZero calls the function fn for each of the non-zero elements of row i of b. The function fn -// takes a row/column index and the element value of b at (i, j). -func (b *BandDense) DoRowNonZero(i int, fn func(i, j int, v float64)) { - if i < 0 || b.mat.Rows <= i { - panic(ErrRowAccess) - } - for j := max(0, i-b.mat.KL); j < min(b.mat.Cols, i+b.mat.KU+1); j++ { - v := b.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} - -// DoColNonZero calls the function fn for each of the non-zero elements of column j of b. The function fn -// takes a row/column index and the element value of b at (i, j). -func (b *BandDense) DoColNonZero(j int, fn func(i, j int, v float64)) { - if j < 0 || b.mat.Cols <= j { - panic(ErrColAccess) - } - for i := 0; i < min(b.mat.Rows, b.mat.Cols+b.mat.KL); i++ { - if i-b.mat.KL <= j && j < i+b.mat.KU+1 { - v := b.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// Zero sets all of the matrix elements to zero. -func (b *BandDense) Zero() { - m := b.mat.Rows - kL := b.mat.KL - nCol := b.mat.KU + 1 + kL - for i := 0; i < m; i++ { - l := max(0, kL-i) - u := min(nCol, m+kL-i) - zero(b.mat.Data[i*b.mat.Stride+l : i*b.mat.Stride+u]) - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/cdense.go b/vendor/gonum.org/v1/gonum/mat/cdense.go deleted file mode 100644 index 9c29d1afd..000000000 --- a/vendor/gonum.org/v1/gonum/mat/cdense.go +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright ©2019 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import "gonum.org/v1/gonum/blas/cblas128" - -// Dense is a dense matrix representation with complex data. -type CDense struct { - mat cblas128.General - - capRows, capCols int -} - -// Dims returns the number of rows and columns in the matrix. -func (m *CDense) Dims() (r, c int) { - return m.mat.Rows, m.mat.Cols -} - -// H performs an implicit conjugate transpose by returning the receiver inside a -// Conjugate. -func (m *CDense) H() CMatrix { - return Conjugate{m} -} - -// NewCDense creates a new complex Dense matrix with r rows and c columns. -// If data == nil, a new slice is allocated for the backing slice. -// If len(data) == r*c, data is used as the backing slice, and changes to the -// elements of the returned CDense will be reflected in data. -// If neither of these is true, NewCDense will panic. -// NewCDense will panic if either r or c is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -func NewCDense(r, c int, data []complex128) *CDense { - if r <= 0 || c <= 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && r*c != len(data) { - panic(ErrShape) - } - if data == nil { - data = make([]complex128, r*c) - } - return &CDense{ - mat: cblas128.General{ - Rows: r, - Cols: c, - Stride: c, - Data: data, - }, - capRows: r, - capCols: c, - } -} - -// reuseAs resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. -// -// reuseAs must be kept in sync with reuseAsZeroed. -func (m *CDense) reuseAs(r, c int) { - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsZero() { - m.mat = cblas128.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useC(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } -} - -func (m *CDense) reuseAsZeroed(r, c int) { - // This must be kept in-sync with reuseAs. - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsZero() { - m.mat = cblas128.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useZeroedC(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } - m.Zero() -} - -// Reset zeros the dimensions of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (m *CDense) Reset() { - // Row, Cols and Stride must be zeroed in unison. - m.mat.Rows, m.mat.Cols, m.mat.Stride = 0, 0, 0 - m.capRows, m.capCols = 0, 0 - m.mat.Data = m.mat.Data[:0] -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. CDense matrices can be zeroed using Reset. -func (m *CDense) IsZero() bool { - // It must be the case that m.Dims() returns - // zeros in this case. See comment in Reset(). - return m.mat.Stride == 0 -} - -// Zero sets all of the matrix elements to zero. -func (m *CDense) Zero() { - r := m.mat.Rows - c := m.mat.Cols - for i := 0; i < r; i++ { - zeroC(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - } -} - -// Copy makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two matrices and -// returns the number of rows and columns it copied. If a aliases the receiver -// and is a transposed Dense or VecDense, with a non-unitary increment, Copy will -// panic. -// -// See the Copier interface for more information. -func (m *CDense) Copy(a CMatrix) (r, c int) { - r, c = a.Dims() - if a == m { - return r, c - } - r = min(r, m.mat.Rows) - c = min(c, m.mat.Cols) - if r == 0 || c == 0 { - return 0, 0 - } - // TODO(btracey): Check for overlap when complex version exists. - // TODO(btracey): Add fast-paths. - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - m.set(i, j, a.At(i, j)) - } - } - return r, c -} diff --git a/vendor/gonum.org/v1/gonum/mat/cholesky.go b/vendor/gonum.org/v1/gonum/mat/cholesky.go deleted file mode 100644 index bee438538..000000000 --- a/vendor/gonum.org/v1/gonum/mat/cholesky.go +++ /dev/null @@ -1,673 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const ( - badTriangle = "mat: invalid triangle" - badCholesky = "mat: invalid Cholesky factorization" -) - -var ( - _ Matrix = (*Cholesky)(nil) - _ Symmetric = (*Cholesky)(nil) -) - -// Cholesky is a symmetric positive definite matrix represented by its -// Cholesky decomposition. -// -// The decomposition can be constructed using the Factorize method. The -// factorization itself can be extracted using the UTo or LTo methods, and the -// original symmetric matrix can be recovered with ToSym. -// -// Note that this matrix representation is useful for certain operations, in -// particular finding solutions to linear equations. It is very inefficient -// at other operations, in particular At is slow. -// -// Cholesky methods may only be called on a value that has been successfully -// initialized by a call to Factorize that has returned true. Calls to methods -// of an unsuccessful Cholesky factorization will panic. -type Cholesky struct { - // The chol pointer must never be retained as a pointer outside the Cholesky - // struct, either by returning chol outside the struct or by setting it to - // a pointer coming from outside. The same prohibition applies to the data - // slice within chol. - chol *TriDense - cond float64 -} - -// updateCond updates the condition number of the Cholesky decomposition. If -// norm > 0, then that norm is used as the norm of the original matrix A, otherwise -// the norm is estimated from the decomposition. -func (c *Cholesky) updateCond(norm float64) { - n := c.chol.mat.N - work := getFloats(3*n, false) - defer putFloats(work) - if norm < 0 { - // This is an approximation. By the definition of a norm, - // |AB| <= |A| |B|. - // Since A = U^T*U, we get for the condition number κ that - // κ(A) := |A| |A^-1| = |U^T*U| |A^-1| <= |U^T| |U| |A^-1|, - // so this will overestimate the condition number somewhat. - // The norm of the original factorized matrix cannot be stored - // because of update possibilities. - unorm := lapack64.Lantr(CondNorm, c.chol.mat, work) - lnorm := lapack64.Lantr(CondNormTrans, c.chol.mat, work) - norm = unorm * lnorm - } - sym := c.chol.asSymBlas() - iwork := getInts(n, false) - v := lapack64.Pocon(sym, norm, work, iwork) - putInts(iwork) - c.cond = 1 / v -} - -// Dims returns the dimensions of the matrix. -func (ch *Cholesky) Dims() (r, c int) { - if !ch.valid() { - panic(badCholesky) - } - r, c = ch.chol.Dims() - return r, c -} - -// At returns the element at row i, column j. -func (c *Cholesky) At(i, j int) float64 { - if !c.valid() { - panic(badCholesky) - } - n := c.Symmetric() - if uint(i) >= uint(n) { - panic(ErrRowAccess) - } - if uint(j) >= uint(n) { - panic(ErrColAccess) - } - - var val float64 - for k := 0; k <= min(i, j); k++ { - val += c.chol.at(k, i) * c.chol.at(k, j) - } - return val -} - -// T returns the the receiver, the transpose of a symmetric matrix. -func (c *Cholesky) T() Matrix { - return c -} - -// Symmetric implements the Symmetric interface and returns the number of rows -// in the matrix (this is also the number of columns). -func (c *Cholesky) Symmetric() int { - r, _ := c.chol.Dims() - return r -} - -// Cond returns the condition number of the factorized matrix. -func (c *Cholesky) Cond() float64 { - if !c.valid() { - panic(badCholesky) - } - return c.cond -} - -// Factorize calculates the Cholesky decomposition of the matrix A and returns -// whether the matrix is positive definite. If Factorize returns false, the -// factorization must not be used. -func (c *Cholesky) Factorize(a Symmetric) (ok bool) { - n := a.Symmetric() - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else { - c.chol = NewTriDense(n, Upper, use(c.chol.mat.Data, n*n)) - } - copySymIntoTriangle(c.chol, a) - - sym := c.chol.asSymBlas() - work := getFloats(c.chol.mat.N, false) - norm := lapack64.Lansy(CondNorm, sym, work) - putFloats(work) - _, ok = lapack64.Potrf(sym) - if ok { - c.updateCond(norm) - } else { - c.Reset() - } - return ok -} - -// Reset resets the factorization so that it can be reused as the receiver of a -// dimensionally restricted operation. -func (c *Cholesky) Reset() { - if c.chol != nil { - c.chol.Reset() - } - c.cond = math.Inf(1) -} - -// SetFromU sets the Cholesky decomposition from the given triangular matrix. -// SetFromU panics if t is not upper triangular. Note that t is copied into, -// not stored inside, the receiver. -func (c *Cholesky) SetFromU(t *TriDense) { - n, kind := t.Triangle() - if kind != Upper { - panic("cholesky: matrix must be upper triangular") - } - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else { - c.chol = NewTriDense(n, Upper, use(c.chol.mat.Data, n*n)) - } - c.chol.Copy(t) - c.updateCond(-1) -} - -// Clone makes a copy of the input Cholesky into the receiver, overwriting the -// previous value of the receiver. Clone does not place any restrictions on receiver -// shape. Clone panics if the input Cholesky is not the result of a valid decomposition. -func (c *Cholesky) Clone(chol *Cholesky) { - if !chol.valid() { - panic(badCholesky) - } - n := chol.Symmetric() - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else { - c.chol = NewTriDense(n, Upper, use(c.chol.mat.Data, n*n)) - } - c.chol.Copy(chol.chol) - c.cond = chol.cond -} - -// Det returns the determinant of the matrix that has been factorized. -func (c *Cholesky) Det() float64 { - if !c.valid() { - panic(badCholesky) - } - return math.Exp(c.LogDet()) -} - -// LogDet returns the log of the determinant of the matrix that has been factorized. -func (c *Cholesky) LogDet() float64 { - if !c.valid() { - panic(badCholesky) - } - var det float64 - for i := 0; i < c.chol.mat.N; i++ { - det += 2 * math.Log(c.chol.mat.Data[i*c.chol.mat.Stride+i]) - } - return det -} - -// SolveTo finds the matrix X that solves A * X = B where A is represented -// by the Cholesky decomposition. The result is stored in-place into dst. -func (c *Cholesky) SolveTo(dst *Dense, b Matrix) error { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - bm, bn := b.Dims() - if n != bm { - panic(ErrShape) - } - - dst.reuseAs(bm, bn) - if b != dst { - dst.Copy(b) - } - lapack64.Potrs(c.chol.mat, dst.mat) - if c.cond > ConditionTolerance { - return Condition(c.cond) - } - return nil -} - -// SolveCholTo finds the matrix X that solves A * X = B where A and B are represented -// by their Cholesky decompositions a and b. The result is stored in-place into -// dst. -func (a *Cholesky) SolveCholTo(dst *Dense, b *Cholesky) error { - if !a.valid() || !b.valid() { - panic(badCholesky) - } - bn := b.chol.mat.N - if a.chol.mat.N != bn { - panic(ErrShape) - } - - dst.reuseAsZeroed(bn, bn) - dst.Copy(b.chol.T()) - blas64.Trsm(blas.Left, blas.Trans, 1, a.chol.mat, dst.mat) - blas64.Trsm(blas.Left, blas.NoTrans, 1, a.chol.mat, dst.mat) - blas64.Trmm(blas.Right, blas.NoTrans, 1, b.chol.mat, dst.mat) - if a.cond > ConditionTolerance { - return Condition(a.cond) - } - return nil -} - -// SolveVecTo finds the vector X that solves A * x = b where A is represented -// by the Cholesky decomposition. The result is stored in-place into -// dst. -func (c *Cholesky) SolveVecTo(dst *VecDense, b Vector) error { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if br, bc := b.Dims(); br != n || bc != 1 { - panic(ErrShape) - } - switch rv := b.(type) { - default: - dst.reuseAs(n) - return c.SolveTo(dst.asDense(), b) - case RawVectorer: - bmat := rv.RawVector() - if dst != b { - dst.checkOverlap(bmat) - } - dst.reuseAs(n) - if dst != b { - dst.CopyVec(b) - } - lapack64.Potrs(c.chol.mat, dst.asGeneral()) - if c.cond > ConditionTolerance { - return Condition(c.cond) - } - return nil - } -} - -// RawU returns the Triangular matrix used to store the Cholesky decomposition of -// the original matrix A. The returned matrix should not be modified. If it is -// modified, the decomposition is invalid and should not be used. -func (c *Cholesky) RawU() Triangular { - return c.chol -} - -// UTo extracts the n×n upper triangular matrix U from a Cholesky -// decomposition into dst and returns the result. If dst is nil a new -// TriDense is allocated. -// A = U^T * U. -func (c *Cholesky) UTo(dst *TriDense) *TriDense { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if dst == nil { - dst = NewTriDense(n, Upper, make([]float64, n*n)) - } else { - dst.reuseAs(n, Upper) - } - dst.Copy(c.chol) - return dst -} - -// LTo extracts the n×n lower triangular matrix L from a Cholesky -// decomposition into dst and returns the result. If dst is nil a new -// TriDense is allocated. -// A = L * L^T. -func (c *Cholesky) LTo(dst *TriDense) *TriDense { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if dst == nil { - dst = NewTriDense(n, Lower, make([]float64, n*n)) - } else { - dst.reuseAs(n, Lower) - } - dst.Copy(c.chol.TTri()) - return dst -} - -// ToSym reconstructs the original positive definite matrix given its -// Cholesky decomposition into dst and returns the result. If dst is nil -// a new SymDense is allocated. -func (c *Cholesky) ToSym(dst *SymDense) *SymDense { - if !c.valid() { - panic(badCholesky) - } - n := c.chol.mat.N - if dst == nil { - dst = NewSymDense(n, nil) - } else { - dst.reuseAs(n) - } - // Create a TriDense representing the Cholesky factor U with dst's - // backing slice. - // Operations on u are reflected in s. - u := &TriDense{ - mat: blas64.Triangular{ - Uplo: blas.Upper, - Diag: blas.NonUnit, - N: n, - Data: dst.mat.Data, - Stride: dst.mat.Stride, - }, - cap: n, - } - u.Copy(c.chol) - // Compute the product U^T*U using the algorithm from LAPACK/TESTING/LIN/dpot01.f - a := u.mat.Data - lda := u.mat.Stride - bi := blas64.Implementation() - for k := n - 1; k >= 0; k-- { - a[k*lda+k] = bi.Ddot(k+1, a[k:], lda, a[k:], lda) - if k > 0 { - bi.Dtrmv(blas.Upper, blas.Trans, blas.NonUnit, k, a, lda, a[k:], lda) - } - } - return dst -} - -// InverseTo computes the inverse of the matrix represented by its Cholesky -// factorization and stores the result into s. If the factorized -// matrix is ill-conditioned, a Condition error will be returned. -// Note that matrix inversion is numerically unstable, and should generally be -// avoided where possible, for example by using the Solve routines. -func (c *Cholesky) InverseTo(s *SymDense) error { - if !c.valid() { - panic(badCholesky) - } - s.reuseAs(c.chol.mat.N) - // Create a TriDense representing the Cholesky factor U with the backing - // slice from s. - // Operations on u are reflected in s. - u := &TriDense{ - mat: blas64.Triangular{ - Uplo: blas.Upper, - Diag: blas.NonUnit, - N: s.mat.N, - Data: s.mat.Data, - Stride: s.mat.Stride, - }, - cap: s.mat.N, - } - u.Copy(c.chol) - - _, ok := lapack64.Potri(u.mat) - if !ok { - return Condition(math.Inf(1)) - } - if c.cond > ConditionTolerance { - return Condition(c.cond) - } - return nil -} - -// Scale multiplies the original matrix A by a positive constant using -// its Cholesky decomposition, storing the result in-place into the receiver. -// That is, if the original Cholesky factorization is -// U^T * U = A -// the updated factorization is -// U'^T * U' = f A = A' -// Scale panics if the constant is non-positive, or if the receiver is non-zero -// and is of a different size from the input. -func (c *Cholesky) Scale(f float64, orig *Cholesky) { - if !orig.valid() { - panic(badCholesky) - } - if f <= 0 { - panic("cholesky: scaling by a non-positive constant") - } - n := orig.Symmetric() - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else if c.chol.mat.N != n { - panic(ErrShape) - } - c.chol.ScaleTri(math.Sqrt(f), orig.chol) - c.cond = orig.cond // Scaling by a positive constant does not change the condition number. -} - -// ExtendVecSym computes the Cholesky decomposition of the original matrix A, -// whose Cholesky decomposition is in a, extended by a the n×1 vector v according to -// [A w] -// [w' k] -// where k = v[n-1] and w = v[:n-1]. The result is stored into the receiver. -// In order for the updated matrix to be positive definite, it must be the case -// that k > w' A^-1 w. If this condition does not hold then ExtendVecSym will -// return false and the receiver will not be updated. -// -// ExtendVecSym will panic if v.Len() != a.Symmetric()+1 or if a does not contain -// a valid decomposition. -func (c *Cholesky) ExtendVecSym(a *Cholesky, v Vector) (ok bool) { - n := a.Symmetric() - - if v.Len() != n+1 { - panic(badSliceLength) - } - if !a.valid() { - panic(badCholesky) - } - - // The algorithm is commented here, but see also - // https://math.stackexchange.com/questions/955874/cholesky-factor-when-adding-a-row-and-column-to-already-factorized-matrix - // We have A and want to compute the Cholesky of - // [A w] - // [w' k] - // We want - // [U c] - // [0 d] - // to be the updated Cholesky, and so it must be that - // [A w] = [U' 0] [U c] - // [w' k] [c' d] [0 d] - // Thus, we need - // 1) A = U'U (true by the original decomposition being valid), - // 2) U' * c = w => c = U'^-1 w - // 3) c'*c + d'*d = k => d = sqrt(k-c'*c) - - // First, compute c = U'^-1 a - // TODO(btracey): Replace this with CopyVec when issue 167 is fixed. - w := NewVecDense(n, nil) - for i := 0; i < n; i++ { - w.SetVec(i, v.At(i, 0)) - } - k := v.At(n, 0) - - var t VecDense - t.SolveVec(a.chol.T(), w) - - dot := Dot(&t, &t) - if dot >= k { - return false - } - d := math.Sqrt(k - dot) - - newU := NewTriDense(n+1, Upper, nil) - newU.Copy(a.chol) - for i := 0; i < n; i++ { - newU.SetTri(i, n, t.At(i, 0)) - } - newU.SetTri(n, n, d) - c.chol = newU - c.updateCond(-1) - return true -} - -// SymRankOne performs a rank-1 update of the original matrix A and refactorizes -// its Cholesky factorization, storing the result into the receiver. That is, if -// in the original Cholesky factorization -// U^T * U = A, -// in the updated factorization -// U'^T * U' = A + alpha * x * x^T = A'. -// -// Note that when alpha is negative, the updating problem may be ill-conditioned -// and the results may be inaccurate, or the updated matrix A' may not be -// positive definite and not have a Cholesky factorization. SymRankOne returns -// whether the updated matrix A' is positive definite. -// -// SymRankOne updates a Cholesky factorization in O(n²) time. The Cholesky -// factorization computation from scratch is O(n³). -func (c *Cholesky) SymRankOne(orig *Cholesky, alpha float64, x Vector) (ok bool) { - if !orig.valid() { - panic(badCholesky) - } - n := orig.Symmetric() - if r, c := x.Dims(); r != n || c != 1 { - panic(ErrShape) - } - if orig != c { - if c.chol == nil { - c.chol = NewTriDense(n, Upper, nil) - } else if c.chol.mat.N != n { - panic(ErrShape) - } - c.chol.Copy(orig.chol) - } - - if alpha == 0 { - return true - } - - // Algorithms for updating and downdating the Cholesky factorization are - // described, for example, in - // - J. J. Dongarra, J. R. Bunch, C. B. Moler, G. W. Stewart: LINPACK - // Users' Guide. SIAM (1979), pages 10.10--10.14 - // or - // - P. E. Gill, G. H. Golub, W. Murray, and M. A. Saunders: Methods for - // modifying matrix factorizations. Mathematics of Computation 28(126) - // (1974), Method C3 on page 521 - // - // The implementation is based on LINPACK code - // http://www.netlib.org/linpack/dchud.f - // http://www.netlib.org/linpack/dchdd.f - // and - // https://icl.cs.utk.edu/lapack-forum/viewtopic.php?f=2&t=2646 - // - // According to http://icl.cs.utk.edu/lapack-forum/archives/lapack/msg00301.html - // LINPACK is released under BSD license. - // - // See also: - // - M. A. Saunders: Large-scale Linear Programming Using the Cholesky - // Factorization. Technical Report Stanford University (1972) - // http://i.stanford.edu/pub/cstr/reports/cs/tr/72/252/CS-TR-72-252.pdf - // - Matthias Seeger: Low rank updates for the Cholesky decomposition. - // EPFL Technical Report 161468 (2004) - // http://infoscience.epfl.ch/record/161468 - - work := getFloats(n, false) - defer putFloats(work) - var xmat blas64.Vector - if rv, ok := x.(RawVectorer); ok { - xmat = rv.RawVector() - } else { - var tmp *VecDense - tmp.CopyVec(x) - xmat = tmp.RawVector() - } - blas64.Copy(xmat, blas64.Vector{N: n, Data: work, Inc: 1}) - - if alpha > 0 { - // Compute rank-1 update. - if alpha != 1 { - blas64.Scal(math.Sqrt(alpha), blas64.Vector{N: n, Data: work, Inc: 1}) - } - umat := c.chol.mat - stride := umat.Stride - for i := 0; i < n; i++ { - // Compute parameters of the Givens matrix that zeroes - // the i-th element of x. - c, s, r, _ := blas64.Rotg(umat.Data[i*stride+i], work[i]) - if r < 0 { - // Multiply by -1 to have positive diagonal - // elemnts. - r *= -1 - c *= -1 - s *= -1 - } - umat.Data[i*stride+i] = r - if i < n-1 { - // Multiply the extended factorization matrix by - // the Givens matrix from the left. Only - // the i-th row and x are modified. - blas64.Rot( - blas64.Vector{N: n - i - 1, Data: umat.Data[i*stride+i+1 : i*stride+n], Inc: 1}, - blas64.Vector{N: n - i - 1, Data: work[i+1 : n], Inc: 1}, - c, s) - } - } - c.updateCond(-1) - return true - } - - // Compute rank-1 downdate. - alpha = math.Sqrt(-alpha) - if alpha != 1 { - blas64.Scal(alpha, blas64.Vector{N: n, Data: work, Inc: 1}) - } - // Solve U^T * p = x storing the result into work. - ok = lapack64.Trtrs(blas.Trans, c.chol.RawTriangular(), blas64.General{ - Rows: n, - Cols: 1, - Stride: 1, - Data: work, - }) - if !ok { - // The original matrix is singular. Should not happen, because - // the factorization is valid. - panic(badCholesky) - } - norm := blas64.Nrm2(blas64.Vector{N: n, Data: work, Inc: 1}) - if norm >= 1 { - // The updated matrix is not positive definite. - return false - } - norm = math.Sqrt((1 + norm) * (1 - norm)) - cos := getFloats(n, false) - defer putFloats(cos) - sin := getFloats(n, false) - defer putFloats(sin) - for i := n - 1; i >= 0; i-- { - // Compute parameters of Givens matrices that zero elements of p - // backwards. - cos[i], sin[i], norm, _ = blas64.Rotg(norm, work[i]) - if norm < 0 { - norm *= -1 - cos[i] *= -1 - sin[i] *= -1 - } - } - umat := c.chol.mat - stride := umat.Stride - for i := n - 1; i >= 0; i-- { - work[i] = 0 - // Apply Givens matrices to U. - // TODO(vladimir-ch): Use workspace to avoid modifying the - // receiver in case an invalid factorization is created. - blas64.Rot( - blas64.Vector{N: n - i, Data: work[i:n], Inc: 1}, - blas64.Vector{N: n - i, Data: umat.Data[i*stride+i : i*stride+n], Inc: 1}, - cos[i], sin[i]) - if umat.Data[i*stride+i] == 0 { - // The matrix is singular (may rarely happen due to - // floating-point effects?). - ok = false - } else if umat.Data[i*stride+i] < 0 { - // Diagonal elements should be positive. If it happens - // that on the i-th row the diagonal is negative, - // multiply U from the left by an identity matrix that - // has -1 on the i-th row. - blas64.Scal(-1, blas64.Vector{N: n - i, Data: umat.Data[i*stride+i : i*stride+n], Inc: 1}) - } - } - if ok { - c.updateCond(-1) - } else { - c.Reset() - } - return ok -} - -func (c *Cholesky) valid() bool { - return c.chol != nil && !c.chol.IsZero() -} diff --git a/vendor/gonum.org/v1/gonum/mat/cmatrix.go b/vendor/gonum.org/v1/gonum/mat/cmatrix.go deleted file mode 100644 index 6219c28aa..000000000 --- a/vendor/gonum.org/v1/gonum/mat/cmatrix.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - "math/cmplx" - - "gonum.org/v1/gonum/floats" -) - -// CMatrix is the basic matrix interface type for complex matrices. -type CMatrix interface { - // Dims returns the dimensions of a Matrix. - Dims() (r, c int) - - // At returns the value of a matrix element at row i, column j. - // It will panic if i or j are out of bounds for the matrix. - At(i, j int) complex128 - - // H returns the conjugate transpose of the Matrix. Whether H - // returns a copy of the underlying data is implementation dependent. - // This method may be implemented using the Conjugate type, which - // provides an implicit matrix conjugate transpose. - H() CMatrix -} - -var ( - _ CMatrix = Conjugate{} - _ Unconjugator = Conjugate{} -) - -// Conjugate is a type for performing an implicit matrix conjugate transpose. -// It implements the Matrix interface, returning values from the conjugate -// transpose of the matrix within. -type Conjugate struct { - CMatrix CMatrix -} - -// At returns the value of the element at row i and column j of the conjugate -// transposed matrix, that is, row j and column i of the Matrix field. -func (t Conjugate) At(i, j int) complex128 { - z := t.CMatrix.At(j, i) - return cmplx.Conj(z) -} - -// Dims returns the dimensions of the transposed matrix. The number of rows returned -// is the number of columns in the Matrix field, and the number of columns is -// the number of rows in the Matrix field. -func (t Conjugate) Dims() (r, c int) { - c, r = t.CMatrix.Dims() - return r, c -} - -// H performs an implicit conjugate transpose by returning the Matrix field. -func (t Conjugate) H() CMatrix { - return t.CMatrix -} - -// Unconjugate returns the Matrix field. -func (t Conjugate) Unconjugate() CMatrix { - return t.CMatrix -} - -// Unconjugator is a type that can undo an implicit conjugate transpose. -type Unconjugator interface { - // Note: This interface is needed to unify all of the Conjugate types. In - // the cmat128 methods, we need to test if the Matrix has been implicitly - // transposed. If this is checked by testing for the specific Conjugate type - // then the behavior will be different if the user uses H() or HTri() for a - // triangular matrix. - - // Unconjugate returns the underlying Matrix stored for the implicit - // conjugate transpose. - Unconjugate() CMatrix -} - -// useC returns a complex128 slice with l elements, using c if it -// has the necessary capacity, otherwise creating a new slice. -func useC(c []complex128, l int) []complex128 { - if l <= cap(c) { - return c[:l] - } - return make([]complex128, l) -} - -// useZeroedC returns a complex128 slice with l elements, using c if it -// has the necessary capacity, otherwise creating a new slice. The -// elements of the returned slice are guaranteed to be zero. -func useZeroedC(c []complex128, l int) []complex128 { - if l <= cap(c) { - c = c[:l] - zeroC(c) - return c - } - return make([]complex128, l) -} - -// zeroC zeros the given slice's elements. -func zeroC(c []complex128) { - for i := range c { - c[i] = 0 - } -} - -// unconjugate unconjugates a matrix if applicable. If a is an Unconjugator, then -// unconjugate returns the underlying matrix and true. If it is not, then it returns -// the input matrix and false. -func unconjugate(a CMatrix) (CMatrix, bool) { - if ut, ok := a.(Unconjugator); ok { - return ut.Unconjugate(), true - } - return a, false -} - -// CEqual returns whether the matrices a and b have the same size -// and are element-wise equal. -func CEqual(a, b CMatrix) bool { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - // TODO(btracey): Add in fast-paths. - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if a.At(i, j) != b.At(i, j) { - return false - } - } - } - return true -} - -// CEqualApprox returns whether the matrices a and b have the same size and contain all equal -// elements with tolerance for element-wise equality specified by epsilon. Matrices -// with non-equal shapes are not equal. -func CEqualApprox(a, b CMatrix, epsilon float64) bool { - // TODO(btracey): - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if !cEqualWithinAbsOrRel(a.At(i, j), b.At(i, j), epsilon, epsilon) { - return false - } - } - } - return true -} - -// TODO(btracey): Move these into a cmplxs if/when we have one. - -func cEqualWithinAbsOrRel(a, b complex128, absTol, relTol float64) bool { - if cEqualWithinAbs(a, b, absTol) { - return true - } - return cEqualWithinRel(a, b, relTol) -} - -// cEqualWithinAbs returns true if a and b have an absolute -// difference of less than tol. -func cEqualWithinAbs(a, b complex128, tol float64) bool { - return a == b || cmplx.Abs(a-b) <= tol -} - -const minNormalFloat64 = 2.2250738585072014e-308 - -// cEqualWithinRel returns true if the difference between a and b -// is not greater than tol times the greater value. -func cEqualWithinRel(a, b complex128, tol float64) bool { - if a == b { - return true - } - if cmplx.IsNaN(a) || cmplx.IsNaN(b) { - return false - } - // Cannot play the same trick as in floats because there are multiple - // possible infinities. - if cmplx.IsInf(a) { - if !cmplx.IsInf(b) { - return false - } - ra := real(a) - if math.IsInf(ra, 0) { - if ra == real(b) { - return floats.EqualWithinRel(imag(a), imag(b), tol) - } - return false - } - if imag(a) == imag(b) { - return floats.EqualWithinRel(ra, real(b), tol) - } - return false - } - if cmplx.IsInf(b) { - return false - } - - delta := cmplx.Abs(a - b) - if delta <= minNormalFloat64 { - return delta <= tol*minNormalFloat64 - } - return delta/math.Max(cmplx.Abs(a), cmplx.Abs(b)) <= tol -} diff --git a/vendor/gonum.org/v1/gonum/mat/consts.go b/vendor/gonum.org/v1/gonum/mat/consts.go deleted file mode 100644 index 3de3f5bf4..000000000 --- a/vendor/gonum.org/v1/gonum/mat/consts.go +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright ©2016 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -// TriKind represents the triangularity of the matrix. -type TriKind bool - -const ( - // Upper specifies an upper triangular matrix. - Upper TriKind = true - // Lower specifies a lower triangular matrix. - Lower TriKind = false -) diff --git a/vendor/gonum.org/v1/gonum/mat/dense.go b/vendor/gonum.org/v1/gonum/mat/dense.go deleted file mode 100644 index 87b1105ca..000000000 --- a/vendor/gonum.org/v1/gonum/mat/dense.go +++ /dev/null @@ -1,558 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - dense *Dense - - _ Matrix = dense - _ Mutable = dense - - _ Cloner = dense - _ RowViewer = dense - _ ColViewer = dense - _ RawRowViewer = dense - _ Grower = dense - - _ RawMatrixSetter = dense - _ RawMatrixer = dense - - _ Reseter = dense -) - -// Dense is a dense matrix representation. -type Dense struct { - mat blas64.General - - capRows, capCols int -} - -// NewDense creates a new Dense matrix with r rows and c columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == r*c, data is -// used as the backing slice, and changes to the elements of the returned Dense -// will be reflected in data. If neither of these is true, NewDense will panic. -// NewDense will panic if either r or c is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -func NewDense(r, c int, data []float64) *Dense { - if r <= 0 || c <= 0 { - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && r*c != len(data) { - panic(ErrShape) - } - if data == nil { - data = make([]float64, r*c) - } - return &Dense{ - mat: blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: data, - }, - capRows: r, - capCols: c, - } -} - -// reuseAs resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. -// -// reuseAs must be kept in sync with reuseAsZeroed. -func (m *Dense) reuseAs(r, c int) { - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsZero() { - m.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: use(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } -} - -// reuseAsZeroed resizes an empty matrix to a r×c matrix, -// or checks that a non-empty matrix is r×c. It zeroes -// all the elements of the matrix. -// -// reuseAsZeroed must be kept in sync with reuseAs. -func (m *Dense) reuseAsZeroed(r, c int) { - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - if m.IsZero() { - m.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useZeroed(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - return - } - if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } - m.Zero() -} - -// Zero sets all of the matrix elements to zero. -func (m *Dense) Zero() { - r := m.mat.Rows - c := m.mat.Cols - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - } -} - -// isolatedWorkspace returns a new dense matrix w with the size of a and -// returns a callback to defer which performs cleanup at the return of the call. -// This should be used when a method receiver is the same pointer as an input argument. -func (m *Dense) isolatedWorkspace(a Matrix) (w *Dense, restore func()) { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrZeroLength) - } - w = getWorkspace(r, c, false) - return w, func() { - m.Copy(w) - putWorkspace(w) - } -} - -// Reset zeros the dimensions of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (m *Dense) Reset() { - // Row, Cols and Stride must be zeroed in unison. - m.mat.Rows, m.mat.Cols, m.mat.Stride = 0, 0, 0 - m.capRows, m.capCols = 0, 0 - m.mat.Data = m.mat.Data[:0] -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. Dense matrices can be zeroed using Reset. -func (m *Dense) IsZero() bool { - // It must be the case that m.Dims() returns - // zeros in this case. See comment in Reset(). - return m.mat.Stride == 0 -} - -// asTriDense returns a TriDense with the given size and side. The backing data -// of the TriDense is the same as the receiver. -func (m *Dense) asTriDense(n int, diag blas.Diag, uplo blas.Uplo) *TriDense { - return &TriDense{ - mat: blas64.Triangular{ - N: n, - Stride: m.mat.Stride, - Data: m.mat.Data, - Uplo: uplo, - Diag: diag, - }, - cap: n, - } -} - -// DenseCopyOf returns a newly allocated copy of the elements of a. -func DenseCopyOf(a Matrix) *Dense { - d := &Dense{} - d.Clone(a) - return d -} - -// SetRawMatrix sets the underlying blas64.General used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in b. -func (m *Dense) SetRawMatrix(b blas64.General) { - m.capRows, m.capCols = b.Rows, b.Cols - m.mat = b -} - -// RawMatrix returns the underlying blas64.General used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.General. -func (m *Dense) RawMatrix() blas64.General { return m.mat } - -// Dims returns the number of rows and columns in the matrix. -func (m *Dense) Dims() (r, c int) { return m.mat.Rows, m.mat.Cols } - -// Caps returns the number of rows and columns in the backing matrix. -func (m *Dense) Caps() (r, c int) { return m.capRows, m.capCols } - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (m *Dense) T() Matrix { - return Transpose{m} -} - -// ColView returns a Vector reflecting the column j, backed by the matrix data. -// -// See ColViewer for more information. -func (m *Dense) ColView(j int) Vector { - var v VecDense - v.ColViewOf(m, j) - return &v -} - -// SetCol sets the values in the specified column of the matrix to the values -// in src. len(src) must equal the number of rows in the receiver. -func (m *Dense) SetCol(j int, src []float64) { - if j >= m.mat.Cols || j < 0 { - panic(ErrColAccess) - } - if len(src) != m.mat.Rows { - panic(ErrColLength) - } - - blas64.Copy( - blas64.Vector{N: m.mat.Rows, Inc: 1, Data: src}, - blas64.Vector{N: m.mat.Rows, Inc: m.mat.Stride, Data: m.mat.Data[j:]}, - ) -} - -// SetRow sets the values in the specified rows of the matrix to the values -// in src. len(src) must equal the number of columns in the receiver. -func (m *Dense) SetRow(i int, src []float64) { - if i >= m.mat.Rows || i < 0 { - panic(ErrRowAccess) - } - if len(src) != m.mat.Cols { - panic(ErrRowLength) - } - - copy(m.rawRowView(i), src) -} - -// RowView returns row i of the matrix data represented as a column vector, -// backed by the matrix data. -// -// See RowViewer for more information. -func (m *Dense) RowView(i int) Vector { - var v VecDense - v.RowViewOf(m, i) - return &v -} - -// RawRowView returns a slice backed by the same array as backing the -// receiver. -func (m *Dense) RawRowView(i int) []float64 { - if i >= m.mat.Rows || i < 0 { - panic(ErrRowAccess) - } - return m.rawRowView(i) -} - -func (m *Dense) rawRowView(i int) []float64 { - return m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+m.mat.Cols] -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (m *Dense) DiagView() Diagonal { - n := min(m.mat.Rows, m.mat.Cols) - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: m.mat.Stride + 1, - Data: m.mat.Data[:(n-1)*m.mat.Stride+n], - }, - } -} - -// Slice returns a new Matrix that shares backing data with the receiver. -// The returned matrix starts at {i,j} of the receiver and extends k-i rows -// and l-j columns. The final row in the resulting matrix is k-1 and the -// final column is l-1. -// Slice panics with ErrIndexOutOfRange if the slice is outside the capacity -// of the receiver. -func (m *Dense) Slice(i, k, j, l int) Matrix { - mr, mc := m.Caps() - if i < 0 || mr <= i || j < 0 || mc <= j || k < i || mr < k || l < j || mc < l { - if i == k || j == l { - panic(ErrZeroLength) - } - panic(ErrIndexOutOfRange) - } - t := *m - t.mat.Data = t.mat.Data[i*t.mat.Stride+j : (k-1)*t.mat.Stride+l] - t.mat.Rows = k - i - t.mat.Cols = l - j - t.capRows -= i - t.capCols -= j - return &t -} - -// Grow returns the receiver expanded by r rows and c columns. If the dimensions -// of the expanded matrix are outside the capacities of the receiver a new -// allocation is made, otherwise not. Note the receiver itself is not modified -// during the call to Grow. -func (m *Dense) Grow(r, c int) Matrix { - if r < 0 || c < 0 { - panic(ErrIndexOutOfRange) - } - if r == 0 && c == 0 { - return m - } - - r += m.mat.Rows - c += m.mat.Cols - - var t Dense - switch { - case m.mat.Rows == 0 || m.mat.Cols == 0: - t.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - // We zero because we don't know how the matrix will be used. - // In other places, the mat is immediately filled with a result; - // this is not the case here. - Data: useZeroed(m.mat.Data, r*c), - } - case r > m.capRows || c > m.capCols: - cr := max(r, m.capRows) - cc := max(c, m.capCols) - t.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: cc, - Data: make([]float64, cr*cc), - } - t.capRows = cr - t.capCols = cc - // Copy the complete matrix over to the new matrix. - // Including elements not currently visible. Use a temporary structure - // to avoid modifying the receiver. - var tmp Dense - tmp.mat = blas64.General{ - Rows: m.mat.Rows, - Cols: m.mat.Cols, - Stride: m.mat.Stride, - Data: m.mat.Data, - } - tmp.capRows = m.capRows - tmp.capCols = m.capCols - t.Copy(&tmp) - return &t - default: - t.mat = blas64.General{ - Data: m.mat.Data[:(r-1)*m.mat.Stride+c], - Rows: r, - Cols: c, - Stride: m.mat.Stride, - } - } - t.capRows = r - t.capCols = c - return &t -} - -// Clone makes a copy of a into the receiver, overwriting the previous value of -// the receiver. The clone operation does not make any restriction on shape and -// will not cause shadowing. -// -// See the Cloner interface for more information. -func (m *Dense) Clone(a Matrix) { - r, c := a.Dims() - mat := blas64.General{ - Rows: r, - Cols: c, - Stride: c, - } - m.capRows, m.capCols = r, c - - aU, trans := untranspose(a) - switch aU := aU.(type) { - case RawMatrixer: - amat := aU.RawMatrix() - mat.Data = make([]float64, r*c) - if trans { - for i := 0; i < r; i++ { - blas64.Copy(blas64.Vector{N: c, Inc: amat.Stride, Data: amat.Data[i : i+(c-1)*amat.Stride+1]}, - blas64.Vector{N: c, Inc: 1, Data: mat.Data[i*c : (i+1)*c]}) - } - } else { - for i := 0; i < r; i++ { - copy(mat.Data[i*c:(i+1)*c], amat.Data[i*amat.Stride:i*amat.Stride+c]) - } - } - case *VecDense: - amat := aU.mat - mat.Data = make([]float64, aU.mat.N) - blas64.Copy(blas64.Vector{N: aU.mat.N, Inc: amat.Inc, Data: amat.Data}, - blas64.Vector{N: aU.mat.N, Inc: 1, Data: mat.Data}) - default: - mat.Data = make([]float64, r*c) - w := *m - w.mat = mat - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - w.set(i, j, a.At(i, j)) - } - } - *m = w - return - } - m.mat = mat -} - -// Copy makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two matrices and -// returns the number of rows and columns it copied. If a aliases the receiver -// and is a transposed Dense or VecDense, with a non-unitary increment, Copy will -// panic. -// -// See the Copier interface for more information. -func (m *Dense) Copy(a Matrix) (r, c int) { - r, c = a.Dims() - if a == m { - return r, c - } - r = min(r, m.mat.Rows) - c = min(c, m.mat.Cols) - if r == 0 || c == 0 { - return 0, 0 - } - - aU, trans := untranspose(a) - switch aU := aU.(type) { - case RawMatrixer: - amat := aU.RawMatrix() - if trans { - if amat.Stride != 1 { - m.checkOverlap(amat) - } - for i := 0; i < r; i++ { - blas64.Copy(blas64.Vector{N: c, Inc: amat.Stride, Data: amat.Data[i : i+(c-1)*amat.Stride+1]}, - blas64.Vector{N: c, Inc: 1, Data: m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]}) - } - } else { - switch o := offset(m.mat.Data, amat.Data); { - case o < 0: - for i := r - 1; i >= 0; i-- { - copy(m.mat.Data[i*m.mat.Stride:i*m.mat.Stride+c], amat.Data[i*amat.Stride:i*amat.Stride+c]) - } - case o > 0: - for i := 0; i < r; i++ { - copy(m.mat.Data[i*m.mat.Stride:i*m.mat.Stride+c], amat.Data[i*amat.Stride:i*amat.Stride+c]) - } - default: - // Nothing to do. - } - } - case *VecDense: - var n, stride int - amat := aU.mat - if trans { - if amat.Inc != 1 { - m.checkOverlap(aU.asGeneral()) - } - n = c - stride = 1 - } else { - n = r - stride = m.mat.Stride - } - if amat.Inc == 1 && stride == 1 { - copy(m.mat.Data, amat.Data[:n]) - break - } - switch o := offset(m.mat.Data, amat.Data); { - case o < 0: - blas64.Copy(blas64.Vector{N: n, Inc: -amat.Inc, Data: amat.Data}, - blas64.Vector{N: n, Inc: -stride, Data: m.mat.Data}) - case o > 0: - blas64.Copy(blas64.Vector{N: n, Inc: amat.Inc, Data: amat.Data}, - blas64.Vector{N: n, Inc: stride, Data: m.mat.Data}) - default: - // Nothing to do. - } - default: - m.checkOverlapMatrix(aU) - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - m.set(i, j, a.At(i, j)) - } - } - } - - return r, c -} - -// Stack appends the rows of b onto the rows of a, placing the result into the -// receiver with b placed in the greater indexed rows. Stack will panic if the -// two input matrices do not have the same number of columns or the constructed -// stacked matrix is not the same shape as the receiver. -func (m *Dense) Stack(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ac != bc || m == a || m == b { - panic(ErrShape) - } - - m.reuseAs(ar+br, ac) - - m.Copy(a) - w := m.Slice(ar, ar+br, 0, bc).(*Dense) - w.Copy(b) -} - -// Augment creates the augmented matrix of a and b, where b is placed in the -// greater indexed columns. Augment will panic if the two input matrices do -// not have the same number of rows or the constructed augmented matrix is -// not the same shape as the receiver. -func (m *Dense) Augment(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || m == a || m == b { - panic(ErrShape) - } - - m.reuseAs(ar, ac+bc) - - m.Copy(a) - w := m.Slice(0, br, ac, ac+bc).(*Dense) - w.Copy(b) -} - -// Trace returns the trace of the matrix. The matrix must be square or Trace -// will panic. -func (m *Dense) Trace() float64 { - if m.mat.Rows != m.mat.Cols { - panic(ErrSquare) - } - // TODO(btracey): could use internal asm sum routine. - var v float64 - for i := 0; i < m.mat.Rows; i++ { - v += m.mat.Data[i*m.mat.Stride+i] - } - return v -} diff --git a/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go b/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go deleted file mode 100644 index dd4526f63..000000000 --- a/vendor/gonum.org/v1/gonum/mat/dense_arithmetic.go +++ /dev/null @@ -1,886 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// Add adds a and b element-wise, placing the result in the receiver. Add -// will panic if the two matrices do not have the same shape. -func (m *Dense) Add(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) - - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v + bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)+b.At(r, c)) - } - } -} - -// Sub subtracts the matrix b from a, placing the result in the receiver. Sub -// will panic if the two matrices do not have the same shape. -func (m *Dense) Sub(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) - - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v - bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)-b.At(r, c)) - } - } -} - -// MulElem performs element-wise multiplication of a and b, placing the result -// in the receiver. MulElem will panic if the two matrices do not have the same -// shape. -func (m *Dense) MulElem(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) - - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v * bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)*b.At(r, c)) - } - } -} - -// DivElem performs element-wise division of a by b, placing the result -// in the receiver. DivElem will panic if the two matrices do not have the same -// shape. -func (m *Dense) DivElem(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - panic(ErrShape) - } - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - m.reuseAs(ar, ac) - - if arm, ok := a.(RawMatrixer); ok { - if brm, ok := b.(RawMatrixer); ok { - amat, bmat := arm.RawMatrix(), brm.RawMatrix() - if m != aU { - m.checkOverlap(amat) - } - if m != bU { - m.checkOverlap(bmat) - } - for ja, jb, jm := 0, 0, 0; ja < ar*amat.Stride; ja, jb, jm = ja+amat.Stride, jb+bmat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v / bmat.Data[i+jb] - } - } - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, a.At(r, c)/b.At(r, c)) - } - } -} - -// Inverse computes the inverse of the matrix a, storing the result into the -// receiver. If a is ill-conditioned, a Condition error will be returned. -// Note that matrix inversion is numerically unstable, and should generally -// be avoided where possible, for example by using the Solve routines. -func (m *Dense) Inverse(a Matrix) error { - // TODO(btracey): Special case for RawTriangular, etc. - r, c := a.Dims() - if r != c { - panic(ErrSquare) - } - m.reuseAs(a.Dims()) - aU, aTrans := untranspose(a) - switch rm := aU.(type) { - case RawMatrixer: - if m != aU || aTrans { - if m == aU || m.checkOverlap(rm.RawMatrix()) { - tmp := getWorkspace(r, c, false) - tmp.Copy(a) - m.Copy(tmp) - putWorkspace(tmp) - break - } - m.Copy(a) - } - default: - m.Copy(a) - } - ipiv := getInts(r, false) - defer putInts(ipiv) - ok := lapack64.Getrf(m.mat, ipiv) - if !ok { - return Condition(math.Inf(1)) - } - work := getFloats(4*r, false) // must be at least 4*r for cond. - lapack64.Getri(m.mat, ipiv, work, -1) - if int(work[0]) > 4*r { - l := int(work[0]) - putFloats(work) - work = getFloats(l, false) - } else { - work = work[:4*r] - } - defer putFloats(work) - lapack64.Getri(m.mat, ipiv, work, len(work)) - norm := lapack64.Lange(CondNorm, m.mat, work) - rcond := lapack64.Gecon(CondNorm, m.mat, norm, work, ipiv) // reuse ipiv - if rcond == 0 { - return Condition(math.Inf(1)) - } - cond := 1 / rcond - if cond > ConditionTolerance { - return Condition(cond) - } - return nil -} - -// Mul takes the matrix product of a and b, placing the result in the receiver. -// If the number of columns in a does not equal the number of rows in b, Mul will panic. -func (m *Dense) Mul(a, b Matrix) { - ar, ac := a.Dims() - br, bc := b.Dims() - - if ac != br { - panic(ErrShape) - } - - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - m.reuseAs(ar, bc) - var restore func() - if m == aU { - m, restore = m.isolatedWorkspace(aU) - defer restore() - } else if m == bU { - m, restore = m.isolatedWorkspace(bU) - defer restore() - } - aT := blas.NoTrans - if aTrans { - aT = blas.Trans - } - bT := blas.NoTrans - if bTrans { - bT = blas.Trans - } - - // Some of the cases do not have a transpose option, so create - // temporary memory. - // C = A^T * B = (B^T * A)^T - // C^T = B^T * A. - if aUrm, ok := aU.(RawMatrixer); ok { - amat := aUrm.RawMatrix() - if restore == nil { - m.checkOverlap(amat) - } - if bUrm, ok := bU.(RawMatrixer); ok { - bmat := bUrm.RawMatrix() - if restore == nil { - m.checkOverlap(bmat) - } - blas64.Gemm(aT, bT, 1, amat, bmat, 0, m.mat) - return - } - if bU, ok := bU.(RawSymmetricer); ok { - bmat := bU.RawSymmetric() - if aTrans { - c := getWorkspace(ac, ar, false) - blas64.Symm(blas.Left, 1, bmat, amat, 0, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - blas64.Symm(blas.Right, 1, bmat, amat, 0, m.mat) - return - } - if bU, ok := bU.(RawTriangular); ok { - // Trmm updates in place, so copy aU first. - bmat := bU.RawTriangular() - if aTrans { - c := getWorkspace(ac, ar, false) - var tmp Dense - tmp.SetRawMatrix(amat) - c.Copy(&tmp) - bT := blas.Trans - if bTrans { - bT = blas.NoTrans - } - blas64.Trmm(blas.Left, bT, 1, bmat, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - m.Copy(a) - blas64.Trmm(blas.Right, bT, 1, bmat, m.mat) - return - } - if bU, ok := bU.(*VecDense); ok { - m.checkOverlap(bU.asGeneral()) - bvec := bU.RawVector() - if bTrans { - // {ar,1} x {1,bc}, which is not a vector. - // Instead, construct B as a General. - bmat := blas64.General{ - Rows: bc, - Cols: 1, - Stride: bvec.Inc, - Data: bvec.Data, - } - blas64.Gemm(aT, bT, 1, amat, bmat, 0, m.mat) - return - } - cvec := blas64.Vector{ - Inc: m.mat.Stride, - Data: m.mat.Data, - } - blas64.Gemv(aT, 1, amat, bvec, 0, cvec) - return - } - } - if bUrm, ok := bU.(RawMatrixer); ok { - bmat := bUrm.RawMatrix() - if restore == nil { - m.checkOverlap(bmat) - } - if aU, ok := aU.(RawSymmetricer); ok { - amat := aU.RawSymmetric() - if bTrans { - c := getWorkspace(bc, br, false) - blas64.Symm(blas.Right, 1, amat, bmat, 0, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - blas64.Symm(blas.Left, 1, amat, bmat, 0, m.mat) - return - } - if aU, ok := aU.(RawTriangular); ok { - // Trmm updates in place, so copy bU first. - amat := aU.RawTriangular() - if bTrans { - c := getWorkspace(bc, br, false) - var tmp Dense - tmp.SetRawMatrix(bmat) - c.Copy(&tmp) - aT := blas.Trans - if aTrans { - aT = blas.NoTrans - } - blas64.Trmm(blas.Right, aT, 1, amat, c.mat) - strictCopy(m, c.T()) - putWorkspace(c) - return - } - m.Copy(b) - blas64.Trmm(blas.Left, aT, 1, amat, m.mat) - return - } - if aU, ok := aU.(*VecDense); ok { - m.checkOverlap(aU.asGeneral()) - avec := aU.RawVector() - if aTrans { - // {1,ac} x {ac, bc} - // Transpose B so that the vector is on the right. - cvec := blas64.Vector{ - Inc: 1, - Data: m.mat.Data, - } - bT := blas.Trans - if bTrans { - bT = blas.NoTrans - } - blas64.Gemv(bT, 1, bmat, avec, 0, cvec) - return - } - // {ar,1} x {1,bc} which is not a vector result. - // Instead, construct A as a General. - amat := blas64.General{ - Rows: ar, - Cols: 1, - Stride: avec.Inc, - Data: avec.Data, - } - blas64.Gemm(aT, bT, 1, amat, bmat, 0, m.mat) - return - } - } - - m.checkOverlapMatrix(aU) - m.checkOverlapMatrix(bU) - row := getFloats(ac, false) - defer putFloats(row) - for r := 0; r < ar; r++ { - for i := range row { - row[i] = a.At(r, i) - } - for c := 0; c < bc; c++ { - var v float64 - for i, e := range row { - v += e * b.At(i, c) - } - m.mat.Data[r*m.mat.Stride+c] = v - } - } -} - -// strictCopy copies a into m panicking if the shape of a and m differ. -func strictCopy(m *Dense, a Matrix) { - r, c := m.Copy(a) - if r != m.mat.Rows || c != m.mat.Cols { - // Panic with a string since this - // is not a user-facing panic. - panic(ErrShape.Error()) - } -} - -// Exp calculates the exponential of the matrix a, e^a, placing the result -// in the receiver. Exp will panic with matrix.ErrShape if a is not square. -func (m *Dense) Exp(a Matrix) { - // The implementation used here is from Functions of Matrices: Theory and Computation - // Chapter 10, Algorithm 10.20. https://doi.org/10.1137/1.9780898717778.ch10 - - r, c := a.Dims() - if r != c { - panic(ErrShape) - } - - m.reuseAs(r, r) - if r == 1 { - m.mat.Data[0] = math.Exp(a.At(0, 0)) - return - } - - pade := []struct { - theta float64 - b []float64 - }{ - {theta: 0.015, b: []float64{ - 120, 60, 12, 1, - }}, - {theta: 0.25, b: []float64{ - 30240, 15120, 3360, 420, 30, 1, - }}, - {theta: 0.95, b: []float64{ - 17297280, 8648640, 1995840, 277200, 25200, 1512, 56, 1, - }}, - {theta: 2.1, b: []float64{ - 17643225600, 8821612800, 2075673600, 302702400, 30270240, 2162160, 110880, 3960, 90, 1, - }}, - } - - a1 := m - a1.Copy(a) - v := getWorkspace(r, r, true) - vraw := v.RawMatrix() - n := r * r - vvec := blas64.Vector{N: n, Inc: 1, Data: vraw.Data} - defer putWorkspace(v) - - u := getWorkspace(r, r, true) - uraw := u.RawMatrix() - uvec := blas64.Vector{N: n, Inc: 1, Data: uraw.Data} - defer putWorkspace(u) - - a2 := getWorkspace(r, r, false) - defer putWorkspace(a2) - - n1 := Norm(a, 1) - for i, t := range pade { - if n1 > t.theta { - continue - } - - // This loop only executes once, so - // this is not as horrible as it looks. - p := getWorkspace(r, r, true) - praw := p.RawMatrix() - pvec := blas64.Vector{N: n, Inc: 1, Data: praw.Data} - defer putWorkspace(p) - - for k := 0; k < r; k++ { - p.set(k, k, 1) - v.set(k, k, t.b[0]) - u.set(k, k, t.b[1]) - } - - a2.Mul(a1, a1) - for j := 0; j <= i; j++ { - p.Mul(p, a2) - blas64.Axpy(t.b[2*j+2], pvec, vvec) - blas64.Axpy(t.b[2*j+3], pvec, uvec) - } - u.Mul(a1, u) - - // Use p as a workspace here and - // rename u for the second call's - // receiver. - vmu, vpu := u, p - vpu.Add(v, u) - vmu.Sub(v, u) - - m.Solve(vmu, vpu) - return - } - - // Remaining Padé table line. - const theta13 = 5.4 - b := [...]float64{ - 64764752532480000, 32382376266240000, 7771770303897600, 1187353796428800, - 129060195264000, 10559470521600, 670442572800, 33522128640, - 1323241920, 40840800, 960960, 16380, 182, 1, - } - - s := math.Log2(n1 / theta13) - if s >= 0 { - s = math.Ceil(s) - a1.Scale(1/math.Pow(2, s), a1) - } - a2.Mul(a1, a1) - - i := getWorkspace(r, r, true) - for j := 0; j < r; j++ { - i.set(j, j, 1) - } - iraw := i.RawMatrix() - ivec := blas64.Vector{N: n, Inc: 1, Data: iraw.Data} - defer putWorkspace(i) - - a2raw := a2.RawMatrix() - a2vec := blas64.Vector{N: n, Inc: 1, Data: a2raw.Data} - - a4 := getWorkspace(r, r, false) - a4raw := a4.RawMatrix() - a4vec := blas64.Vector{N: n, Inc: 1, Data: a4raw.Data} - defer putWorkspace(a4) - a4.Mul(a2, a2) - - a6 := getWorkspace(r, r, false) - a6raw := a6.RawMatrix() - a6vec := blas64.Vector{N: n, Inc: 1, Data: a6raw.Data} - defer putWorkspace(a6) - a6.Mul(a2, a4) - - // V = A_6(b_12*A_6 + b_10*A_4 + b_8*A_2) + b_6*A_6 + b_4*A_4 + b_2*A_2 +b_0*I - blas64.Axpy(b[12], a6vec, vvec) - blas64.Axpy(b[10], a4vec, vvec) - blas64.Axpy(b[8], a2vec, vvec) - v.Mul(v, a6) - blas64.Axpy(b[6], a6vec, vvec) - blas64.Axpy(b[4], a4vec, vvec) - blas64.Axpy(b[2], a2vec, vvec) - blas64.Axpy(b[0], ivec, vvec) - - // U = A(A_6(b_13*A_6 + b_11*A_4 + b_9*A_2) + b_7*A_6 + b_5*A_4 + b_2*A_3 +b_1*I) - blas64.Axpy(b[13], a6vec, uvec) - blas64.Axpy(b[11], a4vec, uvec) - blas64.Axpy(b[9], a2vec, uvec) - u.Mul(u, a6) - blas64.Axpy(b[7], a6vec, uvec) - blas64.Axpy(b[5], a4vec, uvec) - blas64.Axpy(b[3], a2vec, uvec) - blas64.Axpy(b[1], ivec, uvec) - u.Mul(u, a1) - - // Use i as a workspace here and - // rename u for the second call's - // receiver. - vmu, vpu := u, i - vpu.Add(v, u) - vmu.Sub(v, u) - - m.Solve(vmu, vpu) - - for ; s > 0; s-- { - m.Mul(m, m) - } -} - -// Pow calculates the integral power of the matrix a to n, placing the result -// in the receiver. Pow will panic if n is negative or if a is not square. -func (m *Dense) Pow(a Matrix, n int) { - if n < 0 { - panic("matrix: illegal power") - } - r, c := a.Dims() - if r != c { - panic(ErrShape) - } - - m.reuseAs(r, c) - - // Take possible fast paths. - switch n { - case 0: - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - m.mat.Data[i*m.mat.Stride+i] = 1 - } - return - case 1: - m.Copy(a) - return - case 2: - m.Mul(a, a) - return - } - - // Perform iterative exponentiation by squaring in work space. - w := getWorkspace(r, r, false) - w.Copy(a) - s := getWorkspace(r, r, false) - s.Copy(a) - x := getWorkspace(r, r, false) - for n--; n > 0; n >>= 1 { - if n&1 != 0 { - x.Mul(w, s) - w, x = x, w - } - if n != 1 { - x.Mul(s, s) - s, x = x, s - } - } - m.Copy(w) - putWorkspace(w) - putWorkspace(s) - putWorkspace(x) -} - -// Scale multiplies the elements of a by f, placing the result in the receiver. -// -// See the Scaler interface for more information. -func (m *Dense) Scale(f float64, a Matrix) { - ar, ac := a.Dims() - - m.reuseAs(ar, ac) - - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - amat := rm.RawMatrix() - if m == aU || m.checkOverlap(amat) { - var restore func() - m, restore = m.isolatedWorkspace(a) - defer restore() - } - if !aTrans { - for ja, jm := 0, 0; ja < ar*amat.Stride; ja, jm = ja+amat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = v * f - } - } - } else { - for ja, jm := 0, 0; ja < ac*amat.Stride; ja, jm = ja+amat.Stride, jm+1 { - for i, v := range amat.Data[ja : ja+ar] { - m.mat.Data[i*m.mat.Stride+jm] = v * f - } - } - } - return - } - - m.checkOverlapMatrix(a) - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, f*a.At(r, c)) - } - } -} - -// Apply applies the function fn to each of the elements of a, placing the -// resulting matrix in the receiver. The function fn takes a row/column -// index and element value and returns some function of that tuple. -func (m *Dense) Apply(fn func(i, j int, v float64) float64, a Matrix) { - ar, ac := a.Dims() - - m.reuseAs(ar, ac) - - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - amat := rm.RawMatrix() - if m == aU || m.checkOverlap(amat) { - var restore func() - m, restore = m.isolatedWorkspace(a) - defer restore() - } - if !aTrans { - for j, ja, jm := 0, 0, 0; ja < ar*amat.Stride; j, ja, jm = j+1, ja+amat.Stride, jm+m.mat.Stride { - for i, v := range amat.Data[ja : ja+ac] { - m.mat.Data[i+jm] = fn(j, i, v) - } - } - } else { - for j, ja, jm := 0, 0, 0; ja < ac*amat.Stride; j, ja, jm = j+1, ja+amat.Stride, jm+1 { - for i, v := range amat.Data[ja : ja+ar] { - m.mat.Data[i*m.mat.Stride+jm] = fn(i, j, v) - } - } - } - return - } - - m.checkOverlapMatrix(a) - for r := 0; r < ar; r++ { - for c := 0; c < ac; c++ { - m.set(r, c, fn(r, c, a.At(r, c))) - } - } -} - -// RankOne performs a rank-one update to the matrix a and stores the result -// in the receiver. If a is zero, see Outer. -// m = a + alpha * x * y' -func (m *Dense) RankOne(a Matrix, alpha float64, x, y Vector) { - ar, ac := a.Dims() - xr, xc := x.Dims() - if xr != ar || xc != 1 { - panic(ErrShape) - } - yr, yc := y.Dims() - if yr != ac || yc != 1 { - panic(ErrShape) - } - - if a != m { - aU, _ := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - m.checkOverlap(rm.RawMatrix()) - } - } - - var xmat, ymat blas64.Vector - fast := true - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat = rv.RawVector() - m.checkOverlap((&VecDense{mat: xmat}).asGeneral()) - } else { - fast = false - } - yU, _ := untranspose(y) - if rv, ok := yU.(RawVectorer); ok { - ymat = rv.RawVector() - m.checkOverlap((&VecDense{mat: ymat}).asGeneral()) - } else { - fast = false - } - - if fast { - if m != a { - m.reuseAs(ar, ac) - m.Copy(a) - } - blas64.Ger(alpha, xmat, ymat, m.mat) - return - } - - m.reuseAs(ar, ac) - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - m.set(i, j, a.At(i, j)+alpha*x.AtVec(i)*y.AtVec(j)) - } - } -} - -// Outer calculates the outer product of the column vectors x and y, -// and stores the result in the receiver. -// m = alpha * x * y' -// In order to update an existing matrix, see RankOne. -func (m *Dense) Outer(alpha float64, x, y Vector) { - xr, xc := x.Dims() - if xc != 1 { - panic(ErrShape) - } - yr, yc := y.Dims() - if yc != 1 { - panic(ErrShape) - } - - r := xr - c := yr - - // Copied from reuseAs with use replaced by useZeroed - // and a final zero of the matrix elements if we pass - // the shape checks. - // TODO(kortschak): Factor out into reuseZeroedAs if - // we find another case that needs it. - if m.mat.Rows > m.capRows || m.mat.Cols > m.capCols { - // Panic as a string, not a mat.Error. - panic("mat: caps not correctly set") - } - if m.IsZero() { - m.mat = blas64.General{ - Rows: r, - Cols: c, - Stride: c, - Data: useZeroed(m.mat.Data, r*c), - } - m.capRows = r - m.capCols = c - } else if r != m.mat.Rows || c != m.mat.Cols { - panic(ErrShape) - } - - var xmat, ymat blas64.Vector - fast := true - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat = rv.RawVector() - m.checkOverlap((&VecDense{mat: xmat}).asGeneral()) - - } else { - fast = false - } - yU, _ := untranspose(y) - if rv, ok := yU.(RawVectorer); ok { - ymat = rv.RawVector() - m.checkOverlap((&VecDense{mat: ymat}).asGeneral()) - } else { - fast = false - } - - if fast { - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+c]) - } - blas64.Ger(alpha, xmat, ymat, m.mat) - return - } - - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - m.set(i, j, alpha*x.AtVec(i)*y.AtVec(j)) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/diagonal.go b/vendor/gonum.org/v1/gonum/mat/diagonal.go deleted file mode 100644 index e9f074a7f..000000000 --- a/vendor/gonum.org/v1/gonum/mat/diagonal.go +++ /dev/null @@ -1,311 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - diagDense *DiagDense - _ Matrix = diagDense - _ Diagonal = diagDense - _ MutableDiagonal = diagDense - _ Triangular = diagDense - _ TriBanded = diagDense - _ Symmetric = diagDense - _ SymBanded = diagDense - _ Banded = diagDense - _ RawBander = diagDense - _ RawSymBander = diagDense - - diag Diagonal - _ Matrix = diag - _ Diagonal = diag - _ Triangular = diag - _ TriBanded = diag - _ Symmetric = diag - _ SymBanded = diag - _ Banded = diag -) - -// Diagonal represents a diagonal matrix, that is a square matrix that only -// has non-zero terms on the diagonal. -type Diagonal interface { - Matrix - // Diag returns the number of rows/columns in the matrix. - Diag() int - - // Bandwidth and TBand are included in the Diagonal interface - // to allow the use of Diagonal types in banded functions. - // Bandwidth will always return (0, 0). - Bandwidth() (kl, ku int) - TBand() Banded - - // Triangle and TTri are included in the Diagonal interface - // to allow the use of Diagonal types in triangular functions. - Triangle() (int, TriKind) - TTri() Triangular - - // Symmetric and SymBand are included in the Diagonal interface - // to allow the use of Diagonal types in symmetric and banded symmetric - // functions respectively. - Symmetric() int - SymBand() (n, k int) - - // TriBand and TTriBand are included in the Diagonal interface - // to allow the use of Diagonal types in triangular banded functions. - TriBand() (n, k int, kind TriKind) - TTriBand() TriBanded -} - -// MutableDiagonal is a Diagonal matrix whose elements can be set. -type MutableDiagonal interface { - Diagonal - SetDiag(i int, v float64) -} - -// DiagDense represents a diagonal matrix in dense storage format. -type DiagDense struct { - mat blas64.Vector -} - -// NewDiagDense creates a new Diagonal matrix with n rows and n columns. -// The length of data must be n or data must be nil, otherwise NewDiagDense -// will panic. NewDiagDense will panic if n is zero. -func NewDiagDense(n int, data []float64) *DiagDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data == nil { - data = make([]float64, n) - } - if len(data) != n { - panic(ErrShape) - } - return &DiagDense{ - mat: blas64.Vector{N: n, Data: data, Inc: 1}, - } -} - -// Diag returns the dimension of the receiver. -func (d *DiagDense) Diag() int { - return d.mat.N -} - -// Dims returns the dimensions of the matrix. -func (d *DiagDense) Dims() (r, c int) { - return d.mat.N, d.mat.N -} - -// T returns the transpose of the matrix. -func (d *DiagDense) T() Matrix { - return d -} - -// TTri returns the transpose of the matrix. Note that Diagonal matrices are -// Upper by default. -func (d *DiagDense) TTri() Triangular { - return TransposeTri{d} -} - -// TBand performs an implicit transpose by returning the receiver inside a -// TransposeBand. -func (d *DiagDense) TBand() Banded { - return TransposeBand{d} -} - -// TTriBand performs an implicit transpose by returning the receiver inside a -// TransposeTriBand. Note that Diagonal matrices are Upper by default. -func (d *DiagDense) TTriBand() TriBanded { - return TransposeTriBand{d} -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -// These values are always zero for diagonal matrices. -func (d *DiagDense) Bandwidth() (kl, ku int) { - return 0, 0 -} - -// Symmetric implements the Symmetric interface. -func (d *DiagDense) Symmetric() int { - return d.mat.N -} - -// SymBand returns the number of rows/columns in the matrix, and the size of -// the bandwidth. -func (d *DiagDense) SymBand() (n, k int) { - return d.mat.N, 0 -} - -// Triangle implements the Triangular interface. -func (d *DiagDense) Triangle() (int, TriKind) { - return d.mat.N, Upper -} - -// TriBand returns the number of rows/columns in the matrix, the -// size of the bandwidth, and the orientation. Note that Diagonal matrices are -// Upper by default. -func (d *DiagDense) TriBand() (n, k int, kind TriKind) { - return d.mat.N, 0, Upper -} - -// Reset zeros the length of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (d *DiagDense) Reset() { - // No change of Inc or n to 0 may be - // made unless both are set to 0. - d.mat.Inc = 0 - d.mat.N = 0 - d.mat.Data = d.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (d *DiagDense) Zero() { - for i := 0; i < d.mat.N; i++ { - d.mat.Data[d.mat.Inc*i] = 0 - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (d *DiagDense) DiagView() Diagonal { - return d -} - -// DiagFrom copies the diagonal of m into the receiver. The receiver must -// be min(r, c) long or zero. Otherwise DiagFrom will panic. -func (d *DiagDense) DiagFrom(m Matrix) { - n := min(m.Dims()) - d.reuseAs(n) - - var vec blas64.Vector - switch r := m.(type) { - case *DiagDense: - vec = r.mat - case RawBander: - mat := r.RawBand() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride, - Data: mat.Data[mat.KL : (n-1)*mat.Stride+mat.KL+1], - } - case RawMatrixer: - mat := r.RawMatrix() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride + 1, - Data: mat.Data[:(n-1)*mat.Stride+n], - } - case RawSymBander: - mat := r.RawSymBand() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride, - Data: mat.Data[:(n-1)*mat.Stride+1], - } - case RawSymmetricer: - mat := r.RawSymmetric() - vec = blas64.Vector{ - N: n, - Inc: mat.Stride + 1, - Data: mat.Data[:(n-1)*mat.Stride+n], - } - case RawTriBander: - mat := r.RawTriBand() - data := mat.Data - if mat.Uplo == blas.Lower { - data = data[mat.K:] - } - vec = blas64.Vector{ - N: n, - Inc: mat.Stride, - Data: data[:(n-1)*mat.Stride+1], - } - case RawTriangular: - mat := r.RawTriangular() - if mat.Diag == blas.Unit { - for i := 0; i < n; i += d.mat.Inc { - d.mat.Data[i] = 1 - } - return - } - vec = blas64.Vector{ - N: n, - Inc: mat.Stride + 1, - Data: mat.Data[:(n-1)*mat.Stride+n], - } - case RawVectorer: - d.mat.Data[0] = r.RawVector().Data[0] - return - default: - for i := 0; i < n; i++ { - d.setDiag(i, m.At(i, i)) - } - return - } - blas64.Copy(vec, d.mat) -} - -// RawBand returns the underlying data used by the receiver represented -// as a blas64.Band. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Band. -func (d *DiagDense) RawBand() blas64.Band { - return blas64.Band{ - Rows: d.mat.N, - Cols: d.mat.N, - KL: 0, - KU: 0, - Stride: d.mat.Inc, - Data: d.mat.Data, - } -} - -// RawSymBand returns the underlying data used by the receiver represented -// as a blas64.SymmetricBand. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.Band. -func (d *DiagDense) RawSymBand() blas64.SymmetricBand { - return blas64.SymmetricBand{ - N: d.mat.N, - K: 0, - Stride: d.mat.Inc, - Uplo: blas.Upper, - Data: d.mat.Data, - } -} - -// reuseAs resizes an empty diagonal to a r×r diagonal, -// or checks that a non-empty matrix is r×r. -func (d *DiagDense) reuseAs(r int) { - if r == 0 { - panic(ErrZeroLength) - } - if d.IsZero() { - d.mat = blas64.Vector{ - Inc: 1, - Data: use(d.mat.Data, r), - } - d.mat.N = r - return - } - if r != d.mat.N { - panic(ErrShape) - } -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized vectors can be the -// receiver for size-restricted operations. DiagDenses can be zeroed using Reset. -func (d *DiagDense) IsZero() bool { - // It must be the case that d.Dims() returns - // zeros in this case. See comment in Reset(). - return d.mat.Inc == 0 -} diff --git a/vendor/gonum.org/v1/gonum/mat/doc.go b/vendor/gonum.org/v1/gonum/mat/doc.go deleted file mode 100644 index 2cc910015..000000000 --- a/vendor/gonum.org/v1/gonum/mat/doc.go +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package mat provides implementations of float64 and complex128 matrix -// structures and linear algebra operations on them. -// -// Overview -// -// This section provides a quick overview of the mat package. The following -// sections provide more in depth commentary. -// -// mat provides: -// - Interfaces for Matrix classes (Matrix, Symmetric, Triangular) -// - Concrete implementations (Dense, SymDense, TriDense) -// - Methods and functions for using matrix data (Add, Trace, SymRankOne) -// - Types for constructing and using matrix factorizations (QR, LU) -// - The complementary types for complex matrices, CMatrix, CSymDense, etc. -// -// A matrix may be constructed through the corresponding New function. If no -// backing array is provided the matrix will be initialized to all zeros. -// // Allocate a zeroed real matrix of size 3×5 -// zero := mat.NewDense(3, 5, nil) -// If a backing data slice is provided, the matrix will have those elements. -// Matrices are all stored in row-major format. -// // Generate a 6×6 matrix of random values. -// data := make([]float64, 36) -// for i := range data { -// data[i] = rand.NormFloat64() -// } -// a := mat.NewDense(6, 6, data) -// Operations involving matrix data are implemented as functions when the values -// of the matrix remain unchanged -// tr := mat.Trace(a) -// and are implemented as methods when the operation modifies the receiver. -// zero.Copy(a) -// -// Receivers must be the correct size for the matrix operations, otherwise the -// operation will panic. As a special case for convenience, a zero-value matrix -// will be modified to have the correct size, allocating data if necessary. -// var c mat.Dense // construct a new zero-sized matrix -// c.Mul(a, a) // c is automatically adjusted to be 6×6 -// -// Zero-value of a matrix -// -// A zero-value matrix is either the Go language definition of a zero-value or -// is a zero-sized matrix with zero-length stride. Matrix implementations may have -// a Reset method to revert the receiver into a zero-valued matrix and an IsZero -// method that returns whether the matrix is zero-valued. -// So the following will all result in a zero-value matrix. -// - var a mat.Dense -// - a := NewDense(0, 0, make([]float64, 0, 100)) -// - a.Reset() -// A zero-value matrix can not be sliced even if it does have an adequately sized -// backing data slice, but can be expanded using its Grow method if it exists. -// -// The Matrix Interfaces -// -// The Matrix interface is the common link between the concrete types of real -// matrices, The Matrix interface is defined by three functions: Dims, which -// returns the dimensions of the Matrix, At, which returns the element in the -// specified location, and T for returning a Transpose (discussed later). All of -// the concrete types can perform these behaviors and so implement the interface. -// Methods and functions are designed to use this interface, so in particular the method -// func (m *Dense) Mul(a, b Matrix) -// constructs a *Dense from the result of a multiplication with any Matrix types, -// not just *Dense. Where more restrictive requirements must be met, there are also the -// Symmetric and Triangular interfaces. For example, in -// func (s *SymDense) AddSym(a, b Symmetric) -// the Symmetric interface guarantees a symmetric result. -// -// The CMatrix interface plays the same role for complex matrices. The difference -// is that the CMatrix type has the H method instead T, for returning the conjugate -// transpose. -// -// (Conjugate) Transposes -// -// The T method is used for transposition on real matrices, and H is used for -// conjugate transposition on complex matrices. For example, c.Mul(a.T(), b) computes -// c = a^T * b. The mat types implement this method implicitly — -// see the Transpose and Conjugate types for more details. Note that some -// operations have a transpose as part of their definition, as in *SymDense.SymOuterK. -// -// Matrix Factorization -// -// Matrix factorizations, such as the LU decomposition, typically have their own -// specific data storage, and so are each implemented as a specific type. The -// factorization can be computed through a call to Factorize -// var lu mat.LU -// lu.Factorize(a) -// The elements of the factorization can be extracted through methods on the -// factorized type, i.e. *LU.UTo. The factorization types can also be used directly, -// as in *Dense.SolveCholesky. Some factorizations can be updated directly, -// without needing to update the original matrix and refactorize, -// as in *LU.RankOne. -// -// BLAS and LAPACK -// -// BLAS and LAPACK are the standard APIs for linear algebra routines. Many -// operations in mat are implemented using calls to the wrapper functions -// in gonum/blas/blas64 and gonum/lapack/lapack64 and their complex equivalents. -// By default, blas64 and lapack64 call the native Go implementations of the -// routines. Alternatively, it is possible to use C-based implementations of the -// APIs through the respective cgo packages and "Use" functions. The Go -// implementation of LAPACK (used by default) makes calls -// through blas64, so if a cgo BLAS implementation is registered, the lapack64 -// calls will be partially executed in Go and partially executed in C. -// -// Type Switching -// -// The Matrix abstraction enables efficiency as well as interoperability. Go's -// type reflection capabilities are used to choose the most efficient routine -// given the specific concrete types. For example, in -// c.Mul(a, b) -// if a and b both implement RawMatrixer, that is, they can be represented as a -// blas64.General, blas64.Gemm (general matrix multiplication) is called, while -// instead if b is a RawSymmetricer blas64.Symm is used (general-symmetric -// multiplication), and if b is a *VecDense blas64.Gemv is used. -// -// There are many possible type combinations and special cases. No specific guarantees -// are made about the performance of any method, and in particular, note that an -// abstract matrix type may be copied into a concrete type of the corresponding -// value. If there are specific special cases that are needed, please submit a -// pull-request or file an issue. -// -// Invariants -// -// Matrix input arguments to functions are never directly modified. If an operation -// changes Matrix data, the mutated matrix will be the receiver of a function. -// -// For convenience, a matrix may be used as both a receiver and as an input, e.g. -// a.Pow(a, 6) -// v.SolveVec(a.T(), v) -// though in many cases this will cause an allocation (see Element Aliasing). -// An exception to this rule is Copy, which does not allow a.Copy(a.T()). -// -// Element Aliasing -// -// Most methods in mat modify receiver data. It is forbidden for the modified -// data region of the receiver to overlap the used data area of the input -// arguments. The exception to this rule is when the method receiver is equal to one -// of the input arguments, as in the a.Pow(a, 6) call above, or its implicit transpose. -// -// This prohibition is to help avoid subtle mistakes when the method needs to read -// from and write to the same data region. There are ways to make mistakes using the -// mat API, and mat functions will detect and complain about those. -// There are many ways to make mistakes by excursion from the mat API via -// interaction with raw matrix values. -// -// If you need to read the rest of this section to understand the behavior of -// your program, you are being clever. Don't be clever. If you must be clever, -// blas64 and lapack64 may be used to call the behavior directly. -// -// mat will use the following rules to detect overlap between the receiver and one -// of the inputs: -// - the input implements one of the Raw methods, and -// - the address ranges of the backing data slices overlap, and -// - the strides differ or there is an overlap in the used data elements. -// If such an overlap is detected, the method will panic. -// -// The following cases will not panic: -// - the data slices do not overlap, -// - there is pointer identity between the receiver and input values after -// the value has been untransposed if necessary. -// -// mat will not attempt to detect element overlap if the input does not implement a -// Raw method. Method behavior is undefined if there is undetected overlap. -// -package mat // import "gonum.org/v1/gonum/mat" diff --git a/vendor/gonum.org/v1/gonum/mat/eigen.go b/vendor/gonum.org/v1/gonum/mat/eigen.go deleted file mode 100644 index ee971e4ae..000000000 --- a/vendor/gonum.org/v1/gonum/mat/eigen.go +++ /dev/null @@ -1,350 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const ( - badFact = "mat: use without successful factorization" - badNoVect = "mat: eigenvectors not computed" -) - -// EigenSym is a type for creating and manipulating the Eigen decomposition of -// symmetric matrices. -type EigenSym struct { - vectorsComputed bool - - values []float64 - vectors *Dense -} - -// Factorize computes the eigenvalue decomposition of the symmetric matrix a. -// The Eigen decomposition is defined as -// A = P * D * P^-1 -// where D is a diagonal matrix containing the eigenvalues of the matrix, and -// P is a matrix of the eigenvectors of A. Factorize computes the eigenvalues -// in ascending order. If the vectors input argument is false, the eigenvectors -// are not computed. -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, methods that require a successful factorization will panic. -func (e *EigenSym) Factorize(a Symmetric, vectors bool) (ok bool) { - // kill previous decomposition - e.vectorsComputed = false - e.values = e.values[:] - - n := a.Symmetric() - sd := NewSymDense(n, nil) - sd.CopySym(a) - - jobz := lapack.EVNone - if vectors { - jobz = lapack.EVCompute - } - w := make([]float64, n) - work := []float64{0} - lapack64.Syev(jobz, sd.mat, w, work, -1) - - work = getFloats(int(work[0]), false) - ok = lapack64.Syev(jobz, sd.mat, w, work, len(work)) - putFloats(work) - if !ok { - e.vectorsComputed = false - e.values = nil - e.vectors = nil - return false - } - e.vectorsComputed = vectors - e.values = w - e.vectors = NewDense(n, n, sd.mat.Data) - return true -} - -// succFact returns whether the receiver contains a successful factorization. -func (e *EigenSym) succFact() bool { - return len(e.values) != 0 -} - -// Values extracts the eigenvalues of the factorized matrix. If dst is -// non-nil, the values are stored in-place into dst. In this case -// dst must have length n, otherwise Values will panic. If dst is -// nil, then a new slice will be allocated of the proper length and filled -// with the eigenvalues. -// -// Values panics if the Eigen decomposition was not successful. -func (e *EigenSym) Values(dst []float64) []float64 { - if !e.succFact() { - panic(badFact) - } - if dst == nil { - dst = make([]float64, len(e.values)) - } - if len(dst) != len(e.values) { - panic(ErrSliceLengthMismatch) - } - copy(dst, e.values) - return dst -} - -// VectorsTo returns the eigenvectors of the decomposition. VectorsTo -// will panic if the eigenvectors were not computed during the factorization, -// or if the factorization was not successful. -// -// If dst is not nil, the eigenvectors are stored in-place into dst, and dst -// must have size n×n and panics otherwise. If dst is nil, a new matrix -// is allocated and returned. -func (e *EigenSym) VectorsTo(dst *Dense) *Dense { - if !e.succFact() { - panic(badFact) - } - if !e.vectorsComputed { - panic(badNoVect) - } - r, c := e.vectors.Dims() - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - dst.Copy(e.vectors) - return dst -} - -// EigenKind specifies the computation of eigenvectors during factorization. -type EigenKind int - -const ( - // EigenNone specifies to not compute any eigenvectors. - EigenNone EigenKind = 0 - // EigenLeft specifies to compute the left eigenvectors. - EigenLeft EigenKind = 1 << iota - // EigenRight specifies to compute the right eigenvectors. - EigenRight - // EigenBoth is a convenience value for computing both eigenvectors. - EigenBoth EigenKind = EigenLeft | EigenRight -) - -// Eigen is a type for creating and using the eigenvalue decomposition of a dense matrix. -type Eigen struct { - n int // The size of the factorized matrix. - - kind EigenKind - - values []complex128 - rVectors *CDense - lVectors *CDense -} - -// succFact returns whether the receiver contains a successful factorization. -func (e *Eigen) succFact() bool { - return e.n != 0 -} - -// Factorize computes the eigenvalues of the square matrix a, and optionally -// the eigenvectors. -// -// A right eigenvalue/eigenvector combination is defined by -// A * x_r = λ * x_r -// where x_r is the column vector called an eigenvector, and λ is the corresponding -// eigenvalue. -// -// Similarly, a left eigenvalue/eigenvector combination is defined by -// x_l * A = λ * x_l -// The eigenvalues, but not the eigenvectors, are the same for both decompositions. -// -// Typically eigenvectors refer to right eigenvectors. -// -// In all cases, Factorize computes the eigenvalues of the matrix. kind -// specifies which of the eigenvectors, if any, to compute. See the EigenKind -// documentation for more information. -// Eigen panics if the input matrix is not square. -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, methods that require a successful factorization will panic. -func (e *Eigen) Factorize(a Matrix, kind EigenKind) (ok bool) { - // kill previous factorization. - e.n = 0 - e.kind = 0 - // Copy a because it is modified during the Lapack call. - r, c := a.Dims() - if r != c { - panic(ErrShape) - } - var sd Dense - sd.Clone(a) - - left := kind&EigenLeft != 0 - right := kind&EigenRight != 0 - - var vl, vr Dense - jobvl := lapack.LeftEVNone - jobvr := lapack.RightEVNone - if left { - vl = *NewDense(r, r, nil) - jobvl = lapack.LeftEVCompute - } - if right { - vr = *NewDense(c, c, nil) - jobvr = lapack.RightEVCompute - } - - wr := getFloats(c, false) - defer putFloats(wr) - wi := getFloats(c, false) - defer putFloats(wi) - - work := []float64{0} - lapack64.Geev(jobvl, jobvr, sd.mat, wr, wi, vl.mat, vr.mat, work, -1) - work = getFloats(int(work[0]), false) - first := lapack64.Geev(jobvl, jobvr, sd.mat, wr, wi, vl.mat, vr.mat, work, len(work)) - putFloats(work) - - if first != 0 { - e.values = nil - return false - } - e.n = r - e.kind = kind - - // Construct complex eigenvalues from float64 data. - values := make([]complex128, r) - for i, v := range wr { - values[i] = complex(v, wi[i]) - } - e.values = values - - // Construct complex eigenvectors from float64 data. - var cvl, cvr CDense - if left { - cvl = *NewCDense(r, r, nil) - e.complexEigenTo(&cvl, &vl) - e.lVectors = &cvl - } else { - e.lVectors = nil - } - if right { - cvr = *NewCDense(c, c, nil) - e.complexEigenTo(&cvr, &vr) - e.rVectors = &cvr - } else { - e.rVectors = nil - } - return true -} - -// Kind returns the EigenKind of the decomposition. If no decomposition has been -// computed, Kind returns -1. -func (e *Eigen) Kind() EigenKind { - if !e.succFact() { - return -1 - } - return e.kind -} - -// Values extracts the eigenvalues of the factorized matrix. If dst is -// non-nil, the values are stored in-place into dst. In this case -// dst must have length n, otherwise Values will panic. If dst is -// nil, then a new slice will be allocated of the proper length and -// filed with the eigenvalues. -// -// Values panics if the Eigen decomposition was not successful. -func (e *Eigen) Values(dst []complex128) []complex128 { - if !e.succFact() { - panic(badFact) - } - if dst == nil { - dst = make([]complex128, e.n) - } - if len(dst) != e.n { - panic(ErrSliceLengthMismatch) - } - copy(dst, e.values) - return dst -} - -// complexEigenTo extracts the complex eigenvectors from the real matrix d -// and stores them into the complex matrix dst. -// -// The columns of the returned n×n dense matrix contain the eigenvectors of the -// decomposition in the same order as the eigenvalues. -// If the j-th eigenvalue is real, then -// dst[:,j] = d[:,j], -// and if it is not real, then the elements of the j-th and (j+1)-th columns of d -// form complex conjugate pairs and the eigenvectors are recovered as -// dst[:,j] = d[:,j] + i*d[:,j+1], -// dst[:,j+1] = d[:,j] - i*d[:,j+1], -// where i is the imaginary unit. -func (e *Eigen) complexEigenTo(dst *CDense, d *Dense) { - r, c := d.Dims() - cr, cc := dst.Dims() - if r != cr { - panic("size mismatch") - } - if c != cc { - panic("size mismatch") - } - for j := 0; j < c; j++ { - if imag(e.values[j]) == 0 { - for i := 0; i < r; i++ { - dst.set(i, j, complex(d.at(i, j), 0)) - } - continue - } - for i := 0; i < r; i++ { - real := d.at(i, j) - imag := d.at(i, j+1) - dst.set(i, j, complex(real, imag)) - dst.set(i, j+1, complex(real, -imag)) - } - j++ - } -} - -// VectorsTo returns the right eigenvectors of the decomposition. VectorsTo -// will panic if the right eigenvectors were not computed during the factorization, -// or if the factorization was not successful. -// -// The computed eigenvectors are normalized to have Euclidean norm equal to 1 -// and largest component real. -func (e *Eigen) VectorsTo(dst *CDense) *CDense { - if !e.succFact() { - panic(badFact) - } - if e.kind&EigenRight == 0 { - panic(badNoVect) - } - if dst == nil { - dst = NewCDense(e.n, e.n, nil) - } else { - dst.reuseAs(e.n, e.n) - } - dst.Copy(e.rVectors) - return dst -} - -// LeftVectorsTo returns the left eigenvectors of the decomposition. LeftVectorsTo -// will panic if the left eigenvectors were not computed during the factorization, -// or if the factorization was not successful. -// -// The computed eigenvectors are normalized to have Euclidean norm equal to 1 -// and largest component real. -func (e *Eigen) LeftVectorsTo(dst *CDense) *CDense { - if !e.succFact() { - panic(badFact) - } - if e.kind&EigenLeft == 0 { - panic(badNoVect) - } - if dst == nil { - dst = NewCDense(e.n, e.n, nil) - } else { - dst.reuseAs(e.n, e.n) - } - dst.Copy(e.lVectors) - return dst -} diff --git a/vendor/gonum.org/v1/gonum/mat/errors.go b/vendor/gonum.org/v1/gonum/mat/errors.go deleted file mode 100644 index 0430d126f..000000000 --- a/vendor/gonum.org/v1/gonum/mat/errors.go +++ /dev/null @@ -1,149 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "fmt" - "runtime" - - "gonum.org/v1/gonum/lapack" -) - -// Condition is the condition number of a matrix. The condition -// number is defined as |A| * |A^-1|. -// -// One important use of Condition is during linear solve routines (finding x such -// that A * x = b). The condition number of A indicates the accuracy of -// the computed solution. A Condition error will be returned if the condition -// number of A is sufficiently large. If A is exactly singular to working precision, -// Condition == ∞, and the solve algorithm may have completed early. If Condition -// is large and finite the solve algorithm will be performed, but the computed -// solution may be innacurate. Due to the nature of finite precision arithmetic, -// the value of Condition is only an approximate test of singularity. -type Condition float64 - -func (c Condition) Error() string { - return fmt.Sprintf("matrix singular or near-singular with condition number %.4e", c) -} - -// ConditionTolerance is the tolerance limit of the condition number. If the -// condition number is above this value, the matrix is considered singular. -const ConditionTolerance = 1e16 - -const ( - // CondNorm is the matrix norm used for computing the condition number by routines - // in the matrix packages. - CondNorm = lapack.MaxRowSum - - // CondNormTrans is the norm used to compute on A^T to get the same result as - // computing CondNorm on A. - CondNormTrans = lapack.MaxColumnSum -) - -const stackTraceBufferSize = 1 << 20 - -// Maybe will recover a panic with a type mat.Error from fn, and return this error -// as the Err field of an ErrorStack. The stack trace for the panicking function will be -// recovered and placed in the StackTrace field. Any other error is re-panicked. -func Maybe(fn func()) (err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(Error); ok { - if e.string == "" { - panic("mat: invalid error") - } - buf := make([]byte, stackTraceBufferSize) - n := runtime.Stack(buf, false) - err = ErrorStack{Err: e, StackTrace: string(buf[:n])} - return - } - panic(r) - } - }() - fn() - return -} - -// MaybeFloat will recover a panic with a type mat.Error from fn, and return this error -// as the Err field of an ErrorStack. The stack trace for the panicking function will be -// recovered and placed in the StackTrace field. Any other error is re-panicked. -func MaybeFloat(fn func() float64) (f float64, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(Error); ok { - if e.string == "" { - panic("mat: invalid error") - } - buf := make([]byte, stackTraceBufferSize) - n := runtime.Stack(buf, false) - err = ErrorStack{Err: e, StackTrace: string(buf[:n])} - return - } - panic(r) - } - }() - return fn(), nil -} - -// MaybeComplex will recover a panic with a type mat.Error from fn, and return this error -// as the Err field of an ErrorStack. The stack trace for the panicking function will be -// recovered and placed in the StackTrace field. Any other error is re-panicked. -func MaybeComplex(fn func() complex128) (f complex128, err error) { - defer func() { - if r := recover(); r != nil { - if e, ok := r.(Error); ok { - if e.string == "" { - panic("mat: invalid error") - } - buf := make([]byte, stackTraceBufferSize) - n := runtime.Stack(buf, false) - err = ErrorStack{Err: e, StackTrace: string(buf[:n])} - return - } - panic(r) - } - }() - return fn(), nil -} - -// Error represents matrix handling errors. These errors can be recovered by Maybe wrappers. -type Error struct{ string } - -func (err Error) Error() string { return err.string } - -var ( - ErrIndexOutOfRange = Error{"matrix: index out of range"} - ErrRowAccess = Error{"matrix: row index out of range"} - ErrColAccess = Error{"matrix: column index out of range"} - ErrVectorAccess = Error{"matrix: vector index out of range"} - ErrZeroLength = Error{"matrix: zero length in matrix dimension"} - ErrRowLength = Error{"matrix: row length mismatch"} - ErrColLength = Error{"matrix: col length mismatch"} - ErrSquare = Error{"matrix: expect square matrix"} - ErrNormOrder = Error{"matrix: invalid norm order for matrix"} - ErrSingular = Error{"matrix: matrix is singular"} - ErrShape = Error{"matrix: dimension mismatch"} - ErrIllegalStride = Error{"matrix: illegal stride"} - ErrPivot = Error{"matrix: malformed pivot list"} - ErrTriangle = Error{"matrix: triangular storage mismatch"} - ErrTriangleSet = Error{"matrix: triangular set out of bounds"} - ErrBandSet = Error{"matrix: band set out of bounds"} - ErrDiagSet = Error{"matrix: diagonal set out of bounds"} - ErrSliceLengthMismatch = Error{"matrix: input slice length mismatch"} - ErrNotPSD = Error{"matrix: input not positive symmetric definite"} - ErrFailedEigen = Error{"matrix: eigendecomposition not successful"} -) - -// ErrorStack represents matrix handling errors that have been recovered by Maybe wrappers. -type ErrorStack struct { - Err error - - // StackTrace is the stack trace - // recovered by Maybe, MaybeFloat - // or MaybeComplex. - StackTrace string -} - -func (err ErrorStack) Error() string { return err.Err.Error() } diff --git a/vendor/gonum.org/v1/gonum/mat/format.go b/vendor/gonum.org/v1/gonum/mat/format.go deleted file mode 100644 index 9b60cb318..000000000 --- a/vendor/gonum.org/v1/gonum/mat/format.go +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "fmt" - "strconv" -) - -// Formatted returns a fmt.Formatter for the matrix m using the given options. -func Formatted(m Matrix, options ...FormatOption) fmt.Formatter { - f := formatter{ - matrix: m, - dot: '.', - } - for _, o := range options { - o(&f) - } - return f -} - -type formatter struct { - matrix Matrix - prefix string - margin int - dot byte - squeeze bool -} - -// FormatOption is a functional option for matrix formatting. -type FormatOption func(*formatter) - -// Prefix sets the formatted prefix to the string p. Prefix is a string that is prepended to -// each line of output. -func Prefix(p string) FormatOption { - return func(f *formatter) { f.prefix = p } -} - -// Excerpt sets the maximum number of rows and columns to print at the margins of the matrix -// to m. If m is zero or less all elements are printed. -func Excerpt(m int) FormatOption { - return func(f *formatter) { f.margin = m } -} - -// DotByte sets the dot character to b. The dot character is used to replace zero elements -// if the result is printed with the fmt ' ' verb flag. Without a DotByte option, the default -// dot character is '.'. -func DotByte(b byte) FormatOption { - return func(f *formatter) { f.dot = b } -} - -// Squeeze sets the printing behaviour to minimise column width for each individual column. -func Squeeze() FormatOption { - return func(f *formatter) { f.squeeze = true } -} - -// Format satisfies the fmt.Formatter interface. -func (f formatter) Format(fs fmt.State, c rune) { - if c == 'v' && fs.Flag('#') { - fmt.Fprintf(fs, "%#v", f.matrix) - return - } - format(f.matrix, f.prefix, f.margin, f.dot, f.squeeze, fs, c) -} - -// format prints a pretty representation of m to the fs io.Writer. The format character c -// specifies the numerical representation of elements; valid values are those for float64 -// specified in the fmt package, with their associated flags. In addition to this, a space -// preceding a verb indicates that zero values should be represented by the dot character. -// The printed range of the matrix can be limited by specifying a positive value for margin; -// If margin is greater than zero, only the first and last margin rows/columns of the matrix -// are output. If squeeze is true, column widths are determined on a per-column basis. -// -// format will not provide Go syntax output. -func format(m Matrix, prefix string, margin int, dot byte, squeeze bool, fs fmt.State, c rune) { - rows, cols := m.Dims() - - var printed int - if margin <= 0 { - printed = rows - if cols > printed { - printed = cols - } - } else { - printed = margin - } - - prec, pOk := fs.Precision() - if !pOk { - prec = -1 - } - - var ( - maxWidth int - widths widther - buf, pad []byte - ) - if squeeze { - widths = make(columnWidth, cols) - } else { - widths = new(uniformWidth) - } - switch c { - case 'v', 'e', 'E', 'f', 'F', 'g', 'G': - if c == 'v' { - buf, maxWidth = maxCellWidth(m, 'g', printed, prec, widths) - } else { - buf, maxWidth = maxCellWidth(m, c, printed, prec, widths) - } - default: - fmt.Fprintf(fs, "%%!%c(%T=Dims(%d, %d))", c, m, rows, cols) - return - } - width, _ := fs.Width() - width = max(width, maxWidth) - pad = make([]byte, max(width, 2)) - for i := range pad { - pad[i] = ' ' - } - - first := true - if rows > 2*printed || cols > 2*printed { - first = false - fmt.Fprintf(fs, "Dims(%d, %d)\n", rows, cols) - } - - skipZero := fs.Flag(' ') - for i := 0; i < rows; i++ { - if !first { - fmt.Fprint(fs, prefix) - } - first = false - var el string - switch { - case rows == 1: - fmt.Fprint(fs, "[") - el = "]" - case i == 0: - fmt.Fprint(fs, "⎡") - el = "⎤\n" - case i < rows-1: - fmt.Fprint(fs, "⎢") - el = "⎥\n" - default: - fmt.Fprint(fs, "⎣") - el = "⎦" - } - - for j := 0; j < cols; j++ { - if j >= printed && j < cols-printed { - j = cols - printed - 1 - if i == 0 || i == rows-1 { - fmt.Fprint(fs, "... ... ") - } else { - fmt.Fprint(fs, " ") - } - continue - } - - v := m.At(i, j) - if v == 0 && skipZero { - buf = buf[:1] - buf[0] = dot - } else { - if c == 'v' { - buf = strconv.AppendFloat(buf[:0], v, 'g', prec, 64) - } else { - buf = strconv.AppendFloat(buf[:0], v, byte(c), prec, 64) - } - } - if fs.Flag('-') { - fs.Write(buf) - fs.Write(pad[:widths.width(j)-len(buf)]) - } else { - fs.Write(pad[:widths.width(j)-len(buf)]) - fs.Write(buf) - } - - if j < cols-1 { - fs.Write(pad[:2]) - } - } - - fmt.Fprint(fs, el) - - if i >= printed-1 && i < rows-printed && 2*printed < rows { - i = rows - printed - 1 - fmt.Fprintf(fs, "%s .\n%[1]s .\n%[1]s .\n", prefix) - continue - } - } -} - -func maxCellWidth(m Matrix, c rune, printed, prec int, w widther) ([]byte, int) { - var ( - buf = make([]byte, 0, 64) - rows, cols = m.Dims() - max int - ) - for i := 0; i < rows; i++ { - if i >= printed-1 && i < rows-printed && 2*printed < rows { - i = rows - printed - 1 - continue - } - for j := 0; j < cols; j++ { - if j >= printed && j < cols-printed { - continue - } - - buf = strconv.AppendFloat(buf, m.At(i, j), byte(c), prec, 64) - if len(buf) > max { - max = len(buf) - } - if len(buf) > w.width(j) { - w.setWidth(j, len(buf)) - } - buf = buf[:0] - } - } - return buf, max -} - -type widther interface { - width(i int) int - setWidth(i, w int) -} - -type uniformWidth int - -func (u *uniformWidth) width(_ int) int { return int(*u) } -func (u *uniformWidth) setWidth(_, w int) { *u = uniformWidth(w) } - -type columnWidth []int - -func (c columnWidth) width(i int) int { return c[i] } -func (c columnWidth) setWidth(i, w int) { c[i] = w } diff --git a/vendor/gonum.org/v1/gonum/mat/gsvd.go b/vendor/gonum.org/v1/gonum/mat/gsvd.go deleted file mode 100644 index 2de511a9f..000000000 --- a/vendor/gonum.org/v1/gonum/mat/gsvd.go +++ /dev/null @@ -1,415 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/floats" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// GSVDKind specifies the treatment of singular vectors during a GSVD -// factorization. -type GSVDKind int - -const ( - // GSVDNone specifies that no singular vectors should be computed during - // the decomposition. - GSVDNone GSVDKind = 0 - - // GSVDU specifies that the U singular vectors should be computed during - // the decomposition. - GSVDU GSVDKind = 1 << iota - // GSVDV specifies that the V singular vectors should be computed during - // the decomposition. - GSVDV - // GSVDQ specifies that the Q singular vectors should be computed during - // the decomposition. - GSVDQ - - // GSVDAll is a convenience value for computing all of the singular vectors. - GSVDAll = GSVDU | GSVDV | GSVDQ -) - -// GSVD is a type for creating and using the Generalized Singular Value Decomposition -// (GSVD) of a matrix. -// -// The factorization is a linear transformation of the data sets from the given -// variable×sample spaces to reduced and diagonalized "eigenvariable"×"eigensample" -// spaces. -type GSVD struct { - kind GSVDKind - - r, p, c, k, l int - s1, s2 []float64 - a, b, u, v, q blas64.General - - work []float64 - iwork []int -} - -// succFact returns whether the receiver contains a successful factorization. -func (gsvd *GSVD) succFact() bool { - return gsvd.r != 0 -} - -// Factorize computes the generalized singular value decomposition (GSVD) of the input -// the r×c matrix A and the p×c matrix B. The singular values of A and B are computed -// in all cases, while the singular vectors are optionally computed depending on the -// input kind. -// -// The full singular value decomposition (kind == GSVDAll) deconstructs A and B as -// A = U * Σ₁ * [ 0 R ] * Q^T -// -// B = V * Σ₂ * [ 0 R ] * Q^T -// where Σ₁ and Σ₂ are r×(k+l) and p×(k+l) diagonal matrices of singular values, and -// U, V and Q are r×r, p×p and c×c orthogonal matrices of singular vectors. k+l is the -// effective numerical rank of the matrix [ A^T B^T ]^T. -// -// It is frequently not necessary to compute the full GSVD. Computation time and -// storage costs can be reduced using the appropriate kind. Either only the singular -// values can be computed (kind == SVDNone), or in conjunction with specific singular -// vectors (kind bit set according to matrix.GSVDU, matrix.GSVDV and matrix.GSVDQ). -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, routines that require a successful factorization will panic. -func (gsvd *GSVD) Factorize(a, b Matrix, kind GSVDKind) (ok bool) { - // kill the previous decomposition - gsvd.r = 0 - gsvd.kind = 0 - - r, c := a.Dims() - gsvd.r, gsvd.c = r, c - p, c := b.Dims() - gsvd.p = p - if gsvd.c != c { - panic(ErrShape) - } - var jobU, jobV, jobQ lapack.GSVDJob - switch { - default: - panic("gsvd: bad input kind") - case kind == GSVDNone: - jobU = lapack.GSVDNone - jobV = lapack.GSVDNone - jobQ = lapack.GSVDNone - case GSVDAll&kind != 0: - if GSVDU&kind != 0 { - jobU = lapack.GSVDU - gsvd.u = blas64.General{ - Rows: r, - Cols: r, - Stride: r, - Data: use(gsvd.u.Data, r*r), - } - } - if GSVDV&kind != 0 { - jobV = lapack.GSVDV - gsvd.v = blas64.General{ - Rows: p, - Cols: p, - Stride: p, - Data: use(gsvd.v.Data, p*p), - } - } - if GSVDQ&kind != 0 { - jobQ = lapack.GSVDQ - gsvd.q = blas64.General{ - Rows: c, - Cols: c, - Stride: c, - Data: use(gsvd.q.Data, c*c), - } - } - } - - // A and B are destroyed on call, so copy the matrices. - aCopy := DenseCopyOf(a) - bCopy := DenseCopyOf(b) - - gsvd.s1 = use(gsvd.s1, c) - gsvd.s2 = use(gsvd.s2, c) - - gsvd.iwork = useInt(gsvd.iwork, c) - - gsvd.work = use(gsvd.work, 1) - lapack64.Ggsvd3(jobU, jobV, jobQ, aCopy.mat, bCopy.mat, gsvd.s1, gsvd.s2, gsvd.u, gsvd.v, gsvd.q, gsvd.work, -1, gsvd.iwork) - gsvd.work = use(gsvd.work, int(gsvd.work[0])) - gsvd.k, gsvd.l, ok = lapack64.Ggsvd3(jobU, jobV, jobQ, aCopy.mat, bCopy.mat, gsvd.s1, gsvd.s2, gsvd.u, gsvd.v, gsvd.q, gsvd.work, len(gsvd.work), gsvd.iwork) - if ok { - gsvd.a = aCopy.mat - gsvd.b = bCopy.mat - gsvd.kind = kind - } - return ok -} - -// Kind returns the GSVDKind of the decomposition. If no decomposition has been -// computed, Kind returns -1. -func (gsvd *GSVD) Kind() GSVDKind { - if !gsvd.succFact() { - return -1 - } - return gsvd.kind -} - -// Rank returns the k and l terms of the rank of [ A^T B^T ]^T. -func (gsvd *GSVD) Rank() (k, l int) { - return gsvd.k, gsvd.l -} - -// GeneralizedValues returns the generalized singular values of the factorized matrices. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length min(r,c)-k, and GeneralizedValues will -// panic with matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// GeneralizedValues will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) GeneralizedValues(v []float64) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - d := min(r, c) - if v == nil { - v = make([]float64, d-k) - } - if len(v) != d-k { - panic(ErrSliceLengthMismatch) - } - floats.DivTo(v, gsvd.s1[k:d], gsvd.s2[k:d]) - return v -} - -// ValuesA returns the singular values of the factorized A matrix. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length min(r,c)-k, and ValuesA will panic with -// matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// ValuesA will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ValuesA(s []float64) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - d := min(r, c) - if s == nil { - s = make([]float64, d-k) - } - if len(s) != d-k { - panic(ErrSliceLengthMismatch) - } - copy(s, gsvd.s1[k:min(r, c)]) - return s -} - -// ValuesB returns the singular values of the factorized B matrix. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length min(r,c)-k, and ValuesB will panic with -// matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// ValuesB will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ValuesB(s []float64) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - d := min(r, c) - if s == nil { - s = make([]float64, d-k) - } - if len(s) != d-k { - panic(ErrSliceLengthMismatch) - } - copy(s, gsvd.s2[k:d]) - return s -} - -// ZeroRTo extracts the matrix [ 0 R ] from the singular value decomposition, storing -// the result in-place into dst. [ 0 R ] is size (k+l)×c. -// If dst is nil, a new matrix is allocated. The resulting ZeroR matrix is returned. -// -// ZeroRTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) ZeroRTo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - c := gsvd.c - k := gsvd.k - l := gsvd.l - h := min(k+l, r) - if dst == nil { - dst = NewDense(k+l, c, nil) - } else { - dst.reuseAsZeroed(k+l, c) - } - a := Dense{ - mat: gsvd.a, - capRows: r, - capCols: c, - } - dst.Slice(0, h, c-k-l, c).(*Dense). - Copy(a.Slice(0, h, c-k-l, c)) - if r < k+l { - b := Dense{ - mat: gsvd.b, - capRows: gsvd.p, - capCols: c, - } - dst.Slice(r, k+l, c+r-k-l, c).(*Dense). - Copy(b.Slice(r-k, l, c+r-k-l, c)) - } - return dst -} - -// SigmaATo extracts the matrix Σ₁ from the singular value decomposition, storing -// the result in-place into dst. Σ₁ is size r×(k+l). -// If dst is nil, a new matrix is allocated. The resulting SigmaA matrix is returned. -// -// SigmaATo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) SigmaATo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - k := gsvd.k - l := gsvd.l - if dst == nil { - dst = NewDense(r, k+l, nil) - } else { - dst.reuseAsZeroed(r, k+l) - } - for i := 0; i < k; i++ { - dst.set(i, i, 1) - } - for i := k; i < min(r, k+l); i++ { - dst.set(i, i, gsvd.s1[i]) - } - return dst -} - -// SigmaBTo extracts the matrix Σ₂ from the singular value decomposition, storing -// the result in-place into dst. Σ₂ is size p×(k+l). -// If dst is nil, a new matrix is allocated. The resulting SigmaB matrix is returned. -// -// SigmaBTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) SigmaBTo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - r := gsvd.r - p := gsvd.p - k := gsvd.k - l := gsvd.l - if dst == nil { - dst = NewDense(p, k+l, nil) - } else { - dst.reuseAsZeroed(p, k+l) - } - for i := 0; i < min(l, r-k); i++ { - dst.set(i, i+k, gsvd.s2[k+i]) - } - for i := r - k; i < l; i++ { - dst.set(i, i+k, 1) - } - return dst -} - -// UTo extracts the matrix U from the singular value decomposition, storing -// the result in-place into dst. U is size r×r. -// If dst is nil, a new matrix is allocated. The resulting U matrix is returned. -// -// UTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) UTo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - if gsvd.kind&GSVDU == 0 { - panic("mat: improper GSVD kind") - } - r := gsvd.u.Rows - c := gsvd.u.Cols - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - - tmp := &Dense{ - mat: gsvd.u, - capRows: r, - capCols: c, - } - dst.Copy(tmp) - return dst -} - -// VTo extracts the matrix V from the singular value decomposition, storing -// the result in-place into dst. V is size p×p. -// If dst is nil, a new matrix is allocated. The resulting V matrix is returned. -// -// VTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) VTo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - if gsvd.kind&GSVDV == 0 { - panic("mat: improper GSVD kind") - } - r := gsvd.v.Rows - c := gsvd.v.Cols - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - - tmp := &Dense{ - mat: gsvd.v, - capRows: r, - capCols: c, - } - dst.Copy(tmp) - return dst -} - -// QTo extracts the matrix Q from the singular value decomposition, storing -// the result in-place into dst. Q is size c×c. -// If dst is nil, a new matrix is allocated. The resulting Q matrix is returned. -// -// QTo will panic if the receiver does not contain a successful factorization. -func (gsvd *GSVD) QTo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - if gsvd.kind&GSVDQ == 0 { - panic("mat: improper GSVD kind") - } - r := gsvd.q.Rows - c := gsvd.q.Cols - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - - tmp := &Dense{ - mat: gsvd.q, - capRows: r, - capCols: c, - } - dst.Copy(tmp) - return dst -} diff --git a/vendor/gonum.org/v1/gonum/mat/hogsvd.go b/vendor/gonum.org/v1/gonum/mat/hogsvd.go deleted file mode 100644 index bd843e6b3..000000000 --- a/vendor/gonum.org/v1/gonum/mat/hogsvd.go +++ /dev/null @@ -1,233 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "errors" - - "gonum.org/v1/gonum/blas/blas64" -) - -// HOGSVD is a type for creating and using the Higher Order Generalized Singular Value -// Decomposition (HOGSVD) of a set of matrices. -// -// The factorization is a linear transformation of the data sets from the given -// variable×sample spaces to reduced and diagonalized "eigenvariable"×"eigensample" -// spaces. -type HOGSVD struct { - n int - v *Dense - b []Dense - - err error -} - -// succFact returns whether the receiver contains a successful factorization. -func (gsvd *HOGSVD) succFact() bool { - return gsvd.n != 0 -} - -// Factorize computes the higher order generalized singular value decomposition (HOGSVD) -// of the n input r_i×c column tall matrices in m. HOGSV extends the GSVD case from 2 to n -// input matrices. -// -// M_0 = U_0 * Σ_0 * V^T -// M_1 = U_1 * Σ_1 * V^T -// . -// . -// . -// M_{n-1} = U_{n-1} * Σ_{n-1} * V^T -// -// where U_i are r_i×c matrices of singular vectors, Σ are c×c matrices singular values, and V -// is a c×c matrix of singular vectors. -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, routines that require a successful factorization will panic. -func (gsvd *HOGSVD) Factorize(m ...Matrix) (ok bool) { - // Factorize performs the HOGSVD factorisation - // essentially as described by Ponnapalli et al. - // https://doi.org/10.1371/journal.pone.0028072 - - if len(m) < 2 { - panic("hogsvd: too few matrices") - } - gsvd.n = 0 - - r, c := m[0].Dims() - a := make([]Cholesky, len(m)) - var ts SymDense - for i, d := range m { - rd, cd := d.Dims() - if rd < cd { - gsvd.err = ErrShape - return false - } - if rd > r { - r = rd - } - if cd != c { - panic(ErrShape) - } - ts.Reset() - ts.SymOuterK(1, d.T()) - ok = a[i].Factorize(&ts) - if !ok { - gsvd.err = errors.New("hogsvd: cholesky decomposition failed") - return false - } - } - - s := getWorkspace(c, c, true) - defer putWorkspace(s) - sij := getWorkspace(c, c, false) - defer putWorkspace(sij) - for i, ai := range a { - for _, aj := range a[i+1:] { - gsvd.err = ai.SolveCholTo(sij, &aj) - if gsvd.err != nil { - return false - } - s.Add(s, sij) - - gsvd.err = aj.SolveCholTo(sij, &ai) - if gsvd.err != nil { - return false - } - s.Add(s, sij) - } - } - s.Scale(1/float64(len(m)*(len(m)-1)), s) - - var eig Eigen - ok = eig.Factorize(s.T(), EigenRight) - if !ok { - gsvd.err = errors.New("hogsvd: eigen decomposition failed") - return false - } - vc := eig.VectorsTo(nil) - // vc is guaranteed to have real eigenvalues. - rc, cc := vc.Dims() - v := NewDense(rc, cc, nil) - for i := 0; i < rc; i++ { - for j := 0; j < cc; j++ { - a := vc.At(i, j) - v.set(i, j, real(a)) - } - } - // Rescale the columns of v by their Frobenius norms. - // Work done in cv is reflected in v. - var cv VecDense - for j := 0; j < c; j++ { - cv.ColViewOf(v, j) - cv.ScaleVec(1/blas64.Nrm2(cv.mat), &cv) - } - - b := make([]Dense, len(m)) - biT := getWorkspace(c, r, false) - defer putWorkspace(biT) - for i, d := range m { - // All calls to reset will leave a zeroed - // matrix with capacity to store the result - // without additional allocation. - biT.Reset() - gsvd.err = biT.Solve(v, d.T()) - if gsvd.err != nil { - return false - } - b[i].Clone(biT.T()) - } - - gsvd.n = len(m) - gsvd.v = v - gsvd.b = b - return true -} - -// Err returns the reason for a factorization failure. -func (gsvd *HOGSVD) Err() error { - return gsvd.err -} - -// Len returns the number of matrices that have been factorized. If Len returns -// zero, the factorization was not successful. -func (gsvd *HOGSVD) Len() int { - return gsvd.n -} - -// UTo extracts the matrix U_n from the singular value decomposition, storing -// the result in-place into dst. U_n is size r×c. -// If dst is nil, a new matrix is allocated. The resulting U matrix is returned. -// -// UTo will panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) UTo(dst *Dense, n int) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - if n < 0 || gsvd.n <= n { - panic("hogsvd: invalid index") - } - - if dst == nil { - r, c := gsvd.b[n].Dims() - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(gsvd.b[n].Dims()) - } - dst.Copy(&gsvd.b[n]) - var v VecDense - for j, f := range gsvd.Values(nil, n) { - v.ColViewOf(dst, j) - v.ScaleVec(1/f, &v) - } - return dst -} - -// Values returns the nth set of singular values of the factorized system. -// If the input slice is non-nil, the values will be stored in-place into the slice. -// In this case, the slice must have length c, and Values will panic with -// matrix.ErrSliceLengthMismatch otherwise. If the input slice is nil, -// a new slice of the appropriate length will be allocated and returned. -// -// Values will panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) Values(s []float64, n int) []float64 { - if !gsvd.succFact() { - panic(badFact) - } - if n < 0 || gsvd.n <= n { - panic("hogsvd: invalid index") - } - - _, c := gsvd.b[n].Dims() - if s == nil { - s = make([]float64, c) - } else if len(s) != c { - panic(ErrSliceLengthMismatch) - } - var v VecDense - for j := 0; j < c; j++ { - v.ColViewOf(&gsvd.b[n], j) - s[j] = blas64.Nrm2(v.mat) - } - return s -} - -// VTo extracts the matrix V from the singular value decomposition, storing -// the result in-place into dst. V is size c×c. -// If dst is nil, a new matrix is allocated. The resulting V matrix is returned. -// -// VTo will panic if the receiver does not contain a successful factorization. -func (gsvd *HOGSVD) VTo(dst *Dense) *Dense { - if !gsvd.succFact() { - panic(badFact) - } - if dst == nil { - r, c := gsvd.v.Dims() - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(gsvd.v.Dims()) - } - dst.Copy(gsvd.v) - return dst -} diff --git a/vendor/gonum.org/v1/gonum/mat/index_bound_checks.go b/vendor/gonum.org/v1/gonum/mat/index_bound_checks.go deleted file mode 100644 index 59815a676..000000000 --- a/vendor/gonum.org/v1/gonum/mat/index_bound_checks.go +++ /dev/null @@ -1,348 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file must be kept in sync with index_no_bound_checks.go. - -// +build bounds - -package mat - -// At returns the element at row i, column j. -func (m *Dense) At(i, j int) float64 { - return m.at(i, j) -} - -func (m *Dense) at(i, j int) float64 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *Dense) Set(i, j int, v float64) { - m.set(i, j, v) -} - -func (m *Dense) set(i, j int, v float64) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (m *CDense) At(i, j int) complex128 { - return m.at(i, j) -} - -func (m *CDense) at(i, j int) complex128 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *CDense) Set(i, j int, v complex128) { - m.set(i, j, v) -} - -func (m *CDense) set(i, j int, v complex128) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i. -// It panics if i is out of bounds or if j is not zero. -func (v *VecDense) At(i, j int) float64 { - if j != 0 { - panic(ErrColAccess) - } - return v.at(i) -} - -// AtVec returns the element at row i. -// It panics if i is out of bounds. -func (v *VecDense) AtVec(i int) float64 { - return v.at(i) -} - -func (v *VecDense) at(i int) float64 { - if uint(i) >= uint(v.mat.N) { - panic(ErrRowAccess) - } - return v.mat.Data[i*v.mat.Inc] -} - -// SetVec sets the element at row i to the value val. -// It panics if i is out of bounds. -func (v *VecDense) SetVec(i int, val float64) { - v.setVec(i, val) -} - -func (v *VecDense) setVec(i int, val float64) { - if uint(i) >= uint(v.mat.N) { - panic(ErrVectorAccess) - } - v.mat.Data[i*v.mat.Inc] = val -} - -// At returns the element at row i and column j. -func (t *SymDense) At(i, j int) float64 { - return t.at(i, j) -} - -func (t *SymDense) at(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - return t.mat.Data[i*t.mat.Stride+j] -} - -// SetSym sets the elements at (i,j) and (j,i) to the value v. -func (t *SymDense) SetSym(i, j int, v float64) { - t.set(i, j, v) -} - -func (t *SymDense) set(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - t.mat.Data[i*t.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (t *TriDense) At(i, j int) float64 { - return t.at(i, j) -} - -func (t *TriDense) at(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - return t.mat.Data[i*t.mat.Stride+j] -} - -// SetTri sets the element of the triangular matrix at row i, column j to the value v. -// It panics if the location is outside the appropriate half of the matrix. -func (t *TriDense) SetTri(i, j int, v float64) { - t.set(i, j, v) -} - -func (t *TriDense) set(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - t.mat.Data[i*t.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (b *BandDense) At(i, j int) float64 { - return b.at(i, j) -} - -func (b *BandDense) at(i, j int) float64 { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - return 0 - } - return b.mat.Data[i*b.mat.Stride+pj] -} - -// SetBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (b *BandDense) SetBand(i, j int, v float64) { - b.set(i, j, v) -} - -func (b *BandDense) set(i, j int, v float64) { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - panic(ErrBandSet) - } - b.mat.Data[i*b.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (s *SymBandDense) At(i, j int) float64 { - return s.at(i, j) -} - -func (s *SymBandDense) at(i, j int) float64 { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - return 0 - } - return s.mat.Data[i*s.mat.Stride+pj] -} - -// SetSymBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (s *SymBandDense) SetSymBand(i, j int, v float64) { - s.set(i, j, v) -} - -func (s *SymBandDense) set(i, j int, v float64) { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - panic(ErrBandSet) - } - s.mat.Data[i*s.mat.Stride+pj] = v -} - -func (t *TriBandDense) At(i, j int) float64 { - return t.at(i, j) -} - -func (t *TriBandDense) at(i, j int) float64 { - // TODO(btracey): Support Diag field, see #692. - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - kl, ku := t.mat.K, 0 - if isUpper { - kl, ku = 0, t.mat.K - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - return 0 - } - return t.mat.Data[i*t.mat.Stride+pj] -} - -func (t *TriBandDense) SetTriBand(i, j int, v float64) { - t.setTriBand(i, j, v) -} - -func (t *TriBandDense) setTriBand(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - kl, ku := t.mat.K, 0 - if isUpper { - kl, ku = 0, t.mat.K - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - panic(ErrBandSet) - } - // TODO(btracey): Support Diag field, see #692. - t.mat.Data[i*t.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (d *DiagDense) At(i, j int) float64 { - return d.at(i, j) -} - -func (d *DiagDense) at(i, j int) float64 { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(d.mat.N) { - panic(ErrColAccess) - } - if i != j { - return 0 - } - return d.mat.Data[i*d.mat.Inc] -} - -// SetDiag sets the element at row i, column i to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (d *DiagDense) SetDiag(i int, v float64) { - d.setDiag(i, v) -} - -func (d *DiagDense) setDiag(i int, v float64) { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - d.mat.Data[i*d.mat.Inc] = v -} diff --git a/vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go b/vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go deleted file mode 100644 index 051f8437a..000000000 --- a/vendor/gonum.org/v1/gonum/mat/index_no_bound_checks.go +++ /dev/null @@ -1,359 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// This file must be kept in sync with index_bound_checks.go. - -// +build !bounds - -package mat - -// At returns the element at row i, column j. -func (m *Dense) At(i, j int) float64 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.at(i, j) -} - -func (m *Dense) at(i, j int) float64 { - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *Dense) Set(i, j int, v float64) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.set(i, j, v) -} - -func (m *Dense) set(i, j int, v float64) { - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (m *CDense) At(i, j int) complex128 { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - return m.at(i, j) -} - -func (m *CDense) at(i, j int) complex128 { - return m.mat.Data[i*m.mat.Stride+j] -} - -// Set sets the element at row i, column j to the value v. -func (m *CDense) Set(i, j int, v complex128) { - if uint(i) >= uint(m.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(m.mat.Cols) { - panic(ErrColAccess) - } - m.set(i, j, v) -} - -func (m *CDense) set(i, j int, v complex128) { - m.mat.Data[i*m.mat.Stride+j] = v -} - -// At returns the element at row i. -// It panics if i is out of bounds or if j is not zero. -func (v *VecDense) At(i, j int) float64 { - if uint(i) >= uint(v.mat.N) { - panic(ErrRowAccess) - } - if j != 0 { - panic(ErrColAccess) - } - return v.at(i) -} - -// AtVec returns the element at row i. -// It panics if i is out of bounds. -func (v *VecDense) AtVec(i int) float64 { - if uint(i) >= uint(v.mat.N) { - panic(ErrRowAccess) - } - return v.at(i) -} - -func (v *VecDense) at(i int) float64 { - return v.mat.Data[i*v.mat.Inc] -} - -// SetVec sets the element at row i to the value val. -// It panics if i is out of bounds. -func (v *VecDense) SetVec(i int, val float64) { - if uint(i) >= uint(v.mat.N) { - panic(ErrVectorAccess) - } - v.setVec(i, val) -} - -func (v *VecDense) setVec(i int, val float64) { - v.mat.Data[i*v.mat.Inc] = val -} - -// At returns the element at row i and column j. -func (s *SymDense) At(i, j int) float64 { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - return s.at(i, j) -} - -func (s *SymDense) at(i, j int) float64 { - if i > j { - i, j = j, i - } - return s.mat.Data[i*s.mat.Stride+j] -} - -// SetSym sets the elements at (i,j) and (j,i) to the value v. -func (s *SymDense) SetSym(i, j int, v float64) { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - s.set(i, j, v) -} - -func (s *SymDense) set(i, j int, v float64) { - if i > j { - i, j = j, i - } - s.mat.Data[i*s.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (t *TriDense) At(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - return t.at(i, j) -} - -func (t *TriDense) at(i, j int) float64 { - isUpper := t.triKind() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - return t.mat.Data[i*t.mat.Stride+j] -} - -// SetTri sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate half of the matrix. -func (t *TriDense) SetTri(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - t.set(i, j, v) -} - -func (t *TriDense) set(i, j int, v float64) { - t.mat.Data[i*t.mat.Stride+j] = v -} - -// At returns the element at row i, column j. -func (b *BandDense) At(i, j int) float64 { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - return b.at(i, j) -} - -func (b *BandDense) at(i, j int) float64 { - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - return 0 - } - return b.mat.Data[i*b.mat.Stride+pj] -} - -// SetBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (b *BandDense) SetBand(i, j int, v float64) { - if uint(i) >= uint(b.mat.Rows) { - panic(ErrRowAccess) - } - if uint(j) >= uint(b.mat.Cols) { - panic(ErrColAccess) - } - pj := j + b.mat.KL - i - if pj < 0 || b.mat.KL+b.mat.KU+1 <= pj { - panic(ErrBandSet) - } - b.set(i, j, v) -} - -func (b *BandDense) set(i, j int, v float64) { - pj := j + b.mat.KL - i - b.mat.Data[i*b.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (s *SymBandDense) At(i, j int) float64 { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - return s.at(i, j) -} - -func (s *SymBandDense) at(i, j int) float64 { - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - return 0 - } - return s.mat.Data[i*s.mat.Stride+pj] -} - -// SetSymBand sets the element at row i, column j to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (s *SymBandDense) SetSymBand(i, j int, v float64) { - if uint(i) >= uint(s.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(s.mat.N) { - panic(ErrColAccess) - } - s.set(i, j, v) -} - -func (s *SymBandDense) set(i, j int, v float64) { - if i > j { - i, j = j, i - } - pj := j - i - if s.mat.K+1 <= pj { - panic(ErrBandSet) - } - s.mat.Data[i*s.mat.Stride+pj] = v -} - -func (t *TriBandDense) At(i, j int) float64 { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - return t.at(i, j) -} - -func (t *TriBandDense) at(i, j int) float64 { - // TODO(btracey): Support Diag field, see #692. - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - return 0 - } - kl := t.mat.K - ku := 0 - if isUpper { - ku = t.mat.K - kl = 0 - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - return 0 - } - return t.mat.Data[i*t.mat.Stride+pj] -} - -func (t *TriBandDense) SetTriBand(i, j int, v float64) { - if uint(i) >= uint(t.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(t.mat.N) { - panic(ErrColAccess) - } - isUpper := t.isUpper() - if (isUpper && i > j) || (!isUpper && i < j) { - panic(ErrTriangleSet) - } - kl, ku := t.mat.K, 0 - if isUpper { - kl, ku = 0, t.mat.K - } - pj := j + kl - i - if pj < 0 || kl+ku+1 <= pj { - panic(ErrBandSet) - } - // TODO(btracey): Support Diag field, see #692. - t.mat.Data[i*t.mat.Stride+pj] = v -} - -func (t *TriBandDense) setTriBand(i, j int, v float64) { - var kl int - if !t.isUpper() { - kl = t.mat.K - } - pj := j + kl - i - t.mat.Data[i*t.mat.Stride+pj] = v -} - -// At returns the element at row i, column j. -func (d *DiagDense) At(i, j int) float64 { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - if uint(j) >= uint(d.mat.N) { - panic(ErrColAccess) - } - return d.at(i, j) -} - -func (d *DiagDense) at(i, j int) float64 { - if i != j { - return 0 - } - return d.mat.Data[i*d.mat.Inc] -} - -// SetDiag sets the element at row i, column i to the value v. -// It panics if the location is outside the appropriate region of the matrix. -func (d *DiagDense) SetDiag(i int, v float64) { - if uint(i) >= uint(d.mat.N) { - panic(ErrRowAccess) - } - d.setDiag(i, v) -} - -func (d *DiagDense) setDiag(i int, v float64) { - d.mat.Data[i*d.mat.Inc] = v -} diff --git a/vendor/gonum.org/v1/gonum/mat/inner.go b/vendor/gonum.org/v1/gonum/mat/inner.go deleted file mode 100644 index fba3e0b04..000000000 --- a/vendor/gonum.org/v1/gonum/mat/inner.go +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/internal/asm/f64" -) - -// Inner computes the generalized inner product -// x^T A y -// between column vectors x and y with matrix A. This is only a true inner product if -// A is symmetric positive definite, though the operation works for any matrix A. -// -// Inner panics if x.Len != m or y.Len != n when A is an m x n matrix. -func Inner(x Vector, a Matrix, y Vector) float64 { - m, n := a.Dims() - if x.Len() != m { - panic(ErrShape) - } - if y.Len() != n { - panic(ErrShape) - } - if m == 0 || n == 0 { - return 0 - } - - var sum float64 - - switch a := a.(type) { - case RawSymmetricer: - amat := a.RawSymmetric() - if amat.Uplo != blas.Upper { - // Panic as a string not a mat.Error. - panic(badSymTriangle) - } - var xmat, ymat blas64.Vector - if xrv, ok := x.(RawVectorer); ok { - xmat = xrv.RawVector() - } else { - break - } - if yrv, ok := y.(RawVectorer); ok { - ymat = yrv.RawVector() - } else { - break - } - for i := 0; i < x.Len(); i++ { - xi := x.AtVec(i) - if xi != 0 { - if ymat.Inc == 1 { - sum += xi * f64.DotUnitary( - amat.Data[i*amat.Stride+i:i*amat.Stride+n], - ymat.Data[i:], - ) - } else { - sum += xi * f64.DotInc( - amat.Data[i*amat.Stride+i:i*amat.Stride+n], - ymat.Data[i*ymat.Inc:], uintptr(n-i), - 1, uintptr(ymat.Inc), - 0, 0, - ) - } - } - yi := y.AtVec(i) - if i != n-1 && yi != 0 { - if xmat.Inc == 1 { - sum += yi * f64.DotUnitary( - amat.Data[i*amat.Stride+i+1:i*amat.Stride+n], - xmat.Data[i+1:], - ) - } else { - sum += yi * f64.DotInc( - amat.Data[i*amat.Stride+i+1:i*amat.Stride+n], - xmat.Data[(i+1)*xmat.Inc:], uintptr(n-i-1), - 1, uintptr(xmat.Inc), - 0, 0, - ) - } - } - } - return sum - case RawMatrixer: - amat := a.RawMatrix() - var ymat blas64.Vector - if yrv, ok := y.(RawVectorer); ok { - ymat = yrv.RawVector() - } else { - break - } - for i := 0; i < x.Len(); i++ { - xi := x.AtVec(i) - if xi != 0 { - if ymat.Inc == 1 { - sum += xi * f64.DotUnitary( - amat.Data[i*amat.Stride:i*amat.Stride+n], - ymat.Data, - ) - } else { - sum += xi * f64.DotInc( - amat.Data[i*amat.Stride:i*amat.Stride+n], - ymat.Data, uintptr(n), - 1, uintptr(ymat.Inc), - 0, 0, - ) - } - } - } - return sum - } - for i := 0; i < x.Len(); i++ { - xi := x.AtVec(i) - for j := 0; j < y.Len(); j++ { - sum += xi * a.At(i, j) * y.AtVec(j) - } - } - return sum -} diff --git a/vendor/gonum.org/v1/gonum/mat/io.go b/vendor/gonum.org/v1/gonum/mat/io.go deleted file mode 100644 index 7f7ef0703..000000000 --- a/vendor/gonum.org/v1/gonum/mat/io.go +++ /dev/null @@ -1,492 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "io" - "math" -) - -// version is the current on-disk codec version. -const version uint32 = 0x1 - -// maxLen is the biggest slice/array len one can create on a 32/64b platform. -const maxLen = int64(int(^uint(0) >> 1)) - -var ( - headerSize = binary.Size(storage{}) - sizeInt64 = binary.Size(int64(0)) - sizeFloat64 = binary.Size(float64(0)) - - errWrongType = errors.New("mat: wrong data type") - - errTooBig = errors.New("mat: resulting data slice too big") - errTooSmall = errors.New("mat: input slice too small") - errBadBuffer = errors.New("mat: data buffer size mismatch") - errBadSize = errors.New("mat: invalid dimension") -) - -// Type encoding scheme: -// -// Type Form Packing Uplo Unit Rows Columns kU kL -// uint8 [GST] uint8 [BPF] uint8 [AUL] bool int64 int64 int64 int64 -// General 'G' 'F' 'A' false r c 0 0 -// Band 'G' 'B' 'A' false r c kU kL -// Symmetric 'S' 'F' ul false n n 0 0 -// SymmetricBand 'S' 'B' ul false n n k k -// SymmetricPacked 'S' 'P' ul false n n 0 0 -// Triangular 'T' 'F' ul Diag==Unit n n 0 0 -// TriangularBand 'T' 'B' ul Diag==Unit n n k k -// TriangularPacked 'T' 'P' ul Diag==Unit n n 0 0 -// -// G - general, S - symmetric, T - triangular -// F - full, B - band, P - packed -// A - all, U - upper, L - lower - -// MarshalBinary encodes the receiver into a binary form and returns the result. -// -// Dense is little-endian encoded as follows: -// 0 - 3 Version = 1 (uint32) -// 4 'G' (byte) -// 5 'F' (byte) -// 6 'A' (byte) -// 7 0 (byte) -// 8 - 15 number of rows (int64) -// 16 - 23 number of columns (int64) -// 24 - 31 0 (int64) -// 32 - 39 0 (int64) -// 40 - .. matrix data elements (float64) -// [0,0] [0,1] ... [0,ncols-1] -// [1,0] [1,1] ... [1,ncols-1] -// ... -// [nrows-1,0] ... [nrows-1,ncols-1] -func (m Dense) MarshalBinary() ([]byte, error) { - bufLen := int64(headerSize) + int64(m.mat.Rows)*int64(m.mat.Cols)*int64(sizeFloat64) - if bufLen <= 0 { - // bufLen is too big and has wrapped around. - return nil, errTooBig - } - - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(m.mat.Rows), Cols: int64(m.mat.Cols), - Version: version, - } - buf := make([]byte, bufLen) - n, err := header.marshalBinaryTo(bytes.NewBuffer(buf[:0])) - if err != nil { - return buf[:n], err - } - - p := headerSize - r, c := m.Dims() - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - binary.LittleEndian.PutUint64(buf[p:p+sizeFloat64], math.Float64bits(m.at(i, j))) - p += sizeFloat64 - } - } - - return buf, nil -} - -// MarshalBinaryTo encodes the receiver into a binary form and writes it into w. -// MarshalBinaryTo returns the number of bytes written into w and an error, if any. -// -// See MarshalBinary for the on-disk layout. -func (m Dense) MarshalBinaryTo(w io.Writer) (int, error) { - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(m.mat.Rows), Cols: int64(m.mat.Cols), - Version: version, - } - n, err := header.marshalBinaryTo(w) - if err != nil { - return n, err - } - - r, c := m.Dims() - var b [8]byte - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - binary.LittleEndian.PutUint64(b[:], math.Float64bits(m.at(i, j))) - nn, err := w.Write(b[:]) - n += nn - if err != nil { - return n, err - } - } - } - - return n, nil -} - -// UnmarshalBinary decodes the binary form into the receiver. -// It panics if the receiver is a non-zero Dense matrix. -// -// See MarshalBinary for the on-disk layout. -// -// Limited checks on the validity of the binary input are performed: -// - matrix.ErrShape is returned if the number of rows or columns is negative, -// - an error is returned if the resulting Dense matrix is too -// big for the current architecture (e.g. a 16GB matrix written by a -// 64b application and read back from a 32b application.) -// UnmarshalBinary does not limit the size of the unmarshaled matrix, and so -// it should not be used on untrusted data. -func (m *Dense) UnmarshalBinary(data []byte) error { - if !m.IsZero() { - panic("mat: unmarshal into non-zero matrix") - } - - if len(data) < headerSize { - return errTooSmall - } - - var header storage - err := header.unmarshalBinary(data[:headerSize]) - if err != nil { - return err - } - rows := header.Rows - cols := header.Cols - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return errWrongType - } - if rows < 0 || cols < 0 { - return errBadSize - } - size := rows * cols - if size == 0 { - return ErrZeroLength - } - if int(size) < 0 || size > maxLen { - return errTooBig - } - if len(data) != headerSize+int(rows*cols)*sizeFloat64 { - return errBadBuffer - } - - p := headerSize - m.reuseAs(int(rows), int(cols)) - for i := range m.mat.Data { - m.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64])) - p += sizeFloat64 - } - - return nil -} - -// UnmarshalBinaryFrom decodes the binary form into the receiver and returns -// the number of bytes read and an error if any. -// It panics if the receiver is a non-zero Dense matrix. -// -// See MarshalBinary for the on-disk layout. -// -// Limited checks on the validity of the binary input are performed: -// - matrix.ErrShape is returned if the number of rows or columns is negative, -// - an error is returned if the resulting Dense matrix is too -// big for the current architecture (e.g. a 16GB matrix written by a -// 64b application and read back from a 32b application.) -// UnmarshalBinary does not limit the size of the unmarshaled matrix, and so -// it should not be used on untrusted data. -func (m *Dense) UnmarshalBinaryFrom(r io.Reader) (int, error) { - if !m.IsZero() { - panic("mat: unmarshal into non-zero matrix") - } - - var header storage - n, err := header.unmarshalBinaryFrom(r) - if err != nil { - return n, err - } - rows := header.Rows - cols := header.Cols - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return n, errWrongType - } - if rows < 0 || cols < 0 { - return n, errBadSize - } - size := rows * cols - if size == 0 { - return n, ErrZeroLength - } - if int(size) < 0 || size > maxLen { - return n, errTooBig - } - - m.reuseAs(int(rows), int(cols)) - var b [8]byte - for i := range m.mat.Data { - nn, err := readFull(r, b[:]) - n += nn - if err != nil { - if err == io.EOF { - return n, io.ErrUnexpectedEOF - } - return n, err - } - m.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[:])) - } - - return n, nil -} - -// MarshalBinary encodes the receiver into a binary form and returns the result. -// -// VecDense is little-endian encoded as follows: -// -// 0 - 3 Version = 1 (uint32) -// 4 'G' (byte) -// 5 'F' (byte) -// 6 'A' (byte) -// 7 0 (byte) -// 8 - 15 number of elements (int64) -// 16 - 23 1 (int64) -// 24 - 31 0 (int64) -// 32 - 39 0 (int64) -// 40 - .. vector's data elements (float64) -func (v VecDense) MarshalBinary() ([]byte, error) { - bufLen := int64(headerSize) + int64(v.mat.N)*int64(sizeFloat64) - if bufLen <= 0 { - // bufLen is too big and has wrapped around. - return nil, errTooBig - } - - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(v.mat.N), Cols: 1, - Version: version, - } - buf := make([]byte, bufLen) - n, err := header.marshalBinaryTo(bytes.NewBuffer(buf[:0])) - if err != nil { - return buf[:n], err - } - - p := headerSize - for i := 0; i < v.mat.N; i++ { - binary.LittleEndian.PutUint64(buf[p:p+sizeFloat64], math.Float64bits(v.at(i))) - p += sizeFloat64 - } - - return buf, nil -} - -// MarshalBinaryTo encodes the receiver into a binary form, writes it to w and -// returns the number of bytes written and an error if any. -// -// See MarshalBainry for the on-disk format. -func (v VecDense) MarshalBinaryTo(w io.Writer) (int, error) { - header := storage{ - Form: 'G', Packing: 'F', Uplo: 'A', - Rows: int64(v.mat.N), Cols: 1, - Version: version, - } - n, err := header.marshalBinaryTo(w) - if err != nil { - return n, err - } - - var buf [8]byte - for i := 0; i < v.mat.N; i++ { - binary.LittleEndian.PutUint64(buf[:], math.Float64bits(v.at(i))) - nn, err := w.Write(buf[:]) - n += nn - if err != nil { - return n, err - } - } - - return n, nil -} - -// UnmarshalBinary decodes the binary form into the receiver. -// It panics if the receiver is a non-zero VecDense. -// -// See MarshalBinary for the on-disk layout. -// -// Limited checks on the validity of the binary input are performed: -// - matrix.ErrShape is returned if the number of rows is negative, -// - an error is returned if the resulting VecDense is too -// big for the current architecture (e.g. a 16GB vector written by a -// 64b application and read back from a 32b application.) -// UnmarshalBinary does not limit the size of the unmarshaled vector, and so -// it should not be used on untrusted data. -func (v *VecDense) UnmarshalBinary(data []byte) error { - if !v.IsZero() { - panic("mat: unmarshal into non-zero vector") - } - - if len(data) < headerSize { - return errTooSmall - } - - var header storage - err := header.unmarshalBinary(data[:headerSize]) - if err != nil { - return err - } - if header.Cols != 1 { - return ErrShape - } - n := header.Rows - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return errWrongType - } - if n == 0 { - return ErrZeroLength - } - if n < 0 { - return errBadSize - } - if int64(maxLen) < n { - return errTooBig - } - if len(data) != headerSize+int(n)*sizeFloat64 { - return errBadBuffer - } - - p := headerSize - v.reuseAs(int(n)) - for i := range v.mat.Data { - v.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[p : p+sizeFloat64])) - p += sizeFloat64 - } - - return nil -} - -// UnmarshalBinaryFrom decodes the binary form into the receiver, from the -// io.Reader and returns the number of bytes read and an error if any. -// It panics if the receiver is a non-zero VecDense. -// -// See MarshalBinary for the on-disk layout. -// See UnmarshalBinary for the list of sanity checks performed on the input. -func (v *VecDense) UnmarshalBinaryFrom(r io.Reader) (int, error) { - if !v.IsZero() { - panic("mat: unmarshal into non-zero vector") - } - - var header storage - n, err := header.unmarshalBinaryFrom(r) - if err != nil { - return n, err - } - if header.Cols != 1 { - return n, ErrShape - } - l := header.Rows - header.Version = 0 - header.Rows = 0 - header.Cols = 0 - if (header != storage{Form: 'G', Packing: 'F', Uplo: 'A'}) { - return n, errWrongType - } - if l == 0 { - return n, ErrZeroLength - } - if l < 0 { - return n, errBadSize - } - if int64(maxLen) < l { - return n, errTooBig - } - - v.reuseAs(int(l)) - var b [8]byte - for i := range v.mat.Data { - nn, err := readFull(r, b[:]) - n += nn - if err != nil { - if err == io.EOF { - return n, io.ErrUnexpectedEOF - } - return n, err - } - v.mat.Data[i] = math.Float64frombits(binary.LittleEndian.Uint64(b[:])) - } - - return n, nil -} - -// storage is the internal representation of the storage format of a -// serialised matrix. -type storage struct { - Version uint32 // Keep this first. - Form byte // [GST] - Packing byte // [BPF] - Uplo byte // [AUL] - Unit bool - Rows int64 - Cols int64 - KU int64 - KL int64 -} - -// TODO(kortschak): Consider replacing these with calls to direct -// encoding/decoding of fields rather than to binary.Write/binary.Read. - -func (s storage) marshalBinaryTo(w io.Writer) (int, error) { - buf := bytes.NewBuffer(make([]byte, 0, headerSize)) - err := binary.Write(buf, binary.LittleEndian, s) - if err != nil { - return 0, err - } - return w.Write(buf.Bytes()) -} - -func (s *storage) unmarshalBinary(buf []byte) error { - err := binary.Read(bytes.NewReader(buf), binary.LittleEndian, s) - if err != nil { - return err - } - if s.Version != version { - return fmt.Errorf("mat: incorrect version: %d", s.Version) - } - return nil -} - -func (s *storage) unmarshalBinaryFrom(r io.Reader) (int, error) { - buf := make([]byte, headerSize) - n, err := readFull(r, buf) - if err != nil { - return n, err - } - return n, s.unmarshalBinary(buf[:n]) -} - -// readFull reads from r into buf until it has read len(buf). -// It returns the number of bytes copied and an error if fewer bytes were read. -// If an EOF happens after reading fewer than len(buf) bytes, io.ErrUnexpectedEOF is returned. -func readFull(r io.Reader, buf []byte) (int, error) { - var n int - var err error - for n < len(buf) && err == nil { - var nn int - nn, err = r.Read(buf[n:]) - n += nn - } - if n == len(buf) { - return n, nil - } - if err == io.EOF { - return n, io.ErrUnexpectedEOF - } - return n, err -} diff --git a/vendor/gonum.org/v1/gonum/mat/lq.go b/vendor/gonum.org/v1/gonum/mat/lq.go deleted file mode 100644 index d788457d2..000000000 --- a/vendor/gonum.org/v1/gonum/mat/lq.go +++ /dev/null @@ -1,262 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const badLQ = "mat: invalid LQ factorization" - -// LQ is a type for creating and using the LQ factorization of a matrix. -type LQ struct { - lq *Dense - tau []float64 - cond float64 -} - -func (lq *LQ) updateCond(norm lapack.MatrixNorm) { - // Since A = L*Q, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |L*Q| |(L*Q)^-1| = |L| |Q^T * L^-1| - // = |L| |L^-1| = κ(L), - // where we used that fact that Q^-1 = Q^T. However, this assumes that - // the matrix norm is invariant under orthogonal transformations which - // is not the case for CondNorm. Hopefully the error is negligible: κ - // is only a qualitative measure anyway. - m := lq.lq.mat.Rows - work := getFloats(3*m, false) - iwork := getInts(m, false) - l := lq.lq.asTriDense(m, blas.NonUnit, blas.Lower) - v := lapack64.Trcon(norm, l.mat, work, iwork) - lq.cond = 1 / v - putFloats(work) - putInts(iwork) -} - -// Factorize computes the LQ factorization of an m×n matrix a where n <= m. The LQ -// factorization always exists even if A is singular. -// -// The LQ decomposition is a factorization of the matrix A such that A = L * Q. -// The matrix Q is an orthonormal n×n matrix, and L is an m×n upper triangular matrix. -// L and Q can be extracted from the LTo and QTo methods. -func (lq *LQ) Factorize(a Matrix) { - lq.factorize(a, CondNorm) -} - -func (lq *LQ) factorize(a Matrix, norm lapack.MatrixNorm) { - m, n := a.Dims() - if m > n { - panic(ErrShape) - } - k := min(m, n) - if lq.lq == nil { - lq.lq = &Dense{} - } - lq.lq.Clone(a) - work := []float64{0} - lq.tau = make([]float64, k) - lapack64.Gelqf(lq.lq.mat, lq.tau, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Gelqf(lq.lq.mat, lq.tau, work, len(work)) - putFloats(work) - lq.updateCond(norm) -} - -// isValid returns whether the receiver contains a factorization. -func (lq *LQ) isValid() bool { - return lq.lq != nil && !lq.lq.IsZero() -} - -// Cond returns the condition number for the factorized matrix. -// Cond will panic if the receiver does not contain a factorization. -func (lq *LQ) Cond() float64 { - if !lq.isValid() { - panic(badLQ) - } - return lq.cond -} - -// TODO(btracey): Add in the "Reduced" forms for extracting the m×m orthogonal -// and upper triangular matrices. - -// LTo extracts the m×n lower trapezoidal matrix from a LQ decomposition. -// If dst is nil, a new matrix is allocated. The resulting L matrix is returned. -// LTo will panic if the receiver does not contain a factorization. -func (lq *LQ) LTo(dst *Dense) *Dense { - if !lq.isValid() { - panic(badLQ) - } - - r, c := lq.lq.Dims() - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - - // Disguise the LQ as a lower triangular. - t := &TriDense{ - mat: blas64.Triangular{ - N: r, - Stride: lq.lq.mat.Stride, - Data: lq.lq.mat.Data, - Uplo: blas.Lower, - Diag: blas.NonUnit, - }, - cap: lq.lq.capCols, - } - dst.Copy(t) - - if r == c { - return dst - } - // Zero right of the triangular. - for i := 0; i < r; i++ { - zero(dst.mat.Data[i*dst.mat.Stride+r : i*dst.mat.Stride+c]) - } - - return dst -} - -// QTo extracts the n×n orthonormal matrix Q from an LQ decomposition. -// If dst is nil, a new matrix is allocated. The resulting Q matrix is returned. -// QTo will panic if the receiver does not contain a factorization. -func (lq *LQ) QTo(dst *Dense) *Dense { - if !lq.isValid() { - panic(badLQ) - } - - _, c := lq.lq.Dims() - if dst == nil { - dst = NewDense(c, c, nil) - } else { - dst.reuseAsZeroed(c, c) - } - q := dst.mat - - // Set Q = I. - ldq := q.Stride - for i := 0; i < c; i++ { - q.Data[i*ldq+i] = 1 - } - - // Construct Q from the elementary reflectors. - work := []float64{0} - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, q, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, q, work, len(work)) - putFloats(work) - - return dst -} - -// SolveTo finds a minimum-norm solution to a system of linear equations defined -// by the matrices A and b, where A is an m×n matrix represented in its LQ factorized -// form. If A is singular or near-singular a Condition error is returned. -// See the documentation for Condition for more information. -// -// The minimization problem solved depends on the input parameters. -// If trans == false, find the minimum norm solution of A * X = B. -// If trans == true, find X such that ||A*X - B||_2 is minimized. -// The solution matrix, X, is stored in place into dst. -// SolveTo will panic if the receiver does not contain a factorization. -func (lq *LQ) SolveTo(dst *Dense, trans bool, b Matrix) error { - if !lq.isValid() { - panic(badLQ) - } - - r, c := lq.lq.Dims() - br, bc := b.Dims() - - // The LQ solve algorithm stores the result in-place into the right hand side. - // The storage for the answer must be large enough to hold both b and x. - // However, this method's receiver must be the size of x. Copy b, and then - // copy the result into x at the end. - if trans { - if c != br { - panic(ErrShape) - } - dst.reuseAs(r, bc) - } else { - if r != br { - panic(ErrShape) - } - dst.reuseAs(c, bc) - } - // Do not need to worry about overlap between x and b because w has its own - // independent storage. - w := getWorkspace(max(r, c), bc, false) - w.Copy(b) - t := lq.lq.asTriDense(lq.lq.mat.Rows, blas.NonUnit, blas.Lower).mat - if trans { - work := []float64{0} - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormlq(blas.Left, blas.NoTrans, lq.lq.mat, lq.tau, w.mat, work, len(work)) - putFloats(work) - - ok := lapack64.Trtrs(blas.Trans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - } else { - ok := lapack64.Trtrs(blas.NoTrans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - for i := r; i < c; i++ { - zero(w.mat.Data[i*w.mat.Stride : i*w.mat.Stride+bc]) - } - work := []float64{0} - lapack64.Ormlq(blas.Left, blas.Trans, lq.lq.mat, lq.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormlq(blas.Left, blas.Trans, lq.lq.mat, lq.tau, w.mat, work, len(work)) - putFloats(work) - } - // x was set above to be the correct size for the result. - dst.Copy(w) - putWorkspace(w) - if lq.cond > ConditionTolerance { - return Condition(lq.cond) - } - return nil -} - -// SolveVecTo finds a minimum-norm solution to a system of linear equations. -// See LQ.SolveTo for the full documentation. -// SolveToVec will panic if the receiver does not contain a factorization. -func (lq *LQ) SolveVecTo(dst *VecDense, trans bool, b Vector) error { - if !lq.isValid() { - panic(badLQ) - } - - r, c := lq.lq.Dims() - if _, bc := b.Dims(); bc != 1 { - panic(ErrShape) - } - - // The Solve implementation is non-trivial, so rather than duplicate the code, - // instead recast the VecDenses as Dense and call the matrix code. - bm := Matrix(b) - if rv, ok := b.(RawVectorer); ok { - bmat := rv.RawVector() - if dst != b { - dst.checkOverlap(bmat) - } - b := VecDense{mat: bmat} - bm = b.asDense() - } - if trans { - dst.reuseAs(r) - } else { - dst.reuseAs(c) - } - return lq.SolveTo(dst.asDense(), trans, bm) -} diff --git a/vendor/gonum.org/v1/gonum/mat/lu.go b/vendor/gonum.org/v1/gonum/mat/lu.go deleted file mode 100644 index e0437169b..000000000 --- a/vendor/gonum.org/v1/gonum/mat/lu.go +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/floats" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const ( - badSliceLength = "mat: improper slice length" - badLU = "mat: invalid LU factorization" -) - -// LU is a type for creating and using the LU factorization of a matrix. -type LU struct { - lu *Dense - pivot []int - cond float64 -} - -// updateCond updates the stored condition number of the matrix. anorm is the -// norm of the original matrix. If anorm is negative it will be estimated. -func (lu *LU) updateCond(anorm float64, norm lapack.MatrixNorm) { - n := lu.lu.mat.Cols - work := getFloats(4*n, false) - defer putFloats(work) - iwork := getInts(n, false) - defer putInts(iwork) - if anorm < 0 { - // This is an approximation. By the definition of a norm, - // |AB| <= |A| |B|. - // Since A = L*U, we get for the condition number κ that - // κ(A) := |A| |A^-1| = |L*U| |A^-1| <= |L| |U| |A^-1|, - // so this will overestimate the condition number somewhat. - // The norm of the original factorized matrix cannot be stored - // because of update possibilities. - u := lu.lu.asTriDense(n, blas.NonUnit, blas.Upper) - l := lu.lu.asTriDense(n, blas.Unit, blas.Lower) - unorm := lapack64.Lantr(norm, u.mat, work) - lnorm := lapack64.Lantr(norm, l.mat, work) - anorm = unorm * lnorm - } - v := lapack64.Gecon(norm, lu.lu.mat, anorm, work, iwork) - lu.cond = 1 / v -} - -// Factorize computes the LU factorization of the square matrix a and stores the -// result. The LU decomposition will complete regardless of the singularity of a. -// -// The LU factorization is computed with pivoting, and so really the decomposition -// is a PLU decomposition where P is a permutation matrix. The individual matrix -// factors can be extracted from the factorization using the Permutation method -// on Dense, and the LU LTo and UTo methods. -func (lu *LU) Factorize(a Matrix) { - lu.factorize(a, CondNorm) -} - -func (lu *LU) factorize(a Matrix, norm lapack.MatrixNorm) { - r, c := a.Dims() - if r != c { - panic(ErrSquare) - } - if lu.lu == nil { - lu.lu = NewDense(r, r, nil) - } else { - lu.lu.Reset() - lu.lu.reuseAs(r, r) - } - lu.lu.Copy(a) - if cap(lu.pivot) < r { - lu.pivot = make([]int, r) - } - lu.pivot = lu.pivot[:r] - work := getFloats(r, false) - anorm := lapack64.Lange(norm, lu.lu.mat, work) - putFloats(work) - lapack64.Getrf(lu.lu.mat, lu.pivot) - lu.updateCond(anorm, norm) -} - -// isValid returns whether the receiver contains a factorization. -func (lu *LU) isValid() bool { - return lu.lu != nil && !lu.lu.IsZero() -} - -// Cond returns the condition number for the factorized matrix. -// Cond will panic if the receiver does not contain a factorization. -func (lu *LU) Cond() float64 { - if !lu.isValid() { - panic(badLU) - } - return lu.cond -} - -// Reset resets the factorization so that it can be reused as the receiver of a -// dimensionally restricted operation. -func (lu *LU) Reset() { - if lu.lu != nil { - lu.lu.Reset() - } - lu.pivot = lu.pivot[:0] -} - -func (lu *LU) isZero() bool { - return len(lu.pivot) == 0 -} - -// Det returns the determinant of the matrix that has been factorized. In many -// expressions, using LogDet will be more numerically stable. -// Det will panic if the receiver does not contain a factorization. -func (lu *LU) Det() float64 { - det, sign := lu.LogDet() - return math.Exp(det) * sign -} - -// LogDet returns the log of the determinant and the sign of the determinant -// for the matrix that has been factorized. Numerical stability in product and -// division expressions is generally improved by working in log space. -// LogDet will panic if the receiver does not contain a factorization. -func (lu *LU) LogDet() (det float64, sign float64) { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - logDiag := getFloats(n, false) - defer putFloats(logDiag) - sign = 1.0 - for i := 0; i < n; i++ { - v := lu.lu.at(i, i) - if v < 0 { - sign *= -1 - } - if lu.pivot[i] != i { - sign *= -1 - } - logDiag[i] = math.Log(math.Abs(v)) - } - return floats.Sum(logDiag), sign -} - -// Pivot returns pivot indices that enable the construction of the permutation -// matrix P (see Dense.Permutation). If swaps == nil, then new memory will be -// allocated, otherwise the length of the input must be equal to the size of the -// factorized matrix. -// Pivot will panic if the receiver does not contain a factorization. -func (lu *LU) Pivot(swaps []int) []int { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if swaps == nil { - swaps = make([]int, n) - } - if len(swaps) != n { - panic(badSliceLength) - } - // Perform the inverse of the row swaps in order to find the final - // row swap position. - for i := range swaps { - swaps[i] = i - } - for i := n - 1; i >= 0; i-- { - v := lu.pivot[i] - swaps[i], swaps[v] = swaps[v], swaps[i] - } - return swaps -} - -// RankOne updates an LU factorization as if a rank-one update had been applied to -// the original matrix A, storing the result into the receiver. That is, if in -// the original LU decomposition P * L * U = A, in the updated decomposition -// P * L * U = A + alpha * x * y^T. -// RankOne will panic if orig does not contain a factorization. -func (lu *LU) RankOne(orig *LU, alpha float64, x, y Vector) { - if !orig.isValid() { - panic(badLU) - } - - // RankOne uses algorithm a1 on page 28 of "Multiple-Rank Updates to Matrix - // Factorizations for Nonlinear Analysis and Circuit Design" by Linzhong Deng. - // http://web.stanford.edu/group/SOL/dissertations/Linzhong-Deng-thesis.pdf - _, n := orig.lu.Dims() - if r, c := x.Dims(); r != n || c != 1 { - panic(ErrShape) - } - if r, c := y.Dims(); r != n || c != 1 { - panic(ErrShape) - } - if orig != lu { - if lu.isZero() { - if cap(lu.pivot) < n { - lu.pivot = make([]int, n) - } - lu.pivot = lu.pivot[:n] - if lu.lu == nil { - lu.lu = NewDense(n, n, nil) - } else { - lu.lu.reuseAs(n, n) - } - } else if len(lu.pivot) != n { - panic(ErrShape) - } - copy(lu.pivot, orig.pivot) - lu.lu.Copy(orig.lu) - } - - xs := getFloats(n, false) - defer putFloats(xs) - ys := getFloats(n, false) - defer putFloats(ys) - for i := 0; i < n; i++ { - xs[i] = x.AtVec(i) - ys[i] = y.AtVec(i) - } - - // Adjust for the pivoting in the LU factorization - for i, v := range lu.pivot { - xs[i], xs[v] = xs[v], xs[i] - } - - lum := lu.lu.mat - omega := alpha - for j := 0; j < n; j++ { - ujj := lum.Data[j*lum.Stride+j] - ys[j] /= ujj - theta := 1 + xs[j]*ys[j]*omega - beta := omega * ys[j] / theta - gamma := omega * xs[j] - omega -= beta * gamma - lum.Data[j*lum.Stride+j] *= theta - for i := j + 1; i < n; i++ { - xs[i] -= lum.Data[i*lum.Stride+j] * xs[j] - tmp := ys[i] - ys[i] -= lum.Data[j*lum.Stride+i] * ys[j] - lum.Data[i*lum.Stride+j] += beta * xs[i] - lum.Data[j*lum.Stride+i] += gamma * tmp - } - } - lu.updateCond(-1, CondNorm) -} - -// LTo extracts the lower triangular matrix from an LU factorization. -// If dst is nil, a new matrix is allocated. The resulting L matrix is returned. -// LTo will panic if the receiver does not contain a factorization. -func (lu *LU) LTo(dst *TriDense) *TriDense { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if dst == nil { - dst = NewTriDense(n, Lower, nil) - } else { - dst.reuseAs(n, Lower) - } - // Extract the lower triangular elements. - for i := 0; i < n; i++ { - for j := 0; j < i; j++ { - dst.mat.Data[i*dst.mat.Stride+j] = lu.lu.mat.Data[i*lu.lu.mat.Stride+j] - } - } - // Set ones on the diagonal. - for i := 0; i < n; i++ { - dst.mat.Data[i*dst.mat.Stride+i] = 1 - } - return dst -} - -// UTo extracts the upper triangular matrix from an LU factorization. -// If dst is nil, a new matrix is allocated. The resulting U matrix is returned. -// UTo will panic if the receiver does not contain a factorization. -func (lu *LU) UTo(dst *TriDense) *TriDense { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if dst == nil { - dst = NewTriDense(n, Upper, nil) - } else { - dst.reuseAs(n, Upper) - } - // Extract the upper triangular elements. - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - dst.mat.Data[i*dst.mat.Stride+j] = lu.lu.mat.Data[i*lu.lu.mat.Stride+j] - } - } - return dst -} - -// Permutation constructs an r×r permutation matrix with the given row swaps. -// A permutation matrix has exactly one element equal to one in each row and column -// and all other elements equal to zero. swaps[i] specifies the row with which -// i will be swapped, which is equivalent to the non-zero column of row i. -func (m *Dense) Permutation(r int, swaps []int) { - m.reuseAs(r, r) - for i := 0; i < r; i++ { - zero(m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+r]) - v := swaps[i] - if v < 0 || v >= r { - panic(ErrRowAccess) - } - m.mat.Data[i*m.mat.Stride+v] = 1 - } -} - -// SolveTo solves a system of linear equations using the LU decomposition of a matrix. -// It computes -// A * X = B if trans == false -// A^T * X = B if trans == true -// In both cases, A is represented in LU factorized form, and the matrix X is -// stored into dst. -// -// If A is singular or near-singular a Condition error is returned. See -// the documentation for Condition for more information. -// SolveTo will panic if the receiver does not contain a factorization. -func (lu *LU) SolveTo(dst *Dense, trans bool, b Matrix) error { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - br, bc := b.Dims() - if br != n { - panic(ErrShape) - } - // TODO(btracey): Should test the condition number instead of testing that - // the determinant is exactly zero. - if lu.Det() == 0 { - return Condition(math.Inf(1)) - } - - dst.reuseAs(n, bc) - bU, _ := untranspose(b) - var restore func() - if dst == bU { - dst, restore = dst.isolatedWorkspace(bU) - defer restore() - } else if rm, ok := bU.(RawMatrixer); ok { - dst.checkOverlap(rm.RawMatrix()) - } - - dst.Copy(b) - t := blas.NoTrans - if trans { - t = blas.Trans - } - lapack64.Getrs(t, lu.lu.mat, dst.mat, lu.pivot) - if lu.cond > ConditionTolerance { - return Condition(lu.cond) - } - return nil -} - -// SolveVecTo solves a system of linear equations using the LU decomposition of a matrix. -// It computes -// A * x = b if trans == false -// A^T * x = b if trans == true -// In both cases, A is represented in LU factorized form, and the vector x is -// stored into dst. -// -// If A is singular or near-singular a Condition error is returned. See -// the documentation for Condition for more information. -// SolveVecTo will panic if the receiver does not contain a factorization. -func (lu *LU) SolveVecTo(dst *VecDense, trans bool, b Vector) error { - if !lu.isValid() { - panic(badLU) - } - - _, n := lu.lu.Dims() - if br, bc := b.Dims(); br != n || bc != 1 { - panic(ErrShape) - } - switch rv := b.(type) { - default: - dst.reuseAs(n) - return lu.SolveTo(dst.asDense(), trans, b) - case RawVectorer: - if dst != b { - dst.checkOverlap(rv.RawVector()) - } - // TODO(btracey): Should test the condition number instead of testing that - // the determinant is exactly zero. - if lu.Det() == 0 { - return Condition(math.Inf(1)) - } - - dst.reuseAs(n) - var restore func() - if dst == b { - dst, restore = dst.isolatedWorkspace(b) - defer restore() - } - dst.CopyVec(b) - vMat := blas64.General{ - Rows: n, - Cols: 1, - Stride: dst.mat.Inc, - Data: dst.mat.Data, - } - t := blas.NoTrans - if trans { - t = blas.Trans - } - lapack64.Getrs(t, lu.lu.mat, vMat, lu.pivot) - if lu.cond > ConditionTolerance { - return Condition(lu.cond) - } - return nil - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/matrix.go b/vendor/gonum.org/v1/gonum/mat/matrix.go deleted file mode 100644 index 444d04457..000000000 --- a/vendor/gonum.org/v1/gonum/mat/matrix.go +++ /dev/null @@ -1,946 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/floats" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// Matrix is the basic matrix interface type. -type Matrix interface { - // Dims returns the dimensions of a Matrix. - Dims() (r, c int) - - // At returns the value of a matrix element at row i, column j. - // It will panic if i or j are out of bounds for the matrix. - At(i, j int) float64 - - // T returns the transpose of the Matrix. Whether T returns a copy of the - // underlying data is implementation dependent. - // This method may be implemented using the Transpose type, which - // provides an implicit matrix transpose. - T() Matrix -} - -var ( - _ Matrix = Transpose{} - _ Untransposer = Transpose{} -) - -// Transpose is a type for performing an implicit matrix transpose. It implements -// the Matrix interface, returning values from the transpose of the matrix within. -type Transpose struct { - Matrix Matrix -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Matrix field. -func (t Transpose) At(i, j int) float64 { - return t.Matrix.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. The number of rows returned -// is the number of columns in the Matrix field, and the number of columns is -// the number of rows in the Matrix field. -func (t Transpose) Dims() (r, c int) { - c, r = t.Matrix.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Matrix field. -func (t Transpose) T() Matrix { - return t.Matrix -} - -// Untranspose returns the Matrix field. -func (t Transpose) Untranspose() Matrix { - return t.Matrix -} - -// Untransposer is a type that can undo an implicit transpose. -type Untransposer interface { - // Note: This interface is needed to unify all of the Transpose types. In - // the mat methods, we need to test if the Matrix has been implicitly - // transposed. If this is checked by testing for the specific Transpose type - // then the behavior will be different if the user uses T() or TTri() for a - // triangular matrix. - - // Untranspose returns the underlying Matrix stored for the implicit transpose. - Untranspose() Matrix -} - -// UntransposeBander is a type that can undo an implicit band transpose. -type UntransposeBander interface { - // Untranspose returns the underlying Banded stored for the implicit transpose. - UntransposeBand() Banded -} - -// UntransposeTrier is a type that can undo an implicit triangular transpose. -type UntransposeTrier interface { - // Untranspose returns the underlying Triangular stored for the implicit transpose. - UntransposeTri() Triangular -} - -// UntransposeTriBander is a type that can undo an implicit triangular banded -// transpose. -type UntransposeTriBander interface { - // Untranspose returns the underlying Triangular stored for the implicit transpose. - UntransposeTriBand() TriBanded -} - -// Mutable is a matrix interface type that allows elements to be altered. -type Mutable interface { - // Set alters the matrix element at row i, column j to v. - // It will panic if i or j are out of bounds for the matrix. - Set(i, j int, v float64) - - Matrix -} - -// A RowViewer can return a Vector reflecting a row that is backed by the matrix -// data. The Vector returned will have length equal to the number of columns. -type RowViewer interface { - RowView(i int) Vector -} - -// A RawRowViewer can return a slice of float64 reflecting a row that is backed by the matrix -// data. -type RawRowViewer interface { - RawRowView(i int) []float64 -} - -// A ColViewer can return a Vector reflecting a column that is backed by the matrix -// data. The Vector returned will have length equal to the number of rows. -type ColViewer interface { - ColView(j int) Vector -} - -// A RawColViewer can return a slice of float64 reflecting a column that is backed by the matrix -// data. -type RawColViewer interface { - RawColView(j int) []float64 -} - -// A Cloner can make a copy of a into the receiver, overwriting the previous value of the -// receiver. The clone operation does not make any restriction on shape and will not cause -// shadowing. -type Cloner interface { - Clone(a Matrix) -} - -// A Reseter can reset the matrix so that it can be reused as the receiver of a dimensionally -// restricted operation. This is commonly used when the matrix is being used as a workspace -// or temporary matrix. -// -// If the matrix is a view, using the reset matrix may result in data corruption in elements -// outside the view. -type Reseter interface { - Reset() -} - -// A Copier can make a copy of elements of a into the receiver. The submatrix copied -// starts at row and column 0 and has dimensions equal to the minimum dimensions of -// the two matrices. The number of row and columns copied is returned. -// Copy will copy from a source that aliases the receiver unless the source is transposed; -// an aliasing transpose copy will panic with the exception for a special case when -// the source data has a unitary increment or stride. -type Copier interface { - Copy(a Matrix) (r, c int) -} - -// A Grower can grow the size of the represented matrix by the given number of rows and columns. -// Growing beyond the size given by the Caps method will result in the allocation of a new -// matrix and copying of the elements. If Grow is called with negative increments it will -// panic with ErrIndexOutOfRange. -type Grower interface { - Caps() (r, c int) - Grow(r, c int) Matrix -} - -// A BandWidther represents a banded matrix and can return the left and right half-bandwidths, k1 and -// k2. -type BandWidther interface { - BandWidth() (k1, k2 int) -} - -// A RawMatrixSetter can set the underlying blas64.General used by the receiver. There is no restriction -// on the shape of the receiver. Changes to the receiver's elements will be reflected in the blas64.General.Data. -type RawMatrixSetter interface { - SetRawMatrix(a blas64.General) -} - -// A RawMatrixer can return a blas64.General representation of the receiver. Changes to the blas64.General.Data -// slice will be reflected in the original matrix, changes to the Rows, Cols and Stride fields will not. -type RawMatrixer interface { - RawMatrix() blas64.General -} - -// A RawVectorer can return a blas64.Vector representation of the receiver. Changes to the blas64.Vector.Data -// slice will be reflected in the original matrix, changes to the Inc field will not. -type RawVectorer interface { - RawVector() blas64.Vector -} - -// A NonZeroDoer can call a function for each non-zero element of the receiver. -// The parameters of the function are the element indices and its value. -type NonZeroDoer interface { - DoNonZero(func(i, j int, v float64)) -} - -// A RowNonZeroDoer can call a function for each non-zero element of a row of the receiver. -// The parameters of the function are the element indices and its value. -type RowNonZeroDoer interface { - DoRowNonZero(i int, fn func(i, j int, v float64)) -} - -// A ColNonZeroDoer can call a function for each non-zero element of a column of the receiver. -// The parameters of the function are the element indices and its value. -type ColNonZeroDoer interface { - DoColNonZero(j int, fn func(i, j int, v float64)) -} - -// untranspose untransposes a matrix if applicable. If a is an Untransposer, then -// untranspose returns the underlying matrix and true. If it is not, then it returns -// the input matrix and false. -func untranspose(a Matrix) (Matrix, bool) { - if ut, ok := a.(Untransposer); ok { - return ut.Untranspose(), true - } - return a, false -} - -// untransposeExtract returns an untransposed matrix in a built-in matrix type. -// -// The untransposed matrix is returned unaltered if it is a built-in matrix type. -// Otherwise, if it implements a Raw method, an appropriate built-in type value -// is returned holding the raw matrix value of the input. If neither of these -// is possible, the untransposed matrix is returned. -func untransposeExtract(a Matrix) (Matrix, bool) { - ut, trans := untranspose(a) - switch m := ut.(type) { - case *DiagDense, *SymBandDense, *TriBandDense, *BandDense, *TriDense, *SymDense, *Dense: - return m, trans - // TODO(btracey): Add here if we ever have an equivalent of RawDiagDense. - case RawSymBander: - rsb := m.RawSymBand() - if rsb.Uplo != blas.Upper { - return ut, trans - } - var sb SymBandDense - sb.SetRawSymBand(rsb) - return &sb, trans - case RawTriBander: - rtb := m.RawTriBand() - if rtb.Diag == blas.Unit { - return ut, trans - } - var tb TriBandDense - tb.SetRawTriBand(rtb) - return &tb, trans - case RawBander: - var b BandDense - b.SetRawBand(m.RawBand()) - return &b, trans - case RawTriangular: - rt := m.RawTriangular() - if rt.Diag == blas.Unit { - return ut, trans - } - var t TriDense - t.SetRawTriangular(rt) - return &t, trans - case RawSymmetricer: - rs := m.RawSymmetric() - if rs.Uplo != blas.Upper { - return ut, trans - } - var s SymDense - s.SetRawSymmetric(rs) - return &s, trans - case RawMatrixer: - var d Dense - d.SetRawMatrix(m.RawMatrix()) - return &d, trans - default: - return ut, trans - } -} - -// TODO(btracey): Consider adding CopyCol/CopyRow if the behavior seems useful. -// TODO(btracey): Add in fast paths to Row/Col for the other concrete types -// (TriDense, etc.) as well as relevant interfaces (RowColer, RawRowViewer, etc.) - -// Col copies the elements in the jth column of the matrix into the slice dst. -// The length of the provided slice must equal the number of rows, unless the -// slice is nil in which case a new slice is first allocated. -func Col(dst []float64, j int, a Matrix) []float64 { - r, c := a.Dims() - if j < 0 || j >= c { - panic(ErrColAccess) - } - if dst == nil { - dst = make([]float64, r) - } else { - if len(dst) != r { - panic(ErrColLength) - } - } - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - m := rm.RawMatrix() - if aTrans { - copy(dst, m.Data[j*m.Stride:j*m.Stride+m.Cols]) - return dst - } - blas64.Copy(blas64.Vector{N: r, Inc: m.Stride, Data: m.Data[j:]}, - blas64.Vector{N: r, Inc: 1, Data: dst}, - ) - return dst - } - for i := 0; i < r; i++ { - dst[i] = a.At(i, j) - } - return dst -} - -// Row copies the elements in the ith row of the matrix into the slice dst. -// The length of the provided slice must equal the number of columns, unless the -// slice is nil in which case a new slice is first allocated. -func Row(dst []float64, i int, a Matrix) []float64 { - r, c := a.Dims() - if i < 0 || i >= r { - panic(ErrColAccess) - } - if dst == nil { - dst = make([]float64, c) - } else { - if len(dst) != c { - panic(ErrRowLength) - } - } - aU, aTrans := untranspose(a) - if rm, ok := aU.(RawMatrixer); ok { - m := rm.RawMatrix() - if aTrans { - blas64.Copy(blas64.Vector{N: c, Inc: m.Stride, Data: m.Data[i:]}, - blas64.Vector{N: c, Inc: 1, Data: dst}, - ) - return dst - } - copy(dst, m.Data[i*m.Stride:i*m.Stride+m.Cols]) - return dst - } - for j := 0; j < c; j++ { - dst[j] = a.At(i, j) - } - return dst -} - -// Cond returns the condition number of the given matrix under the given norm. -// The condition number must be based on the 1-norm, 2-norm or ∞-norm. -// Cond will panic with matrix.ErrShape if the matrix has zero size. -// -// BUG(btracey): The computation of the 1-norm and ∞-norm for non-square matrices -// is innacurate, although is typically the right order of magnitude. See -// https://github.com/xianyi/OpenBLAS/issues/636. While the value returned will -// change with the resolution of this bug, the result from Cond will match the -// condition number used internally. -func Cond(a Matrix, norm float64) float64 { - m, n := a.Dims() - if m == 0 || n == 0 { - panic(ErrShape) - } - var lnorm lapack.MatrixNorm - switch norm { - default: - panic("mat: bad norm value") - case 1: - lnorm = lapack.MaxColumnSum - case 2: - var svd SVD - ok := svd.Factorize(a, SVDNone) - if !ok { - return math.Inf(1) - } - return svd.Cond() - case math.Inf(1): - lnorm = lapack.MaxRowSum - } - - if m == n { - // Use the LU decomposition to compute the condition number. - var lu LU - lu.factorize(a, lnorm) - return lu.Cond() - } - if m > n { - // Use the QR factorization to compute the condition number. - var qr QR - qr.factorize(a, lnorm) - return qr.Cond() - } - // Use the LQ factorization to compute the condition number. - var lq LQ - lq.factorize(a, lnorm) - return lq.Cond() -} - -// Det returns the determinant of the matrix a. In many expressions using LogDet -// will be more numerically stable. -func Det(a Matrix) float64 { - det, sign := LogDet(a) - return math.Exp(det) * sign -} - -// Dot returns the sum of the element-wise product of a and b. -// Dot panics if the matrix sizes are unequal. -func Dot(a, b Vector) float64 { - la := a.Len() - lb := b.Len() - if la != lb { - panic(ErrShape) - } - if arv, ok := a.(RawVectorer); ok { - if brv, ok := b.(RawVectorer); ok { - return blas64.Dot(arv.RawVector(), brv.RawVector()) - } - } - var sum float64 - for i := 0; i < la; i++ { - sum += a.At(i, 0) * b.At(i, 0) - } - return sum -} - -// Equal returns whether the matrices a and b have the same size -// and are element-wise equal. -func Equal(a, b Matrix) bool { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - if rma, ok := aU.(RawMatrixer); ok { - if rmb, ok := bU.(RawMatrixer); ok { - ra := rma.RawMatrix() - rb := rmb.RawMatrix() - if aTrans == bTrans { - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if ra.Data[i*ra.Stride+j] != rb.Data[i*rb.Stride+j] { - return false - } - } - } - return true - } - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if ra.Data[i*ra.Stride+j] != rb.Data[j*rb.Stride+i] { - return false - } - } - } - return true - } - } - if rma, ok := aU.(RawSymmetricer); ok { - if rmb, ok := bU.(RawSymmetricer); ok { - ra := rma.RawSymmetric() - rb := rmb.RawSymmetric() - // Symmetric matrices are always upper and equal to their transpose. - for i := 0; i < ra.N; i++ { - for j := i; j < ra.N; j++ { - if ra.Data[i*ra.Stride+j] != rb.Data[i*rb.Stride+j] { - return false - } - } - } - return true - } - } - if ra, ok := aU.(*VecDense); ok { - if rb, ok := bU.(*VecDense); ok { - // If the raw vectors are the same length they must either both be - // transposed or both not transposed (or have length 1). - for i := 0; i < ra.mat.N; i++ { - if ra.mat.Data[i*ra.mat.Inc] != rb.mat.Data[i*rb.mat.Inc] { - return false - } - } - return true - } - } - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if a.At(i, j) != b.At(i, j) { - return false - } - } - } - return true -} - -// EqualApprox returns whether the matrices a and b have the same size and contain all equal -// elements with tolerance for element-wise equality specified by epsilon. Matrices -// with non-equal shapes are not equal. -func EqualApprox(a, b Matrix, epsilon float64) bool { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br || ac != bc { - return false - } - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - if rma, ok := aU.(RawMatrixer); ok { - if rmb, ok := bU.(RawMatrixer); ok { - ra := rma.RawMatrix() - rb := rmb.RawMatrix() - if aTrans == bTrans { - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if !floats.EqualWithinAbsOrRel(ra.Data[i*ra.Stride+j], rb.Data[i*rb.Stride+j], epsilon, epsilon) { - return false - } - } - } - return true - } - for i := 0; i < ra.Rows; i++ { - for j := 0; j < ra.Cols; j++ { - if !floats.EqualWithinAbsOrRel(ra.Data[i*ra.Stride+j], rb.Data[j*rb.Stride+i], epsilon, epsilon) { - return false - } - } - } - return true - } - } - if rma, ok := aU.(RawSymmetricer); ok { - if rmb, ok := bU.(RawSymmetricer); ok { - ra := rma.RawSymmetric() - rb := rmb.RawSymmetric() - // Symmetric matrices are always upper and equal to their transpose. - for i := 0; i < ra.N; i++ { - for j := i; j < ra.N; j++ { - if !floats.EqualWithinAbsOrRel(ra.Data[i*ra.Stride+j], rb.Data[i*rb.Stride+j], epsilon, epsilon) { - return false - } - } - } - return true - } - } - if ra, ok := aU.(*VecDense); ok { - if rb, ok := bU.(*VecDense); ok { - // If the raw vectors are the same length they must either both be - // transposed or both not transposed (or have length 1). - for i := 0; i < ra.mat.N; i++ { - if !floats.EqualWithinAbsOrRel(ra.mat.Data[i*ra.mat.Inc], rb.mat.Data[i*rb.mat.Inc], epsilon, epsilon) { - return false - } - } - return true - } - } - for i := 0; i < ar; i++ { - for j := 0; j < ac; j++ { - if !floats.EqualWithinAbsOrRel(a.At(i, j), b.At(i, j), epsilon, epsilon) { - return false - } - } - } - return true -} - -// LogDet returns the log of the determinant and the sign of the determinant -// for the matrix that has been factorized. Numerical stability in product and -// division expressions is generally improved by working in log space. -func LogDet(a Matrix) (det float64, sign float64) { - // TODO(btracey): Add specialized routines for TriDense, etc. - var lu LU - lu.Factorize(a) - return lu.LogDet() -} - -// Max returns the largest element value of the matrix A. -// Max will panic with matrix.ErrShape if the matrix has zero size. -func Max(a Matrix) float64 { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrShape) - } - // Max(A) = Max(A^T) - aU, _ := untranspose(a) - switch m := aU.(type) { - case RawMatrixer: - rm := m.RawMatrix() - max := math.Inf(-1) - for i := 0; i < rm.Rows; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { - if v > max { - max = v - } - } - } - return max - case RawTriangular: - rm := m.RawTriangular() - // The max of a triangular is at least 0 unless the size is 1. - if rm.N == 1 { - return rm.Data[0] - } - max := 0.0 - if rm.Uplo == blas.Upper { - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v > max { - max = v - } - } - } - return max - } - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+i+1] { - if v > max { - max = v - } - } - } - return max - case RawSymmetricer: - rm := m.RawSymmetric() - if rm.Uplo != blas.Upper { - panic(badSymTriangle) - } - max := math.Inf(-1) - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v > max { - max = v - } - } - } - return max - default: - r, c := aU.Dims() - max := math.Inf(-1) - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - v := aU.At(i, j) - if v > max { - max = v - } - } - } - return max - } -} - -// Min returns the smallest element value of the matrix A. -// Min will panic with matrix.ErrShape if the matrix has zero size. -func Min(a Matrix) float64 { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrShape) - } - // Min(A) = Min(A^T) - aU, _ := untranspose(a) - switch m := aU.(type) { - case RawMatrixer: - rm := m.RawMatrix() - min := math.Inf(1) - for i := 0; i < rm.Rows; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { - if v < min { - min = v - } - } - } - return min - case RawTriangular: - rm := m.RawTriangular() - // The min of a triangular is at most 0 unless the size is 1. - if rm.N == 1 { - return rm.Data[0] - } - min := 0.0 - if rm.Uplo == blas.Upper { - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v < min { - min = v - } - } - } - return min - } - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+i+1] { - if v < min { - min = v - } - } - } - return min - case RawSymmetricer: - rm := m.RawSymmetric() - if rm.Uplo != blas.Upper { - panic(badSymTriangle) - } - min := math.Inf(1) - for i := 0; i < rm.N; i++ { - for _, v := range rm.Data[i*rm.Stride+i : i*rm.Stride+rm.N] { - if v < min { - min = v - } - } - } - return min - default: - r, c := aU.Dims() - min := math.Inf(1) - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - v := aU.At(i, j) - if v < min { - min = v - } - } - } - return min - } -} - -// Norm returns the specified (induced) norm of the matrix a. See -// https://en.wikipedia.org/wiki/Matrix_norm for the definition of an induced norm. -// -// Valid norms are: -// 1 - The maximum absolute column sum -// 2 - Frobenius norm, the square root of the sum of the squares of the elements. -// Inf - The maximum absolute row sum. -// Norm will panic with ErrNormOrder if an illegal norm order is specified and -// with matrix.ErrShape if the matrix has zero size. -func Norm(a Matrix, norm float64) float64 { - r, c := a.Dims() - if r == 0 || c == 0 { - panic(ErrShape) - } - aU, aTrans := untranspose(a) - var work []float64 - switch rma := aU.(type) { - case RawMatrixer: - rm := rma.RawMatrix() - n := normLapack(norm, aTrans) - if n == lapack.MaxColumnSum { - work = getFloats(rm.Cols, false) - defer putFloats(work) - } - return lapack64.Lange(n, rm, work) - case RawTriangular: - rm := rma.RawTriangular() - n := normLapack(norm, aTrans) - if n == lapack.MaxRowSum || n == lapack.MaxColumnSum { - work = getFloats(rm.N, false) - defer putFloats(work) - } - return lapack64.Lantr(n, rm, work) - case RawSymmetricer: - rm := rma.RawSymmetric() - n := normLapack(norm, aTrans) - if n == lapack.MaxRowSum || n == lapack.MaxColumnSum { - work = getFloats(rm.N, false) - defer putFloats(work) - } - return lapack64.Lansy(n, rm, work) - case *VecDense: - rv := rma.RawVector() - switch norm { - default: - panic("unreachable") - case 1: - if aTrans { - imax := blas64.Iamax(rv) - return math.Abs(rma.At(imax, 0)) - } - return blas64.Asum(rv) - case 2: - return blas64.Nrm2(rv) - case math.Inf(1): - if aTrans { - return blas64.Asum(rv) - } - imax := blas64.Iamax(rv) - return math.Abs(rma.At(imax, 0)) - } - } - switch norm { - default: - panic("unreachable") - case 1: - var max float64 - for j := 0; j < c; j++ { - var sum float64 - for i := 0; i < r; i++ { - sum += math.Abs(a.At(i, j)) - } - if sum > max { - max = sum - } - } - return max - case 2: - var sum float64 - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - v := a.At(i, j) - sum += v * v - } - } - return math.Sqrt(sum) - case math.Inf(1): - var max float64 - for i := 0; i < r; i++ { - var sum float64 - for j := 0; j < c; j++ { - sum += math.Abs(a.At(i, j)) - } - if sum > max { - max = sum - } - } - return max - } -} - -// normLapack converts the float64 norm input in Norm to a lapack.MatrixNorm. -func normLapack(norm float64, aTrans bool) lapack.MatrixNorm { - switch norm { - case 1: - n := lapack.MaxColumnSum - if aTrans { - n = lapack.MaxRowSum - } - return n - case 2: - return lapack.Frobenius - case math.Inf(1): - n := lapack.MaxRowSum - if aTrans { - n = lapack.MaxColumnSum - } - return n - default: - panic(ErrNormOrder) - } -} - -// Sum returns the sum of the elements of the matrix. -func Sum(a Matrix) float64 { - // TODO(btracey): Add a fast path for the other supported matrix types. - - r, c := a.Dims() - var sum float64 - aU, _ := untranspose(a) - if rma, ok := aU.(RawMatrixer); ok { - rm := rma.RawMatrix() - for i := 0; i < rm.Rows; i++ { - for _, v := range rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] { - sum += v - } - } - return sum - } - for i := 0; i < r; i++ { - for j := 0; j < c; j++ { - sum += a.At(i, j) - } - } - return sum -} - -// A Tracer can compute the trace of the matrix. Trace must panic if the -// matrix is not square. -type Tracer interface { - Trace() float64 -} - -// Trace returns the trace of the matrix. Trace will panic if the -// matrix is not square. -func Trace(a Matrix) float64 { - m, _ := untransposeExtract(a) - if t, ok := m.(Tracer); ok { - return t.Trace() - } - r, c := a.Dims() - if r != c { - panic(ErrSquare) - } - var v float64 - for i := 0; i < r; i++ { - v += a.At(i, i) - } - return v -} - -func min(a, b int) int { - if a < b { - return a - } - return b -} - -func max(a, b int) int { - if a > b { - return a - } - return b -} - -// use returns a float64 slice with l elements, using f if it -// has the necessary capacity, otherwise creating a new slice. -func use(f []float64, l int) []float64 { - if l <= cap(f) { - return f[:l] - } - return make([]float64, l) -} - -// useZeroed returns a float64 slice with l elements, using f if it -// has the necessary capacity, otherwise creating a new slice. The -// elements of the returned slice are guaranteed to be zero. -func useZeroed(f []float64, l int) []float64 { - if l <= cap(f) { - f = f[:l] - zero(f) - return f - } - return make([]float64, l) -} - -// zero zeros the given slice's elements. -func zero(f []float64) { - for i := range f { - f[i] = 0 - } -} - -// useInt returns an int slice with l elements, using i if it -// has the necessary capacity, otherwise creating a new slice. -func useInt(i []int, l int) []int { - if l <= cap(i) { - return i[:l] - } - return make([]int, l) -} diff --git a/vendor/gonum.org/v1/gonum/mat/offset.go b/vendor/gonum.org/v1/gonum/mat/offset.go deleted file mode 100644 index af2c03b64..000000000 --- a/vendor/gonum.org/v1/gonum/mat/offset.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !appengine,!safe - -package mat - -import "unsafe" - -// offset returns the number of float64 values b[0] is after a[0]. -func offset(a, b []float64) int { - if &a[0] == &b[0] { - return 0 - } - // This expression must be atomic with respect to GC moves. - // At this stage this is true, because the GC does not - // move. See https://golang.org/issue/12445. - return int(uintptr(unsafe.Pointer(&b[0]))-uintptr(unsafe.Pointer(&a[0]))) / int(unsafe.Sizeof(float64(0))) -} diff --git a/vendor/gonum.org/v1/gonum/mat/offset_appengine.go b/vendor/gonum.org/v1/gonum/mat/offset_appengine.go deleted file mode 100644 index df617478c..000000000 --- a/vendor/gonum.org/v1/gonum/mat/offset_appengine.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build appengine safe - -package mat - -import "reflect" - -var sizeOfFloat64 = int(reflect.TypeOf(float64(0)).Size()) - -// offset returns the number of float64 values b[0] is after a[0]. -func offset(a, b []float64) int { - va0 := reflect.ValueOf(a).Index(0) - vb0 := reflect.ValueOf(b).Index(0) - if va0.Addr() == vb0.Addr() { - return 0 - } - // This expression must be atomic with respect to GC moves. - // At this stage this is true, because the GC does not - // move. See https://golang.org/issue/12445. - return int(vb0.UnsafeAddr()-va0.UnsafeAddr()) / sizeOfFloat64 -} diff --git a/vendor/gonum.org/v1/gonum/mat/pool.go b/vendor/gonum.org/v1/gonum/mat/pool.go deleted file mode 100644 index 25ca29f18..000000000 --- a/vendor/gonum.org/v1/gonum/mat/pool.go +++ /dev/null @@ -1,236 +0,0 @@ -// Copyright ©2014 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "sync" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var tab64 = [64]byte{ - 0x3f, 0x00, 0x3a, 0x01, 0x3b, 0x2f, 0x35, 0x02, - 0x3c, 0x27, 0x30, 0x1b, 0x36, 0x21, 0x2a, 0x03, - 0x3d, 0x33, 0x25, 0x28, 0x31, 0x12, 0x1c, 0x14, - 0x37, 0x1e, 0x22, 0x0b, 0x2b, 0x0e, 0x16, 0x04, - 0x3e, 0x39, 0x2e, 0x34, 0x26, 0x1a, 0x20, 0x29, - 0x32, 0x24, 0x11, 0x13, 0x1d, 0x0a, 0x0d, 0x15, - 0x38, 0x2d, 0x19, 0x1f, 0x23, 0x10, 0x09, 0x0c, - 0x2c, 0x18, 0x0f, 0x08, 0x17, 0x07, 0x06, 0x05, -} - -// bits returns the ceiling of base 2 log of v. -// Approach based on http://stackoverflow.com/a/11398748. -func bits(v uint64) byte { - if v == 0 { - return 0 - } - v <<= 2 - v-- - v |= v >> 1 - v |= v >> 2 - v |= v >> 4 - v |= v >> 8 - v |= v >> 16 - v |= v >> 32 - return tab64[((v-(v>>1))*0x07EDD5E59A4E28C2)>>58] - 1 -} - -var ( - // pool contains size stratified workspace Dense pools. - // Each pool element i returns sized matrices with a data - // slice capped at 1< 2. - if !m.IsZero() { - if fr != r { - panic(ErrShape) - } - if _, lc := factors[len(factors)-1].Dims(); lc != c { - panic(ErrShape) - } - } - - dims := make([]int, len(factors)+1) - dims[0] = r - dims[len(dims)-1] = c - pc := fc - for i, f := range factors[1:] { - cr, cc := f.Dims() - dims[i+1] = cr - if pc != cr { - panic(ErrShape) - } - pc = cc - } - - return &multiplier{ - factors: factors, - dims: dims, - table: newTable(len(factors)), - } -} - -// optimize determines an optimal matrix multiply operation order. -func (p *multiplier) optimize() { - if debugProductWalk { - fmt.Printf("chain dims: %v\n", p.dims) - } - const maxInt = int(^uint(0) >> 1) - for f := 1; f < len(p.factors); f++ { - for i := 0; i < len(p.factors)-f; i++ { - j := i + f - p.table.set(i, j, entry{cost: maxInt}) - for k := i; k < j; k++ { - cost := p.table.at(i, k).cost + p.table.at(k+1, j).cost + p.dims[i]*p.dims[k+1]*p.dims[j+1] - if cost < p.table.at(i, j).cost { - p.table.set(i, j, entry{cost: cost, k: k}) - } - } - } - } -} - -// multiply walks the optimal operation tree found by optimize, -// leaving the final result in the stack. It returns the -// product, which may be copied but should be returned to -// the workspace pool. -func (p *multiplier) multiply() *Dense { - result, _ := p.multiplySubchain(0, len(p.factors)-1) - if debugProductWalk { - r, c := result.Dims() - fmt.Printf("\tpop result (%d×%d) cost=%d\n", r, c, p.table.at(0, len(p.factors)-1).cost) - } - return result.(*Dense) -} - -func (p *multiplier) multiplySubchain(i, j int) (m Matrix, intermediate bool) { - if i == j { - return p.factors[i], false - } - - a, aTmp := p.multiplySubchain(i, p.table.at(i, j).k) - b, bTmp := p.multiplySubchain(p.table.at(i, j).k+1, j) - - ar, ac := a.Dims() - br, bc := b.Dims() - if ac != br { - // Panic with a string since this - // is not a user-facing panic. - panic(ErrShape.Error()) - } - - if debugProductWalk { - fmt.Printf("\tpush f[%d] (%d×%d)%s * f[%d] (%d×%d)%s\n", - i, ar, ac, result(aTmp), j, br, bc, result(bTmp)) - } - - r := getWorkspace(ar, bc, false) - r.Mul(a, b) - if aTmp { - putWorkspace(a.(*Dense)) - } - if bTmp { - putWorkspace(b.(*Dense)) - } - return r, true -} - -type entry struct { - k int // is the chain subdivision index. - cost int // cost is the cost of the operation. -} - -// table is a row major n×n dynamic programming table. -type table struct { - n int - entries []entry -} - -func newTable(n int) table { - return table{n: n, entries: make([]entry, n*n)} -} - -func (t table) at(i, j int) entry { return t.entries[i*t.n+j] } -func (t table) set(i, j int, e entry) { t.entries[i*t.n+j] = e } - -type result bool - -func (r result) String() string { - if r { - return " (popped result)" - } - return "" -} diff --git a/vendor/gonum.org/v1/gonum/mat/qr.go b/vendor/gonum.org/v1/gonum/mat/qr.go deleted file mode 100644 index bf38ee4d6..000000000 --- a/vendor/gonum.org/v1/gonum/mat/qr.go +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -const badQR = "mat: invalid QR factorization" - -// QR is a type for creating and using the QR factorization of a matrix. -type QR struct { - qr *Dense - tau []float64 - cond float64 -} - -func (qr *QR) updateCond(norm lapack.MatrixNorm) { - // Since A = Q*R, and Q is orthogonal, we get for the condition number κ - // κ(A) := |A| |A^-1| = |Q*R| |(Q*R)^-1| = |R| |R^-1 * Q^T| - // = |R| |R^-1| = κ(R), - // where we used that fact that Q^-1 = Q^T. However, this assumes that - // the matrix norm is invariant under orthogonal transformations which - // is not the case for CondNorm. Hopefully the error is negligible: κ - // is only a qualitative measure anyway. - n := qr.qr.mat.Cols - work := getFloats(3*n, false) - iwork := getInts(n, false) - r := qr.qr.asTriDense(n, blas.NonUnit, blas.Upper) - v := lapack64.Trcon(norm, r.mat, work, iwork) - putFloats(work) - putInts(iwork) - qr.cond = 1 / v -} - -// Factorize computes the QR factorization of an m×n matrix a where m >= n. The QR -// factorization always exists even if A is singular. -// -// The QR decomposition is a factorization of the matrix A such that A = Q * R. -// The matrix Q is an orthonormal m×m matrix, and R is an m×n upper triangular matrix. -// Q and R can be extracted using the QTo and RTo methods. -func (qr *QR) Factorize(a Matrix) { - qr.factorize(a, CondNorm) -} - -func (qr *QR) factorize(a Matrix, norm lapack.MatrixNorm) { - m, n := a.Dims() - if m < n { - panic(ErrShape) - } - k := min(m, n) - if qr.qr == nil { - qr.qr = &Dense{} - } - qr.qr.Clone(a) - work := []float64{0} - qr.tau = make([]float64, k) - lapack64.Geqrf(qr.qr.mat, qr.tau, work, -1) - - work = getFloats(int(work[0]), false) - lapack64.Geqrf(qr.qr.mat, qr.tau, work, len(work)) - putFloats(work) - qr.updateCond(norm) -} - -// isValid returns whether the receiver contains a factorization. -func (qr *QR) isValid() bool { - return qr.qr != nil && !qr.qr.IsZero() -} - -// Cond returns the condition number for the factorized matrix. -// Cond will panic if the receiver does not contain a factorization. -func (qr *QR) Cond() float64 { - if !qr.isValid() { - panic(badQR) - } - return qr.cond -} - -// TODO(btracey): Add in the "Reduced" forms for extracting the n×n orthogonal -// and upper triangular matrices. - -// RTo extracts the m×n upper trapezoidal matrix from a QR decomposition. -// If dst is nil, a new matrix is allocated. The resulting dst matrix is returned. -// RTo will panic if the receiver does not contain a factorization. -func (qr *QR) RTo(dst *Dense) *Dense { - if !qr.isValid() { - panic(badQR) - } - - r, c := qr.qr.Dims() - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - - // Disguise the QR as an upper triangular - t := &TriDense{ - mat: blas64.Triangular{ - N: c, - Stride: qr.qr.mat.Stride, - Data: qr.qr.mat.Data, - Uplo: blas.Upper, - Diag: blas.NonUnit, - }, - cap: qr.qr.capCols, - } - dst.Copy(t) - - // Zero below the triangular. - for i := r; i < c; i++ { - zero(dst.mat.Data[i*dst.mat.Stride : i*dst.mat.Stride+c]) - } - - return dst -} - -// QTo extracts the m×m orthonormal matrix Q from a QR decomposition. -// If dst is nil, a new matrix is allocated. The resulting Q matrix is returned. -// QTo will panic if the receiver does not contain a factorization. -func (qr *QR) QTo(dst *Dense) *Dense { - if !qr.isValid() { - panic(badQR) - } - - r, _ := qr.qr.Dims() - if dst == nil { - dst = NewDense(r, r, nil) - } else { - dst.reuseAsZeroed(r, r) - } - - // Set Q = I. - for i := 0; i < r*r; i += r + 1 { - dst.mat.Data[i] = 1 - } - - // Construct Q from the elementary reflectors. - work := []float64{0} - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, dst.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, dst.mat, work, len(work)) - putFloats(work) - - return dst -} - -// SolveTo finds a minimum-norm solution to a system of linear equations defined -// by the matrices A and b, where A is an m×n matrix represented in its QR factorized -// form. If A is singular or near-singular a Condition error is returned. -// See the documentation for Condition for more information. -// -// The minimization problem solved depends on the input parameters. -// If trans == false, find X such that ||A*X - B||_2 is minimized. -// If trans == true, find the minimum norm solution of A^T * X = B. -// The solution matrix, X, is stored in place into dst. -// SolveTo will panic if the receiver does not contain a factorization. -func (qr *QR) SolveTo(dst *Dense, trans bool, b Matrix) error { - if !qr.isValid() { - panic(badQR) - } - - r, c := qr.qr.Dims() - br, bc := b.Dims() - - // The QR solve algorithm stores the result in-place into the right hand side. - // The storage for the answer must be large enough to hold both b and x. - // However, this method's receiver must be the size of x. Copy b, and then - // copy the result into m at the end. - if trans { - if c != br { - panic(ErrShape) - } - dst.reuseAs(r, bc) - } else { - if r != br { - panic(ErrShape) - } - dst.reuseAs(c, bc) - } - // Do not need to worry about overlap between m and b because x has its own - // independent storage. - w := getWorkspace(max(r, c), bc, false) - w.Copy(b) - t := qr.qr.asTriDense(qr.qr.mat.Cols, blas.NonUnit, blas.Upper).mat - if trans { - ok := lapack64.Trtrs(blas.Trans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - for i := c; i < r; i++ { - zero(w.mat.Data[i*w.mat.Stride : i*w.mat.Stride+bc]) - } - work := []float64{0} - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormqr(blas.Left, blas.NoTrans, qr.qr.mat, qr.tau, w.mat, work, len(work)) - putFloats(work) - } else { - work := []float64{0} - lapack64.Ormqr(blas.Left, blas.Trans, qr.qr.mat, qr.tau, w.mat, work, -1) - work = getFloats(int(work[0]), false) - lapack64.Ormqr(blas.Left, blas.Trans, qr.qr.mat, qr.tau, w.mat, work, len(work)) - putFloats(work) - - ok := lapack64.Trtrs(blas.NoTrans, t, w.mat) - if !ok { - return Condition(math.Inf(1)) - } - } - // X was set above to be the correct size for the result. - dst.Copy(w) - putWorkspace(w) - if qr.cond > ConditionTolerance { - return Condition(qr.cond) - } - return nil -} - -// SolveVecTo finds a minimum-norm solution to a system of linear equations, -// Ax = b. -// See QR.SolveTo for the full documentation. -// SolveVecTo will panic if the receiver does not contain a factorization. -func (qr *QR) SolveVecTo(dst *VecDense, trans bool, b Vector) error { - if !qr.isValid() { - panic(badQR) - } - - r, c := qr.qr.Dims() - if _, bc := b.Dims(); bc != 1 { - panic(ErrShape) - } - - // The Solve implementation is non-trivial, so rather than duplicate the code, - // instead recast the VecDenses as Dense and call the matrix code. - bm := Matrix(b) - if rv, ok := b.(RawVectorer); ok { - bmat := rv.RawVector() - if dst != b { - dst.checkOverlap(bmat) - } - b := VecDense{mat: bmat} - bm = b.asDense() - } - if trans { - dst.reuseAs(r) - } else { - dst.reuseAs(c) - } - return qr.SolveTo(dst.asDense(), trans, bm) - -} diff --git a/vendor/gonum.org/v1/gonum/mat/shadow.go b/vendor/gonum.org/v1/gonum/mat/shadow.go deleted file mode 100644 index cc62e44f0..000000000 --- a/vendor/gonum.org/v1/gonum/mat/shadow.go +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas/blas64" -) - -const ( - // regionOverlap is the panic string used for the general case - // of a matrix region overlap between a source and destination. - regionOverlap = "mat: bad region: overlap" - - // regionIdentity is the panic string used for the specific - // case of complete agreement between a source and a destination. - regionIdentity = "mat: bad region: identical" - - // mismatchedStrides is the panic string used for overlapping - // data slices with differing strides. - mismatchedStrides = "mat: bad region: different strides" -) - -// checkOverlap returns false if the receiver does not overlap data elements -// referenced by the parameter and panics otherwise. -// -// checkOverlap methods return a boolean to allow the check call to be added to a -// boolean expression, making use of short-circuit operators. -func checkOverlap(a, b blas64.General) bool { - if cap(a.Data) == 0 || cap(b.Data) == 0 { - return false - } - - off := offset(a.Data[:1], b.Data[:1]) - - if off == 0 { - // At least one element overlaps. - if a.Cols == b.Cols && a.Rows == b.Rows && a.Stride == b.Stride { - panic(regionIdentity) - } - panic(regionOverlap) - } - - if off > 0 && len(a.Data) <= off { - // We know a is completely before b. - return false - } - if off < 0 && len(b.Data) <= -off { - // We know a is completely after b. - return false - } - - if a.Stride != b.Stride { - // Too hard, so assume the worst. - panic(mismatchedStrides) - } - - if off < 0 { - off = -off - a.Cols, b.Cols = b.Cols, a.Cols - } - if rectanglesOverlap(off, a.Cols, b.Cols, a.Stride) { - panic(regionOverlap) - } - return false -} - -func (m *Dense) checkOverlap(a blas64.General) bool { - return checkOverlap(m.RawMatrix(), a) -} - -func (m *Dense) checkOverlapMatrix(a Matrix) bool { - if m == a { - return false - } - var amat blas64.General - switch a := a.(type) { - default: - return false - case RawMatrixer: - amat = a.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(a.RawSymmetric()) - case RawTriangular: - amat = generalFromTriangular(a.RawTriangular()) - } - return m.checkOverlap(amat) -} - -func (s *SymDense) checkOverlap(a blas64.General) bool { - return checkOverlap(generalFromSymmetric(s.RawSymmetric()), a) -} - -func (s *SymDense) checkOverlapMatrix(a Matrix) bool { - if s == a { - return false - } - var amat blas64.General - switch a := a.(type) { - default: - return false - case RawMatrixer: - amat = a.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(a.RawSymmetric()) - case RawTriangular: - amat = generalFromTriangular(a.RawTriangular()) - } - return s.checkOverlap(amat) -} - -// generalFromSymmetric returns a blas64.General with the backing -// data and dimensions of a. -func generalFromSymmetric(a blas64.Symmetric) blas64.General { - return blas64.General{ - Rows: a.N, - Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } -} - -func (t *TriDense) checkOverlap(a blas64.General) bool { - return checkOverlap(generalFromTriangular(t.RawTriangular()), a) -} - -func (t *TriDense) checkOverlapMatrix(a Matrix) bool { - if t == a { - return false - } - var amat blas64.General - switch a := a.(type) { - default: - return false - case RawMatrixer: - amat = a.RawMatrix() - case RawSymmetricer: - amat = generalFromSymmetric(a.RawSymmetric()) - case RawTriangular: - amat = generalFromTriangular(a.RawTriangular()) - } - return t.checkOverlap(amat) -} - -// generalFromTriangular returns a blas64.General with the backing -// data and dimensions of a. -func generalFromTriangular(a blas64.Triangular) blas64.General { - return blas64.General{ - Rows: a.N, - Cols: a.N, - Stride: a.Stride, - Data: a.Data, - } -} - -func (v *VecDense) checkOverlap(a blas64.Vector) bool { - mat := v.mat - if cap(mat.Data) == 0 || cap(a.Data) == 0 { - return false - } - - off := offset(mat.Data[:1], a.Data[:1]) - - if off == 0 { - // At least one element overlaps. - if mat.Inc == a.Inc && len(mat.Data) == len(a.Data) { - panic(regionIdentity) - } - panic(regionOverlap) - } - - if off > 0 && len(mat.Data) <= off { - // We know v is completely before a. - return false - } - if off < 0 && len(a.Data) <= -off { - // We know v is completely after a. - return false - } - - if mat.Inc != a.Inc { - // Too hard, so assume the worst. - panic(mismatchedStrides) - } - - if mat.Inc == 1 || off&mat.Inc == 0 { - panic(regionOverlap) - } - return false -} - -// rectanglesOverlap returns whether the strided rectangles a and b overlap -// when b is offset by off elements after a but has at least one element before -// the end of a. off must be positive. a and b have aCols and bCols respectively. -// -// rectanglesOverlap works by shifting both matrices left such that the left -// column of a is at 0. The column indexes are flattened by obtaining the shifted -// relative left and right column positions modulo the common stride. This allows -// direct comparison of the column offsets when the matrix backing data slices -// are known to overlap. -func rectanglesOverlap(off, aCols, bCols, stride int) bool { - if stride == 1 { - // Unit stride means overlapping data - // slices must overlap as matrices. - return true - } - - // Flatten the shifted matrix column positions - // so a starts at 0, modulo the common stride. - aTo := aCols - // The mod stride operations here make the from - // and to indexes comparable between a and b when - // the data slices of a and b overlap. - bFrom := off % stride - bTo := (bFrom + bCols) % stride - - if bTo == 0 || bFrom < bTo { - // b matrix is not wrapped: compare for - // simple overlap. - return bFrom < aTo - } - - // b strictly wraps and so must overlap with a. - return true -} diff --git a/vendor/gonum.org/v1/gonum/mat/solve.go b/vendor/gonum.org/v1/gonum/mat/solve.go deleted file mode 100644 index 11813280f..000000000 --- a/vendor/gonum.org/v1/gonum/mat/solve.go +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// Solve finds a minimum-norm solution to a system of linear equations defined -// by the matrices A and B. If A is singular or near-singular, a Condition error -// is returned. See the documentation for Condition for more information. -// -// The minimization problem solved depends on the input parameters: -// - if m >= n, find X such that ||A*X - B||_2 is minimized, -// - if m < n, find the minimum norm solution of A * X = B. -// The solution matrix, X, is stored in-place into the receiver. -func (m *Dense) Solve(a, b Matrix) error { - ar, ac := a.Dims() - br, bc := b.Dims() - if ar != br { - panic(ErrShape) - } - m.reuseAs(ac, bc) - - // TODO(btracey): Add special cases for SymDense, etc. - aU, aTrans := untranspose(a) - bU, bTrans := untranspose(b) - switch rma := aU.(type) { - case RawTriangular: - side := blas.Left - tA := blas.NoTrans - if aTrans { - tA = blas.Trans - } - - switch rm := bU.(type) { - case RawMatrixer: - if m != bU || bTrans { - if m == bU || m.checkOverlap(rm.RawMatrix()) { - tmp := getWorkspace(br, bc, false) - tmp.Copy(b) - m.Copy(tmp) - putWorkspace(tmp) - break - } - m.Copy(b) - } - default: - if m != bU { - m.Copy(b) - } else if bTrans { - // m and b share data so Copy cannot be used directly. - tmp := getWorkspace(br, bc, false) - tmp.Copy(b) - m.Copy(tmp) - putWorkspace(tmp) - } - } - - rm := rma.RawTriangular() - blas64.Trsm(side, tA, 1, rm, m.mat) - work := getFloats(3*rm.N, false) - iwork := getInts(rm.N, false) - cond := lapack64.Trcon(CondNorm, rm, work, iwork) - putFloats(work) - putInts(iwork) - if cond > ConditionTolerance { - return Condition(cond) - } - return nil - } - - switch { - case ar == ac: - if a == b { - // x = I. - if ar == 1 { - m.mat.Data[0] = 1 - return nil - } - for i := 0; i < ar; i++ { - v := m.mat.Data[i*m.mat.Stride : i*m.mat.Stride+ac] - zero(v) - v[i] = 1 - } - return nil - } - var lu LU - lu.Factorize(a) - return lu.SolveTo(m, false, b) - case ar > ac: - var qr QR - qr.Factorize(a) - return qr.SolveTo(m, false, b) - default: - var lq LQ - lq.Factorize(a) - return lq.SolveTo(m, false, b) - } -} - -// SolveVec finds a minimum-norm solution to a system of linear equations defined -// by the matrix a and the right-hand side column vector b. If A is singular or -// near-singular, a Condition error is returned. See the documentation for -// Dense.Solve for more information. -func (v *VecDense) SolveVec(a Matrix, b Vector) error { - if _, bc := b.Dims(); bc != 1 { - panic(ErrShape) - } - _, c := a.Dims() - - // The Solve implementation is non-trivial, so rather than duplicate the code, - // instead recast the VecDenses as Dense and call the matrix code. - - if rv, ok := b.(RawVectorer); ok { - bmat := rv.RawVector() - if v != b { - v.checkOverlap(bmat) - } - v.reuseAs(c) - m := v.asDense() - // We conditionally create bm as m when b and v are identical - // to prevent the overlap detection code from identifying m - // and bm as overlapping but not identical. - bm := m - if v != b { - b := VecDense{mat: bmat} - bm = b.asDense() - } - return m.Solve(a, bm) - } - - v.reuseAs(c) - m := v.asDense() - return m.Solve(a, b) -} diff --git a/vendor/gonum.org/v1/gonum/mat/svd.go b/vendor/gonum.org/v1/gonum/mat/svd.go deleted file mode 100644 index 2f55c4114..000000000 --- a/vendor/gonum.org/v1/gonum/mat/svd.go +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack" - "gonum.org/v1/gonum/lapack/lapack64" -) - -// SVD is a type for creating and using the Singular Value Decomposition (SVD) -// of a matrix. -type SVD struct { - kind SVDKind - - s []float64 - u blas64.General - vt blas64.General -} - -// SVDKind specifies the treatment of singular vectors during an SVD -// factorization. -type SVDKind int - -const ( - // SVDNone specifies that no singular vectors should be computed during - // the decomposition. - SVDNone SVDKind = 0 - - // SVDThinU specifies the thin decomposition for U should be computed. - SVDThinU SVDKind = 1 << (iota - 1) - // SVDFullU specifies the full decomposition for U should be computed. - SVDFullU - // SVDThinV specifies the thin decomposition for V should be computed. - SVDThinV - // SVDFullV specifies the full decomposition for V should be computed. - SVDFullV - - // SVDThin is a convenience value for computing both thin vectors. - SVDThin SVDKind = SVDThinU | SVDThinV - // SVDThin is a convenience value for computing both full vectors. - SVDFull SVDKind = SVDFullU | SVDFullV -) - -// succFact returns whether the receiver contains a successful factorization. -func (svd *SVD) succFact() bool { - return len(svd.s) != 0 -} - -// Factorize computes the singular value decomposition (SVD) of the input matrix A. -// The singular values of A are computed in all cases, while the singular -// vectors are optionally computed depending on the input kind. -// -// The full singular value decomposition (kind == SVDFull) is a factorization -// of an m×n matrix A of the form -// A = U * Σ * V^T -// where Σ is an m×n diagonal matrix, U is an m×m orthogonal matrix, and V is an -// n×n orthogonal matrix. The diagonal elements of Σ are the singular values of A. -// The first min(m,n) columns of U and V are, respectively, the left and right -// singular vectors of A. -// -// Significant storage space can be saved by using the thin representation of -// the SVD (kind == SVDThin) instead of the full SVD, especially if -// m >> n or m << n. The thin SVD finds -// A = U~ * Σ * V~^T -// where U~ is of size m×min(m,n), Σ is a diagonal matrix of size min(m,n)×min(m,n) -// and V~ is of size n×min(m,n). -// -// Factorize returns whether the decomposition succeeded. If the decomposition -// failed, routines that require a successful factorization will panic. -func (svd *SVD) Factorize(a Matrix, kind SVDKind) (ok bool) { - // kill previous factorization - svd.s = svd.s[:0] - svd.kind = kind - - m, n := a.Dims() - var jobU, jobVT lapack.SVDJob - - // TODO(btracey): This code should be modified to have the smaller - // matrix written in-place into aCopy when the lapack/native/dgesvd - // implementation is complete. - switch { - case kind&SVDFullU != 0: - jobU = lapack.SVDAll - svd.u = blas64.General{ - Rows: m, - Cols: m, - Stride: m, - Data: use(svd.u.Data, m*m), - } - case kind&SVDThinU != 0: - jobU = lapack.SVDStore - svd.u = blas64.General{ - Rows: m, - Cols: min(m, n), - Stride: min(m, n), - Data: use(svd.u.Data, m*min(m, n)), - } - default: - jobU = lapack.SVDNone - } - switch { - case kind&SVDFullV != 0: - svd.vt = blas64.General{ - Rows: n, - Cols: n, - Stride: n, - Data: use(svd.vt.Data, n*n), - } - jobVT = lapack.SVDAll - case kind&SVDThinV != 0: - svd.vt = blas64.General{ - Rows: min(m, n), - Cols: n, - Stride: n, - Data: use(svd.vt.Data, min(m, n)*n), - } - jobVT = lapack.SVDStore - default: - jobVT = lapack.SVDNone - } - - // A is destroyed on call, so copy the matrix. - aCopy := DenseCopyOf(a) - svd.kind = kind - svd.s = use(svd.s, min(m, n)) - - work := []float64{0} - lapack64.Gesvd(jobU, jobVT, aCopy.mat, svd.u, svd.vt, svd.s, work, -1) - work = getFloats(int(work[0]), false) - ok = lapack64.Gesvd(jobU, jobVT, aCopy.mat, svd.u, svd.vt, svd.s, work, len(work)) - putFloats(work) - if !ok { - svd.kind = 0 - } - return ok -} - -// Kind returns the SVDKind of the decomposition. If no decomposition has been -// computed, Kind returns -1. -func (svd *SVD) Kind() SVDKind { - if !svd.succFact() { - return -1 - } - return svd.kind -} - -// Cond returns the 2-norm condition number for the factorized matrix. Cond will -// panic if the receiver does not contain a successful factorization. -func (svd *SVD) Cond() float64 { - if !svd.succFact() { - panic(badFact) - } - return svd.s[0] / svd.s[len(svd.s)-1] -} - -// Values returns the singular values of the factorized matrix in descending order. -// -// If the input slice is non-nil, the values will be stored in-place into -// the slice. In this case, the slice must have length min(m,n), and Values will -// panic with ErrSliceLengthMismatch otherwise. If the input slice is nil, a new -// slice of the appropriate length will be allocated and returned. -// -// Values will panic if the receiver does not contain a successful factorization. -func (svd *SVD) Values(s []float64) []float64 { - if !svd.succFact() { - panic(badFact) - } - if s == nil { - s = make([]float64, len(svd.s)) - } - if len(s) != len(svd.s) { - panic(ErrSliceLengthMismatch) - } - copy(s, svd.s) - return s -} - -// UTo extracts the matrix U from the singular value decomposition. The first -// min(m,n) columns are the left singular vectors and correspond to the singular -// values as returned from SVD.Values. -// -// If dst is not nil, U is stored in-place into dst, and dst must have size -// m×m if the full U was computed, size m×min(m,n) if the thin U was computed, -// and UTo panics otherwise. If dst is nil, a new matrix of the appropriate size -// is allocated and returned. -func (svd *SVD) UTo(dst *Dense) *Dense { - if !svd.succFact() { - panic(badFact) - } - kind := svd.kind - if kind&SVDThinU == 0 && kind&SVDFullU == 0 { - panic("svd: u not computed during factorization") - } - r := svd.u.Rows - c := svd.u.Cols - if dst == nil { - dst = NewDense(r, c, nil) - } else { - dst.reuseAs(r, c) - } - - tmp := &Dense{ - mat: svd.u, - capRows: r, - capCols: c, - } - dst.Copy(tmp) - - return dst -} - -// VTo extracts the matrix V from the singular value decomposition. The first -// min(m,n) columns are the right singular vectors and correspond to the singular -// values as returned from SVD.Values. -// -// If dst is not nil, V is stored in-place into dst, and dst must have size -// n×n if the full V was computed, size n×min(m,n) if the thin V was computed, -// and VTo panics otherwise. If dst is nil, a new matrix of the appropriate size -// is allocated and returned. -func (svd *SVD) VTo(dst *Dense) *Dense { - if !svd.succFact() { - panic(badFact) - } - kind := svd.kind - if kind&SVDThinU == 0 && kind&SVDFullV == 0 { - panic("svd: v not computed during factorization") - } - r := svd.vt.Rows - c := svd.vt.Cols - if dst == nil { - dst = NewDense(c, r, nil) - } else { - dst.reuseAs(c, r) - } - - tmp := &Dense{ - mat: svd.vt, - capRows: r, - capCols: c, - } - dst.Copy(tmp.T()) - - return dst -} diff --git a/vendor/gonum.org/v1/gonum/mat/symband.go b/vendor/gonum.org/v1/gonum/mat/symband.go deleted file mode 100644 index add9a807d..000000000 --- a/vendor/gonum.org/v1/gonum/mat/symband.go +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright ©2017 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - symBandDense *SymBandDense - _ Matrix = symBandDense - _ Symmetric = symBandDense - _ Banded = symBandDense - _ SymBanded = symBandDense - _ RawSymBander = symBandDense - _ MutableSymBanded = symBandDense - - _ NonZeroDoer = symBandDense - _ RowNonZeroDoer = symBandDense - _ ColNonZeroDoer = symBandDense -) - -// SymBandDense represents a symmetric band matrix in dense storage format. -type SymBandDense struct { - mat blas64.SymmetricBand -} - -// SymBanded is a symmetric band matrix interface type. -type SymBanded interface { - Banded - - // Symmetric returns the number of rows/columns in the matrix. - Symmetric() int - - // SymBand returns the number of rows/columns in the matrix, and the size of - // the bandwidth. - SymBand() (n, k int) -} - -// MutableSymBanded is a symmetric band matrix interface type that allows elements -// to be altered. -type MutableSymBanded interface { - SymBanded - SetSymBand(i, j int, v float64) -} - -// A RawSymBander can return a blas64.SymmetricBand representation of the receiver. -// Changes to the blas64.SymmetricBand.Data slice will be reflected in the original -// matrix, changes to the N, K, Stride and Uplo fields will not. -type RawSymBander interface { - RawSymBand() blas64.SymmetricBand -} - -// NewSymBandDense creates a new SymBand matrix with n rows and columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*(k+1), -// data is used as the backing slice, and changes to the elements of the returned -// SymBandDense will be reflected in data. If neither of these is true, NewSymBandDense -// will panic. k must be at least zero and less than n, otherwise NewSymBandDense will panic. -// -// The data must be arranged in row-major order constructed by removing the zeros -// from the rows outside the band and aligning the diagonals. SymBandDense matrices -// are stored in the upper triangle. For example, the matrix -// 1 2 3 0 0 0 -// 2 4 5 6 0 0 -// 3 5 7 8 9 0 -// 0 6 8 10 11 12 -// 0 0 9 11 13 14 -// 0 0 0 12 14 15 -// becomes (* entries are never accessed) -// 1 2 3 -// 4 5 6 -// 7 8 9 -// 10 11 12 -// 13 14 * -// 15 * * -// which is passed to NewSymBandDense as []float64{1, 2, ..., 15, *, *, *} with k=2. -// Only the values in the band portion of the matrix are used. -func NewSymBandDense(n, k int, data []float64) *SymBandDense { - if n <= 0 || k < 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if k+1 > n { - panic("mat: band out of range") - } - bc := k + 1 - if data != nil && len(data) != n*bc { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*bc) - } - return &SymBandDense{ - mat: blas64.SymmetricBand{ - N: n, - K: k, - Stride: bc, - Uplo: blas.Upper, - Data: data, - }, - } -} - -// Dims returns the number of rows and columns in the matrix. -func (s *SymBandDense) Dims() (r, c int) { - return s.mat.N, s.mat.N -} - -// Symmetric returns the size of the receiver. -func (s *SymBandDense) Symmetric() int { - return s.mat.N -} - -// Bandwidth returns the bandwidths of the matrix. -func (s *SymBandDense) Bandwidth() (kl, ku int) { - return s.mat.K, s.mat.K -} - -// SymBand returns the number of rows/columns in the matrix, and the size of -// the bandwidth. -func (s *SymBandDense) SymBand() (n, k int) { - return s.mat.N, s.mat.K -} - -// T implements the Matrix interface. Symmetric matrices, by definition, are -// equal to their transpose, and this is a no-op. -func (s *SymBandDense) T() Matrix { - return s -} - -// TBand implements the Banded interface. -func (s *SymBandDense) TBand() Banded { - return s -} - -// RawSymBand returns the underlying blas64.SymBand used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in returned blas64.SymBand. -func (s *SymBandDense) RawSymBand() blas64.SymmetricBand { - return s.mat -} - -// SetRawSymBand sets the underlying blas64.SymmetricBand used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied SymmetricBand must use blas.Upper storage format. -func (s *SymBandDense) SetRawSymBand(mat blas64.SymmetricBand) { - if mat.Uplo != blas.Upper { - panic("mat: blas64.SymmetricBand does not have blas.Upper storage") - } - s.mat = mat -} - -// Zero sets all of the matrix elements to zero. -func (s *SymBandDense) Zero() { - for i := 0; i < s.mat.N; i++ { - u := min(1+s.mat.K, s.mat.N-i) - zero(s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+u]) - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (s *SymBandDense) DiagView() Diagonal { - n := s.mat.N - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: s.mat.Stride, - Data: s.mat.Data[:(n-1)*s.mat.Stride+1], - }, - } -} - -// DoNonZero calls the function fn for each of the non-zero elements of s. The function fn -// takes a row/column index and the element value of s at (i, j). -func (s *SymBandDense) DoNonZero(fn func(i, j int, v float64)) { - for i := 0; i < s.mat.N; i++ { - for j := max(0, i-s.mat.K); j < min(s.mat.N, i+s.mat.K+1); j++ { - v := s.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// DoRowNonZero calls the function fn for each of the non-zero elements of row i of s. The function fn -// takes a row/column index and the element value of s at (i, j). -func (s *SymBandDense) DoRowNonZero(i int, fn func(i, j int, v float64)) { - if i < 0 || s.mat.N <= i { - panic(ErrRowAccess) - } - for j := max(0, i-s.mat.K); j < min(s.mat.N, i+s.mat.K+1); j++ { - v := s.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} - -// DoColNonZero calls the function fn for each of the non-zero elements of column j of s. The function fn -// takes a row/column index and the element value of s at (i, j). -func (s *SymBandDense) DoColNonZero(j int, fn func(i, j int, v float64)) { - if j < 0 || s.mat.N <= j { - panic(ErrColAccess) - } - for i := 0; i < s.mat.N; i++ { - if i-s.mat.K <= j && j < i+s.mat.K+1 { - v := s.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/symmetric.go b/vendor/gonum.org/v1/gonum/mat/symmetric.go deleted file mode 100644 index 2ea5bdb03..000000000 --- a/vendor/gonum.org/v1/gonum/mat/symmetric.go +++ /dev/null @@ -1,602 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - symDense *SymDense - - _ Matrix = symDense - _ Symmetric = symDense - _ RawSymmetricer = symDense - _ MutableSymmetric = symDense -) - -const ( - badSymTriangle = "mat: blas64.Symmetric not upper" - badSymCap = "mat: bad capacity for SymDense" -) - -// SymDense is a symmetric matrix that uses dense storage. SymDense -// matrices are stored in the upper triangle. -type SymDense struct { - mat blas64.Symmetric - cap int -} - -// Symmetric represents a symmetric matrix (where the element at {i, j} equals -// the element at {j, i}). Symmetric matrices are always square. -type Symmetric interface { - Matrix - // Symmetric returns the number of rows/columns in the matrix. - Symmetric() int -} - -// A RawSymmetricer can return a view of itself as a BLAS Symmetric matrix. -type RawSymmetricer interface { - RawSymmetric() blas64.Symmetric -} - -// A MutableSymmetric can set elements of a symmetric matrix. -type MutableSymmetric interface { - Symmetric - SetSym(i, j int, v float64) -} - -// NewSymDense creates a new Symmetric matrix with n rows and columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*n, data is -// used as the backing slice, and changes to the elements of the returned SymDense -// will be reflected in data. If neither of these is true, NewSymDense will panic. -// NewSymDense will panic if n is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -// Only the values in the upper triangular portion of the matrix are used. -func NewSymDense(n int, data []float64) *SymDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && n*n != len(data) { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*n) - } - return &SymDense{ - mat: blas64.Symmetric{ - N: n, - Stride: n, - Data: data, - Uplo: blas.Upper, - }, - cap: n, - } -} - -// Dims returns the number of rows and columns in the matrix. -func (s *SymDense) Dims() (r, c int) { - return s.mat.N, s.mat.N -} - -// Caps returns the number of rows and columns in the backing matrix. -func (s *SymDense) Caps() (r, c int) { - return s.cap, s.cap -} - -// T returns the receiver, the transpose of a symmetric matrix. -func (s *SymDense) T() Matrix { - return s -} - -// Symmetric implements the Symmetric interface and returns the number of rows -// and columns in the matrix. -func (s *SymDense) Symmetric() int { - return s.mat.N -} - -// RawSymmetric returns the matrix as a blas64.Symmetric. The returned -// value must be stored in upper triangular format. -func (s *SymDense) RawSymmetric() blas64.Symmetric { - return s.mat -} - -// SetRawSymmetric sets the underlying blas64.Symmetric used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied Symmetric must use blas.Upper storage format. -func (s *SymDense) SetRawSymmetric(mat blas64.Symmetric) { - if mat.Uplo != blas.Upper { - panic(badSymTriangle) - } - s.mat = mat -} - -// Reset zeros the dimensions of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (s *SymDense) Reset() { - // N and Stride must be zeroed in unison. - s.mat.N, s.mat.Stride = 0, 0 - s.mat.Data = s.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (s *SymDense) Zero() { - for i := 0; i < s.mat.N; i++ { - zero(s.mat.Data[i*s.mat.Stride+i : i*s.mat.Stride+s.mat.N]) - } -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. SymDense matrices can be zeroed using Reset. -func (s *SymDense) IsZero() bool { - // It must be the case that m.Dims() returns - // zeros in this case. See comment in Reset(). - return s.mat.N == 0 -} - -// reuseAs resizes an empty matrix to a n×n matrix, -// or checks that a non-empty matrix is n×n. -func (s *SymDense) reuseAs(n int) { - if n == 0 { - panic(ErrZeroLength) - } - if s.mat.N > s.cap { - panic(badSymCap) - } - if s.IsZero() { - s.mat = blas64.Symmetric{ - N: n, - Stride: n, - Data: use(s.mat.Data, n*n), - Uplo: blas.Upper, - } - s.cap = n - return - } - if s.mat.Uplo != blas.Upper { - panic(badSymTriangle) - } - if s.mat.N != n { - panic(ErrShape) - } -} - -func (s *SymDense) isolatedWorkspace(a Symmetric) (w *SymDense, restore func()) { - n := a.Symmetric() - if n == 0 { - panic(ErrZeroLength) - } - w = getWorkspaceSym(n, false) - return w, func() { - s.CopySym(w) - putWorkspaceSym(w) - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (s *SymDense) DiagView() Diagonal { - n := s.mat.N - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: s.mat.Stride + 1, - Data: s.mat.Data[:(n-1)*s.mat.Stride+n], - }, - } -} - -func (s *SymDense) AddSym(a, b Symmetric) { - n := a.Symmetric() - if n != b.Symmetric() { - panic(ErrShape) - } - s.reuseAs(n) - - if a, ok := a.(RawSymmetricer); ok { - if b, ok := b.(RawSymmetricer); ok { - amat, bmat := a.RawSymmetric(), b.RawSymmetric() - if s != a { - s.checkOverlap(generalFromSymmetric(amat)) - } - if s != b { - s.checkOverlap(generalFromSymmetric(bmat)) - } - for i := 0; i < n; i++ { - btmp := bmat.Data[i*bmat.Stride+i : i*bmat.Stride+n] - stmp := s.mat.Data[i*s.mat.Stride+i : i*s.mat.Stride+n] - for j, v := range amat.Data[i*amat.Stride+i : i*amat.Stride+n] { - stmp[j] = v + btmp[j] - } - } - return - } - } - - s.checkOverlapMatrix(a) - s.checkOverlapMatrix(b) - for i := 0; i < n; i++ { - stmp := s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+n] - for j := i; j < n; j++ { - stmp[j] = a.At(i, j) + b.At(i, j) - } - } -} - -func (s *SymDense) CopySym(a Symmetric) int { - n := a.Symmetric() - n = min(n, s.mat.N) - if n == 0 { - return 0 - } - switch a := a.(type) { - case RawSymmetricer: - amat := a.RawSymmetric() - if amat.Uplo != blas.Upper { - panic(badSymTriangle) - } - for i := 0; i < n; i++ { - copy(s.mat.Data[i*s.mat.Stride+i:i*s.mat.Stride+n], amat.Data[i*amat.Stride+i:i*amat.Stride+n]) - } - default: - for i := 0; i < n; i++ { - stmp := s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+n] - for j := i; j < n; j++ { - stmp[j] = a.At(i, j) - } - } - } - return n -} - -// SymRankOne performs a symetric rank-one update to the matrix a and stores -// the result in the receiver -// s = a + alpha * x * x' -func (s *SymDense) SymRankOne(a Symmetric, alpha float64, x Vector) { - n, c := x.Dims() - if a.Symmetric() != n || c != 1 { - panic(ErrShape) - } - s.reuseAs(n) - - if s != a { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - s.CopySym(a) - } - - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat := rv.RawVector() - s.checkOverlap((&VecDense{mat: xmat}).asGeneral()) - blas64.Syr(alpha, xmat, s.mat) - return - } - - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.set(i, j, s.at(i, j)+alpha*x.AtVec(i)*x.AtVec(j)) - } - } -} - -// SymRankK performs a symmetric rank-k update to the matrix a and stores the -// result into the receiver. If a is zero, see SymOuterK. -// s = a + alpha * x * x' -func (s *SymDense) SymRankK(a Symmetric, alpha float64, x Matrix) { - n := a.Symmetric() - r, _ := x.Dims() - if r != n { - panic(ErrShape) - } - xMat, aTrans := untranspose(x) - var g blas64.General - if rm, ok := xMat.(RawMatrixer); ok { - g = rm.RawMatrix() - } else { - g = DenseCopyOf(x).mat - aTrans = false - } - if a != s { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - s.reuseAs(n) - s.CopySym(a) - } - t := blas.NoTrans - if aTrans { - t = blas.Trans - } - blas64.Syrk(t, alpha, g, 1, s.mat) -} - -// SymOuterK calculates the outer product of x with itself and stores -// the result into the receiver. It is equivalent to the matrix -// multiplication -// s = alpha * x * x'. -// In order to update an existing matrix, see SymRankOne. -func (s *SymDense) SymOuterK(alpha float64, x Matrix) { - n, _ := x.Dims() - switch { - case s.IsZero(): - s.mat = blas64.Symmetric{ - N: n, - Stride: n, - Data: useZeroed(s.mat.Data, n*n), - Uplo: blas.Upper, - } - s.cap = n - s.SymRankK(s, alpha, x) - case s.mat.Uplo != blas.Upper: - panic(badSymTriangle) - case s.mat.N == n: - if s == x { - w := getWorkspaceSym(n, true) - w.SymRankK(w, alpha, x) - s.CopySym(w) - putWorkspaceSym(w) - } else { - switch r := x.(type) { - case RawMatrixer: - s.checkOverlap(r.RawMatrix()) - case RawSymmetricer: - s.checkOverlap(generalFromSymmetric(r.RawSymmetric())) - case RawTriangular: - s.checkOverlap(generalFromTriangular(r.RawTriangular())) - } - // Only zero the upper triangle. - for i := 0; i < n; i++ { - ri := i * s.mat.Stride - zero(s.mat.Data[ri+i : ri+n]) - } - s.SymRankK(s, alpha, x) - } - default: - panic(ErrShape) - } -} - -// RankTwo performs a symmmetric rank-two update to the matrix a and stores -// the result in the receiver -// m = a + alpha * (x * y' + y * x') -func (s *SymDense) RankTwo(a Symmetric, alpha float64, x, y Vector) { - n := s.mat.N - xr, xc := x.Dims() - if xr != n || xc != 1 { - panic(ErrShape) - } - yr, yc := y.Dims() - if yr != n || yc != 1 { - panic(ErrShape) - } - - if s != a { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - } - - var xmat, ymat blas64.Vector - fast := true - xU, _ := untranspose(x) - if rv, ok := xU.(RawVectorer); ok { - xmat = rv.RawVector() - s.checkOverlap((&VecDense{mat: xmat}).asGeneral()) - } else { - fast = false - } - yU, _ := untranspose(y) - if rv, ok := yU.(RawVectorer); ok { - ymat = rv.RawVector() - s.checkOverlap((&VecDense{mat: ymat}).asGeneral()) - } else { - fast = false - } - - if s != a { - if rs, ok := a.(RawSymmetricer); ok { - s.checkOverlap(generalFromSymmetric(rs.RawSymmetric())) - } - s.reuseAs(n) - s.CopySym(a) - } - - if fast { - if s != a { - s.reuseAs(n) - s.CopySym(a) - } - blas64.Syr2(alpha, xmat, ymat, s.mat) - return - } - - for i := 0; i < n; i++ { - s.reuseAs(n) - for j := i; j < n; j++ { - s.set(i, j, a.At(i, j)+alpha*(x.AtVec(i)*y.AtVec(j)+y.AtVec(i)*x.AtVec(j))) - } - } -} - -// ScaleSym multiplies the elements of a by f, placing the result in the receiver. -func (s *SymDense) ScaleSym(f float64, a Symmetric) { - n := a.Symmetric() - s.reuseAs(n) - if a, ok := a.(RawSymmetricer); ok { - amat := a.RawSymmetric() - if s != a { - s.checkOverlap(generalFromSymmetric(amat)) - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.mat.Data[i*s.mat.Stride+j] = f * amat.Data[i*amat.Stride+j] - } - } - return - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.mat.Data[i*s.mat.Stride+j] = f * a.At(i, j) - } - } -} - -// SubsetSym extracts a subset of the rows and columns of the matrix a and stores -// the result in-place into the receiver. The resulting matrix size is -// len(set)×len(set). Specifically, at the conclusion of SubsetSym, -// s.At(i, j) equals a.At(set[i], set[j]). Note that the supplied set does not -// have to be a strict subset, dimension repeats are allowed. -func (s *SymDense) SubsetSym(a Symmetric, set []int) { - n := len(set) - na := a.Symmetric() - s.reuseAs(n) - var restore func() - if a == s { - s, restore = s.isolatedWorkspace(a) - defer restore() - } - - if a, ok := a.(RawSymmetricer); ok { - raw := a.RawSymmetric() - if s != a { - s.checkOverlap(generalFromSymmetric(raw)) - } - for i := 0; i < n; i++ { - ssub := s.mat.Data[i*s.mat.Stride : i*s.mat.Stride+n] - r := set[i] - rsub := raw.Data[r*raw.Stride : r*raw.Stride+na] - for j := i; j < n; j++ { - c := set[j] - if r <= c { - ssub[j] = rsub[c] - } else { - ssub[j] = raw.Data[c*raw.Stride+r] - } - } - } - return - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - s.mat.Data[i*s.mat.Stride+j] = a.At(set[i], set[j]) - } - } -} - -// SliceSym returns a new Matrix that shares backing data with the receiver. -// The returned matrix starts at {i,i} of the receiver and extends k-i rows -// and columns. The final row and column in the resulting matrix is k-1. -// SliceSym panics with ErrIndexOutOfRange if the slice is outside the -// capacity of the receiver. -func (s *SymDense) SliceSym(i, k int) Symmetric { - sz := s.cap - if i < 0 || sz < i || k < i || sz < k { - panic(ErrIndexOutOfRange) - } - v := *s - v.mat.Data = s.mat.Data[i*s.mat.Stride+i : (k-1)*s.mat.Stride+k] - v.mat.N = k - i - v.cap = s.cap - i - return &v -} - -// Trace returns the trace of the matrix. -func (s *SymDense) Trace() float64 { - // TODO(btracey): could use internal asm sum routine. - var v float64 - for i := 0; i < s.mat.N; i++ { - v += s.mat.Data[i*s.mat.Stride+i] - } - return v -} - -// GrowSym returns the receiver expanded by n rows and n columns. If the -// dimensions of the expanded matrix are outside the capacity of the receiver -// a new allocation is made, otherwise not. Note that the receiver itself is -// not modified during the call to GrowSquare. -func (s *SymDense) GrowSym(n int) Symmetric { - if n < 0 { - panic(ErrIndexOutOfRange) - } - if n == 0 { - return s - } - var v SymDense - n += s.mat.N - if n > s.cap { - v.mat = blas64.Symmetric{ - N: n, - Stride: n, - Uplo: blas.Upper, - Data: make([]float64, n*n), - } - v.cap = n - // Copy elements, including those not currently visible. Use a temporary - // structure to avoid modifying the receiver. - var tmp SymDense - tmp.mat = blas64.Symmetric{ - N: s.cap, - Stride: s.mat.Stride, - Data: s.mat.Data, - Uplo: s.mat.Uplo, - } - tmp.cap = s.cap - v.CopySym(&tmp) - return &v - } - v.mat = blas64.Symmetric{ - N: n, - Stride: s.mat.Stride, - Uplo: blas.Upper, - Data: s.mat.Data[:(n-1)*s.mat.Stride+n], - } - v.cap = s.cap - return &v -} - -// PowPSD computes a^pow where a is a positive symmetric definite matrix. -// -// PowPSD returns an error if the matrix is not not positive symmetric definite -// or the Eigendecomposition is not successful. -func (s *SymDense) PowPSD(a Symmetric, pow float64) error { - dim := a.Symmetric() - s.reuseAs(dim) - - var eigen EigenSym - ok := eigen.Factorize(a, true) - if !ok { - return ErrFailedEigen - } - values := eigen.Values(nil) - for i, v := range values { - if v <= 0 { - return ErrNotPSD - } - values[i] = math.Pow(v, pow) - } - u := eigen.VectorsTo(nil) - - s.SymOuterK(values[0], u.ColView(0)) - - var v VecDense - for i := 1; i < dim; i++ { - v.ColViewOf(u, i) - s.SymRankOne(s, values[i], &v) - } - return nil -} diff --git a/vendor/gonum.org/v1/gonum/mat/triangular.go b/vendor/gonum.org/v1/gonum/mat/triangular.go deleted file mode 100644 index e32ee4054..000000000 --- a/vendor/gonum.org/v1/gonum/mat/triangular.go +++ /dev/null @@ -1,659 +0,0 @@ -// Copyright ©2015 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "math" - - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/lapack/lapack64" -) - -var ( - triDense *TriDense - _ Matrix = triDense - _ Triangular = triDense - _ RawTriangular = triDense - _ MutableTriangular = triDense - - _ NonZeroDoer = triDense - _ RowNonZeroDoer = triDense - _ ColNonZeroDoer = triDense -) - -const badTriCap = "mat: bad capacity for TriDense" - -// TriDense represents an upper or lower triangular matrix in dense storage -// format. -type TriDense struct { - mat blas64.Triangular - cap int -} - -// Triangular represents a triangular matrix. Triangular matrices are always square. -type Triangular interface { - Matrix - // Triangle returns the number of rows/columns in the matrix and its - // orientation. - Triangle() (n int, kind TriKind) - - // TTri is the equivalent of the T() method in the Matrix interface but - // guarantees the transpose is of triangular type. - TTri() Triangular -} - -// A RawTriangular can return a blas64.Triangular representation of the receiver. -// Changes to the blas64.Triangular.Data slice will be reflected in the original -// matrix, changes to the N, Stride, Uplo and Diag fields will not. -type RawTriangular interface { - RawTriangular() blas64.Triangular -} - -// A MutableTriangular can set elements of a triangular matrix. -type MutableTriangular interface { - Triangular - SetTri(i, j int, v float64) -} - -var ( - _ Matrix = TransposeTri{} - _ Triangular = TransposeTri{} - _ UntransposeTrier = TransposeTri{} -) - -// TransposeTri is a type for performing an implicit transpose of a Triangular -// matrix. It implements the Triangular interface, returning values from the -// transpose of the matrix within. -type TransposeTri struct { - Triangular Triangular -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Triangular field. -func (t TransposeTri) At(i, j int) float64 { - return t.Triangular.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. Triangular matrices are -// square and thus this is the same size as the original Triangular. -func (t TransposeTri) Dims() (r, c int) { - c, r = t.Triangular.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Triangular field. -func (t TransposeTri) T() Matrix { - return t.Triangular -} - -// Triangle returns the number of rows/columns in the matrix and its orientation. -func (t TransposeTri) Triangle() (int, TriKind) { - n, upper := t.Triangular.Triangle() - return n, !upper -} - -// TTri performs an implicit transpose by returning the Triangular field. -func (t TransposeTri) TTri() Triangular { - return t.Triangular -} - -// Untranspose returns the Triangular field. -func (t TransposeTri) Untranspose() Matrix { - return t.Triangular -} - -func (t TransposeTri) UntransposeTri() Triangular { - return t.Triangular -} - -// NewTriDense creates a new Triangular matrix with n rows and columns. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*n, data is -// used as the backing slice, and changes to the elements of the returned TriDense -// will be reflected in data. If neither of these is true, NewTriDense will panic. -// NewTriDense will panic if n is zero. -// -// The data must be arranged in row-major order, i.e. the (i*c + j)-th -// element in the data slice is the {i, j}-th element in the matrix. -// Only the values in the triangular portion corresponding to kind are used. -func NewTriDense(n int, kind TriKind, data []float64) *TriDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if data != nil && len(data) != n*n { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*n) - } - uplo := blas.Lower - if kind == Upper { - uplo = blas.Upper - } - return &TriDense{ - mat: blas64.Triangular{ - N: n, - Stride: n, - Data: data, - Uplo: uplo, - Diag: blas.NonUnit, - }, - cap: n, - } -} - -func (t *TriDense) Dims() (r, c int) { - return t.mat.N, t.mat.N -} - -// Triangle returns the dimension of t and its orientation. The returned -// orientation is only valid when n is not zero. -func (t *TriDense) Triangle() (n int, kind TriKind) { - return t.mat.N, t.triKind() -} - -func (t *TriDense) isUpper() bool { - return isUpperUplo(t.mat.Uplo) -} - -func (t *TriDense) triKind() TriKind { - return TriKind(isUpperUplo(t.mat.Uplo)) -} - -func isUpperUplo(u blas.Uplo) bool { - switch u { - case blas.Upper: - return true - case blas.Lower: - return false - default: - panic(badTriangle) - } -} - -func uploToTriKind(u blas.Uplo) TriKind { - switch u { - case blas.Upper: - return Upper - case blas.Lower: - return Lower - default: - panic(badTriangle) - } -} - -// asSymBlas returns the receiver restructured as a blas64.Symmetric with the -// same backing memory. Panics if the receiver is unit. -// This returns a blas64.Symmetric and not a *SymDense because SymDense can only -// be upper triangular. -func (t *TriDense) asSymBlas() blas64.Symmetric { - if t.mat.Diag == blas.Unit { - panic("mat: cannot convert unit TriDense into blas64.Symmetric") - } - return blas64.Symmetric{ - N: t.mat.N, - Stride: t.mat.Stride, - Data: t.mat.Data, - Uplo: t.mat.Uplo, - } -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (t *TriDense) T() Matrix { - return Transpose{t} -} - -// TTri performs an implicit transpose by returning the receiver inside a TransposeTri. -func (t *TriDense) TTri() Triangular { - return TransposeTri{t} -} - -func (t *TriDense) RawTriangular() blas64.Triangular { - return t.mat -} - -// SetRawTriangular sets the underlying blas64.Triangular used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied Triangular must not use blas.Unit storage format. -func (t *TriDense) SetRawTriangular(mat blas64.Triangular) { - if mat.Diag == blas.Unit { - panic("mat: cannot set TriDense with Unit storage format") - } - t.mat = mat -} - -// Reset zeros the dimensions of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (t *TriDense) Reset() { - // N and Stride must be zeroed in unison. - t.mat.N, t.mat.Stride = 0, 0 - // Defensively zero Uplo to ensure - // it is set correctly later. - t.mat.Uplo = 0 - t.mat.Data = t.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (t *TriDense) Zero() { - if t.isUpper() { - for i := 0; i < t.mat.N; i++ { - zero(t.mat.Data[i*t.mat.Stride+i : i*t.mat.Stride+t.mat.N]) - } - return - } - for i := 0; i < t.mat.N; i++ { - zero(t.mat.Data[i*t.mat.Stride : i*t.mat.Stride+i+1]) - } -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. TriDense matrices can be zeroed using Reset. -func (t *TriDense) IsZero() bool { - // It must be the case that t.Dims() returns - // zeros in this case. See comment in Reset(). - return t.mat.Stride == 0 -} - -// untranspose untransposes a matrix if applicable. If a is an Untransposer, then -// untranspose returns the underlying matrix and true. If it is not, then it returns -// the input matrix and false. -func untransposeTri(a Triangular) (Triangular, bool) { - if ut, ok := a.(UntransposeTrier); ok { - return ut.UntransposeTri(), true - } - return a, false -} - -// reuseAs resizes a zero receiver to an n×n triangular matrix with the given -// orientation. If the receiver is non-zero, reuseAs checks that the receiver -// is the correct size and orientation. -func (t *TriDense) reuseAs(n int, kind TriKind) { - if n == 0 { - panic(ErrZeroLength) - } - ul := blas.Lower - if kind == Upper { - ul = blas.Upper - } - if t.mat.N > t.cap { - panic(badTriCap) - } - if t.IsZero() { - t.mat = blas64.Triangular{ - N: n, - Stride: n, - Diag: blas.NonUnit, - Data: use(t.mat.Data, n*n), - Uplo: ul, - } - t.cap = n - return - } - if t.mat.N != n { - panic(ErrShape) - } - if t.mat.Uplo != ul { - panic(ErrTriangle) - } -} - -// isolatedWorkspace returns a new TriDense matrix w with the size of a and -// returns a callback to defer which performs cleanup at the return of the call. -// This should be used when a method receiver is the same pointer as an input argument. -func (t *TriDense) isolatedWorkspace(a Triangular) (w *TriDense, restore func()) { - n, kind := a.Triangle() - if n == 0 { - panic(ErrZeroLength) - } - w = getWorkspaceTri(n, kind, false) - return w, func() { - t.Copy(w) - putWorkspaceTri(w) - } -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (t *TriDense) DiagView() Diagonal { - if t.mat.Diag == blas.Unit { - panic("mat: cannot take view of Unit diagonal") - } - n := t.mat.N - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: t.mat.Stride + 1, - Data: t.mat.Data[:(n-1)*t.mat.Stride+n], - }, - } -} - -// Copy makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two matrices and -// returns the number of rows and columns it copied. Only elements within the -// receiver's non-zero triangle are set. -// -// See the Copier interface for more information. -func (t *TriDense) Copy(a Matrix) (r, c int) { - r, c = a.Dims() - r = min(r, t.mat.N) - c = min(c, t.mat.N) - if r == 0 || c == 0 { - return 0, 0 - } - - switch a := a.(type) { - case RawMatrixer: - amat := a.RawMatrix() - if t.isUpper() { - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride+i:i*t.mat.Stride+c], amat.Data[i*amat.Stride+i:i*amat.Stride+c]) - } - } else { - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride:i*t.mat.Stride+i+1], amat.Data[i*amat.Stride:i*amat.Stride+i+1]) - } - } - case RawTriangular: - amat := a.RawTriangular() - aIsUpper := isUpperUplo(amat.Uplo) - tIsUpper := t.isUpper() - switch { - case tIsUpper && aIsUpper: - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride+i:i*t.mat.Stride+c], amat.Data[i*amat.Stride+i:i*amat.Stride+c]) - } - case !tIsUpper && !aIsUpper: - for i := 0; i < r; i++ { - copy(t.mat.Data[i*t.mat.Stride:i*t.mat.Stride+i+1], amat.Data[i*amat.Stride:i*amat.Stride+i+1]) - } - default: - for i := 0; i < r; i++ { - t.set(i, i, amat.Data[i*amat.Stride+i]) - } - } - default: - isUpper := t.isUpper() - for i := 0; i < r; i++ { - if isUpper { - for j := i; j < c; j++ { - t.set(i, j, a.At(i, j)) - } - } else { - for j := 0; j <= i; j++ { - t.set(i, j, a.At(i, j)) - } - } - } - } - - return r, c -} - -// InverseTri computes the inverse of the triangular matrix a, storing the result -// into the receiver. If a is ill-conditioned, a Condition error will be returned. -// Note that matrix inversion is numerically unstable, and should generally be -// avoided where possible, for example by using the Solve routines. -func (t *TriDense) InverseTri(a Triangular) error { - t.checkOverlapMatrix(a) - n, _ := a.Triangle() - t.reuseAs(a.Triangle()) - t.Copy(a) - work := getFloats(3*n, false) - iwork := getInts(n, false) - cond := lapack64.Trcon(CondNorm, t.mat, work, iwork) - putFloats(work) - putInts(iwork) - if math.IsInf(cond, 1) { - return Condition(cond) - } - ok := lapack64.Trtri(t.mat) - if !ok { - return Condition(math.Inf(1)) - } - if cond > ConditionTolerance { - return Condition(cond) - } - return nil -} - -// MulTri takes the product of triangular matrices a and b and places the result -// in the receiver. The size of a and b must match, and they both must have the -// same TriKind, or Mul will panic. -func (t *TriDense) MulTri(a, b Triangular) { - n, kind := a.Triangle() - nb, kindb := b.Triangle() - if n != nb { - panic(ErrShape) - } - if kind != kindb { - panic(ErrTriangle) - } - - aU, _ := untransposeTri(a) - bU, _ := untransposeTri(b) - t.checkOverlapMatrix(bU) - t.checkOverlapMatrix(aU) - t.reuseAs(n, kind) - var restore func() - if t == aU { - t, restore = t.isolatedWorkspace(aU) - defer restore() - } else if t == bU { - t, restore = t.isolatedWorkspace(bU) - defer restore() - } - - // TODO(btracey): Improve the set of fast-paths. - if kind == Upper { - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - var v float64 - for k := i; k <= j; k++ { - v += a.At(i, k) * b.At(k, j) - } - t.SetTri(i, j, v) - } - } - return - } - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - var v float64 - for k := j; k <= i; k++ { - v += a.At(i, k) * b.At(k, j) - } - t.SetTri(i, j, v) - } - } -} - -// ScaleTri multiplies the elements of a by f, placing the result in the receiver. -// If the receiver is non-zero, the size and kind of the receiver must match -// the input, or ScaleTri will panic. -func (t *TriDense) ScaleTri(f float64, a Triangular) { - n, kind := a.Triangle() - t.reuseAs(n, kind) - - // TODO(btracey): Improve the set of fast-paths. - switch a := a.(type) { - case RawTriangular: - amat := a.RawTriangular() - if t != a { - t.checkOverlap(generalFromTriangular(amat)) - } - if kind == Upper { - for i := 0; i < n; i++ { - ts := t.mat.Data[i*t.mat.Stride+i : i*t.mat.Stride+n] - as := amat.Data[i*amat.Stride+i : i*amat.Stride+n] - for i, v := range as { - ts[i] = v * f - } - } - return - } - for i := 0; i < n; i++ { - ts := t.mat.Data[i*t.mat.Stride : i*t.mat.Stride+i+1] - as := amat.Data[i*amat.Stride : i*amat.Stride+i+1] - for i, v := range as { - ts[i] = v * f - } - } - return - default: - t.checkOverlapMatrix(a) - isUpper := kind == Upper - for i := 0; i < n; i++ { - if isUpper { - for j := i; j < n; j++ { - t.set(i, j, f*a.At(i, j)) - } - } else { - for j := 0; j <= i; j++ { - t.set(i, j, f*a.At(i, j)) - } - } - } - } -} - -// Trace returns the trace of the matrix. -func (t *TriDense) Trace() float64 { - // TODO(btracey): could use internal asm sum routine. - var v float64 - for i := 0; i < t.mat.N; i++ { - v += t.mat.Data[i*t.mat.Stride+i] - } - return v -} - -// copySymIntoTriangle copies a symmetric matrix into a TriDense -func copySymIntoTriangle(t *TriDense, s Symmetric) { - n, upper := t.Triangle() - ns := s.Symmetric() - if n != ns { - panic("mat: triangle size mismatch") - } - ts := t.mat.Stride - if rs, ok := s.(RawSymmetricer); ok { - sd := rs.RawSymmetric() - ss := sd.Stride - if upper { - if sd.Uplo == blas.Upper { - for i := 0; i < n; i++ { - copy(t.mat.Data[i*ts+i:i*ts+n], sd.Data[i*ss+i:i*ss+n]) - } - return - } - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - t.mat.Data[i*ts+j] = sd.Data[j*ss+i] - } - } - return - } - if sd.Uplo == blas.Upper { - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - t.mat.Data[i*ts+j] = sd.Data[j*ss+i] - } - } - return - } - for i := 0; i < n; i++ { - copy(t.mat.Data[i*ts:i*ts+i+1], sd.Data[i*ss:i*ss+i+1]) - } - return - } - if upper { - for i := 0; i < n; i++ { - for j := i; j < n; j++ { - t.mat.Data[i*ts+j] = s.At(i, j) - } - } - return - } - for i := 0; i < n; i++ { - for j := 0; j <= i; j++ { - t.mat.Data[i*ts+j] = s.At(i, j) - } - } -} - -// DoNonZero calls the function fn for each of the non-zero elements of t. The function fn -// takes a row/column index and the element value of t at (i, j). -func (t *TriDense) DoNonZero(fn func(i, j int, v float64)) { - if t.isUpper() { - for i := 0; i < t.mat.N; i++ { - for j := i; j < t.mat.N; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } - return - } - for i := 0; i < t.mat.N; i++ { - for j := 0; j <= i; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - } -} - -// DoRowNonZero calls the function fn for each of the non-zero elements of row i of t. The function fn -// takes a row/column index and the element value of t at (i, j). -func (t *TriDense) DoRowNonZero(i int, fn func(i, j int, v float64)) { - if i < 0 || t.mat.N <= i { - panic(ErrRowAccess) - } - if t.isUpper() { - for j := i; j < t.mat.N; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - return - } - for j := 0; j <= i; j++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} - -// DoColNonZero calls the function fn for each of the non-zero elements of column j of t. The function fn -// takes a row/column index and the element value of t at (i, j). -func (t *TriDense) DoColNonZero(j int, fn func(i, j int, v float64)) { - if j < 0 || t.mat.N <= j { - panic(ErrColAccess) - } - if t.isUpper() { - for i := 0; i <= j; i++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } - return - } - for i := j; i < t.mat.N; i++ { - v := t.at(i, j) - if v != 0 { - fn(i, j, v) - } - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/triband.go b/vendor/gonum.org/v1/gonum/mat/triband.go deleted file mode 100644 index f97855046..000000000 --- a/vendor/gonum.org/v1/gonum/mat/triband.go +++ /dev/null @@ -1,353 +0,0 @@ -// Copyright ©2018 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" -) - -var ( - triBand TriBanded - _ Banded = triBand - _ Triangular = triBand - - triBandDense *TriBandDense - _ Matrix = triBandDense - _ Triangular = triBandDense - _ Banded = triBandDense - _ TriBanded = triBandDense - _ RawTriBander = triBandDense - _ MutableTriBanded = triBandDense -) - -// TriBanded is a triangular band matrix interface type. -type TriBanded interface { - Banded - - // Triangle returns the number of rows/columns in the matrix and its - // orientation. - Triangle() (n int, kind TriKind) - - // TTri is the equivalent of the T() method in the Matrix interface but - // guarantees the transpose is of triangular type. - TTri() Triangular - - // TriBand returns the number of rows/columns in the matrix, the - // size of the bandwidth, and the orientation. - TriBand() (n, k int, kind TriKind) - - // TTriBand is the equivalent of the T() method in the Matrix interface but - // guarantees the transpose is of banded triangular type. - TTriBand() TriBanded -} - -// A RawTriBander can return a blas64.TriangularBand representation of the receiver. -// Changes to the blas64.TriangularBand.Data slice will be reflected in the original -// matrix, changes to the N, K, Stride, Uplo and Diag fields will not. -type RawTriBander interface { - RawTriBand() blas64.TriangularBand -} - -// MutableTriBanded is a triangular band matrix interface type that allows -// elements to be altered. -type MutableTriBanded interface { - TriBanded - SetTriBand(i, j int, v float64) -} - -var ( - tTriBand TransposeTriBand - _ Matrix = tTriBand - _ TriBanded = tTriBand - _ Untransposer = tTriBand - _ UntransposeTrier = tTriBand - _ UntransposeBander = tTriBand - _ UntransposeTriBander = tTriBand -) - -// TransposeTriBand is a type for performing an implicit transpose of a TriBanded -// matrix. It implements the TriBanded interface, returning values from the -// transpose of the matrix within. -type TransposeTriBand struct { - TriBanded TriBanded -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the TriBanded field. -func (t TransposeTriBand) At(i, j int) float64 { - return t.TriBanded.At(j, i) -} - -// Dims returns the dimensions of the transposed matrix. TriBanded matrices are -// square and thus this is the same size as the original TriBanded. -func (t TransposeTriBand) Dims() (r, c int) { - c, r = t.TriBanded.Dims() - return r, c -} - -// T performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) T() Matrix { - return t.TriBanded -} - -// Triangle returns the number of rows/columns in the matrix and its orientation. -func (t TransposeTriBand) Triangle() (int, TriKind) { - n, upper := t.TriBanded.Triangle() - return n, !upper -} - -// TTri performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) TTri() Triangular { - return t.TriBanded -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -func (t TransposeTriBand) Bandwidth() (kl, ku int) { - kl, ku = t.TriBanded.Bandwidth() - return ku, kl -} - -// TBand performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) TBand() Banded { - return t.TriBanded -} - -// TriBand returns the number of rows/columns in the matrix, the -// size of the bandwidth, and the orientation. -func (t TransposeTriBand) TriBand() (n, k int, kind TriKind) { - n, k, kind = t.TriBanded.TriBand() - return n, k, !kind -} - -// TTriBand performs an implicit transpose by returning the TriBand field. -func (t TransposeTriBand) TTriBand() TriBanded { - return t.TriBanded -} - -// Untranspose returns the Triangular field. -func (t TransposeTriBand) Untranspose() Matrix { - return t.TriBanded -} - -// UntransposeTri returns the underlying Triangular matrix. -func (t TransposeTriBand) UntransposeTri() Triangular { - return t.TriBanded -} - -// UntransposeBand returns the underlying Banded matrix. -func (t TransposeTriBand) UntransposeBand() Banded { - return t.TriBanded -} - -// UntransposeTriBand returns the underlying TriBanded matrix. -func (t TransposeTriBand) UntransposeTriBand() TriBanded { - return t.TriBanded -} - -// TriBandDense represents a triangular band matrix in dense storage format. -type TriBandDense struct { - mat blas64.TriangularBand -} - -// NewTriBandDense creates a new triangular banded matrix with n rows and columns, -// k bands in the direction of the specified kind. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n*(k+1), -// data is used as the backing slice, and changes to the elements of the returned -// TriBandDense will be reflected in data. If neither of these is true, NewTriBandDense -// will panic. k must be at least zero and less than n, otherwise NewTriBandDense will panic. -// -// The data must be arranged in row-major order constructed by removing the zeros -// from the rows outside the band and aligning the diagonals. For example, if -// the upper-triangular banded matrix -// 1 2 3 0 0 0 -// 0 4 5 6 0 0 -// 0 0 7 8 9 0 -// 0 0 0 10 11 12 -// 0 0 0 0 13 14 -// 0 0 0 0 0 15 -// becomes (* entries are never accessed) -// 1 2 3 -// 4 5 6 -// 7 8 9 -// 10 11 12 -// 13 14 * -// 15 * * -// which is passed to NewTriBandDense as []float64{1, 2, ..., 15, *, *, *} -// with k=2 and kind = mat.Upper. -// The lower triangular banded matrix -// 1 0 0 0 0 0 -// 2 3 0 0 0 0 -// 4 5 6 0 0 0 -// 0 7 8 9 0 0 -// 0 0 10 11 12 0 -// 0 0 0 13 14 15 -// becomes (* entries are never accessed) -// * * 1 -// * 2 3 -// 4 5 6 -// 7 8 9 -// 10 11 12 -// 13 14 15 -// which is passed to NewTriBandDense as []float64{*, *, *, 1, 2, ..., 15} -// with k=2 and kind = mat.Lower. -// Only the values in the band portion of the matrix are used. -func NewTriBandDense(n, k int, kind TriKind, data []float64) *TriBandDense { - if n <= 0 || k < 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if k+1 > n { - panic("mat: band out of range") - } - bc := k + 1 - if data != nil && len(data) != n*bc { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n*bc) - } - uplo := blas.Lower - if kind { - uplo = blas.Upper - } - return &TriBandDense{ - mat: blas64.TriangularBand{ - Uplo: uplo, - Diag: blas.NonUnit, - N: n, - K: k, - Data: data, - Stride: bc, - }, - } -} - -// Dims returns the number of rows and columns in the matrix. -func (t *TriBandDense) Dims() (r, c int) { - return t.mat.N, t.mat.N -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (t *TriBandDense) T() Matrix { - return Transpose{t} -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized matrices can be the -// receiver for size-restricted operations. TriBandDense matrices can be zeroed using Reset. -func (t *TriBandDense) IsZero() bool { - // It must be the case that t.Dims() returns - // zeros in this case. See comment in Reset(). - return t.mat.Stride == 0 -} - -// Reset zeros the dimensions of the matrix so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (t *TriBandDense) Reset() { - t.mat.N = 0 - t.mat.Stride = 0 - t.mat.K = 0 - t.mat.Data = t.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (t *TriBandDense) Zero() { - if t.isUpper() { - for i := 0; i < t.mat.N; i++ { - u := min(1+t.mat.K, t.mat.N-i) - zero(t.mat.Data[i*t.mat.Stride : i*t.mat.Stride+u]) - } - return - } - for i := 0; i < t.mat.N; i++ { - l := max(0, t.mat.K-i) - zero(t.mat.Data[i*t.mat.Stride+l : i*t.mat.Stride+t.mat.K+1]) - } -} - -func (t *TriBandDense) isUpper() bool { - return isUpperUplo(t.mat.Uplo) -} - -func (t *TriBandDense) triKind() TriKind { - return TriKind(isUpperUplo(t.mat.Uplo)) -} - -// Triangle returns the dimension of t and its orientation. The returned -// orientation is only valid when n is not zero. -func (t *TriBandDense) Triangle() (n int, kind TriKind) { - return t.mat.N, t.triKind() -} - -// TTri performs an implicit transpose by returning the receiver inside a TransposeTri. -func (t *TriBandDense) TTri() Triangular { - return TransposeTri{t} -} - -// Bandwidth returns the upper and lower bandwidths of the matrix. -func (t *TriBandDense) Bandwidth() (kl, ku int) { - if t.isUpper() { - return 0, t.mat.K - } - return t.mat.K, 0 -} - -// TBand performs an implicit transpose by returning the receiver inside a TransposeBand. -func (t *TriBandDense) TBand() Banded { - return TransposeBand{t} -} - -// TriBand returns the number of rows/columns in the matrix, the -// size of the bandwidth, and the orientation. -func (t *TriBandDense) TriBand() (n, k int, kind TriKind) { - return t.mat.N, t.mat.K, TriKind(!t.IsZero()) && t.triKind() -} - -// TTriBand performs an implicit transpose by returning the receiver inside a TransposeTriBand. -func (t *TriBandDense) TTriBand() TriBanded { - return TransposeTriBand{t} -} - -// RawTriBand returns the underlying blas64.TriangularBand used by the receiver. -// Changes to the blas64.TriangularBand.Data slice will be reflected in the original -// matrix, changes to the N, K, Stride, Uplo and Diag fields will not. -func (t *TriBandDense) RawTriBand() blas64.TriangularBand { - return t.mat -} - -// SetRawTriBand sets the underlying blas64.TriangularBand used by the receiver. -// Changes to elements in the receiver following the call will be reflected -// in the input. -// -// The supplied TriangularBand must not use blas.Unit storage format. -func (t *TriBandDense) SetRawTriBand(mat blas64.TriangularBand) { - if mat.Diag == blas.Unit { - panic("mat: cannot set TriBand with Unit storage") - } - t.mat = mat -} - -// DiagView returns the diagonal as a matrix backed by the original data. -func (t *TriBandDense) DiagView() Diagonal { - if t.mat.Diag == blas.Unit { - panic("mat: cannot take view of Unit diagonal") - } - n := t.mat.N - data := t.mat.Data - if !t.isUpper() { - data = data[t.mat.K:] - } - return &DiagDense{ - mat: blas64.Vector{ - N: n, - Inc: t.mat.Stride, - Data: data[:(n-1)*t.mat.Stride+1], - }, - } -} diff --git a/vendor/gonum.org/v1/gonum/mat/vector.go b/vendor/gonum.org/v1/gonum/mat/vector.go deleted file mode 100644 index 8191312bf..000000000 --- a/vendor/gonum.org/v1/gonum/mat/vector.go +++ /dev/null @@ -1,741 +0,0 @@ -// Copyright ©2013 The Gonum Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package mat - -import ( - "gonum.org/v1/gonum/blas" - "gonum.org/v1/gonum/blas/blas64" - "gonum.org/v1/gonum/internal/asm/f64" -) - -var ( - vector *VecDense - - _ Matrix = vector - _ Vector = vector - _ Reseter = vector -) - -// Vector is a vector. -type Vector interface { - Matrix - AtVec(int) float64 - Len() int -} - -// TransposeVec is a type for performing an implicit transpose of a Vector. -// It implements the Vector interface, returning values from the transpose -// of the vector within. -type TransposeVec struct { - Vector Vector -} - -// At returns the value of the element at row i and column j of the transposed -// matrix, that is, row j and column i of the Vector field. -func (t TransposeVec) At(i, j int) float64 { - return t.Vector.At(j, i) -} - -// AtVec returns the element at position i. It panics if i is out of bounds. -func (t TransposeVec) AtVec(i int) float64 { - return t.Vector.AtVec(i) -} - -// Dims returns the dimensions of the transposed vector. -func (t TransposeVec) Dims() (r, c int) { - c, r = t.Vector.Dims() - return r, c -} - -// T performs an implicit transpose by returning the Vector field. -func (t TransposeVec) T() Matrix { - return t.Vector -} - -// Len returns the number of columns in the vector. -func (t TransposeVec) Len() int { - return t.Vector.Len() -} - -// TVec performs an implicit transpose by returning the Vector field. -func (t TransposeVec) TVec() Vector { - return t.Vector -} - -// Untranspose returns the Vector field. -func (t TransposeVec) Untranspose() Matrix { - return t.Vector -} - -func (t TransposeVec) UntransposeVec() Vector { - return t.Vector -} - -// VecDense represents a column vector. -type VecDense struct { - mat blas64.Vector - // A BLAS vector can have a negative increment, but allowing this - // in the mat type complicates a lot of code, and doesn't gain anything. - // VecDense must have positive increment in this package. -} - -// NewVecDense creates a new VecDense of length n. If data == nil, -// a new slice is allocated for the backing slice. If len(data) == n, data is -// used as the backing slice, and changes to the elements of the returned VecDense -// will be reflected in data. If neither of these is true, NewVecDense will panic. -// NewVecDense will panic if n is zero. -func NewVecDense(n int, data []float64) *VecDense { - if n <= 0 { - if n == 0 { - panic(ErrZeroLength) - } - panic("mat: negative dimension") - } - if len(data) != n && data != nil { - panic(ErrShape) - } - if data == nil { - data = make([]float64, n) - } - return &VecDense{ - mat: blas64.Vector{ - N: n, - Inc: 1, - Data: data, - }, - } -} - -// SliceVec returns a new Vector that shares backing data with the receiver. -// The returned matrix starts at i of the receiver and extends k-i elements. -// SliceVec panics with ErrIndexOutOfRange if the slice is outside the capacity -// of the receiver. -func (v *VecDense) SliceVec(i, k int) Vector { - if i < 0 || k <= i || v.Cap() < k { - panic(ErrIndexOutOfRange) - } - return &VecDense{ - mat: blas64.Vector{ - N: k - i, - Inc: v.mat.Inc, - Data: v.mat.Data[i*v.mat.Inc : (k-1)*v.mat.Inc+1], - }, - } -} - -// Dims returns the number of rows and columns in the matrix. Columns is always 1 -// for a non-Reset vector. -func (v *VecDense) Dims() (r, c int) { - if v.IsZero() { - return 0, 0 - } - return v.mat.N, 1 -} - -// Caps returns the number of rows and columns in the backing matrix. Columns is always 1 -// for a non-Reset vector. -func (v *VecDense) Caps() (r, c int) { - if v.IsZero() { - return 0, 0 - } - return v.Cap(), 1 -} - -// Len returns the length of the vector. -func (v *VecDense) Len() int { - return v.mat.N -} - -// Cap returns the capacity of the vector. -func (v *VecDense) Cap() int { - if v.IsZero() { - return 0 - } - return (cap(v.mat.Data)-1)/v.mat.Inc + 1 -} - -// T performs an implicit transpose by returning the receiver inside a Transpose. -func (v *VecDense) T() Matrix { - return Transpose{v} -} - -// TVec performs an implicit transpose by returning the receiver inside a TransposeVec. -func (v *VecDense) TVec() Vector { - return TransposeVec{v} -} - -// Reset zeros the length of the vector so that it can be reused as the -// receiver of a dimensionally restricted operation. -// -// See the Reseter interface for more information. -func (v *VecDense) Reset() { - // No change of Inc or N to 0 may be - // made unless both are set to 0. - v.mat.Inc = 0 - v.mat.N = 0 - v.mat.Data = v.mat.Data[:0] -} - -// Zero sets all of the matrix elements to zero. -func (v *VecDense) Zero() { - for i := 0; i < v.mat.N; i++ { - v.mat.Data[v.mat.Inc*i] = 0 - } -} - -// CloneVec makes a copy of a into the receiver, overwriting the previous value -// of the receiver. -func (v *VecDense) CloneVec(a Vector) { - if v == a { - return - } - n := a.Len() - v.mat = blas64.Vector{ - N: n, - Inc: 1, - Data: use(v.mat.Data, n), - } - if r, ok := a.(RawVectorer); ok { - blas64.Copy(r.RawVector(), v.mat) - return - } - for i := 0; i < a.Len(); i++ { - v.SetVec(i, a.AtVec(i)) - } -} - -// VecDenseCopyOf returns a newly allocated copy of the elements of a. -func VecDenseCopyOf(a Vector) *VecDense { - v := &VecDense{} - v.CloneVec(a) - return v -} - -func (v *VecDense) RawVector() blas64.Vector { - return v.mat -} - -// CopyVec makes a copy of elements of a into the receiver. It is similar to the -// built-in copy; it copies as much as the overlap between the two vectors and -// returns the number of elements it copied. -func (v *VecDense) CopyVec(a Vector) int { - n := min(v.Len(), a.Len()) - if v == a { - return n - } - if r, ok := a.(RawVectorer); ok { - blas64.Copy(r.RawVector(), v.mat) - return n - } - for i := 0; i < n; i++ { - v.setVec(i, a.AtVec(i)) - } - return n -} - -// ScaleVec scales the vector a by alpha, placing the result in the receiver. -func (v *VecDense) ScaleVec(alpha float64, a Vector) { - n := a.Len() - - if v == a { - if v.mat.Inc == 1 { - f64.ScalUnitary(alpha, v.mat.Data) - return - } - f64.ScalInc(alpha, v.mat.Data, uintptr(n), uintptr(v.mat.Inc)) - return - } - - v.reuseAs(n) - - if rv, ok := a.(RawVectorer); ok { - mat := rv.RawVector() - v.checkOverlap(mat) - if v.mat.Inc == 1 && mat.Inc == 1 { - f64.ScalUnitaryTo(v.mat.Data, alpha, mat.Data) - return - } - f64.ScalIncTo(v.mat.Data, uintptr(v.mat.Inc), - alpha, mat.Data, uintptr(n), uintptr(mat.Inc)) - return - } - - for i := 0; i < n; i++ { - v.setVec(i, alpha*a.AtVec(i)) - } -} - -// AddScaledVec adds the vectors a and alpha*b, placing the result in the receiver. -func (v *VecDense) AddScaledVec(a Vector, alpha float64, b Vector) { - if alpha == 1 { - v.AddVec(a, b) - return - } - if alpha == -1 { - v.SubVec(a, b) - return - } - - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - var amat, bmat blas64.Vector - fast := true - aU, _ := untranspose(a) - if rv, ok := aU.(RawVectorer); ok { - amat = rv.RawVector() - if v != a { - v.checkOverlap(amat) - } - } else { - fast = false - } - bU, _ := untranspose(b) - if rv, ok := bU.(RawVectorer); ok { - bmat = rv.RawVector() - if v != b { - v.checkOverlap(bmat) - } - } else { - fast = false - } - - v.reuseAs(ar) - - switch { - case alpha == 0: // v <- a - if v == a { - return - } - v.CopyVec(a) - case v == a && v == b: // v <- v + alpha * v = (alpha + 1) * v - blas64.Scal(alpha+1, v.mat) - case !fast: // v <- a + alpha * b without blas64 support. - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)+alpha*b.AtVec(i)) - } - case v == a && v != b: // v <- v + alpha * b - if v.mat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, alpha, bmat.Data, amat.Data) - } else { - f64.AxpyInc(alpha, bmat.Data, v.mat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(v.mat.Inc), 0, 0) - } - default: // v <- a + alpha * b or v <- a + alpha * v - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, alpha, bmat.Data, amat.Data) - } else { - f64.AxpyIncTo(v.mat.Data, uintptr(v.mat.Inc), 0, - alpha, bmat.Data, amat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(amat.Inc), 0, 0) - } - } -} - -// AddVec adds the vectors a and b, placing the result in the receiver. -func (v *VecDense) AddVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAs(ar) - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, 1, bmat.Data, amat.Data) - return - } - f64.AxpyIncTo(v.mat.Data, uintptr(v.mat.Inc), 0, - 1, bmat.Data, amat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(amat.Inc), 0, 0) - return - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)+b.AtVec(i)) - } -} - -// SubVec subtracts the vector b from a, placing the result in the receiver. -func (v *VecDense) SubVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAs(ar) - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - f64.AxpyUnitaryTo(v.mat.Data, -1, bmat.Data, amat.Data) - return - } - f64.AxpyIncTo(v.mat.Data, uintptr(v.mat.Inc), 0, - -1, bmat.Data, amat.Data, - uintptr(ar), uintptr(bmat.Inc), uintptr(amat.Inc), 0, 0) - return - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)-b.AtVec(i)) - } -} - -// MulElemVec performs element-wise multiplication of a and b, placing the result -// in the receiver. -func (v *VecDense) MulElemVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAs(ar) - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - for i, a := range amat.Data { - v.mat.Data[i] = a * bmat.Data[i] - } - return - } - var ia, ib int - for i := 0; i < ar; i++ { - v.setVec(i, amat.Data[ia]*bmat.Data[ib]) - ia += amat.Inc - ib += bmat.Inc - } - return - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)*b.AtVec(i)) - } -} - -// DivElemVec performs element-wise division of a by b, placing the result -// in the receiver. -func (v *VecDense) DivElemVec(a, b Vector) { - ar := a.Len() - br := b.Len() - - if ar != br { - panic(ErrShape) - } - - v.reuseAs(ar) - - aU, _ := untranspose(a) - bU, _ := untranspose(b) - - if arv, ok := aU.(RawVectorer); ok { - if brv, ok := bU.(RawVectorer); ok { - amat := arv.RawVector() - bmat := brv.RawVector() - - if v != a { - v.checkOverlap(amat) - } - if v != b { - v.checkOverlap(bmat) - } - - if v.mat.Inc == 1 && amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - for i, a := range amat.Data { - v.setVec(i, a/bmat.Data[i]) - } - return - } - var ia, ib int - for i := 0; i < ar; i++ { - v.setVec(i, amat.Data[ia]/bmat.Data[ib]) - ia += amat.Inc - ib += bmat.Inc - } - } - } - - for i := 0; i < ar; i++ { - v.setVec(i, a.AtVec(i)/b.AtVec(i)) - } -} - -// MulVec computes a * b. The result is stored into the receiver. -// MulVec panics if the number of columns in a does not equal the number of rows in b -// or if the number of columns in b does not equal 1. -func (v *VecDense) MulVec(a Matrix, b Vector) { - r, c := a.Dims() - br, bc := b.Dims() - if c != br || bc != 1 { - panic(ErrShape) - } - - aU, trans := untranspose(a) - var bmat blas64.Vector - fast := true - bU, _ := untranspose(b) - if rv, ok := bU.(RawVectorer); ok { - bmat = rv.RawVector() - if v != b { - v.checkOverlap(bmat) - } - } else { - fast = false - } - - v.reuseAs(r) - var restore func() - if v == aU { - v, restore = v.isolatedWorkspace(aU.(*VecDense)) - defer restore() - } else if v == b { - v, restore = v.isolatedWorkspace(b) - defer restore() - } - - // TODO(kortschak): Improve the non-fast paths. - switch aU := aU.(type) { - case Vector: - if b.Len() == 1 { - // {n,1} x {1,1} - v.ScaleVec(b.AtVec(0), aU) - return - } - - // {1,n} x {n,1} - if fast { - if rv, ok := aU.(RawVectorer); ok { - amat := rv.RawVector() - if v != aU { - v.checkOverlap(amat) - } - - if amat.Inc == 1 && bmat.Inc == 1 { - // Fast path for a common case. - v.setVec(0, f64.DotUnitary(amat.Data, bmat.Data)) - return - } - v.setVec(0, f64.DotInc(amat.Data, bmat.Data, - uintptr(c), uintptr(amat.Inc), uintptr(bmat.Inc), 0, 0)) - return - } - } - var sum float64 - for i := 0; i < c; i++ { - sum += aU.AtVec(i) * b.AtVec(i) - } - v.setVec(0, sum) - return - case RawSymmetricer: - if fast { - amat := aU.RawSymmetric() - // We don't know that a is a *SymDense, so make - // a temporary SymDense to check overlap. - (&SymDense{mat: amat}).checkOverlap(v.asGeneral()) - blas64.Symv(1, amat, bmat, 0, v.mat) - return - } - case RawTriangular: - v.CopyVec(b) - amat := aU.RawTriangular() - // We don't know that a is a *TriDense, so make - // a temporary TriDense to check overlap. - (&TriDense{mat: amat}).checkOverlap(v.asGeneral()) - ta := blas.NoTrans - if trans { - ta = blas.Trans - } - blas64.Trmv(ta, amat, v.mat) - case RawMatrixer: - if fast { - amat := aU.RawMatrix() - // We don't know that a is a *Dense, so make - // a temporary Dense to check overlap. - (&Dense{mat: amat}).checkOverlap(v.asGeneral()) - t := blas.NoTrans - if trans { - t = blas.Trans - } - blas64.Gemv(t, 1, amat, bmat, 0, v.mat) - return - } - default: - if fast { - for i := 0; i < r; i++ { - var f float64 - for j := 0; j < c; j++ { - f += a.At(i, j) * bmat.Data[j*bmat.Inc] - } - v.setVec(i, f) - } - return - } - } - - for i := 0; i < r; i++ { - var f float64 - for j := 0; j < c; j++ { - f += a.At(i, j) * b.AtVec(j) - } - v.setVec(i, f) - } -} - -// reuseAs resizes an empty vector to a r×1 vector, -// or checks that a non-empty matrix is r×1. -func (v *VecDense) reuseAs(r int) { - if r == 0 { - panic(ErrZeroLength) - } - if v.IsZero() { - v.mat = blas64.Vector{ - N: r, - Inc: 1, - Data: use(v.mat.Data, r), - } - return - } - if r != v.mat.N { - panic(ErrShape) - } -} - -// IsZero returns whether the receiver is zero-sized. Zero-sized vectors can be the -// receiver for size-restricted operations. VecDenses can be zeroed using Reset. -func (v *VecDense) IsZero() bool { - // It must be the case that v.Dims() returns - // zeros in this case. See comment in Reset(). - return v.mat.Inc == 0 -} - -func (v *VecDense) isolatedWorkspace(a Vector) (n *VecDense, restore func()) { - l := a.Len() - if l == 0 { - panic(ErrZeroLength) - } - n = getWorkspaceVec(l, false) - return n, func() { - v.CopyVec(n) - putWorkspaceVec(n) - } -} - -// asDense returns a Dense representation of the receiver with the same -// underlying data. -func (v *VecDense) asDense() *Dense { - return &Dense{ - mat: v.asGeneral(), - capRows: v.mat.N, - capCols: 1, - } -} - -// asGeneral returns a blas64.General representation of the receiver with the -// same underlying data. -func (v *VecDense) asGeneral() blas64.General { - return blas64.General{ - Rows: v.mat.N, - Cols: 1, - Stride: v.mat.Inc, - Data: v.mat.Data, - } -} - -// ColViewOf reflects the column j of the RawMatrixer m, into the receiver -// backed by the same underlying data. The length of the receiver must either be -// zero or match the number of rows in m. -func (v *VecDense) ColViewOf(m RawMatrixer, j int) { - rm := m.RawMatrix() - - if j >= rm.Cols || j < 0 { - panic(ErrColAccess) - } - if !v.IsZero() && v.mat.N != rm.Rows { - panic(ErrShape) - } - - v.mat.Inc = rm.Stride - v.mat.Data = rm.Data[j : (rm.Rows-1)*rm.Stride+j+1] - v.mat.N = rm.Rows -} - -// RowViewOf reflects the row i of the RawMatrixer m, into the receiver -// backed by the same underlying data. The length of the receiver must either be -// zero or match the number of columns in m. -func (v *VecDense) RowViewOf(m RawMatrixer, i int) { - rm := m.RawMatrix() - - if i >= rm.Rows || i < 0 { - panic(ErrRowAccess) - } - if !v.IsZero() && v.mat.N != rm.Cols { - panic(ErrShape) - } - - v.mat.Inc = 1 - v.mat.Data = rm.Data[i*rm.Stride : i*rm.Stride+rm.Cols] - v.mat.N = rm.Cols -} diff --git a/vendor/google.golang.org/genproto/LICENSE b/vendor/google.golang.org/genproto/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/google.golang.org/genproto/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go new file mode 100644 index 000000000..e79a53884 --- /dev/null +++ b/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -0,0 +1,206 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.13.0 +// source: google/rpc/status.proto + +package status + +import ( + reflect "reflect" + sync "sync" + + proto "github.com/golang/protobuf/proto" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// This is a compile-time assertion that a sufficiently up-to-date version +// of the legacy proto package is being used. +const _ = proto.ProtoPackageIsVersion4 + +// The `Status` type defines a logical error model that is suitable for +// different programming environments, including REST APIs and RPC APIs. It is +// used by [gRPC](https://github.com/grpc). Each `Status` message contains +// three pieces of data: error code, error message, and error details. +// +// You can find out more about this error model and how to work with it in the +// [API Design Guide](https://cloud.google.com/apis/design/errors). +type Status struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. + Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` + // A developer-facing error message, which should be in English. Any + // user-facing error message should be localized and sent in the + // [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. + Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` + // A list of messages that carry the error details. There is a common set of + // message types for APIs to use. + Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` +} + +func (x *Status) Reset() { + *x = Status{} + if protoimpl.UnsafeEnabled { + mi := &file_google_rpc_status_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Status) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Status) ProtoMessage() {} + +func (x *Status) ProtoReflect() protoreflect.Message { + mi := &file_google_rpc_status_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Status.ProtoReflect.Descriptor instead. +func (*Status) Descriptor() ([]byte, []int) { + return file_google_rpc_status_proto_rawDescGZIP(), []int{0} +} + +func (x *Status) GetCode() int32 { + if x != nil { + return x.Code + } + return 0 +} + +func (x *Status) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +func (x *Status) GetDetails() []*anypb.Any { + if x != nil { + return x.Details + } + return nil +} + +var File_google_rpc_status_proto protoreflect.FileDescriptor + +var file_google_rpc_status_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0a, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x72, 0x70, 0x63, 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x22, 0x66, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x2e, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, + 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x61, 0x0a, 0x0e, 0x63, 0x6f, 0x6d, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x72, 0x70, 0x63, 0x42, 0x0b, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, + 0x2f, 0x72, 0x70, 0x63, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x3b, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0xf8, 0x01, 0x01, 0xa2, 0x02, 0x03, 0x52, 0x50, 0x43, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, +} + +var ( + file_google_rpc_status_proto_rawDescOnce sync.Once + file_google_rpc_status_proto_rawDescData = file_google_rpc_status_proto_rawDesc +) + +func file_google_rpc_status_proto_rawDescGZIP() []byte { + file_google_rpc_status_proto_rawDescOnce.Do(func() { + file_google_rpc_status_proto_rawDescData = protoimpl.X.CompressGZIP(file_google_rpc_status_proto_rawDescData) + }) + return file_google_rpc_status_proto_rawDescData +} + +var file_google_rpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_google_rpc_status_proto_goTypes = []interface{}{ + (*Status)(nil), // 0: google.rpc.Status + (*anypb.Any)(nil), // 1: google.protobuf.Any +} +var file_google_rpc_status_proto_depIdxs = []int32{ + 1, // 0: google.rpc.Status.details:type_name -> google.protobuf.Any + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_google_rpc_status_proto_init() } +func file_google_rpc_status_proto_init() { + if File_google_rpc_status_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_google_rpc_status_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Status); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_google_rpc_status_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_google_rpc_status_proto_goTypes, + DependencyIndexes: file_google_rpc_status_proto_depIdxs, + MessageInfos: file_google_rpc_status_proto_msgTypes, + }.Build() + File_google_rpc_status_proto = out.File + file_google_rpc_status_proto_rawDesc = nil + file_google_rpc_status_proto_goTypes = nil + file_google_rpc_status_proto_depIdxs = nil +} diff --git a/vendor/google.golang.org/grpc/.travis.yml b/vendor/google.golang.org/grpc/.travis.yml new file mode 100644 index 000000000..0e24e59f0 --- /dev/null +++ b/vendor/google.golang.org/grpc/.travis.yml @@ -0,0 +1,42 @@ +language: go + +matrix: + include: + - go: 1.14.x + env: VET=1 GO111MODULE=on + - go: 1.14.x + env: RACE=1 GO111MODULE=on + - go: 1.14.x + env: RUN386=1 + - go: 1.14.x + env: GRPC_GO_RETRY=on + - go: 1.14.x + env: TESTEXTRAS=1 + - go: 1.13.x + env: GO111MODULE=on + - go: 1.12.x + env: GO111MODULE=on + - go: 1.9.x + env: GAE=1 + +go_import_path: google.golang.org/grpc + +before_install: + - if [[ "${GO111MODULE}" = "on" ]]; then mkdir "${HOME}/go"; export GOPATH="${HOME}/go"; fi + - if [[ -n "${RUN386}" ]]; then export GOARCH=386; fi + - if [[ "${TRAVIS_EVENT_TYPE}" = "cron" && -z "${RUN386}" ]]; then RACE=1; fi + - if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]]; then export VET_SKIP_PROTO=1; fi + +install: + - try3() { eval "$*" || eval "$*" || eval "$*"; } + - try3 'if [[ "${GO111MODULE}" = "on" ]]; then go mod download; else make testdeps; fi' + - if [[ -n "${GAE}" ]]; then source ./install_gae.sh; make testappenginedeps; fi + - if [[ -n "${VET}" ]]; then ./vet.sh -install; fi + +script: + - set -e + - if [[ -n "${TESTEXTRAS}" ]]; then examples/examples_test.sh; interop/interop_test.sh; make testsubmodule; exit 0; fi + - if [[ -n "${VET}" ]]; then ./vet.sh; fi + - if [[ -n "${GAE}" ]]; then make testappengine; exit 0; fi + - if [[ -n "${RACE}" ]]; then make testrace; exit 0; fi + - make test diff --git a/vendor/google.golang.org/grpc/AUTHORS b/vendor/google.golang.org/grpc/AUTHORS new file mode 100644 index 000000000..e491a9e7f --- /dev/null +++ b/vendor/google.golang.org/grpc/AUTHORS @@ -0,0 +1 @@ +Google Inc. diff --git a/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md b/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md new file mode 100644 index 000000000..9d4213ebc --- /dev/null +++ b/vendor/google.golang.org/grpc/CODE-OF-CONDUCT.md @@ -0,0 +1,3 @@ +## Community Code of Conduct + +gRPC follows the [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md). diff --git a/vendor/google.golang.org/grpc/CONTRIBUTING.md b/vendor/google.golang.org/grpc/CONTRIBUTING.md new file mode 100644 index 000000000..4f1567e2f --- /dev/null +++ b/vendor/google.golang.org/grpc/CONTRIBUTING.md @@ -0,0 +1,62 @@ +# How to contribute + +We definitely welcome your patches and contributions to gRPC! Please read the gRPC +organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md) +and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding. + +If you are new to github, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/) + +## Legal requirements + +In order to protect both you and ourselves, you will need to sign the +[Contributor License Agreement](https://identity.linuxfoundation.org/projects/cncf). + +## Guidelines for Pull Requests +How to get your contributions merged smoothly and quickly. + +- Create **small PRs** that are narrowly focused on **addressing a single + concern**. We often times receive PRs that are trying to fix several things at + a time, but only one fix is considered acceptable, nothing gets merged and + both author's & review's time is wasted. Create more PRs to address different + concerns and everyone will be happy. + +- The grpc package should only depend on standard Go packages and a small number + of exceptions. If your contribution introduces new dependencies which are NOT + in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a + discussion with gRPC-Go authors and consultants. + +- For speculative changes, consider opening an issue and discussing it first. If + you are suggesting a behavioral or API change, consider starting with a [gRFC + proposal](https://github.com/grpc/proposal). + +- Provide a good **PR description** as a record of **what** change is being made + and **why** it was made. Link to a github issue if it exists. + +- Don't fix code style and formatting unless you are already changing that line + to address an issue. PRs with irrelevant changes won't be merged. If you do + want to fix formatting or style, do that in a separate PR. + +- Unless your PR is trivial, you should expect there will be reviewer comments + that you'll need to address before merging. We expect you to be reasonably + responsive to those comments, otherwise the PR will be closed after 2-3 weeks + of inactivity. + +- Maintain **clean commit history** and use **meaningful commit messages**. PRs + with messy commit history are difficult to review and won't be merged. Use + `rebase -i upstream/master` to curate your commit history and/or to bring in + latest changes from master (but avoid rebasing in the middle of a code + review). + +- Keep your PR up to date with upstream/master (if there are merge conflicts, we + can't really merge your change). + +- **All tests need to be passing** before your change can be merged. We + recommend you **run tests locally** before creating your PR to catch breakages + early on. + - `make all` to test everything, OR + - `make vet` to catch vet errors + - `make test` to run the tests + - `make testrace` to run tests in race mode + - optional `make testappengine` to run tests with appengine + +- Exceptions to the rules can be made if there's a compelling reason for doing so. diff --git a/vendor/google.golang.org/grpc/GOVERNANCE.md b/vendor/google.golang.org/grpc/GOVERNANCE.md new file mode 100644 index 000000000..d6ff26747 --- /dev/null +++ b/vendor/google.golang.org/grpc/GOVERNANCE.md @@ -0,0 +1 @@ +This repository is governed by the gRPC organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md). diff --git a/vendor/google.golang.org/grpc/LICENSE b/vendor/google.golang.org/grpc/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/google.golang.org/grpc/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/google.golang.org/grpc/MAINTAINERS.md b/vendor/google.golang.org/grpc/MAINTAINERS.md new file mode 100644 index 000000000..093c82b3a --- /dev/null +++ b/vendor/google.golang.org/grpc/MAINTAINERS.md @@ -0,0 +1,27 @@ +This page lists all active maintainers of this repository. If you were a +maintainer and would like to add your name to the Emeritus list, please send us a +PR. + +See [GOVERNANCE.md](https://github.com/grpc/grpc-community/blob/master/governance.md) +for governance guidelines and how to become a maintainer. +See [CONTRIBUTING.md](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) +for general contribution guidelines. + +## Maintainers (in alphabetical order) +- [canguler](https://github.com/canguler), Google LLC +- [cesarghali](https://github.com/cesarghali), Google LLC +- [dfawley](https://github.com/dfawley), Google LLC +- [easwars](https://github.com/easwars), Google LLC +- [jadekler](https://github.com/jadekler), Google LLC +- [menghanl](https://github.com/menghanl), Google LLC +- [srini100](https://github.com/srini100), Google LLC + +## Emeritus Maintainers (in alphabetical order) +- [adelez](https://github.com/adelez), Google LLC +- [iamqizhao](https://github.com/iamqizhao), Google LLC +- [jtattermusch](https://github.com/jtattermusch), Google LLC +- [lyuxuan](https://github.com/lyuxuan), Google LLC +- [makmukhi](https://github.com/makmukhi), Google LLC +- [matt-kwong](https://github.com/matt-kwong), Google LLC +- [nicolasnoble](https://github.com/nicolasnoble), Google LLC +- [yongni](https://github.com/yongni), Google LLC diff --git a/vendor/google.golang.org/grpc/Makefile b/vendor/google.golang.org/grpc/Makefile new file mode 100644 index 000000000..410f7d56d --- /dev/null +++ b/vendor/google.golang.org/grpc/Makefile @@ -0,0 +1,63 @@ +all: vet test testrace + +build: deps + go build google.golang.org/grpc/... + +clean: + go clean -i google.golang.org/grpc/... + +deps: + go get -d -v google.golang.org/grpc/... + +proto: + @ if ! which protoc > /dev/null; then \ + echo "error: protoc not installed" >&2; \ + exit 1; \ + fi + go generate google.golang.org/grpc/... + +test: testdeps + go test -cpu 1,4 -timeout 7m google.golang.org/grpc/... + +testsubmodule: testdeps + cd security/advancedtls && go test -cpu 1,4 -timeout 7m google.golang.org/grpc/security/advancedtls/... + +testappengine: testappenginedeps + goapp test -cpu 1,4 -timeout 7m google.golang.org/grpc/... + +testappenginedeps: + goapp get -d -v -t -tags 'appengine appenginevm' google.golang.org/grpc/... + +testdeps: + go get -d -v -t google.golang.org/grpc/... + +testrace: testdeps + go test -race -cpu 1,4 -timeout 7m google.golang.org/grpc/... + +updatedeps: + go get -d -v -u -f google.golang.org/grpc/... + +updatetestdeps: + go get -d -v -t -u -f google.golang.org/grpc/... + +vet: vetdeps + ./vet.sh + +vetdeps: + ./vet.sh -install + +.PHONY: \ + all \ + build \ + clean \ + deps \ + proto \ + test \ + testappengine \ + testappenginedeps \ + testdeps \ + testrace \ + updatedeps \ + updatetestdeps \ + vet \ + vetdeps diff --git a/vendor/google.golang.org/grpc/README.md b/vendor/google.golang.org/grpc/README.md new file mode 100644 index 000000000..fef78e4a1 --- /dev/null +++ b/vendor/google.golang.org/grpc/README.md @@ -0,0 +1,141 @@ +# gRPC-Go + +[![Build Status](https://travis-ci.org/grpc/grpc-go.svg)](https://travis-ci.org/grpc/grpc-go) +[![GoDoc](https://godoc.org/google.golang.org/grpc?status.svg)][API] +[![GoReportCard](https://goreportcard.com/badge/grpc/grpc-go)](https://goreportcard.com/report/github.com/grpc/grpc-go) + +The [Go][] implementation of [gRPC][]: A high performance, open source, general +RPC framework that puts mobile and HTTP/2 first. For more information see the +[Go gRPC docs][], or jump directly into the [quick start][]. + +## Prerequisites + +- **[Go][]**: any one of the **three latest major** [releases][go-releases]. + +## Installation + +With [Go module][] support (Go 1.11+), simply add the following import + +```go +import "google.golang.org/grpc" +``` + +to your code, and then `go [build|run|test]` will automatically fetch the +necessary dependencies. + +Otherwise, to install the `grpc-go` package, run the following command: + +```console +$ go get -u google.golang.org/grpc +``` + +> **Note:** If you are trying to access `grpc-go` from **China**, see the +> [FAQ](#FAQ) below. + +## Learn more + +- [Go gRPC docs][], which include a [quick start][] and [API + reference][API] among other resources +- [Low-level technical docs](Documentation) from this repository +- [Performance benchmark][] +- [Examples](examples) + +## FAQ + +### I/O Timeout Errors + +The `golang.org` domain may be blocked from some countries. `go get` usually +produces an error like the following when this happens: + +```console +$ go get -u google.golang.org/grpc +package google.golang.org/grpc: unrecognized import path "google.golang.org/grpc" (https fetch: Get https://google.golang.org/grpc?go-get=1: dial tcp 216.239.37.1:443: i/o timeout) +``` + +To build Go code, there are several options: + +- Set up a VPN and access google.golang.org through that. + +- Without Go module support: `git clone` the repo manually: + + ```sh + git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc + ``` + + You will need to do the same for all of grpc's dependencies in `golang.org`, + e.g. `golang.org/x/net`. + +- With Go module support: it is possible to use the `replace` feature of `go + mod` to create aliases for golang.org packages. In your project's directory: + + ```sh + go mod edit -replace=google.golang.org/grpc=github.com/grpc/grpc-go@latest + go mod tidy + go mod vendor + go build -mod=vendor + ``` + + Again, this will need to be done for all transitive dependencies hosted on + golang.org as well. For details, refer to [golang/go issue #28652](https://github.com/golang/go/issues/28652). + +### Compiling error, undefined: grpc.SupportPackageIsVersion + +#### If you are using Go modules: + +Ensure your gRPC-Go version is `require`d at the appropriate version in +the same module containing the generated `.pb.go` files. For example, +`SupportPackageIsVersion6` needs `v1.27.0`, so in your `go.mod` file: + +```go +module + +require ( + google.golang.org/grpc v1.27.0 +) +``` + +#### If you are *not* using Go modules: + +Update the `proto` package, gRPC package, and rebuild the `.proto` files: + +```sh +go get -u github.com/golang/protobuf/{proto,protoc-gen-go} +go get -u google.golang.org/grpc +protoc --go_out=plugins=grpc:. *.proto +``` + +### How to turn on logging + +The default logger is controlled by environment variables. Turn everything on +like this: + +```console +$ export GRPC_GO_LOG_VERBOSITY_LEVEL=99 +$ export GRPC_GO_LOG_SEVERITY_LEVEL=info +``` + +### The RPC failed with error `"code = Unavailable desc = transport is closing"` + +This error means the connection the RPC is using was closed, and there are many +possible reasons, including: + 1. mis-configured transport credentials, connection failed on handshaking + 1. bytes disrupted, possibly by a proxy in between + 1. server shutdown + 1. Keepalive parameters caused connection shutdown, for example if you have configured + your server to terminate connections regularly to [trigger DNS lookups](https://github.com/grpc/grpc-go/issues/3170#issuecomment-552517779). + If this is the case, you may want to increase your [MaxConnectionAgeGrace](https://pkg.go.dev/google.golang.org/grpc/keepalive?tab=doc#ServerParameters), + to allow longer RPC calls to finish. + +It can be tricky to debug this because the error happens on the client side but +the root cause of the connection being closed is on the server side. Turn on +logging on __both client and server__, and see if there are any transport +errors. + +[API]: https://grpc.io/docs/languages/go/api +[Go]: https://golang.org +[Go module]: https://github.com/golang/go/wiki/Modules +[gRPC]: https://grpc.io +[Go gRPC docs]: https://grpc.io/docs/languages/go +[Performance benchmark]: https://performance-dot-grpc-testing.appspot.com/explore?dashboard=5652536396611584&widget=490377658&container=1286539696 +[quick start]: https://grpc.io/docs/languages/go/quickstart +[go-releases]: https://golang.org/doc/devel/release.html diff --git a/vendor/google.golang.org/grpc/attributes/attributes.go b/vendor/google.golang.org/grpc/attributes/attributes.go new file mode 100644 index 000000000..ee5c51e6c --- /dev/null +++ b/vendor/google.golang.org/grpc/attributes/attributes.go @@ -0,0 +1,76 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package attributes defines a generic key/value store used in various gRPC +// components. +// +// All APIs in this package are EXPERIMENTAL. +package attributes + +import "fmt" + +// Attributes is an immutable struct for storing and retrieving generic +// key/value pairs. Keys must be hashable, and users should define their own +// types for keys. +type Attributes struct { + m map[interface{}]interface{} +} + +// New returns a new Attributes containing all key/value pairs in kvs. If the +// same key appears multiple times, the last value overwrites all previous +// values for that key. Panics if len(kvs) is not even. +func New(kvs ...interface{}) *Attributes { + if len(kvs)%2 != 0 { + panic(fmt.Sprintf("attributes.New called with unexpected input: len(kvs) = %v", len(kvs))) + } + a := &Attributes{m: make(map[interface{}]interface{}, len(kvs)/2)} + for i := 0; i < len(kvs)/2; i++ { + a.m[kvs[i*2]] = kvs[i*2+1] + } + return a +} + +// WithValues returns a new Attributes containing all key/value pairs in a and +// kvs. Panics if len(kvs) is not even. If the same key appears multiple +// times, the last value overwrites all previous values for that key. To +// remove an existing key, use a nil value. +func (a *Attributes) WithValues(kvs ...interface{}) *Attributes { + if a == nil { + return New(kvs...) + } + if len(kvs)%2 != 0 { + panic(fmt.Sprintf("attributes.New called with unexpected input: len(kvs) = %v", len(kvs))) + } + n := &Attributes{m: make(map[interface{}]interface{}, len(a.m)+len(kvs)/2)} + for k, v := range a.m { + n.m[k] = v + } + for i := 0; i < len(kvs)/2; i++ { + n.m[kvs[i*2]] = kvs[i*2+1] + } + return n +} + +// Value returns the value associated with these attributes for key, or nil if +// no value is associated with key. +func (a *Attributes) Value(key interface{}) interface{} { + if a == nil { + return nil + } + return a.m[key] +} diff --git a/vendor/google.golang.org/grpc/backoff.go b/vendor/google.golang.org/grpc/backoff.go new file mode 100644 index 000000000..ff7c3ee6f --- /dev/null +++ b/vendor/google.golang.org/grpc/backoff.go @@ -0,0 +1,58 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// See internal/backoff package for the backoff implementation. This file is +// kept for the exported types and API backward compatibility. + +package grpc + +import ( + "time" + + "google.golang.org/grpc/backoff" +) + +// DefaultBackoffConfig uses values specified for backoff in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// Deprecated: use ConnectParams instead. Will be supported throughout 1.x. +var DefaultBackoffConfig = BackoffConfig{ + MaxDelay: 120 * time.Second, +} + +// BackoffConfig defines the parameters for the default gRPC backoff strategy. +// +// Deprecated: use ConnectParams instead. Will be supported throughout 1.x. +type BackoffConfig struct { + // MaxDelay is the upper bound of backoff delay. + MaxDelay time.Duration +} + +// ConnectParams defines the parameters for connecting and retrying. Users are +// encouraged to use this instead of the BackoffConfig type defined above. See +// here for more details: +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// This API is EXPERIMENTAL. +type ConnectParams struct { + // Backoff specifies the configuration options for connection backoff. + Backoff backoff.Config + // MinConnectTimeout is the minimum amount of time we are willing to give a + // connection to complete. + MinConnectTimeout time.Duration +} diff --git a/vendor/google.golang.org/grpc/backoff/backoff.go b/vendor/google.golang.org/grpc/backoff/backoff.go new file mode 100644 index 000000000..0787d0b50 --- /dev/null +++ b/vendor/google.golang.org/grpc/backoff/backoff.go @@ -0,0 +1,52 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package backoff provides configuration options for backoff. +// +// More details can be found at: +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// All APIs in this package are experimental. +package backoff + +import "time" + +// Config defines the configuration options for backoff. +type Config struct { + // BaseDelay is the amount of time to backoff after the first failure. + BaseDelay time.Duration + // Multiplier is the factor with which to multiply backoffs after a + // failed retry. Should ideally be greater than 1. + Multiplier float64 + // Jitter is the factor with which backoffs are randomized. + Jitter float64 + // MaxDelay is the upper bound of backoff delay. + MaxDelay time.Duration +} + +// DefaultConfig is a backoff configuration with the default values specfied +// at https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +// +// This should be useful for callers who want to configure backoff with +// non-default values only for a subset of the options. +var DefaultConfig = Config{ + BaseDelay: 1.0 * time.Second, + Multiplier: 1.6, + Jitter: 0.2, + MaxDelay: 120 * time.Second, +} diff --git a/vendor/google.golang.org/grpc/balancer/balancer.go b/vendor/google.golang.org/grpc/balancer/balancer.go new file mode 100644 index 000000000..8bf359dbf --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/balancer.go @@ -0,0 +1,374 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package balancer defines APIs for load balancing in gRPC. +// All APIs in this package are experimental. +package balancer + +import ( + "context" + "encoding/json" + "errors" + "net" + "strings" + + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" +) + +var ( + // m is a map from name to balancer builder. + m = make(map[string]Builder) +) + +// Register registers the balancer builder to the balancer map. b.Name +// (lowercased) will be used as the name registered with this builder. If the +// Builder implements ConfigParser, ParseConfig will be called when new service +// configs are received by the resolver, and the result will be provided to the +// Balancer in UpdateClientConnState. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple Balancers are +// registered with the same name, the one registered last will take effect. +func Register(b Builder) { + m[strings.ToLower(b.Name())] = b +} + +// unregisterForTesting deletes the balancer with the given name from the +// balancer map. +// +// This function is not thread-safe. +func unregisterForTesting(name string) { + delete(m, name) +} + +func init() { + internal.BalancerUnregister = unregisterForTesting +} + +// Get returns the resolver builder registered with the given name. +// Note that the compare is done in a case-insensitive fashion. +// If no builder is register with the name, nil will be returned. +func Get(name string) Builder { + if b, ok := m[strings.ToLower(name)]; ok { + return b + } + return nil +} + +// SubConn represents a gRPC sub connection. +// Each sub connection contains a list of addresses. gRPC will +// try to connect to them (in sequence), and stop trying the +// remainder once one connection is successful. +// +// The reconnect backoff will be applied on the list, not a single address. +// For example, try_on_all_addresses -> backoff -> try_on_all_addresses. +// +// All SubConns start in IDLE, and will not try to connect. To trigger +// the connecting, Balancers must call Connect. +// When the connection encounters an error, it will reconnect immediately. +// When the connection becomes IDLE, it will not reconnect unless Connect is +// called. +// +// This interface is to be implemented by gRPC. Users should not need a +// brand new implementation of this interface. For the situations like +// testing, the new implementation should embed this interface. This allows +// gRPC to add new methods to this interface. +type SubConn interface { + // UpdateAddresses updates the addresses used in this SubConn. + // gRPC checks if currently-connected address is still in the new list. + // If it's in the list, the connection will be kept. + // If it's not in the list, the connection will gracefully closed, and + // a new connection will be created. + // + // This will trigger a state transition for the SubConn. + UpdateAddresses([]resolver.Address) + // Connect starts the connecting for this SubConn. + Connect() +} + +// NewSubConnOptions contains options to create new SubConn. +type NewSubConnOptions struct { + // CredsBundle is the credentials bundle that will be used in the created + // SubConn. If it's nil, the original creds from grpc DialOptions will be + // used. + // + // Deprecated: Use the Attributes field in resolver.Address to pass + // arbitrary data to the credential handshaker. + CredsBundle credentials.Bundle + // HealthCheckEnabled indicates whether health check service should be + // enabled on this SubConn + HealthCheckEnabled bool +} + +// State contains the balancer's state relevant to the gRPC ClientConn. +type State struct { + // State contains the connectivity state of the balancer, which is used to + // determine the state of the ClientConn. + ConnectivityState connectivity.State + // Picker is used to choose connections (SubConns) for RPCs. + Picker Picker +} + +// ClientConn represents a gRPC ClientConn. +// +// This interface is to be implemented by gRPC. Users should not need a +// brand new implementation of this interface. For the situations like +// testing, the new implementation should embed this interface. This allows +// gRPC to add new methods to this interface. +type ClientConn interface { + // NewSubConn is called by balancer to create a new SubConn. + // It doesn't block and wait for the connections to be established. + // Behaviors of the SubConn can be controlled by options. + NewSubConn([]resolver.Address, NewSubConnOptions) (SubConn, error) + // RemoveSubConn removes the SubConn from ClientConn. + // The SubConn will be shutdown. + RemoveSubConn(SubConn) + + // UpdateState notifies gRPC that the balancer's internal state has + // changed. + // + // gRPC will update the connectivity state of the ClientConn, and will call + // Pick on the new Picker to pick new SubConns. + UpdateState(State) + + // ResolveNow is called by balancer to notify gRPC to do a name resolving. + ResolveNow(resolver.ResolveNowOptions) + + // Target returns the dial target for this ClientConn. + // + // Deprecated: Use the Target field in the BuildOptions instead. + Target() string +} + +// BuildOptions contains additional information for Build. +type BuildOptions struct { + // DialCreds is the transport credential the Balancer implementation can + // use to dial to a remote load balancer server. The Balancer implementations + // can ignore this if it does not need to talk to another party securely. + DialCreds credentials.TransportCredentials + // CredsBundle is the credentials bundle that the Balancer can use. + CredsBundle credentials.Bundle + // Dialer is the custom dialer the Balancer implementation can use to dial + // to a remote load balancer server. The Balancer implementations + // can ignore this if it doesn't need to talk to remote balancer. + Dialer func(context.Context, string) (net.Conn, error) + // ChannelzParentID is the entity parent's channelz unique identification number. + ChannelzParentID int64 + // Target contains the parsed address info of the dial target. It is the same resolver.Target as + // passed to the resolver. + // See the documentation for the resolver.Target type for details about what it contains. + Target resolver.Target +} + +// Builder creates a balancer. +type Builder interface { + // Build creates a new balancer with the ClientConn. + Build(cc ClientConn, opts BuildOptions) Balancer + // Name returns the name of balancers built by this builder. + // It will be used to pick balancers (for example in service config). + Name() string +} + +// ConfigParser parses load balancer configs. +type ConfigParser interface { + // ParseConfig parses the JSON load balancer config provided into an + // internal form or returns an error if the config is invalid. For future + // compatibility reasons, unknown fields in the config should be ignored. + ParseConfig(LoadBalancingConfigJSON json.RawMessage) (serviceconfig.LoadBalancingConfig, error) +} + +// PickInfo contains additional information for the Pick operation. +type PickInfo struct { + // FullMethodName is the method name that NewClientStream() is called + // with. The canonical format is /service/Method. + FullMethodName string + // Ctx is the RPC's context, and may contain relevant RPC-level information + // like the outgoing header metadata. + Ctx context.Context +} + +// DoneInfo contains additional information for done. +type DoneInfo struct { + // Err is the rpc error the RPC finished with. It could be nil. + Err error + // Trailer contains the metadata from the RPC's trailer, if present. + Trailer metadata.MD + // BytesSent indicates if any bytes have been sent to the server. + BytesSent bool + // BytesReceived indicates if any byte has been received from the server. + BytesReceived bool + // ServerLoad is the load received from server. It's usually sent as part of + // trailing metadata. + // + // The only supported type now is *orca_v1.LoadReport. + ServerLoad interface{} +} + +var ( + // ErrNoSubConnAvailable indicates no SubConn is available for pick(). + // gRPC will block the RPC until a new picker is available via UpdateState(). + ErrNoSubConnAvailable = errors.New("no SubConn is available") + // ErrTransientFailure indicates all SubConns are in TransientFailure. + // WaitForReady RPCs will block, non-WaitForReady RPCs will fail. + // + // Deprecated: return an appropriate error based on the last resolution or + // connection attempt instead. The behavior is the same for any non-gRPC + // status error. + ErrTransientFailure = errors.New("all SubConns are in TransientFailure") +) + +// PickResult contains information related to a connection chosen for an RPC. +type PickResult struct { + // SubConn is the connection to use for this pick, if its state is Ready. + // If the state is not Ready, gRPC will block the RPC until a new Picker is + // provided by the balancer (using ClientConn.UpdateState). The SubConn + // must be one returned by ClientConn.NewSubConn. + SubConn SubConn + + // Done is called when the RPC is completed. If the SubConn is not ready, + // this will be called with a nil parameter. If the SubConn is not a valid + // type, Done may not be called. May be nil if the balancer does not wish + // to be notified when the RPC completes. + Done func(DoneInfo) +} + +// TransientFailureError returns e. It exists for backward compatibility and +// will be deleted soon. +// +// Deprecated: no longer necessary, picker errors are treated this way by +// default. +func TransientFailureError(e error) error { return e } + +// Picker is used by gRPC to pick a SubConn to send an RPC. +// Balancer is expected to generate a new picker from its snapshot every time its +// internal state has changed. +// +// The pickers used by gRPC can be updated by ClientConn.UpdateState(). +type Picker interface { + // Pick returns the connection to use for this RPC and related information. + // + // Pick should not block. If the balancer needs to do I/O or any blocking + // or time-consuming work to service this call, it should return + // ErrNoSubConnAvailable, and the Pick call will be repeated by gRPC when + // the Picker is updated (using ClientConn.UpdateState). + // + // If an error is returned: + // + // - If the error is ErrNoSubConnAvailable, gRPC will block until a new + // Picker is provided by the balancer (using ClientConn.UpdateState). + // + // - If the error is a status error (implemented by the grpc/status + // package), gRPC will terminate the RPC with the code and message + // provided. + // + // - For all other errors, wait for ready RPCs will wait, but non-wait for + // ready RPCs will be terminated with this error's Error() string and + // status code Unavailable. + Pick(info PickInfo) (PickResult, error) +} + +// Balancer takes input from gRPC, manages SubConns, and collects and aggregates +// the connectivity states. +// +// It also generates and updates the Picker used by gRPC to pick SubConns for RPCs. +// +// UpdateClientConnState, ResolverError, UpdateSubConnState, and Close are +// guaranteed to be called synchronously from the same goroutine. There's no +// guarantee on picker.Pick, it may be called anytime. +type Balancer interface { + // UpdateClientConnState is called by gRPC when the state of the ClientConn + // changes. If the error returned is ErrBadResolverState, the ClientConn + // will begin calling ResolveNow on the active name resolver with + // exponential backoff until a subsequent call to UpdateClientConnState + // returns a nil error. Any other errors are currently ignored. + UpdateClientConnState(ClientConnState) error + // ResolverError is called by gRPC when the name resolver reports an error. + ResolverError(error) + // UpdateSubConnState is called by gRPC when the state of a SubConn + // changes. + UpdateSubConnState(SubConn, SubConnState) + // Close closes the balancer. The balancer is not required to call + // ClientConn.RemoveSubConn for its existing SubConns. + Close() +} + +// SubConnState describes the state of a SubConn. +type SubConnState struct { + // ConnectivityState is the connectivity state of the SubConn. + ConnectivityState connectivity.State + // ConnectionError is set if the ConnectivityState is TransientFailure, + // describing the reason the SubConn failed. Otherwise, it is nil. + ConnectionError error +} + +// ClientConnState describes the state of a ClientConn relevant to the +// balancer. +type ClientConnState struct { + ResolverState resolver.State + // The parsed load balancing configuration returned by the builder's + // ParseConfig method, if implemented. + BalancerConfig serviceconfig.LoadBalancingConfig +} + +// ErrBadResolverState may be returned by UpdateClientConnState to indicate a +// problem with the provided name resolver data. +var ErrBadResolverState = errors.New("bad resolver state") + +// ConnectivityStateEvaluator takes the connectivity states of multiple SubConns +// and returns one aggregated connectivity state. +// +// It's not thread safe. +type ConnectivityStateEvaluator struct { + numReady uint64 // Number of addrConns in ready state. + numConnecting uint64 // Number of addrConns in connecting state. +} + +// RecordTransition records state change happening in subConn and based on that +// it evaluates what aggregated state should be. +// +// - If at least one SubConn in Ready, the aggregated state is Ready; +// - Else if at least one SubConn in Connecting, the aggregated state is Connecting; +// - Else the aggregated state is TransientFailure. +// +// Idle and Shutdown are not considered. +func (cse *ConnectivityStateEvaluator) RecordTransition(oldState, newState connectivity.State) connectivity.State { + // Update counters. + for idx, state := range []connectivity.State{oldState, newState} { + updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. + switch state { + case connectivity.Ready: + cse.numReady += updateVal + case connectivity.Connecting: + cse.numConnecting += updateVal + } + } + + // Evaluate. + if cse.numReady > 0 { + return connectivity.Ready + } + if cse.numConnecting > 0 { + return connectivity.Connecting + } + return connectivity.TransientFailure +} diff --git a/vendor/google.golang.org/grpc/balancer/base/balancer.go b/vendor/google.golang.org/grpc/balancer/base/balancer.go new file mode 100644 index 000000000..32d782f1c --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/base/balancer.go @@ -0,0 +1,237 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package base + +import ( + "errors" + "fmt" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/resolver" +) + +var logger = grpclog.Component("balancer") + +type baseBuilder struct { + name string + pickerBuilder PickerBuilder + config Config +} + +func (bb *baseBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { + bal := &baseBalancer{ + cc: cc, + pickerBuilder: bb.pickerBuilder, + + subConns: make(map[resolver.Address]balancer.SubConn), + scStates: make(map[balancer.SubConn]connectivity.State), + csEvltr: &balancer.ConnectivityStateEvaluator{}, + config: bb.config, + } + // Initialize picker to a picker that always returns + // ErrNoSubConnAvailable, because when state of a SubConn changes, we + // may call UpdateState with this picker. + bal.picker = NewErrPicker(balancer.ErrNoSubConnAvailable) + return bal +} + +func (bb *baseBuilder) Name() string { + return bb.name +} + +type baseBalancer struct { + cc balancer.ClientConn + pickerBuilder PickerBuilder + + csEvltr *balancer.ConnectivityStateEvaluator + state connectivity.State + + subConns map[resolver.Address]balancer.SubConn + scStates map[balancer.SubConn]connectivity.State + picker balancer.Picker + config Config + + resolverErr error // the last error reported by the resolver; cleared on successful resolution + connErr error // the last connection error; cleared upon leaving TransientFailure +} + +func (b *baseBalancer) ResolverError(err error) { + b.resolverErr = err + if len(b.subConns) == 0 { + b.state = connectivity.TransientFailure + } + + if b.state != connectivity.TransientFailure { + // The picker will not change since the balancer does not currently + // report an error. + return + } + b.regeneratePicker() + b.cc.UpdateState(balancer.State{ + ConnectivityState: b.state, + Picker: b.picker, + }) +} + +func (b *baseBalancer) UpdateClientConnState(s balancer.ClientConnState) error { + // TODO: handle s.ResolverState.ServiceConfig? + if logger.V(2) { + logger.Info("base.baseBalancer: got new ClientConn state: ", s) + } + // Successful resolution; clear resolver error and ensure we return nil. + b.resolverErr = nil + // addrsSet is the set converted from addrs, it's used for quick lookup of an address. + addrsSet := make(map[resolver.Address]struct{}) + for _, a := range s.ResolverState.Addresses { + addrsSet[a] = struct{}{} + if _, ok := b.subConns[a]; !ok { + // a is a new address (not existing in b.subConns). + sc, err := b.cc.NewSubConn([]resolver.Address{a}, balancer.NewSubConnOptions{HealthCheckEnabled: b.config.HealthCheck}) + if err != nil { + logger.Warningf("base.baseBalancer: failed to create new SubConn: %v", err) + continue + } + b.subConns[a] = sc + b.scStates[sc] = connectivity.Idle + sc.Connect() + } + } + for a, sc := range b.subConns { + // a was removed by resolver. + if _, ok := addrsSet[a]; !ok { + b.cc.RemoveSubConn(sc) + delete(b.subConns, a) + // Keep the state of this sc in b.scStates until sc's state becomes Shutdown. + // The entry will be deleted in UpdateSubConnState. + } + } + // If resolver state contains no addresses, return an error so ClientConn + // will trigger re-resolve. Also records this as an resolver error, so when + // the overall state turns transient failure, the error message will have + // the zero address information. + if len(s.ResolverState.Addresses) == 0 { + b.ResolverError(errors.New("produced zero addresses")) + return balancer.ErrBadResolverState + } + return nil +} + +// mergeErrors builds an error from the last connection error and the last +// resolver error. Must only be called if b.state is TransientFailure. +func (b *baseBalancer) mergeErrors() error { + // connErr must always be non-nil unless there are no SubConns, in which + // case resolverErr must be non-nil. + if b.connErr == nil { + return fmt.Errorf("last resolver error: %v", b.resolverErr) + } + if b.resolverErr == nil { + return fmt.Errorf("last connection error: %v", b.connErr) + } + return fmt.Errorf("last connection error: %v; last resolver error: %v", b.connErr, b.resolverErr) +} + +// regeneratePicker takes a snapshot of the balancer, and generates a picker +// from it. The picker is +// - errPicker if the balancer is in TransientFailure, +// - built by the pickerBuilder with all READY SubConns otherwise. +func (b *baseBalancer) regeneratePicker() { + if b.state == connectivity.TransientFailure { + b.picker = NewErrPicker(b.mergeErrors()) + return + } + readySCs := make(map[balancer.SubConn]SubConnInfo) + + // Filter out all ready SCs from full subConn map. + for addr, sc := range b.subConns { + if st, ok := b.scStates[sc]; ok && st == connectivity.Ready { + readySCs[sc] = SubConnInfo{Address: addr} + } + } + b.picker = b.pickerBuilder.Build(PickerBuildInfo{ReadySCs: readySCs}) +} + +func (b *baseBalancer) UpdateSubConnState(sc balancer.SubConn, state balancer.SubConnState) { + s := state.ConnectivityState + if logger.V(2) { + logger.Infof("base.baseBalancer: handle SubConn state change: %p, %v", sc, s) + } + oldS, ok := b.scStates[sc] + if !ok { + if logger.V(2) { + logger.Infof("base.baseBalancer: got state changes for an unknown SubConn: %p, %v", sc, s) + } + return + } + if oldS == connectivity.TransientFailure && s == connectivity.Connecting { + // Once a subconn enters TRANSIENT_FAILURE, ignore subsequent + // CONNECTING transitions to prevent the aggregated state from being + // always CONNECTING when many backends exist but are all down. + return + } + b.scStates[sc] = s + switch s { + case connectivity.Idle: + sc.Connect() + case connectivity.Shutdown: + // When an address was removed by resolver, b called RemoveSubConn but + // kept the sc's state in scStates. Remove state for this sc here. + delete(b.scStates, sc) + case connectivity.TransientFailure: + // Save error to be reported via picker. + b.connErr = state.ConnectionError + } + + b.state = b.csEvltr.RecordTransition(oldS, s) + + // Regenerate picker when one of the following happens: + // - this sc entered or left ready + // - the aggregated state of balancer is TransientFailure + // (may need to update error message) + if (s == connectivity.Ready) != (oldS == connectivity.Ready) || + b.state == connectivity.TransientFailure { + b.regeneratePicker() + } + + b.cc.UpdateState(balancer.State{ConnectivityState: b.state, Picker: b.picker}) +} + +// Close is a nop because base balancer doesn't have internal state to clean up, +// and it doesn't need to call RemoveSubConn for the SubConns. +func (b *baseBalancer) Close() { +} + +// NewErrPicker returns a Picker that always returns err on Pick(). +func NewErrPicker(err error) balancer.Picker { + return &errPicker{err: err} +} + +// NewErrPickerV2 is temporarily defined for backward compatibility reasons. +// +// Deprecated: use NewErrPicker instead. +var NewErrPickerV2 = NewErrPicker + +type errPicker struct { + err error // Pick() always returns this err. +} + +func (p *errPicker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + return balancer.PickResult{}, p.err +} diff --git a/vendor/google.golang.org/grpc/balancer/base/base.go b/vendor/google.golang.org/grpc/balancer/base/base.go new file mode 100644 index 000000000..e31d76e33 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/base/base.go @@ -0,0 +1,71 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package base defines a balancer base that can be used to build balancers with +// different picking algorithms. +// +// The base balancer creates a new SubConn for each resolved address. The +// provided picker will only be notified about READY SubConns. +// +// This package is the base of round_robin balancer, its purpose is to be used +// to build round_robin like balancers with complex picking algorithms. +// Balancers with more complicated logic should try to implement a balancer +// builder from scratch. +// +// All APIs in this package are experimental. +package base + +import ( + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/resolver" +) + +// PickerBuilder creates balancer.Picker. +type PickerBuilder interface { + // Build returns a picker that will be used by gRPC to pick a SubConn. + Build(info PickerBuildInfo) balancer.Picker +} + +// PickerBuildInfo contains information needed by the picker builder to +// construct a picker. +type PickerBuildInfo struct { + // ReadySCs is a map from all ready SubConns to the Addresses used to + // create them. + ReadySCs map[balancer.SubConn]SubConnInfo +} + +// SubConnInfo contains information about a SubConn created by the base +// balancer. +type SubConnInfo struct { + Address resolver.Address // the address used to create this SubConn +} + +// Config contains the config info about the base balancer builder. +type Config struct { + // HealthCheck indicates whether health checking should be enabled for this specific balancer. + HealthCheck bool +} + +// NewBalancerBuilder returns a base balancer builder configured by the provided config. +func NewBalancerBuilder(name string, pb PickerBuilder, config Config) balancer.Builder { + return &baseBuilder{ + name: name, + pickerBuilder: pb, + config: config, + } +} diff --git a/vendor/google.golang.org/grpc/balancer/grpclb/state/state.go b/vendor/google.golang.org/grpc/balancer/grpclb/state/state.go new file mode 100644 index 000000000..a24264a34 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/grpclb/state/state.go @@ -0,0 +1,51 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package state declares grpclb types to be set by resolvers wishing to pass +// information to grpclb via resolver.State Attributes. +package state + +import ( + "google.golang.org/grpc/resolver" +) + +// keyType is the key to use for storing State in Attributes. +type keyType string + +const key = keyType("grpc.grpclb.state") + +// State contains gRPCLB-relevant data passed from the name resolver. +type State struct { + // BalancerAddresses contains the remote load balancer address(es). If + // set, overrides any resolver-provided addresses with Type of GRPCLB. + BalancerAddresses []resolver.Address +} + +// Set returns a copy of the provided state with attributes containing s. s's +// data should not be mutated after calling Set. +func Set(state resolver.State, s *State) resolver.State { + state.Attributes = state.Attributes.WithValues(key, s) + return state +} + +// Get returns the grpclb State in the resolver.State, or nil if not present. +// The returned data should not be mutated. +func Get(state resolver.State) *State { + s, _ := state.Attributes.Value(key).(*State) + return s +} diff --git a/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go new file mode 100644 index 000000000..43c2a1537 --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer/roundrobin/roundrobin.go @@ -0,0 +1,83 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package roundrobin defines a roundrobin balancer. Roundrobin balancer is +// installed as one of the default balancers in gRPC, users don't need to +// explicitly install this balancer. +package roundrobin + +import ( + "sync" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/base" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/grpcrand" +) + +// Name is the name of round_robin balancer. +const Name = "round_robin" + +var logger = grpclog.Component("roundrobin") + +// newBuilder creates a new roundrobin balancer builder. +func newBuilder() balancer.Builder { + return base.NewBalancerBuilder(Name, &rrPickerBuilder{}, base.Config{HealthCheck: true}) +} + +func init() { + balancer.Register(newBuilder()) +} + +type rrPickerBuilder struct{} + +func (*rrPickerBuilder) Build(info base.PickerBuildInfo) balancer.Picker { + logger.Infof("roundrobinPicker: newPicker called with info: %v", info) + if len(info.ReadySCs) == 0 { + return base.NewErrPicker(balancer.ErrNoSubConnAvailable) + } + var scs []balancer.SubConn + for sc := range info.ReadySCs { + scs = append(scs, sc) + } + return &rrPicker{ + subConns: scs, + // Start at a random index, as the same RR balancer rebuilds a new + // picker when SubConn states change, and we don't want to apply excess + // load to the first server in the list. + next: grpcrand.Intn(len(scs)), + } +} + +type rrPicker struct { + // subConns is the snapshot of the roundrobin balancer when this picker was + // created. The slice is immutable. Each Get() will do a round robin + // selection from it and return the selected SubConn. + subConns []balancer.SubConn + + mu sync.Mutex + next int +} + +func (p *rrPicker) Pick(balancer.PickInfo) (balancer.PickResult, error) { + p.mu.Lock() + sc := p.subConns[p.next] + p.next = (p.next + 1) % len(p.subConns) + p.mu.Unlock() + return balancer.PickResult{SubConn: sc}, nil +} diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go new file mode 100644 index 000000000..11e592aab --- /dev/null +++ b/vendor/google.golang.org/grpc/balancer_conn_wrappers.go @@ -0,0 +1,246 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "fmt" + "sync" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/internal/buffer" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/resolver" +) + +// scStateUpdate contains the subConn and the new state it changed to. +type scStateUpdate struct { + sc balancer.SubConn + state connectivity.State + err error +} + +// ccBalancerWrapper is a wrapper on top of cc for balancers. +// It implements balancer.ClientConn interface. +type ccBalancerWrapper struct { + cc *ClientConn + balancerMu sync.Mutex // synchronizes calls to the balancer + balancer balancer.Balancer + scBuffer *buffer.Unbounded + done *grpcsync.Event + + mu sync.Mutex + subConns map[*acBalancerWrapper]struct{} +} + +func newCCBalancerWrapper(cc *ClientConn, b balancer.Builder, bopts balancer.BuildOptions) *ccBalancerWrapper { + ccb := &ccBalancerWrapper{ + cc: cc, + scBuffer: buffer.NewUnbounded(), + done: grpcsync.NewEvent(), + subConns: make(map[*acBalancerWrapper]struct{}), + } + go ccb.watcher() + ccb.balancer = b.Build(ccb, bopts) + return ccb +} + +// watcher balancer functions sequentially, so the balancer can be implemented +// lock-free. +func (ccb *ccBalancerWrapper) watcher() { + for { + select { + case t := <-ccb.scBuffer.Get(): + ccb.scBuffer.Load() + if ccb.done.HasFired() { + break + } + ccb.balancerMu.Lock() + su := t.(*scStateUpdate) + ccb.balancer.UpdateSubConnState(su.sc, balancer.SubConnState{ConnectivityState: su.state, ConnectionError: su.err}) + ccb.balancerMu.Unlock() + case <-ccb.done.Done(): + } + + if ccb.done.HasFired() { + ccb.balancer.Close() + ccb.mu.Lock() + scs := ccb.subConns + ccb.subConns = nil + ccb.mu.Unlock() + for acbw := range scs { + ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) + } + ccb.UpdateState(balancer.State{ConnectivityState: connectivity.Connecting, Picker: nil}) + return + } + } +} + +func (ccb *ccBalancerWrapper) close() { + ccb.done.Fire() +} + +func (ccb *ccBalancerWrapper) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { + // When updating addresses for a SubConn, if the address in use is not in + // the new addresses, the old ac will be tearDown() and a new ac will be + // created. tearDown() generates a state change with Shutdown state, we + // don't want the balancer to receive this state change. So before + // tearDown() on the old ac, ac.acbw (acWrapper) will be set to nil, and + // this function will be called with (nil, Shutdown). We don't need to call + // balancer method in this case. + if sc == nil { + return + } + ccb.scBuffer.Put(&scStateUpdate{ + sc: sc, + state: s, + err: err, + }) +} + +func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { + ccb.balancerMu.Lock() + defer ccb.balancerMu.Unlock() + return ccb.balancer.UpdateClientConnState(*ccs) +} + +func (ccb *ccBalancerWrapper) resolverError(err error) { + ccb.balancerMu.Lock() + ccb.balancer.ResolverError(err) + ccb.balancerMu.Unlock() +} + +func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { + if len(addrs) <= 0 { + return nil, fmt.Errorf("grpc: cannot create SubConn with empty address list") + } + ccb.mu.Lock() + defer ccb.mu.Unlock() + if ccb.subConns == nil { + return nil, fmt.Errorf("grpc: ClientConn balancer wrapper was closed") + } + ac, err := ccb.cc.newAddrConn(addrs, opts) + if err != nil { + return nil, err + } + acbw := &acBalancerWrapper{ac: ac} + acbw.ac.mu.Lock() + ac.acbw = acbw + acbw.ac.mu.Unlock() + ccb.subConns[acbw] = struct{}{} + return acbw, nil +} + +func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) { + acbw, ok := sc.(*acBalancerWrapper) + if !ok { + return + } + ccb.mu.Lock() + defer ccb.mu.Unlock() + if ccb.subConns == nil { + return + } + delete(ccb.subConns, acbw) + ccb.cc.removeAddrConn(acbw.getAddrConn(), errConnDrain) +} + +func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { + ccb.mu.Lock() + defer ccb.mu.Unlock() + if ccb.subConns == nil { + return + } + // Update picker before updating state. Even though the ordering here does + // not matter, it can lead to multiple calls of Pick in the common start-up + // case where we wait for ready and then perform an RPC. If the picker is + // updated later, we could call the "connecting" picker when the state is + // updated, and then call the "ready" picker after the picker gets updated. + ccb.cc.blockingpicker.updatePicker(s.Picker) + ccb.cc.csMgr.updateState(s.ConnectivityState) +} + +func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOptions) { + ccb.cc.resolveNow(o) +} + +func (ccb *ccBalancerWrapper) Target() string { + return ccb.cc.target +} + +// acBalancerWrapper is a wrapper on top of ac for balancers. +// It implements balancer.SubConn interface. +type acBalancerWrapper struct { + mu sync.Mutex + ac *addrConn +} + +func (acbw *acBalancerWrapper) UpdateAddresses(addrs []resolver.Address) { + acbw.mu.Lock() + defer acbw.mu.Unlock() + if len(addrs) <= 0 { + acbw.ac.tearDown(errConnDrain) + return + } + if !acbw.ac.tryUpdateAddrs(addrs) { + cc := acbw.ac.cc + opts := acbw.ac.scopts + acbw.ac.mu.Lock() + // Set old ac.acbw to nil so the Shutdown state update will be ignored + // by balancer. + // + // TODO(bar) the state transition could be wrong when tearDown() old ac + // and creating new ac, fix the transition. + acbw.ac.acbw = nil + acbw.ac.mu.Unlock() + acState := acbw.ac.getState() + acbw.ac.tearDown(errConnDrain) + + if acState == connectivity.Shutdown { + return + } + + ac, err := cc.newAddrConn(addrs, opts) + if err != nil { + channelz.Warningf(logger, acbw.ac.channelzID, "acBalancerWrapper: UpdateAddresses: failed to newAddrConn: %v", err) + return + } + acbw.ac = ac + ac.mu.Lock() + ac.acbw = acbw + ac.mu.Unlock() + if acState != connectivity.Idle { + ac.connect() + } + } +} + +func (acbw *acBalancerWrapper) Connect() { + acbw.mu.Lock() + defer acbw.mu.Unlock() + acbw.ac.connect() +} + +func (acbw *acBalancerWrapper) getAddrConn() *addrConn { + acbw.mu.Lock() + defer acbw.mu.Unlock() + return acbw.ac +} diff --git a/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go new file mode 100644 index 000000000..f826ec769 --- /dev/null +++ b/vendor/google.golang.org/grpc/binarylog/grpc_binarylog_v1/binarylog.pb.go @@ -0,0 +1,812 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: grpc/binlog/v1/binarylog.proto + +package grpc_binarylog_v1 + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + duration "github.com/golang/protobuf/ptypes/duration" + timestamp "github.com/golang/protobuf/ptypes/timestamp" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// Enumerates the type of event +// Note the terminology is different from the RPC semantics +// definition, but the same meaning is expressed here. +type GrpcLogEntry_EventType int32 + +const ( + GrpcLogEntry_EVENT_TYPE_UNKNOWN GrpcLogEntry_EventType = 0 + // Header sent from client to server + GrpcLogEntry_EVENT_TYPE_CLIENT_HEADER GrpcLogEntry_EventType = 1 + // Header sent from server to client + GrpcLogEntry_EVENT_TYPE_SERVER_HEADER GrpcLogEntry_EventType = 2 + // Message sent from client to server + GrpcLogEntry_EVENT_TYPE_CLIENT_MESSAGE GrpcLogEntry_EventType = 3 + // Message sent from server to client + GrpcLogEntry_EVENT_TYPE_SERVER_MESSAGE GrpcLogEntry_EventType = 4 + // A signal that client is done sending + GrpcLogEntry_EVENT_TYPE_CLIENT_HALF_CLOSE GrpcLogEntry_EventType = 5 + // Trailer indicates the end of the RPC. + // On client side, this event means a trailer was either received + // from the network or the gRPC library locally generated a status + // to inform the application about a failure. + // On server side, this event means the server application requested + // to send a trailer. Note: EVENT_TYPE_CANCEL may still arrive after + // this due to races on server side. + GrpcLogEntry_EVENT_TYPE_SERVER_TRAILER GrpcLogEntry_EventType = 6 + // A signal that the RPC is cancelled. On client side, this + // indicates the client application requests a cancellation. + // On server side, this indicates that cancellation was detected. + // Note: This marks the end of the RPC. Events may arrive after + // this due to races. For example, on client side a trailer + // may arrive even though the application requested to cancel the RPC. + GrpcLogEntry_EVENT_TYPE_CANCEL GrpcLogEntry_EventType = 7 +) + +var GrpcLogEntry_EventType_name = map[int32]string{ + 0: "EVENT_TYPE_UNKNOWN", + 1: "EVENT_TYPE_CLIENT_HEADER", + 2: "EVENT_TYPE_SERVER_HEADER", + 3: "EVENT_TYPE_CLIENT_MESSAGE", + 4: "EVENT_TYPE_SERVER_MESSAGE", + 5: "EVENT_TYPE_CLIENT_HALF_CLOSE", + 6: "EVENT_TYPE_SERVER_TRAILER", + 7: "EVENT_TYPE_CANCEL", +} + +var GrpcLogEntry_EventType_value = map[string]int32{ + "EVENT_TYPE_UNKNOWN": 0, + "EVENT_TYPE_CLIENT_HEADER": 1, + "EVENT_TYPE_SERVER_HEADER": 2, + "EVENT_TYPE_CLIENT_MESSAGE": 3, + "EVENT_TYPE_SERVER_MESSAGE": 4, + "EVENT_TYPE_CLIENT_HALF_CLOSE": 5, + "EVENT_TYPE_SERVER_TRAILER": 6, + "EVENT_TYPE_CANCEL": 7, +} + +func (x GrpcLogEntry_EventType) String() string { + return proto.EnumName(GrpcLogEntry_EventType_name, int32(x)) +} + +func (GrpcLogEntry_EventType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{0, 0} +} + +// Enumerates the entity that generates the log entry +type GrpcLogEntry_Logger int32 + +const ( + GrpcLogEntry_LOGGER_UNKNOWN GrpcLogEntry_Logger = 0 + GrpcLogEntry_LOGGER_CLIENT GrpcLogEntry_Logger = 1 + GrpcLogEntry_LOGGER_SERVER GrpcLogEntry_Logger = 2 +) + +var GrpcLogEntry_Logger_name = map[int32]string{ + 0: "LOGGER_UNKNOWN", + 1: "LOGGER_CLIENT", + 2: "LOGGER_SERVER", +} + +var GrpcLogEntry_Logger_value = map[string]int32{ + "LOGGER_UNKNOWN": 0, + "LOGGER_CLIENT": 1, + "LOGGER_SERVER": 2, +} + +func (x GrpcLogEntry_Logger) String() string { + return proto.EnumName(GrpcLogEntry_Logger_name, int32(x)) +} + +func (GrpcLogEntry_Logger) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{0, 1} +} + +type Address_Type int32 + +const ( + Address_TYPE_UNKNOWN Address_Type = 0 + // address is in 1.2.3.4 form + Address_TYPE_IPV4 Address_Type = 1 + // address is in IPv6 canonical form (RFC5952 section 4) + // The scope is NOT included in the address string. + Address_TYPE_IPV6 Address_Type = 2 + // address is UDS string + Address_TYPE_UNIX Address_Type = 3 +) + +var Address_Type_name = map[int32]string{ + 0: "TYPE_UNKNOWN", + 1: "TYPE_IPV4", + 2: "TYPE_IPV6", + 3: "TYPE_UNIX", +} + +var Address_Type_value = map[string]int32{ + "TYPE_UNKNOWN": 0, + "TYPE_IPV4": 1, + "TYPE_IPV6": 2, + "TYPE_UNIX": 3, +} + +func (x Address_Type) String() string { + return proto.EnumName(Address_Type_name, int32(x)) +} + +func (Address_Type) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{7, 0} +} + +// Log entry we store in binary logs +type GrpcLogEntry struct { + // The timestamp of the binary log message + Timestamp *timestamp.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + // Uniquely identifies a call. The value must not be 0 in order to disambiguate + // from an unset value. + // Each call may have several log entries, they will all have the same call_id. + // Nothing is guaranteed about their value other than they are unique across + // different RPCs in the same gRPC process. + CallId uint64 `protobuf:"varint,2,opt,name=call_id,json=callId,proto3" json:"call_id,omitempty"` + // The entry sequence id for this call. The first GrpcLogEntry has a + // value of 1, to disambiguate from an unset value. The purpose of + // this field is to detect missing entries in environments where + // durability or ordering is not guaranteed. + SequenceIdWithinCall uint64 `protobuf:"varint,3,opt,name=sequence_id_within_call,json=sequenceIdWithinCall,proto3" json:"sequence_id_within_call,omitempty"` + Type GrpcLogEntry_EventType `protobuf:"varint,4,opt,name=type,proto3,enum=grpc.binarylog.v1.GrpcLogEntry_EventType" json:"type,omitempty"` + Logger GrpcLogEntry_Logger `protobuf:"varint,5,opt,name=logger,proto3,enum=grpc.binarylog.v1.GrpcLogEntry_Logger" json:"logger,omitempty"` + // The logger uses one of the following fields to record the payload, + // according to the type of the log entry. + // + // Types that are valid to be assigned to Payload: + // *GrpcLogEntry_ClientHeader + // *GrpcLogEntry_ServerHeader + // *GrpcLogEntry_Message + // *GrpcLogEntry_Trailer + Payload isGrpcLogEntry_Payload `protobuf_oneof:"payload"` + // true if payload does not represent the full message or metadata. + PayloadTruncated bool `protobuf:"varint,10,opt,name=payload_truncated,json=payloadTruncated,proto3" json:"payload_truncated,omitempty"` + // Peer address information, will only be recorded on the first + // incoming event. On client side, peer is logged on + // EVENT_TYPE_SERVER_HEADER normally or EVENT_TYPE_SERVER_TRAILER in + // the case of trailers-only. On server side, peer is always + // logged on EVENT_TYPE_CLIENT_HEADER. + Peer *Address `protobuf:"bytes,11,opt,name=peer,proto3" json:"peer,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GrpcLogEntry) Reset() { *m = GrpcLogEntry{} } +func (m *GrpcLogEntry) String() string { return proto.CompactTextString(m) } +func (*GrpcLogEntry) ProtoMessage() {} +func (*GrpcLogEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{0} +} + +func (m *GrpcLogEntry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GrpcLogEntry.Unmarshal(m, b) +} +func (m *GrpcLogEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GrpcLogEntry.Marshal(b, m, deterministic) +} +func (m *GrpcLogEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_GrpcLogEntry.Merge(m, src) +} +func (m *GrpcLogEntry) XXX_Size() int { + return xxx_messageInfo_GrpcLogEntry.Size(m) +} +func (m *GrpcLogEntry) XXX_DiscardUnknown() { + xxx_messageInfo_GrpcLogEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_GrpcLogEntry proto.InternalMessageInfo + +func (m *GrpcLogEntry) GetTimestamp() *timestamp.Timestamp { + if m != nil { + return m.Timestamp + } + return nil +} + +func (m *GrpcLogEntry) GetCallId() uint64 { + if m != nil { + return m.CallId + } + return 0 +} + +func (m *GrpcLogEntry) GetSequenceIdWithinCall() uint64 { + if m != nil { + return m.SequenceIdWithinCall + } + return 0 +} + +func (m *GrpcLogEntry) GetType() GrpcLogEntry_EventType { + if m != nil { + return m.Type + } + return GrpcLogEntry_EVENT_TYPE_UNKNOWN +} + +func (m *GrpcLogEntry) GetLogger() GrpcLogEntry_Logger { + if m != nil { + return m.Logger + } + return GrpcLogEntry_LOGGER_UNKNOWN +} + +type isGrpcLogEntry_Payload interface { + isGrpcLogEntry_Payload() +} + +type GrpcLogEntry_ClientHeader struct { + ClientHeader *ClientHeader `protobuf:"bytes,6,opt,name=client_header,json=clientHeader,proto3,oneof"` +} + +type GrpcLogEntry_ServerHeader struct { + ServerHeader *ServerHeader `protobuf:"bytes,7,opt,name=server_header,json=serverHeader,proto3,oneof"` +} + +type GrpcLogEntry_Message struct { + Message *Message `protobuf:"bytes,8,opt,name=message,proto3,oneof"` +} + +type GrpcLogEntry_Trailer struct { + Trailer *Trailer `protobuf:"bytes,9,opt,name=trailer,proto3,oneof"` +} + +func (*GrpcLogEntry_ClientHeader) isGrpcLogEntry_Payload() {} + +func (*GrpcLogEntry_ServerHeader) isGrpcLogEntry_Payload() {} + +func (*GrpcLogEntry_Message) isGrpcLogEntry_Payload() {} + +func (*GrpcLogEntry_Trailer) isGrpcLogEntry_Payload() {} + +func (m *GrpcLogEntry) GetPayload() isGrpcLogEntry_Payload { + if m != nil { + return m.Payload + } + return nil +} + +func (m *GrpcLogEntry) GetClientHeader() *ClientHeader { + if x, ok := m.GetPayload().(*GrpcLogEntry_ClientHeader); ok { + return x.ClientHeader + } + return nil +} + +func (m *GrpcLogEntry) GetServerHeader() *ServerHeader { + if x, ok := m.GetPayload().(*GrpcLogEntry_ServerHeader); ok { + return x.ServerHeader + } + return nil +} + +func (m *GrpcLogEntry) GetMessage() *Message { + if x, ok := m.GetPayload().(*GrpcLogEntry_Message); ok { + return x.Message + } + return nil +} + +func (m *GrpcLogEntry) GetTrailer() *Trailer { + if x, ok := m.GetPayload().(*GrpcLogEntry_Trailer); ok { + return x.Trailer + } + return nil +} + +func (m *GrpcLogEntry) GetPayloadTruncated() bool { + if m != nil { + return m.PayloadTruncated + } + return false +} + +func (m *GrpcLogEntry) GetPeer() *Address { + if m != nil { + return m.Peer + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*GrpcLogEntry) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*GrpcLogEntry_ClientHeader)(nil), + (*GrpcLogEntry_ServerHeader)(nil), + (*GrpcLogEntry_Message)(nil), + (*GrpcLogEntry_Trailer)(nil), + } +} + +type ClientHeader struct { + // This contains only the metadata from the application. + Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // The name of the RPC method, which looks something like: + // // + // Note the leading "/" character. + MethodName string `protobuf:"bytes,2,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"` + // A single process may be used to run multiple virtual + // servers with different identities. + // The authority is the name of such a server identitiy. + // It is typically a portion of the URI in the form of + // or : . + Authority string `protobuf:"bytes,3,opt,name=authority,proto3" json:"authority,omitempty"` + // the RPC timeout + Timeout *duration.Duration `protobuf:"bytes,4,opt,name=timeout,proto3" json:"timeout,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClientHeader) Reset() { *m = ClientHeader{} } +func (m *ClientHeader) String() string { return proto.CompactTextString(m) } +func (*ClientHeader) ProtoMessage() {} +func (*ClientHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{1} +} + +func (m *ClientHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClientHeader.Unmarshal(m, b) +} +func (m *ClientHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClientHeader.Marshal(b, m, deterministic) +} +func (m *ClientHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientHeader.Merge(m, src) +} +func (m *ClientHeader) XXX_Size() int { + return xxx_messageInfo_ClientHeader.Size(m) +} +func (m *ClientHeader) XXX_DiscardUnknown() { + xxx_messageInfo_ClientHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientHeader proto.InternalMessageInfo + +func (m *ClientHeader) GetMetadata() *Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *ClientHeader) GetMethodName() string { + if m != nil { + return m.MethodName + } + return "" +} + +func (m *ClientHeader) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *ClientHeader) GetTimeout() *duration.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +type ServerHeader struct { + // This contains only the metadata from the application. + Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServerHeader) Reset() { *m = ServerHeader{} } +func (m *ServerHeader) String() string { return proto.CompactTextString(m) } +func (*ServerHeader) ProtoMessage() {} +func (*ServerHeader) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{2} +} + +func (m *ServerHeader) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ServerHeader.Unmarshal(m, b) +} +func (m *ServerHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ServerHeader.Marshal(b, m, deterministic) +} +func (m *ServerHeader) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServerHeader.Merge(m, src) +} +func (m *ServerHeader) XXX_Size() int { + return xxx_messageInfo_ServerHeader.Size(m) +} +func (m *ServerHeader) XXX_DiscardUnknown() { + xxx_messageInfo_ServerHeader.DiscardUnknown(m) +} + +var xxx_messageInfo_ServerHeader proto.InternalMessageInfo + +func (m *ServerHeader) GetMetadata() *Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +type Trailer struct { + // This contains only the metadata from the application. + Metadata *Metadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"` + // The gRPC status code. + StatusCode uint32 `protobuf:"varint,2,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + // An original status message before any transport specific + // encoding. + StatusMessage string `protobuf:"bytes,3,opt,name=status_message,json=statusMessage,proto3" json:"status_message,omitempty"` + // The value of the 'grpc-status-details-bin' metadata key. If + // present, this is always an encoded 'google.rpc.Status' message. + StatusDetails []byte `protobuf:"bytes,4,opt,name=status_details,json=statusDetails,proto3" json:"status_details,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Trailer) Reset() { *m = Trailer{} } +func (m *Trailer) String() string { return proto.CompactTextString(m) } +func (*Trailer) ProtoMessage() {} +func (*Trailer) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{3} +} + +func (m *Trailer) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Trailer.Unmarshal(m, b) +} +func (m *Trailer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Trailer.Marshal(b, m, deterministic) +} +func (m *Trailer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Trailer.Merge(m, src) +} +func (m *Trailer) XXX_Size() int { + return xxx_messageInfo_Trailer.Size(m) +} +func (m *Trailer) XXX_DiscardUnknown() { + xxx_messageInfo_Trailer.DiscardUnknown(m) +} + +var xxx_messageInfo_Trailer proto.InternalMessageInfo + +func (m *Trailer) GetMetadata() *Metadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Trailer) GetStatusCode() uint32 { + if m != nil { + return m.StatusCode + } + return 0 +} + +func (m *Trailer) GetStatusMessage() string { + if m != nil { + return m.StatusMessage + } + return "" +} + +func (m *Trailer) GetStatusDetails() []byte { + if m != nil { + return m.StatusDetails + } + return nil +} + +// Message payload, used by CLIENT_MESSAGE and SERVER_MESSAGE +type Message struct { + // Length of the message. It may not be the same as the length of the + // data field, as the logging payload can be truncated or omitted. + Length uint32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` + // May be truncated or omitted. + Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Message) Reset() { *m = Message{} } +func (m *Message) String() string { return proto.CompactTextString(m) } +func (*Message) ProtoMessage() {} +func (*Message) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{4} +} + +func (m *Message) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Message.Unmarshal(m, b) +} +func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Message.Marshal(b, m, deterministic) +} +func (m *Message) XXX_Merge(src proto.Message) { + xxx_messageInfo_Message.Merge(m, src) +} +func (m *Message) XXX_Size() int { + return xxx_messageInfo_Message.Size(m) +} +func (m *Message) XXX_DiscardUnknown() { + xxx_messageInfo_Message.DiscardUnknown(m) +} + +var xxx_messageInfo_Message proto.InternalMessageInfo + +func (m *Message) GetLength() uint32 { + if m != nil { + return m.Length + } + return 0 +} + +func (m *Message) GetData() []byte { + if m != nil { + return m.Data + } + return nil +} + +// A list of metadata pairs, used in the payload of client header, +// server header, and server trailer. +// Implementations may omit some entries to honor the header limits +// of GRPC_BINARY_LOG_CONFIG. +// +// Header keys added by gRPC are omitted. To be more specific, +// implementations will not log the following entries, and this is +// not to be treated as a truncation: +// - entries handled by grpc that are not user visible, such as those +// that begin with 'grpc-' (with exception of grpc-trace-bin) +// or keys like 'lb-token' +// - transport specific entries, including but not limited to: +// ':path', ':authority', 'content-encoding', 'user-agent', 'te', etc +// - entries added for call credentials +// +// Implementations must always log grpc-trace-bin if it is present. +// Practically speaking it will only be visible on server side because +// grpc-trace-bin is managed by low level client side mechanisms +// inaccessible from the application level. On server side, the +// header is just a normal metadata key. +// The pair will not count towards the size limit. +type Metadata struct { + Entry []*MetadataEntry `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Metadata) Reset() { *m = Metadata{} } +func (m *Metadata) String() string { return proto.CompactTextString(m) } +func (*Metadata) ProtoMessage() {} +func (*Metadata) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{5} +} + +func (m *Metadata) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Metadata.Unmarshal(m, b) +} +func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Metadata.Marshal(b, m, deterministic) +} +func (m *Metadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_Metadata.Merge(m, src) +} +func (m *Metadata) XXX_Size() int { + return xxx_messageInfo_Metadata.Size(m) +} +func (m *Metadata) XXX_DiscardUnknown() { + xxx_messageInfo_Metadata.DiscardUnknown(m) +} + +var xxx_messageInfo_Metadata proto.InternalMessageInfo + +func (m *Metadata) GetEntry() []*MetadataEntry { + if m != nil { + return m.Entry + } + return nil +} + +// A metadata key value pair +type MetadataEntry struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MetadataEntry) Reset() { *m = MetadataEntry{} } +func (m *MetadataEntry) String() string { return proto.CompactTextString(m) } +func (*MetadataEntry) ProtoMessage() {} +func (*MetadataEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{6} +} + +func (m *MetadataEntry) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MetadataEntry.Unmarshal(m, b) +} +func (m *MetadataEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MetadataEntry.Marshal(b, m, deterministic) +} +func (m *MetadataEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_MetadataEntry.Merge(m, src) +} +func (m *MetadataEntry) XXX_Size() int { + return xxx_messageInfo_MetadataEntry.Size(m) +} +func (m *MetadataEntry) XXX_DiscardUnknown() { + xxx_messageInfo_MetadataEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_MetadataEntry proto.InternalMessageInfo + +func (m *MetadataEntry) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *MetadataEntry) GetValue() []byte { + if m != nil { + return m.Value + } + return nil +} + +// Address information +type Address struct { + Type Address_Type `protobuf:"varint,1,opt,name=type,proto3,enum=grpc.binarylog.v1.Address_Type" json:"type,omitempty"` + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // only for TYPE_IPV4 and TYPE_IPV6 + IpPort uint32 `protobuf:"varint,3,opt,name=ip_port,json=ipPort,proto3" json:"ip_port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Address) Reset() { *m = Address{} } +func (m *Address) String() string { return proto.CompactTextString(m) } +func (*Address) ProtoMessage() {} +func (*Address) Descriptor() ([]byte, []int) { + return fileDescriptor_b7972e58de45083a, []int{7} +} + +func (m *Address) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Address.Unmarshal(m, b) +} +func (m *Address) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Address.Marshal(b, m, deterministic) +} +func (m *Address) XXX_Merge(src proto.Message) { + xxx_messageInfo_Address.Merge(m, src) +} +func (m *Address) XXX_Size() int { + return xxx_messageInfo_Address.Size(m) +} +func (m *Address) XXX_DiscardUnknown() { + xxx_messageInfo_Address.DiscardUnknown(m) +} + +var xxx_messageInfo_Address proto.InternalMessageInfo + +func (m *Address) GetType() Address_Type { + if m != nil { + return m.Type + } + return Address_TYPE_UNKNOWN +} + +func (m *Address) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Address) GetIpPort() uint32 { + if m != nil { + return m.IpPort + } + return 0 +} + +func init() { + proto.RegisterEnum("grpc.binarylog.v1.GrpcLogEntry_EventType", GrpcLogEntry_EventType_name, GrpcLogEntry_EventType_value) + proto.RegisterEnum("grpc.binarylog.v1.GrpcLogEntry_Logger", GrpcLogEntry_Logger_name, GrpcLogEntry_Logger_value) + proto.RegisterEnum("grpc.binarylog.v1.Address_Type", Address_Type_name, Address_Type_value) + proto.RegisterType((*GrpcLogEntry)(nil), "grpc.binarylog.v1.GrpcLogEntry") + proto.RegisterType((*ClientHeader)(nil), "grpc.binarylog.v1.ClientHeader") + proto.RegisterType((*ServerHeader)(nil), "grpc.binarylog.v1.ServerHeader") + proto.RegisterType((*Trailer)(nil), "grpc.binarylog.v1.Trailer") + proto.RegisterType((*Message)(nil), "grpc.binarylog.v1.Message") + proto.RegisterType((*Metadata)(nil), "grpc.binarylog.v1.Metadata") + proto.RegisterType((*MetadataEntry)(nil), "grpc.binarylog.v1.MetadataEntry") + proto.RegisterType((*Address)(nil), "grpc.binarylog.v1.Address") +} + +func init() { proto.RegisterFile("grpc/binlog/v1/binarylog.proto", fileDescriptor_b7972e58de45083a) } + +var fileDescriptor_b7972e58de45083a = []byte{ + // 904 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0x51, 0x6f, 0xe3, 0x44, + 0x10, 0xae, 0xdb, 0x34, 0x6e, 0x26, 0x49, 0xe5, 0xae, 0xca, 0x9d, 0xaf, 0x94, 0x6b, 0x64, 0x09, + 0x14, 0x84, 0xe4, 0xa8, 0x29, 0xd7, 0xe3, 0x05, 0xa4, 0x24, 0xf5, 0xa5, 0x11, 0xb9, 0x34, 0xda, + 0xe4, 0x7a, 0x80, 0x90, 0xac, 0x6d, 0xbc, 0x38, 0x16, 0x8e, 0xd7, 0xac, 0x37, 0x41, 0xf9, 0x59, + 0xbc, 0x21, 0xdd, 0xef, 0xe2, 0x1d, 0x79, 0xd7, 0x4e, 0x4d, 0xd3, 0x82, 0xc4, 0xbd, 0xed, 0x7c, + 0xf3, 0xcd, 0x37, 0xbb, 0xe3, 0x99, 0x31, 0xbc, 0xf4, 0x79, 0x3c, 0x6b, 0xdd, 0x05, 0x51, 0xc8, + 0xfc, 0xd6, 0xea, 0x3c, 0x3d, 0x11, 0xbe, 0x0e, 0x99, 0x6f, 0xc7, 0x9c, 0x09, 0x86, 0x8e, 0x52, + 0xbf, 0x7d, 0x8f, 0xae, 0xce, 0x4f, 0x5e, 0xfa, 0x8c, 0xf9, 0x21, 0x6d, 0x49, 0xc2, 0xdd, 0xf2, + 0x97, 0x96, 0xb7, 0xe4, 0x44, 0x04, 0x2c, 0x52, 0x21, 0x27, 0x67, 0x0f, 0xfd, 0x22, 0x58, 0xd0, + 0x44, 0x90, 0x45, 0xac, 0x08, 0xd6, 0x07, 0x1d, 0x6a, 0x7d, 0x1e, 0xcf, 0x86, 0xcc, 0x77, 0x22, + 0xc1, 0xd7, 0xe8, 0x1b, 0xa8, 0x6c, 0x38, 0xa6, 0xd6, 0xd0, 0x9a, 0xd5, 0xf6, 0x89, 0xad, 0x54, + 0xec, 0x5c, 0xc5, 0x9e, 0xe6, 0x0c, 0x7c, 0x4f, 0x46, 0xcf, 0x41, 0x9f, 0x91, 0x30, 0x74, 0x03, + 0xcf, 0xdc, 0x6d, 0x68, 0xcd, 0x12, 0x2e, 0xa7, 0xe6, 0xc0, 0x43, 0xaf, 0xe0, 0x79, 0x42, 0x7f, + 0x5b, 0xd2, 0x68, 0x46, 0xdd, 0xc0, 0x73, 0x7f, 0x0f, 0xc4, 0x3c, 0x88, 0xdc, 0xd4, 0x69, 0xee, + 0x49, 0xe2, 0x71, 0xee, 0x1e, 0x78, 0xef, 0xa5, 0xb3, 0x47, 0xc2, 0x10, 0x7d, 0x0b, 0x25, 0xb1, + 0x8e, 0xa9, 0x59, 0x6a, 0x68, 0xcd, 0xc3, 0xf6, 0x97, 0xf6, 0xd6, 0xeb, 0xed, 0xe2, 0xc5, 0x6d, + 0x67, 0x45, 0x23, 0x31, 0x5d, 0xc7, 0x14, 0xcb, 0x30, 0xf4, 0x1d, 0x94, 0x43, 0xe6, 0xfb, 0x94, + 0x9b, 0xfb, 0x52, 0xe0, 0x8b, 0xff, 0x12, 0x18, 0x4a, 0x36, 0xce, 0xa2, 0xd0, 0x1b, 0xa8, 0xcf, + 0xc2, 0x80, 0x46, 0xc2, 0x9d, 0x53, 0xe2, 0x51, 0x6e, 0x96, 0x65, 0x31, 0xce, 0x1e, 0x91, 0xe9, + 0x49, 0xde, 0xb5, 0xa4, 0x5d, 0xef, 0xe0, 0xda, 0xac, 0x60, 0xa7, 0x3a, 0x09, 0xe5, 0x2b, 0xca, + 0x73, 0x1d, 0xfd, 0x49, 0x9d, 0x89, 0xe4, 0xdd, 0xeb, 0x24, 0x05, 0x1b, 0x5d, 0x82, 0xbe, 0xa0, + 0x49, 0x42, 0x7c, 0x6a, 0x1e, 0xe4, 0x9f, 0x65, 0x4b, 0xe1, 0xad, 0x62, 0x5c, 0xef, 0xe0, 0x9c, + 0x9c, 0xc6, 0x09, 0x4e, 0x82, 0x90, 0x72, 0xb3, 0xf2, 0x64, 0xdc, 0x54, 0x31, 0xd2, 0xb8, 0x8c, + 0x8c, 0xbe, 0x82, 0xa3, 0x98, 0xac, 0x43, 0x46, 0x3c, 0x57, 0xf0, 0x65, 0x34, 0x23, 0x82, 0x7a, + 0x26, 0x34, 0xb4, 0xe6, 0x01, 0x36, 0x32, 0xc7, 0x34, 0xc7, 0x91, 0x0d, 0xa5, 0x98, 0x52, 0x6e, + 0x56, 0x9f, 0xcc, 0xd0, 0xf1, 0x3c, 0x4e, 0x93, 0x04, 0x4b, 0x9e, 0xf5, 0x97, 0x06, 0x95, 0xcd, + 0x07, 0x43, 0xcf, 0x00, 0x39, 0xb7, 0xce, 0x68, 0xea, 0x4e, 0x7f, 0x1c, 0x3b, 0xee, 0xbb, 0xd1, + 0xf7, 0xa3, 0x9b, 0xf7, 0x23, 0x63, 0x07, 0x9d, 0x82, 0x59, 0xc0, 0x7b, 0xc3, 0x41, 0x7a, 0xbe, + 0x76, 0x3a, 0x57, 0x0e, 0x36, 0xb4, 0x07, 0xde, 0x89, 0x83, 0x6f, 0x1d, 0x9c, 0x7b, 0x77, 0xd1, + 0x67, 0xf0, 0x62, 0x3b, 0xf6, 0xad, 0x33, 0x99, 0x74, 0xfa, 0x8e, 0xb1, 0xf7, 0xc0, 0x9d, 0x05, + 0xe7, 0xee, 0x12, 0x6a, 0xc0, 0xe9, 0x23, 0x99, 0x3b, 0xc3, 0x37, 0x6e, 0x6f, 0x78, 0x33, 0x71, + 0x8c, 0xfd, 0xc7, 0x05, 0xa6, 0xb8, 0x33, 0x18, 0x3a, 0xd8, 0x28, 0xa3, 0x4f, 0xe0, 0xa8, 0x28, + 0xd0, 0x19, 0xf5, 0x9c, 0xa1, 0xa1, 0x5b, 0x5d, 0x28, 0xab, 0x36, 0x43, 0x08, 0x0e, 0x87, 0x37, + 0xfd, 0xbe, 0x83, 0x0b, 0xef, 0x3d, 0x82, 0x7a, 0x86, 0xa9, 0x8c, 0x86, 0x56, 0x80, 0x54, 0x0a, + 0x63, 0xb7, 0x5b, 0x01, 0x3d, 0xab, 0xbf, 0xf5, 0x41, 0x83, 0x5a, 0xb1, 0xf9, 0xd0, 0x6b, 0x38, + 0x58, 0x50, 0x41, 0x3c, 0x22, 0x48, 0x36, 0xbc, 0x9f, 0x3e, 0xda, 0x25, 0x8a, 0x82, 0x37, 0x64, + 0x74, 0x06, 0xd5, 0x05, 0x15, 0x73, 0xe6, 0xb9, 0x11, 0x59, 0x50, 0x39, 0xc0, 0x15, 0x0c, 0x0a, + 0x1a, 0x91, 0x05, 0x45, 0xa7, 0x50, 0x21, 0x4b, 0x31, 0x67, 0x3c, 0x10, 0x6b, 0x39, 0xb6, 0x15, + 0x7c, 0x0f, 0xa0, 0x0b, 0xd0, 0xd3, 0x45, 0xc0, 0x96, 0x42, 0x8e, 0x6b, 0xb5, 0xfd, 0x62, 0x6b, + 0x67, 0x5c, 0x65, 0x9b, 0x09, 0xe7, 0x4c, 0xab, 0x0f, 0xb5, 0x62, 0xc7, 0xff, 0xef, 0xcb, 0x5b, + 0x7f, 0x68, 0xa0, 0x67, 0x1d, 0xfc, 0x51, 0x15, 0x48, 0x04, 0x11, 0xcb, 0xc4, 0x9d, 0x31, 0x4f, + 0x55, 0xa0, 0x8e, 0x41, 0x41, 0x3d, 0xe6, 0x51, 0xf4, 0x39, 0x1c, 0x66, 0x84, 0x7c, 0x0e, 0x55, + 0x19, 0xea, 0x0a, 0xcd, 0x46, 0xaf, 0x40, 0xf3, 0xa8, 0x20, 0x41, 0x98, 0xc8, 0x8a, 0xd4, 0x72, + 0xda, 0x95, 0x02, 0xad, 0x57, 0xa0, 0xe7, 0x11, 0xcf, 0xa0, 0x1c, 0xd2, 0xc8, 0x17, 0x73, 0x79, + 0xe1, 0x3a, 0xce, 0x2c, 0x84, 0xa0, 0x24, 0x9f, 0xb1, 0x2b, 0xe3, 0xe5, 0xd9, 0xea, 0xc2, 0x41, + 0x7e, 0x77, 0x74, 0x09, 0xfb, 0x34, 0xdd, 0x5c, 0xa6, 0xd6, 0xd8, 0x6b, 0x56, 0xdb, 0x8d, 0x7f, + 0x79, 0xa7, 0xdc, 0x70, 0x58, 0xd1, 0xad, 0xd7, 0x50, 0xff, 0x07, 0x8e, 0x0c, 0xd8, 0xfb, 0x95, + 0xae, 0x65, 0xf6, 0x0a, 0x4e, 0x8f, 0xe8, 0x18, 0xf6, 0x57, 0x24, 0x5c, 0xd2, 0x2c, 0xb7, 0x32, + 0xac, 0x3f, 0x35, 0xd0, 0xb3, 0x39, 0x46, 0x17, 0xd9, 0x76, 0xd6, 0xe4, 0x72, 0x3d, 0x7b, 0x7a, + 0xe2, 0xed, 0xc2, 0x4e, 0x36, 0x41, 0x27, 0x0a, 0xcd, 0x3a, 0x2c, 0x37, 0xd3, 0x9f, 0x47, 0x10, + 0xbb, 0x31, 0xe3, 0x42, 0x56, 0xb5, 0x8e, 0xcb, 0x41, 0x3c, 0x66, 0x5c, 0x58, 0x0e, 0x94, 0xe4, + 0x8e, 0x30, 0xa0, 0xf6, 0x60, 0x3b, 0xd4, 0xa1, 0x22, 0x91, 0xc1, 0xf8, 0xf6, 0x6b, 0x43, 0x2b, + 0x9a, 0x97, 0xc6, 0xee, 0xc6, 0x7c, 0x37, 0x1a, 0xfc, 0x60, 0xec, 0x75, 0x7f, 0x86, 0xe3, 0x80, + 0x6d, 0x5f, 0xb2, 0x7b, 0xd8, 0x95, 0xd6, 0x90, 0xf9, 0xe3, 0xb4, 0x51, 0xc7, 0xda, 0x4f, 0xed, + 0xac, 0x71, 0x7d, 0x16, 0x92, 0xc8, 0xb7, 0x19, 0xf7, 0x5b, 0xf9, 0x7f, 0x59, 0x85, 0x49, 0xd3, + 0xdd, 0x98, 0xee, 0xea, 0xfc, 0xae, 0x2c, 0xbb, 0xfc, 0xe2, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x10, 0x93, 0x68, 0x41, 0xc2, 0x07, 0x00, 0x00, +} diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go new file mode 100644 index 000000000..9e20e4d38 --- /dev/null +++ b/vendor/google.golang.org/grpc/call.go @@ -0,0 +1,74 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" +) + +// Invoke sends the RPC request on the wire and returns after response is +// received. This is typically called by generated code. +// +// All errors returned by Invoke are compatible with the status package. +func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply interface{}, opts ...CallOption) error { + // allow interceptor to see all applicable call options, which means those + // configured as defaults from dial option as well as per-call options + opts = combine(cc.dopts.callOptions, opts) + + if cc.dopts.unaryInt != nil { + return cc.dopts.unaryInt(ctx, method, args, reply, cc, invoke, opts...) + } + return invoke(ctx, method, args, reply, cc, opts...) +} + +func combine(o1 []CallOption, o2 []CallOption) []CallOption { + // we don't use append because o1 could have extra capacity whose + // elements would be overwritten, which could cause inadvertent + // sharing (and race conditions) between concurrent calls + if len(o1) == 0 { + return o2 + } else if len(o2) == 0 { + return o1 + } + ret := make([]CallOption, len(o1)+len(o2)) + copy(ret, o1) + copy(ret[len(o1):], o2) + return ret +} + +// Invoke sends the RPC request on the wire and returns after response is +// received. This is typically called by generated code. +// +// DEPRECATED: Use ClientConn.Invoke instead. +func Invoke(ctx context.Context, method string, args, reply interface{}, cc *ClientConn, opts ...CallOption) error { + return cc.Invoke(ctx, method, args, reply, opts...) +} + +var unaryStreamDesc = &StreamDesc{ServerStreams: false, ClientStreams: false} + +func invoke(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error { + cs, err := newClientStream(ctx, unaryStreamDesc, cc, method, opts...) + if err != nil { + return err + } + if err := cs.SendMsg(req); err != nil { + return err + } + return cs.RecvMsg(reply) +} diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go new file mode 100644 index 000000000..ae5ce4947 --- /dev/null +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -0,0 +1,1556 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "errors" + "fmt" + "math" + "net" + "reflect" + "strings" + "sync" + "sync/atomic" + "time" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/balancer/base" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/backoff" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" + "google.golang.org/grpc/status" + + _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. + _ "google.golang.org/grpc/internal/resolver/dns" // To register dns resolver. + _ "google.golang.org/grpc/internal/resolver/passthrough" // To register passthrough resolver. +) + +const ( + // minimum time to give a connection to complete + minConnectTimeout = 20 * time.Second + // must match grpclbName in grpclb/grpclb.go + grpclbName = "grpclb" +) + +var ( + // ErrClientConnClosing indicates that the operation is illegal because + // the ClientConn is closing. + // + // Deprecated: this error should not be relied upon by users; use the status + // code of Canceled instead. + ErrClientConnClosing = status.Error(codes.Canceled, "grpc: the client connection is closing") + // errConnDrain indicates that the connection starts to be drained and does not accept any new RPCs. + errConnDrain = errors.New("grpc: the connection is drained") + // errConnClosing indicates that the connection is closing. + errConnClosing = errors.New("grpc: the connection is closing") + // invalidDefaultServiceConfigErrPrefix is used to prefix the json parsing error for the default + // service config. + invalidDefaultServiceConfigErrPrefix = "grpc: the provided default service config is invalid" +) + +// The following errors are returned from Dial and DialContext +var ( + // errNoTransportSecurity indicates that there is no transport security + // being set for ClientConn. Users should either set one or explicitly + // call WithInsecure DialOption to disable security. + errNoTransportSecurity = errors.New("grpc: no transport security set (use grpc.WithInsecure() explicitly or set credentials)") + // errTransportCredsAndBundle indicates that creds bundle is used together + // with other individual Transport Credentials. + errTransportCredsAndBundle = errors.New("grpc: credentials.Bundle may not be used with individual TransportCredentials") + // errTransportCredentialsMissing indicates that users want to transmit security + // information (e.g., OAuth2 token) which requires secure connection on an insecure + // connection. + errTransportCredentialsMissing = errors.New("grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)") + // errCredentialsConflict indicates that grpc.WithTransportCredentials() + // and grpc.WithInsecure() are both called for a connection. + errCredentialsConflict = errors.New("grpc: transport credentials are set for an insecure connection (grpc.WithTransportCredentials() and grpc.WithInsecure() are both called)") +) + +const ( + defaultClientMaxReceiveMessageSize = 1024 * 1024 * 4 + defaultClientMaxSendMessageSize = math.MaxInt32 + // http2IOBufSize specifies the buffer size for sending frames. + defaultWriteBufSize = 32 * 1024 + defaultReadBufSize = 32 * 1024 +) + +// Dial creates a client connection to the given target. +func Dial(target string, opts ...DialOption) (*ClientConn, error) { + return DialContext(context.Background(), target, opts...) +} + +// DialContext creates a client connection to the given target. By default, it's +// a non-blocking dial (the function won't wait for connections to be +// established, and connecting happens in the background). To make it a blocking +// dial, use WithBlock() dial option. +// +// In the non-blocking case, the ctx does not act against the connection. It +// only controls the setup steps. +// +// In the blocking case, ctx can be used to cancel or expire the pending +// connection. Once this function returns, the cancellation and expiration of +// ctx will be noop. Users should call ClientConn.Close to terminate all the +// pending operations after this function returns. +// +// The target name syntax is defined in +// https://github.com/grpc/grpc/blob/master/doc/naming.md. +// e.g. to use dns resolver, a "dns:///" prefix should be applied to the target. +func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { + cc := &ClientConn{ + target: target, + csMgr: &connectivityStateManager{}, + conns: make(map[*addrConn]struct{}), + dopts: defaultDialOptions(), + blockingpicker: newPickerWrapper(), + czData: new(channelzData), + firstResolveEvent: grpcsync.NewEvent(), + } + cc.retryThrottler.Store((*retryThrottler)(nil)) + cc.ctx, cc.cancel = context.WithCancel(context.Background()) + + for _, opt := range opts { + opt.apply(&cc.dopts) + } + + chainUnaryClientInterceptors(cc) + chainStreamClientInterceptors(cc) + + defer func() { + if err != nil { + cc.Close() + } + }() + + if channelz.IsOn() { + if cc.dopts.channelzParentID != 0 { + cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, cc.dopts.channelzParentID, target) + channelz.AddTraceEvent(logger, cc.channelzID, 0, &channelz.TraceEventDesc{ + Desc: "Channel Created", + Severity: channelz.CtINFO, + Parent: &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Nested Channel(id:%d) created", cc.channelzID), + Severity: channelz.CtINFO, + }, + }) + } else { + cc.channelzID = channelz.RegisterChannel(&channelzChannel{cc}, 0, target) + channelz.Info(logger, cc.channelzID, "Channel Created") + } + cc.csMgr.channelzID = cc.channelzID + } + + if !cc.dopts.insecure { + if cc.dopts.copts.TransportCredentials == nil && cc.dopts.copts.CredsBundle == nil { + return nil, errNoTransportSecurity + } + if cc.dopts.copts.TransportCredentials != nil && cc.dopts.copts.CredsBundle != nil { + return nil, errTransportCredsAndBundle + } + } else { + if cc.dopts.copts.TransportCredentials != nil || cc.dopts.copts.CredsBundle != nil { + return nil, errCredentialsConflict + } + for _, cd := range cc.dopts.copts.PerRPCCredentials { + if cd.RequireTransportSecurity() { + return nil, errTransportCredentialsMissing + } + } + } + + if cc.dopts.defaultServiceConfigRawJSON != nil { + scpr := parseServiceConfig(*cc.dopts.defaultServiceConfigRawJSON) + if scpr.Err != nil { + return nil, fmt.Errorf("%s: %v", invalidDefaultServiceConfigErrPrefix, scpr.Err) + } + cc.dopts.defaultServiceConfig, _ = scpr.Config.(*ServiceConfig) + } + cc.mkp = cc.dopts.copts.KeepaliveParams + + if cc.dopts.copts.Dialer == nil { + cc.dopts.copts.Dialer = func(ctx context.Context, addr string) (net.Conn, error) { + network, addr := parseDialTarget(addr) + return (&net.Dialer{}).DialContext(ctx, network, addr) + } + if cc.dopts.withProxy { + cc.dopts.copts.Dialer = newProxyDialer(cc.dopts.copts.Dialer) + } + } + + if cc.dopts.copts.UserAgent != "" { + cc.dopts.copts.UserAgent += " " + grpcUA + } else { + cc.dopts.copts.UserAgent = grpcUA + } + + if cc.dopts.timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, cc.dopts.timeout) + defer cancel() + } + defer func() { + select { + case <-ctx.Done(): + switch { + case ctx.Err() == err: + conn = nil + case err == nil || !cc.dopts.returnLastError: + conn, err = nil, ctx.Err() + default: + conn, err = nil, fmt.Errorf("%v: %v", ctx.Err(), err) + } + default: + } + }() + + scSet := false + if cc.dopts.scChan != nil { + // Try to get an initial service config. + select { + case sc, ok := <-cc.dopts.scChan: + if ok { + cc.sc = &sc + scSet = true + } + default: + } + } + if cc.dopts.bs == nil { + cc.dopts.bs = backoff.DefaultExponential + } + + // Determine the resolver to use. + cc.parsedTarget = grpcutil.ParseTarget(cc.target) + unixScheme := strings.HasPrefix(cc.target, "unix:") + channelz.Infof(logger, cc.channelzID, "parsed scheme: %q", cc.parsedTarget.Scheme) + resolverBuilder := cc.getResolver(cc.parsedTarget.Scheme) + if resolverBuilder == nil { + // If resolver builder is still nil, the parsed target's scheme is + // not registered. Fallback to default resolver and set Endpoint to + // the original target. + channelz.Infof(logger, cc.channelzID, "scheme %q not registered, fallback to default scheme", cc.parsedTarget.Scheme) + cc.parsedTarget = resolver.Target{ + Scheme: resolver.GetDefaultScheme(), + Endpoint: target, + } + resolverBuilder = cc.getResolver(cc.parsedTarget.Scheme) + if resolverBuilder == nil { + return nil, fmt.Errorf("could not get resolver for default scheme: %q", cc.parsedTarget.Scheme) + } + } + + creds := cc.dopts.copts.TransportCredentials + if creds != nil && creds.Info().ServerName != "" { + cc.authority = creds.Info().ServerName + } else if cc.dopts.insecure && cc.dopts.authority != "" { + cc.authority = cc.dopts.authority + } else if unixScheme { + cc.authority = "localhost" + } else { + // Use endpoint from "scheme://authority/endpoint" as the default + // authority for ClientConn. + cc.authority = cc.parsedTarget.Endpoint + } + + if cc.dopts.scChan != nil && !scSet { + // Blocking wait for the initial service config. + select { + case sc, ok := <-cc.dopts.scChan: + if ok { + cc.sc = &sc + } + case <-ctx.Done(): + return nil, ctx.Err() + } + } + if cc.dopts.scChan != nil { + go cc.scWatcher() + } + + var credsClone credentials.TransportCredentials + if creds := cc.dopts.copts.TransportCredentials; creds != nil { + credsClone = creds.Clone() + } + cc.balancerBuildOpts = balancer.BuildOptions{ + DialCreds: credsClone, + CredsBundle: cc.dopts.copts.CredsBundle, + Dialer: cc.dopts.copts.Dialer, + ChannelzParentID: cc.channelzID, + Target: cc.parsedTarget, + } + + // Build the resolver. + rWrapper, err := newCCResolverWrapper(cc, resolverBuilder) + if err != nil { + return nil, fmt.Errorf("failed to build resolver: %v", err) + } + cc.mu.Lock() + cc.resolverWrapper = rWrapper + cc.mu.Unlock() + + // A blocking dial blocks until the clientConn is ready. + if cc.dopts.block { + for { + s := cc.GetState() + if s == connectivity.Ready { + break + } else if cc.dopts.copts.FailOnNonTempDialError && s == connectivity.TransientFailure { + if err = cc.connectionError(); err != nil { + terr, ok := err.(interface { + Temporary() bool + }) + if ok && !terr.Temporary() { + return nil, err + } + } + } + if !cc.WaitForStateChange(ctx, s) { + // ctx got timeout or canceled. + if err = cc.connectionError(); err != nil && cc.dopts.returnLastError { + return nil, err + } + return nil, ctx.Err() + } + } + } + + return cc, nil +} + +// chainUnaryClientInterceptors chains all unary client interceptors into one. +func chainUnaryClientInterceptors(cc *ClientConn) { + interceptors := cc.dopts.chainUnaryInts + // Prepend dopts.unaryInt to the chaining interceptors if it exists, since unaryInt will + // be executed before any other chained interceptors. + if cc.dopts.unaryInt != nil { + interceptors = append([]UnaryClientInterceptor{cc.dopts.unaryInt}, interceptors...) + } + var chainedInt UnaryClientInterceptor + if len(interceptors) == 0 { + chainedInt = nil + } else if len(interceptors) == 1 { + chainedInt = interceptors[0] + } else { + chainedInt = func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error { + return interceptors[0](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, 0, invoker), opts...) + } + } + cc.dopts.unaryInt = chainedInt +} + +// getChainUnaryInvoker recursively generate the chained unary invoker. +func getChainUnaryInvoker(interceptors []UnaryClientInterceptor, curr int, finalInvoker UnaryInvoker) UnaryInvoker { + if curr == len(interceptors)-1 { + return finalInvoker + } + return func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error { + return interceptors[curr+1](ctx, method, req, reply, cc, getChainUnaryInvoker(interceptors, curr+1, finalInvoker), opts...) + } +} + +// chainStreamClientInterceptors chains all stream client interceptors into one. +func chainStreamClientInterceptors(cc *ClientConn) { + interceptors := cc.dopts.chainStreamInts + // Prepend dopts.streamInt to the chaining interceptors if it exists, since streamInt will + // be executed before any other chained interceptors. + if cc.dopts.streamInt != nil { + interceptors = append([]StreamClientInterceptor{cc.dopts.streamInt}, interceptors...) + } + var chainedInt StreamClientInterceptor + if len(interceptors) == 0 { + chainedInt = nil + } else if len(interceptors) == 1 { + chainedInt = interceptors[0] + } else { + chainedInt = func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) { + return interceptors[0](ctx, desc, cc, method, getChainStreamer(interceptors, 0, streamer), opts...) + } + } + cc.dopts.streamInt = chainedInt +} + +// getChainStreamer recursively generate the chained client stream constructor. +func getChainStreamer(interceptors []StreamClientInterceptor, curr int, finalStreamer Streamer) Streamer { + if curr == len(interceptors)-1 { + return finalStreamer + } + return func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { + return interceptors[curr+1](ctx, desc, cc, method, getChainStreamer(interceptors, curr+1, finalStreamer), opts...) + } +} + +// connectivityStateManager keeps the connectivity.State of ClientConn. +// This struct will eventually be exported so the balancers can access it. +type connectivityStateManager struct { + mu sync.Mutex + state connectivity.State + notifyChan chan struct{} + channelzID int64 +} + +// updateState updates the connectivity.State of ClientConn. +// If there's a change it notifies goroutines waiting on state change to +// happen. +func (csm *connectivityStateManager) updateState(state connectivity.State) { + csm.mu.Lock() + defer csm.mu.Unlock() + if csm.state == connectivity.Shutdown { + return + } + if csm.state == state { + return + } + csm.state = state + channelz.Infof(logger, csm.channelzID, "Channel Connectivity change to %v", state) + if csm.notifyChan != nil { + // There are other goroutines waiting on this channel. + close(csm.notifyChan) + csm.notifyChan = nil + } +} + +func (csm *connectivityStateManager) getState() connectivity.State { + csm.mu.Lock() + defer csm.mu.Unlock() + return csm.state +} + +func (csm *connectivityStateManager) getNotifyChan() <-chan struct{} { + csm.mu.Lock() + defer csm.mu.Unlock() + if csm.notifyChan == nil { + csm.notifyChan = make(chan struct{}) + } + return csm.notifyChan +} + +// ClientConnInterface defines the functions clients need to perform unary and +// streaming RPCs. It is implemented by *ClientConn, and is only intended to +// be referenced by generated code. +type ClientConnInterface interface { + // Invoke performs a unary RPC and returns after the response is received + // into reply. + Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...CallOption) error + // NewStream begins a streaming RPC. + NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) +} + +// Assert *ClientConn implements ClientConnInterface. +var _ ClientConnInterface = (*ClientConn)(nil) + +// ClientConn represents a virtual connection to a conceptual endpoint, to +// perform RPCs. +// +// A ClientConn is free to have zero or more actual connections to the endpoint +// based on configuration, load, etc. It is also free to determine which actual +// endpoints to use and may change it every RPC, permitting client-side load +// balancing. +// +// A ClientConn encapsulates a range of functionality including name +// resolution, TCP connection establishment (with retries and backoff) and TLS +// handshakes. It also handles errors on established connections by +// re-resolving the name and reconnecting. +type ClientConn struct { + ctx context.Context + cancel context.CancelFunc + + target string + parsedTarget resolver.Target + authority string + dopts dialOptions + csMgr *connectivityStateManager + + balancerBuildOpts balancer.BuildOptions + blockingpicker *pickerWrapper + + mu sync.RWMutex + resolverWrapper *ccResolverWrapper + sc *ServiceConfig + conns map[*addrConn]struct{} + // Keepalive parameter can be updated if a GoAway is received. + mkp keepalive.ClientParameters + curBalancerName string + balancerWrapper *ccBalancerWrapper + retryThrottler atomic.Value + + firstResolveEvent *grpcsync.Event + + channelzID int64 // channelz unique identification number + czData *channelzData + + lceMu sync.Mutex // protects lastConnectionError + lastConnectionError error +} + +// WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or +// ctx expires. A true value is returned in former case and false in latter. +// This is an EXPERIMENTAL API. +func (cc *ClientConn) WaitForStateChange(ctx context.Context, sourceState connectivity.State) bool { + ch := cc.csMgr.getNotifyChan() + if cc.csMgr.getState() != sourceState { + return true + } + select { + case <-ctx.Done(): + return false + case <-ch: + return true + } +} + +// GetState returns the connectivity.State of ClientConn. +// This is an EXPERIMENTAL API. +func (cc *ClientConn) GetState() connectivity.State { + return cc.csMgr.getState() +} + +func (cc *ClientConn) scWatcher() { + for { + select { + case sc, ok := <-cc.dopts.scChan: + if !ok { + return + } + cc.mu.Lock() + // TODO: load balance policy runtime change is ignored. + // We may revisit this decision in the future. + cc.sc = &sc + cc.mu.Unlock() + case <-cc.ctx.Done(): + return + } + } +} + +// waitForResolvedAddrs blocks until the resolver has provided addresses or the +// context expires. Returns nil unless the context expires first; otherwise +// returns a status error based on the context. +func (cc *ClientConn) waitForResolvedAddrs(ctx context.Context) error { + // This is on the RPC path, so we use a fast path to avoid the + // more-expensive "select" below after the resolver has returned once. + if cc.firstResolveEvent.HasFired() { + return nil + } + select { + case <-cc.firstResolveEvent.Done(): + return nil + case <-ctx.Done(): + return status.FromContextError(ctx.Err()).Err() + case <-cc.ctx.Done(): + return ErrClientConnClosing + } +} + +var emptyServiceConfig *ServiceConfig + +func init() { + cfg := parseServiceConfig("{}") + if cfg.Err != nil { + panic(fmt.Sprintf("impossible error parsing empty service config: %v", cfg.Err)) + } + emptyServiceConfig = cfg.Config.(*ServiceConfig) +} + +func (cc *ClientConn) maybeApplyDefaultServiceConfig(addrs []resolver.Address) { + if cc.sc != nil { + cc.applyServiceConfigAndBalancer(cc.sc, addrs) + return + } + if cc.dopts.defaultServiceConfig != nil { + cc.applyServiceConfigAndBalancer(cc.dopts.defaultServiceConfig, addrs) + } else { + cc.applyServiceConfigAndBalancer(emptyServiceConfig, addrs) + } +} + +func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { + defer cc.firstResolveEvent.Fire() + cc.mu.Lock() + // Check if the ClientConn is already closed. Some fields (e.g. + // balancerWrapper) are set to nil when closing the ClientConn, and could + // cause nil pointer panic if we don't have this check. + if cc.conns == nil { + cc.mu.Unlock() + return nil + } + + if err != nil { + // May need to apply the initial service config in case the resolver + // doesn't support service configs, or doesn't provide a service config + // with the new addresses. + cc.maybeApplyDefaultServiceConfig(nil) + + if cc.balancerWrapper != nil { + cc.balancerWrapper.resolverError(err) + } + + // No addresses are valid with err set; return early. + cc.mu.Unlock() + return balancer.ErrBadResolverState + } + + var ret error + if cc.dopts.disableServiceConfig || s.ServiceConfig == nil { + cc.maybeApplyDefaultServiceConfig(s.Addresses) + // TODO: do we need to apply a failing LB policy if there is no + // default, per the error handling design? + } else { + if sc, ok := s.ServiceConfig.Config.(*ServiceConfig); s.ServiceConfig.Err == nil && ok { + cc.applyServiceConfigAndBalancer(sc, s.Addresses) + } else { + ret = balancer.ErrBadResolverState + if cc.balancerWrapper == nil { + var err error + if s.ServiceConfig.Err != nil { + err = status.Errorf(codes.Unavailable, "error parsing service config: %v", s.ServiceConfig.Err) + } else { + err = status.Errorf(codes.Unavailable, "illegal service config type: %T", s.ServiceConfig.Config) + } + cc.blockingpicker.updatePicker(base.NewErrPicker(err)) + cc.csMgr.updateState(connectivity.TransientFailure) + cc.mu.Unlock() + return ret + } + } + } + + var balCfg serviceconfig.LoadBalancingConfig + if cc.dopts.balancerBuilder == nil && cc.sc != nil && cc.sc.lbConfig != nil { + balCfg = cc.sc.lbConfig.cfg + } + + cbn := cc.curBalancerName + bw := cc.balancerWrapper + cc.mu.Unlock() + if cbn != grpclbName { + // Filter any grpclb addresses since we don't have the grpclb balancer. + for i := 0; i < len(s.Addresses); { + if s.Addresses[i].Type == resolver.GRPCLB { + copy(s.Addresses[i:], s.Addresses[i+1:]) + s.Addresses = s.Addresses[:len(s.Addresses)-1] + continue + } + i++ + } + } + uccsErr := bw.updateClientConnState(&balancer.ClientConnState{ResolverState: s, BalancerConfig: balCfg}) + if ret == nil { + ret = uccsErr // prefer ErrBadResolver state since any other error is + // currently meaningless to the caller. + } + return ret +} + +// switchBalancer starts the switching from current balancer to the balancer +// with the given name. +// +// It will NOT send the current address list to the new balancer. If needed, +// caller of this function should send address list to the new balancer after +// this function returns. +// +// Caller must hold cc.mu. +func (cc *ClientConn) switchBalancer(name string) { + if strings.EqualFold(cc.curBalancerName, name) { + return + } + + channelz.Infof(logger, cc.channelzID, "ClientConn switching balancer to %q", name) + if cc.dopts.balancerBuilder != nil { + channelz.Info(logger, cc.channelzID, "ignoring balancer switching: Balancer DialOption used instead") + return + } + if cc.balancerWrapper != nil { + cc.balancerWrapper.close() + } + + builder := balancer.Get(name) + if builder == nil { + channelz.Warningf(logger, cc.channelzID, "Channel switches to new LB policy %q due to fallback from invalid balancer name", PickFirstBalancerName) + channelz.Infof(logger, cc.channelzID, "failed to get balancer builder for: %v, using pick_first instead", name) + builder = newPickfirstBuilder() + } else { + channelz.Infof(logger, cc.channelzID, "Channel switches to new LB policy %q", name) + } + + cc.curBalancerName = builder.Name() + cc.balancerWrapper = newCCBalancerWrapper(cc, builder, cc.balancerBuildOpts) +} + +func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return + } + // TODO(bar switching) send updates to all balancer wrappers when balancer + // gracefully switching is supported. + cc.balancerWrapper.handleSubConnStateChange(sc, s, err) + cc.mu.Unlock() +} + +// newAddrConn creates an addrConn for addrs and adds it to cc.conns. +// +// Caller needs to make sure len(addrs) > 0. +func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (*addrConn, error) { + ac := &addrConn{ + state: connectivity.Idle, + cc: cc, + addrs: addrs, + scopts: opts, + dopts: cc.dopts, + czData: new(channelzData), + resetBackoff: make(chan struct{}), + } + ac.ctx, ac.cancel = context.WithCancel(cc.ctx) + // Track ac in cc. This needs to be done before any getTransport(...) is called. + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return nil, ErrClientConnClosing + } + if channelz.IsOn() { + ac.channelzID = channelz.RegisterSubChannel(ac, cc.channelzID, "") + channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ + Desc: "Subchannel Created", + Severity: channelz.CtINFO, + Parent: &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Subchannel(id:%d) created", ac.channelzID), + Severity: channelz.CtINFO, + }, + }) + } + cc.conns[ac] = struct{}{} + cc.mu.Unlock() + return ac, nil +} + +// removeAddrConn removes the addrConn in the subConn from clientConn. +// It also tears down the ac with the given error. +func (cc *ClientConn) removeAddrConn(ac *addrConn, err error) { + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return + } + delete(cc.conns, ac) + cc.mu.Unlock() + ac.tearDown(err) +} + +func (cc *ClientConn) channelzMetric() *channelz.ChannelInternalMetric { + return &channelz.ChannelInternalMetric{ + State: cc.GetState(), + Target: cc.target, + CallsStarted: atomic.LoadInt64(&cc.czData.callsStarted), + CallsSucceeded: atomic.LoadInt64(&cc.czData.callsSucceeded), + CallsFailed: atomic.LoadInt64(&cc.czData.callsFailed), + LastCallStartedTimestamp: time.Unix(0, atomic.LoadInt64(&cc.czData.lastCallStartedTime)), + } +} + +// Target returns the target string of the ClientConn. +// This is an EXPERIMENTAL API. +func (cc *ClientConn) Target() string { + return cc.target +} + +func (cc *ClientConn) incrCallsStarted() { + atomic.AddInt64(&cc.czData.callsStarted, 1) + atomic.StoreInt64(&cc.czData.lastCallStartedTime, time.Now().UnixNano()) +} + +func (cc *ClientConn) incrCallsSucceeded() { + atomic.AddInt64(&cc.czData.callsSucceeded, 1) +} + +func (cc *ClientConn) incrCallsFailed() { + atomic.AddInt64(&cc.czData.callsFailed, 1) +} + +// connect starts creating a transport. +// It does nothing if the ac is not IDLE. +// TODO(bar) Move this to the addrConn section. +func (ac *addrConn) connect() error { + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return errConnClosing + } + if ac.state != connectivity.Idle { + ac.mu.Unlock() + return nil + } + // Update connectivity state within the lock to prevent subsequent or + // concurrent calls from resetting the transport more than once. + ac.updateConnectivityState(connectivity.Connecting, nil) + ac.mu.Unlock() + + // Start a goroutine connecting to the server asynchronously. + go ac.resetTransport() + return nil +} + +// tryUpdateAddrs tries to update ac.addrs with the new addresses list. +// +// If ac is Connecting, it returns false. The caller should tear down the ac and +// create a new one. Note that the backoff will be reset when this happens. +// +// If ac is TransientFailure, it updates ac.addrs and returns true. The updated +// addresses will be picked up by retry in the next iteration after backoff. +// +// If ac is Shutdown or Idle, it updates ac.addrs and returns true. +// +// If ac is Ready, it checks whether current connected address of ac is in the +// new addrs list. +// - If true, it updates ac.addrs and returns true. The ac will keep using +// the existing connection. +// - If false, it does nothing and returns false. +func (ac *addrConn) tryUpdateAddrs(addrs []resolver.Address) bool { + ac.mu.Lock() + defer ac.mu.Unlock() + channelz.Infof(logger, ac.channelzID, "addrConn: tryUpdateAddrs curAddr: %v, addrs: %v", ac.curAddr, addrs) + if ac.state == connectivity.Shutdown || + ac.state == connectivity.TransientFailure || + ac.state == connectivity.Idle { + ac.addrs = addrs + return true + } + + if ac.state == connectivity.Connecting { + return false + } + + // ac.state is Ready, try to find the connected address. + var curAddrFound bool + for _, a := range addrs { + if reflect.DeepEqual(ac.curAddr, a) { + curAddrFound = true + break + } + } + channelz.Infof(logger, ac.channelzID, "addrConn: tryUpdateAddrs curAddrFound: %v", curAddrFound) + if curAddrFound { + ac.addrs = addrs + } + + return curAddrFound +} + +// GetMethodConfig gets the method config of the input method. +// If there's an exact match for input method (i.e. /service/method), we return +// the corresponding MethodConfig. +// If there isn't an exact match for the input method, we look for the service's default +// config under the service (i.e /service/) and then for the default for all services (empty string). +// +// If there is a default MethodConfig for the service, we return it. +// Otherwise, we return an empty MethodConfig. +func (cc *ClientConn) GetMethodConfig(method string) MethodConfig { + // TODO: Avoid the locking here. + cc.mu.RLock() + defer cc.mu.RUnlock() + if cc.sc == nil { + return MethodConfig{} + } + if m, ok := cc.sc.Methods[method]; ok { + return m + } + i := strings.LastIndex(method, "/") + if m, ok := cc.sc.Methods[method[:i+1]]; ok { + return m + } + return cc.sc.Methods[""] +} + +func (cc *ClientConn) healthCheckConfig() *healthCheckConfig { + cc.mu.RLock() + defer cc.mu.RUnlock() + if cc.sc == nil { + return nil + } + return cc.sc.healthCheckConfig +} + +func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method string) (transport.ClientTransport, func(balancer.DoneInfo), error) { + t, done, err := cc.blockingpicker.pick(ctx, failfast, balancer.PickInfo{ + Ctx: ctx, + FullMethodName: method, + }) + if err != nil { + return nil, nil, toRPCErr(err) + } + return t, done, nil +} + +func (cc *ClientConn) applyServiceConfigAndBalancer(sc *ServiceConfig, addrs []resolver.Address) { + if sc == nil { + // should never reach here. + return + } + cc.sc = sc + + if cc.sc.retryThrottling != nil { + newThrottler := &retryThrottler{ + tokens: cc.sc.retryThrottling.MaxTokens, + max: cc.sc.retryThrottling.MaxTokens, + thresh: cc.sc.retryThrottling.MaxTokens / 2, + ratio: cc.sc.retryThrottling.TokenRatio, + } + cc.retryThrottler.Store(newThrottler) + } else { + cc.retryThrottler.Store((*retryThrottler)(nil)) + } + + if cc.dopts.balancerBuilder == nil { + // Only look at balancer types and switch balancer if balancer dial + // option is not set. + var newBalancerName string + if cc.sc != nil && cc.sc.lbConfig != nil { + newBalancerName = cc.sc.lbConfig.name + } else { + var isGRPCLB bool + for _, a := range addrs { + if a.Type == resolver.GRPCLB { + isGRPCLB = true + break + } + } + if isGRPCLB { + newBalancerName = grpclbName + } else if cc.sc != nil && cc.sc.LB != nil { + newBalancerName = *cc.sc.LB + } else { + newBalancerName = PickFirstBalancerName + } + } + cc.switchBalancer(newBalancerName) + } else if cc.balancerWrapper == nil { + // Balancer dial option was set, and this is the first time handling + // resolved addresses. Build a balancer with dopts.balancerBuilder. + cc.curBalancerName = cc.dopts.balancerBuilder.Name() + cc.balancerWrapper = newCCBalancerWrapper(cc, cc.dopts.balancerBuilder, cc.balancerBuildOpts) + } +} + +func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) { + cc.mu.RLock() + r := cc.resolverWrapper + cc.mu.RUnlock() + if r == nil { + return + } + go r.resolveNow(o) +} + +// ResetConnectBackoff wakes up all subchannels in transient failure and causes +// them to attempt another connection immediately. It also resets the backoff +// times used for subsequent attempts regardless of the current state. +// +// In general, this function should not be used. Typical service or network +// outages result in a reasonable client reconnection strategy by default. +// However, if a previously unavailable network becomes available, this may be +// used to trigger an immediate reconnect. +// +// This API is EXPERIMENTAL. +func (cc *ClientConn) ResetConnectBackoff() { + cc.mu.Lock() + conns := cc.conns + cc.mu.Unlock() + for ac := range conns { + ac.resetConnectBackoff() + } +} + +// Close tears down the ClientConn and all underlying connections. +func (cc *ClientConn) Close() error { + defer cc.cancel() + + cc.mu.Lock() + if cc.conns == nil { + cc.mu.Unlock() + return ErrClientConnClosing + } + conns := cc.conns + cc.conns = nil + cc.csMgr.updateState(connectivity.Shutdown) + + rWrapper := cc.resolverWrapper + cc.resolverWrapper = nil + bWrapper := cc.balancerWrapper + cc.balancerWrapper = nil + cc.mu.Unlock() + + cc.blockingpicker.close() + + if rWrapper != nil { + rWrapper.close() + } + if bWrapper != nil { + bWrapper.close() + } + + for ac := range conns { + ac.tearDown(ErrClientConnClosing) + } + if channelz.IsOn() { + ted := &channelz.TraceEventDesc{ + Desc: "Channel Deleted", + Severity: channelz.CtINFO, + } + if cc.dopts.channelzParentID != 0 { + ted.Parent = &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Nested channel(id:%d) deleted", cc.channelzID), + Severity: channelz.CtINFO, + } + } + channelz.AddTraceEvent(logger, cc.channelzID, 0, ted) + // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add trace reference to + // the entity being deleted, and thus prevent it from being deleted right away. + channelz.RemoveEntry(cc.channelzID) + } + return nil +} + +// addrConn is a network connection to a given address. +type addrConn struct { + ctx context.Context + cancel context.CancelFunc + + cc *ClientConn + dopts dialOptions + acbw balancer.SubConn + scopts balancer.NewSubConnOptions + + // transport is set when there's a viable transport (note: ac state may not be READY as LB channel + // health checking may require server to report healthy to set ac to READY), and is reset + // to nil when the current transport should no longer be used to create a stream (e.g. after GoAway + // is received, transport is closed, ac has been torn down). + transport transport.ClientTransport // The current transport. + + mu sync.Mutex + curAddr resolver.Address // The current address. + addrs []resolver.Address // All addresses that the resolver resolved to. + + // Use updateConnectivityState for updating addrConn's connectivity state. + state connectivity.State + + backoffIdx int // Needs to be stateful for resetConnectBackoff. + resetBackoff chan struct{} + + channelzID int64 // channelz unique identification number. + czData *channelzData +} + +// Note: this requires a lock on ac.mu. +func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) { + if ac.state == s { + return + } + ac.state = s + channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v", s) + ac.cc.handleSubConnStateChange(ac.acbw, s, lastErr) +} + +// adjustParams updates parameters used to create transports upon +// receiving a GoAway. +func (ac *addrConn) adjustParams(r transport.GoAwayReason) { + switch r { + case transport.GoAwayTooManyPings: + v := 2 * ac.dopts.copts.KeepaliveParams.Time + ac.cc.mu.Lock() + if v > ac.cc.mkp.Time { + ac.cc.mkp.Time = v + } + ac.cc.mu.Unlock() + } +} + +func (ac *addrConn) resetTransport() { + for i := 0; ; i++ { + if i > 0 { + ac.cc.resolveNow(resolver.ResolveNowOptions{}) + } + + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return + } + + addrs := ac.addrs + backoffFor := ac.dopts.bs.Backoff(ac.backoffIdx) + // This will be the duration that dial gets to finish. + dialDuration := minConnectTimeout + if ac.dopts.minConnectTimeout != nil { + dialDuration = ac.dopts.minConnectTimeout() + } + + if dialDuration < backoffFor { + // Give dial more time as we keep failing to connect. + dialDuration = backoffFor + } + // We can potentially spend all the time trying the first address, and + // if the server accepts the connection and then hangs, the following + // addresses will never be tried. + // + // The spec doesn't mention what should be done for multiple addresses. + // https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md#proposed-backoff-algorithm + connectDeadline := time.Now().Add(dialDuration) + + ac.updateConnectivityState(connectivity.Connecting, nil) + ac.transport = nil + ac.mu.Unlock() + + newTr, addr, reconnect, err := ac.tryAllAddrs(addrs, connectDeadline) + if err != nil { + // After exhausting all addresses, the addrConn enters + // TRANSIENT_FAILURE. + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return + } + ac.updateConnectivityState(connectivity.TransientFailure, err) + + // Backoff. + b := ac.resetBackoff + ac.mu.Unlock() + + timer := time.NewTimer(backoffFor) + select { + case <-timer.C: + ac.mu.Lock() + ac.backoffIdx++ + ac.mu.Unlock() + case <-b: + timer.Stop() + case <-ac.ctx.Done(): + timer.Stop() + return + } + continue + } + + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + newTr.Close() + return + } + ac.curAddr = addr + ac.transport = newTr + ac.backoffIdx = 0 + + hctx, hcancel := context.WithCancel(ac.ctx) + ac.startHealthCheck(hctx) + ac.mu.Unlock() + + // Block until the created transport is down. And when this happens, + // we restart from the top of the addr list. + <-reconnect.Done() + hcancel() + // restart connecting - the top of the loop will set state to + // CONNECTING. This is against the current connectivity semantics doc, + // however it allows for graceful behavior for RPCs not yet dispatched + // - unfortunate timing would otherwise lead to the RPC failing even + // though the TRANSIENT_FAILURE state (called for by the doc) would be + // instantaneous. + // + // Ideally we should transition to Idle here and block until there is + // RPC activity that leads to the balancer requesting a reconnect of + // the associated SubConn. + } +} + +// tryAllAddrs tries to creates a connection to the addresses, and stop when at the +// first successful one. It returns the transport, the address and a Event in +// the successful case. The Event fires when the returned transport disconnects. +func (ac *addrConn) tryAllAddrs(addrs []resolver.Address, connectDeadline time.Time) (transport.ClientTransport, resolver.Address, *grpcsync.Event, error) { + var firstConnErr error + for _, addr := range addrs { + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return nil, resolver.Address{}, nil, errConnClosing + } + + ac.cc.mu.RLock() + ac.dopts.copts.KeepaliveParams = ac.cc.mkp + ac.cc.mu.RUnlock() + + copts := ac.dopts.copts + if ac.scopts.CredsBundle != nil { + copts.CredsBundle = ac.scopts.CredsBundle + } + ac.mu.Unlock() + + channelz.Infof(logger, ac.channelzID, "Subchannel picks a new address %q to connect", addr.Addr) + + newTr, reconnect, err := ac.createTransport(addr, copts, connectDeadline) + if err == nil { + return newTr, addr, reconnect, nil + } + if firstConnErr == nil { + firstConnErr = err + } + ac.cc.updateConnectionError(err) + } + + // Couldn't connect to any address. + return nil, resolver.Address{}, nil, firstConnErr +} + +// createTransport creates a connection to addr. It returns the transport and a +// Event in the successful case. The Event fires when the returned transport +// disconnects. +func (ac *addrConn) createTransport(addr resolver.Address, copts transport.ConnectOptions, connectDeadline time.Time) (transport.ClientTransport, *grpcsync.Event, error) { + prefaceReceived := make(chan struct{}) + onCloseCalled := make(chan struct{}) + reconnect := grpcsync.NewEvent() + + // addr.ServerName takes precedent over ClientConn authority, if present. + if addr.ServerName == "" { + addr.ServerName = ac.cc.authority + } + + once := sync.Once{} + onGoAway := func(r transport.GoAwayReason) { + ac.mu.Lock() + ac.adjustParams(r) + once.Do(func() { + if ac.state == connectivity.Ready { + // Prevent this SubConn from being used for new RPCs by setting its + // state to Connecting. + // + // TODO: this should be Idle when grpc-go properly supports it. + ac.updateConnectivityState(connectivity.Connecting, nil) + } + }) + ac.mu.Unlock() + reconnect.Fire() + } + + onClose := func() { + ac.mu.Lock() + once.Do(func() { + if ac.state == connectivity.Ready { + // Prevent this SubConn from being used for new RPCs by setting its + // state to Connecting. + // + // TODO: this should be Idle when grpc-go properly supports it. + ac.updateConnectivityState(connectivity.Connecting, nil) + } + }) + ac.mu.Unlock() + close(onCloseCalled) + reconnect.Fire() + } + + onPrefaceReceipt := func() { + close(prefaceReceived) + } + + connectCtx, cancel := context.WithDeadline(ac.ctx, connectDeadline) + defer cancel() + if channelz.IsOn() { + copts.ChannelzParentID = ac.channelzID + } + + newTr, err := transport.NewClientTransport(connectCtx, ac.cc.ctx, addr, copts, onPrefaceReceipt, onGoAway, onClose) + if err != nil { + // newTr is either nil, or closed. + channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %v. Err: %v. Reconnecting...", addr, err) + return nil, nil, err + } + + select { + case <-time.After(time.Until(connectDeadline)): + // We didn't get the preface in time. + newTr.Close() + channelz.Warningf(logger, ac.channelzID, "grpc: addrConn.createTransport failed to connect to %v: didn't receive server preface in time. Reconnecting...", addr) + return nil, nil, errors.New("timed out waiting for server handshake") + case <-prefaceReceived: + // We got the preface - huzzah! things are good. + case <-onCloseCalled: + // The transport has already closed - noop. + return nil, nil, errors.New("connection closed") + // TODO(deklerk) this should bail on ac.ctx.Done(). Add a test and fix. + } + return newTr, reconnect, nil +} + +// startHealthCheck starts the health checking stream (RPC) to watch the health +// stats of this connection if health checking is requested and configured. +// +// LB channel health checking is enabled when all requirements below are met: +// 1. it is not disabled by the user with the WithDisableHealthCheck DialOption +// 2. internal.HealthCheckFunc is set by importing the grpc/health package +// 3. a service config with non-empty healthCheckConfig field is provided +// 4. the load balancer requests it +// +// It sets addrConn to READY if the health checking stream is not started. +// +// Caller must hold ac.mu. +func (ac *addrConn) startHealthCheck(ctx context.Context) { + var healthcheckManagingState bool + defer func() { + if !healthcheckManagingState { + ac.updateConnectivityState(connectivity.Ready, nil) + } + }() + + if ac.cc.dopts.disableHealthCheck { + return + } + healthCheckConfig := ac.cc.healthCheckConfig() + if healthCheckConfig == nil { + return + } + if !ac.scopts.HealthCheckEnabled { + return + } + healthCheckFunc := ac.cc.dopts.healthCheckFunc + if healthCheckFunc == nil { + // The health package is not imported to set health check function. + // + // TODO: add a link to the health check doc in the error message. + channelz.Error(logger, ac.channelzID, "Health check is requested but health check function is not set.") + return + } + + healthcheckManagingState = true + + // Set up the health check helper functions. + currentTr := ac.transport + newStream := func(method string) (interface{}, error) { + ac.mu.Lock() + if ac.transport != currentTr { + ac.mu.Unlock() + return nil, status.Error(codes.Canceled, "the provided transport is no longer valid to use") + } + ac.mu.Unlock() + return newNonRetryClientStream(ctx, &StreamDesc{ServerStreams: true}, method, currentTr, ac) + } + setConnectivityState := func(s connectivity.State, lastErr error) { + ac.mu.Lock() + defer ac.mu.Unlock() + if ac.transport != currentTr { + return + } + ac.updateConnectivityState(s, lastErr) + } + // Start the health checking stream. + go func() { + err := ac.cc.dopts.healthCheckFunc(ctx, newStream, setConnectivityState, healthCheckConfig.ServiceName) + if err != nil { + if status.Code(err) == codes.Unimplemented { + channelz.Error(logger, ac.channelzID, "Subchannel health check is unimplemented at server side, thus health check is disabled") + } else { + channelz.Errorf(logger, ac.channelzID, "HealthCheckFunc exits with unexpected error %v", err) + } + } + }() +} + +func (ac *addrConn) resetConnectBackoff() { + ac.mu.Lock() + close(ac.resetBackoff) + ac.backoffIdx = 0 + ac.resetBackoff = make(chan struct{}) + ac.mu.Unlock() +} + +// getReadyTransport returns the transport if ac's state is READY. +// Otherwise it returns nil, false. +// If ac's state is IDLE, it will trigger ac to connect. +func (ac *addrConn) getReadyTransport() (transport.ClientTransport, bool) { + ac.mu.Lock() + if ac.state == connectivity.Ready && ac.transport != nil { + t := ac.transport + ac.mu.Unlock() + return t, true + } + var idle bool + if ac.state == connectivity.Idle { + idle = true + } + ac.mu.Unlock() + // Trigger idle ac to connect. + if idle { + ac.connect() + } + return nil, false +} + +// tearDown starts to tear down the addrConn. +// TODO(zhaoq): Make this synchronous to avoid unbounded memory consumption in +// some edge cases (e.g., the caller opens and closes many addrConn's in a +// tight loop. +// tearDown doesn't remove ac from ac.cc.conns. +func (ac *addrConn) tearDown(err error) { + ac.mu.Lock() + if ac.state == connectivity.Shutdown { + ac.mu.Unlock() + return + } + curTr := ac.transport + ac.transport = nil + // We have to set the state to Shutdown before anything else to prevent races + // between setting the state and logic that waits on context cancellation / etc. + ac.updateConnectivityState(connectivity.Shutdown, nil) + ac.cancel() + ac.curAddr = resolver.Address{} + if err == errConnDrain && curTr != nil { + // GracefulClose(...) may be executed multiple times when + // i) receiving multiple GoAway frames from the server; or + // ii) there are concurrent name resolver/Balancer triggered + // address removal and GoAway. + // We have to unlock and re-lock here because GracefulClose => Close => onClose, which requires locking ac.mu. + ac.mu.Unlock() + curTr.GracefulClose() + ac.mu.Lock() + } + if channelz.IsOn() { + channelz.AddTraceEvent(logger, ac.channelzID, 0, &channelz.TraceEventDesc{ + Desc: "Subchannel Deleted", + Severity: channelz.CtINFO, + Parent: &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Subchanel(id:%d) deleted", ac.channelzID), + Severity: channelz.CtINFO, + }, + }) + // TraceEvent needs to be called before RemoveEntry, as TraceEvent may add trace reference to + // the entity being deleted, and thus prevent it from being deleted right away. + channelz.RemoveEntry(ac.channelzID) + } + ac.mu.Unlock() +} + +func (ac *addrConn) getState() connectivity.State { + ac.mu.Lock() + defer ac.mu.Unlock() + return ac.state +} + +func (ac *addrConn) ChannelzMetric() *channelz.ChannelInternalMetric { + ac.mu.Lock() + addr := ac.curAddr.Addr + ac.mu.Unlock() + return &channelz.ChannelInternalMetric{ + State: ac.getState(), + Target: addr, + CallsStarted: atomic.LoadInt64(&ac.czData.callsStarted), + CallsSucceeded: atomic.LoadInt64(&ac.czData.callsSucceeded), + CallsFailed: atomic.LoadInt64(&ac.czData.callsFailed), + LastCallStartedTimestamp: time.Unix(0, atomic.LoadInt64(&ac.czData.lastCallStartedTime)), + } +} + +func (ac *addrConn) incrCallsStarted() { + atomic.AddInt64(&ac.czData.callsStarted, 1) + atomic.StoreInt64(&ac.czData.lastCallStartedTime, time.Now().UnixNano()) +} + +func (ac *addrConn) incrCallsSucceeded() { + atomic.AddInt64(&ac.czData.callsSucceeded, 1) +} + +func (ac *addrConn) incrCallsFailed() { + atomic.AddInt64(&ac.czData.callsFailed, 1) +} + +type retryThrottler struct { + max float64 + thresh float64 + ratio float64 + + mu sync.Mutex + tokens float64 // TODO(dfawley): replace with atomic and remove lock. +} + +// throttle subtracts a retry token from the pool and returns whether a retry +// should be throttled (disallowed) based upon the retry throttling policy in +// the service config. +func (rt *retryThrottler) throttle() bool { + if rt == nil { + return false + } + rt.mu.Lock() + defer rt.mu.Unlock() + rt.tokens-- + if rt.tokens < 0 { + rt.tokens = 0 + } + return rt.tokens <= rt.thresh +} + +func (rt *retryThrottler) successfulRPC() { + if rt == nil { + return + } + rt.mu.Lock() + defer rt.mu.Unlock() + rt.tokens += rt.ratio + if rt.tokens > rt.max { + rt.tokens = rt.max + } +} + +type channelzChannel struct { + cc *ClientConn +} + +func (c *channelzChannel) ChannelzMetric() *channelz.ChannelInternalMetric { + return c.cc.channelzMetric() +} + +// ErrClientConnTimeout indicates that the ClientConn cannot establish the +// underlying connections within the specified timeout. +// +// Deprecated: This error is never returned by grpc and should not be +// referenced by users. +var ErrClientConnTimeout = errors.New("grpc: timed out when dialing") + +func (cc *ClientConn) getResolver(scheme string) resolver.Builder { + for _, rb := range cc.dopts.resolvers { + if scheme == rb.Scheme() { + return rb + } + } + return resolver.Get(scheme) +} + +func (cc *ClientConn) updateConnectionError(err error) { + cc.lceMu.Lock() + cc.lastConnectionError = err + cc.lceMu.Unlock() +} + +func (cc *ClientConn) connectionError() error { + cc.lceMu.Lock() + defer cc.lceMu.Unlock() + return cc.lastConnectionError +} diff --git a/vendor/google.golang.org/grpc/codec.go b/vendor/google.golang.org/grpc/codec.go new file mode 100644 index 000000000..129776547 --- /dev/null +++ b/vendor/google.golang.org/grpc/codec.go @@ -0,0 +1,50 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "google.golang.org/grpc/encoding" + _ "google.golang.org/grpc/encoding/proto" // to register the Codec for "proto" +) + +// baseCodec contains the functionality of both Codec and encoding.Codec, but +// omits the name/string, which vary between the two and are not needed for +// anything besides the registry in the encoding package. +type baseCodec interface { + Marshal(v interface{}) ([]byte, error) + Unmarshal(data []byte, v interface{}) error +} + +var _ baseCodec = Codec(nil) +var _ baseCodec = encoding.Codec(nil) + +// Codec defines the interface gRPC uses to encode and decode messages. +// Note that implementations of this interface must be thread safe; +// a Codec's methods can be called from concurrent goroutines. +// +// Deprecated: use encoding.Codec instead. +type Codec interface { + // Marshal returns the wire format of v. + Marshal(v interface{}) ([]byte, error) + // Unmarshal parses the wire format into v. + Unmarshal(data []byte, v interface{}) error + // String returns the name of the Codec implementation. This is unused by + // gRPC. + String() string +} diff --git a/vendor/google.golang.org/grpc/codegen.sh b/vendor/google.golang.org/grpc/codegen.sh new file mode 100644 index 000000000..4cdc6ba7c --- /dev/null +++ b/vendor/google.golang.org/grpc/codegen.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# This script serves as an example to demonstrate how to generate the gRPC-Go +# interface and the related messages from .proto file. +# +# It assumes the installation of i) Google proto buffer compiler at +# https://github.com/google/protobuf (after v2.6.1) and ii) the Go codegen +# plugin at https://github.com/golang/protobuf (after 2015-02-20). If you have +# not, please install them first. +# +# We recommend running this script at $GOPATH/src. +# +# If this is not what you need, feel free to make your own scripts. Again, this +# script is for demonstration purpose. +# +proto=$1 +protoc --go_out=plugins=grpc:. $proto diff --git a/vendor/google.golang.org/grpc/codes/code_string.go b/vendor/google.golang.org/grpc/codes/code_string.go new file mode 100644 index 000000000..0b206a578 --- /dev/null +++ b/vendor/google.golang.org/grpc/codes/code_string.go @@ -0,0 +1,62 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package codes + +import "strconv" + +func (c Code) String() string { + switch c { + case OK: + return "OK" + case Canceled: + return "Canceled" + case Unknown: + return "Unknown" + case InvalidArgument: + return "InvalidArgument" + case DeadlineExceeded: + return "DeadlineExceeded" + case NotFound: + return "NotFound" + case AlreadyExists: + return "AlreadyExists" + case PermissionDenied: + return "PermissionDenied" + case ResourceExhausted: + return "ResourceExhausted" + case FailedPrecondition: + return "FailedPrecondition" + case Aborted: + return "Aborted" + case OutOfRange: + return "OutOfRange" + case Unimplemented: + return "Unimplemented" + case Internal: + return "Internal" + case Unavailable: + return "Unavailable" + case DataLoss: + return "DataLoss" + case Unauthenticated: + return "Unauthenticated" + default: + return "Code(" + strconv.FormatInt(int64(c), 10) + ")" + } +} diff --git a/vendor/google.golang.org/grpc/codes/codes.go b/vendor/google.golang.org/grpc/codes/codes.go new file mode 100644 index 000000000..11b106182 --- /dev/null +++ b/vendor/google.golang.org/grpc/codes/codes.go @@ -0,0 +1,244 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package codes defines the canonical error codes used by gRPC. It is +// consistent across various languages. +package codes // import "google.golang.org/grpc/codes" + +import ( + "fmt" + "strconv" +) + +// A Code is an unsigned 32-bit error code as defined in the gRPC spec. +type Code uint32 + +const ( + // OK is returned on success. + OK Code = 0 + + // Canceled indicates the operation was canceled (typically by the caller). + // + // The gRPC framework will generate this error code when cancellation + // is requested. + Canceled Code = 1 + + // Unknown error. An example of where this error may be returned is + // if a Status value received from another address space belongs to + // an error-space that is not known in this address space. Also + // errors raised by APIs that do not return enough error information + // may be converted to this error. + // + // The gRPC framework will generate this error code in the above two + // mentioned cases. + Unknown Code = 2 + + // InvalidArgument indicates client specified an invalid argument. + // Note that this differs from FailedPrecondition. It indicates arguments + // that are problematic regardless of the state of the system + // (e.g., a malformed file name). + // + // This error code will not be generated by the gRPC framework. + InvalidArgument Code = 3 + + // DeadlineExceeded means operation expired before completion. + // For operations that change the state of the system, this error may be + // returned even if the operation has completed successfully. For + // example, a successful response from a server could have been delayed + // long enough for the deadline to expire. + // + // The gRPC framework will generate this error code when the deadline is + // exceeded. + DeadlineExceeded Code = 4 + + // NotFound means some requested entity (e.g., file or directory) was + // not found. + // + // This error code will not be generated by the gRPC framework. + NotFound Code = 5 + + // AlreadyExists means an attempt to create an entity failed because one + // already exists. + // + // This error code will not be generated by the gRPC framework. + AlreadyExists Code = 6 + + // PermissionDenied indicates the caller does not have permission to + // execute the specified operation. It must not be used for rejections + // caused by exhausting some resource (use ResourceExhausted + // instead for those errors). It must not be + // used if the caller cannot be identified (use Unauthenticated + // instead for those errors). + // + // This error code will not be generated by the gRPC core framework, + // but expect authentication middleware to use it. + PermissionDenied Code = 7 + + // ResourceExhausted indicates some resource has been exhausted, perhaps + // a per-user quota, or perhaps the entire file system is out of space. + // + // This error code will be generated by the gRPC framework in + // out-of-memory and server overload situations, or when a message is + // larger than the configured maximum size. + ResourceExhausted Code = 8 + + // FailedPrecondition indicates operation was rejected because the + // system is not in a state required for the operation's execution. + // For example, directory to be deleted may be non-empty, an rmdir + // operation is applied to a non-directory, etc. + // + // A litmus test that may help a service implementor in deciding + // between FailedPrecondition, Aborted, and Unavailable: + // (a) Use Unavailable if the client can retry just the failing call. + // (b) Use Aborted if the client should retry at a higher-level + // (e.g., restarting a read-modify-write sequence). + // (c) Use FailedPrecondition if the client should not retry until + // the system state has been explicitly fixed. E.g., if an "rmdir" + // fails because the directory is non-empty, FailedPrecondition + // should be returned since the client should not retry unless + // they have first fixed up the directory by deleting files from it. + // (d) Use FailedPrecondition if the client performs conditional + // REST Get/Update/Delete on a resource and the resource on the + // server does not match the condition. E.g., conflicting + // read-modify-write on the same resource. + // + // This error code will not be generated by the gRPC framework. + FailedPrecondition Code = 9 + + // Aborted indicates the operation was aborted, typically due to a + // concurrency issue like sequencer check failures, transaction aborts, + // etc. + // + // See litmus test above for deciding between FailedPrecondition, + // Aborted, and Unavailable. + // + // This error code will not be generated by the gRPC framework. + Aborted Code = 10 + + // OutOfRange means operation was attempted past the valid range. + // E.g., seeking or reading past end of file. + // + // Unlike InvalidArgument, this error indicates a problem that may + // be fixed if the system state changes. For example, a 32-bit file + // system will generate InvalidArgument if asked to read at an + // offset that is not in the range [0,2^32-1], but it will generate + // OutOfRange if asked to read from an offset past the current + // file size. + // + // There is a fair bit of overlap between FailedPrecondition and + // OutOfRange. We recommend using OutOfRange (the more specific + // error) when it applies so that callers who are iterating through + // a space can easily look for an OutOfRange error to detect when + // they are done. + // + // This error code will not be generated by the gRPC framework. + OutOfRange Code = 11 + + // Unimplemented indicates operation is not implemented or not + // supported/enabled in this service. + // + // This error code will be generated by the gRPC framework. Most + // commonly, you will see this error code when a method implementation + // is missing on the server. It can also be generated for unknown + // compression algorithms or a disagreement as to whether an RPC should + // be streaming. + Unimplemented Code = 12 + + // Internal errors. Means some invariants expected by underlying + // system has been broken. If you see one of these errors, + // something is very broken. + // + // This error code will be generated by the gRPC framework in several + // internal error conditions. + Internal Code = 13 + + // Unavailable indicates the service is currently unavailable. + // This is a most likely a transient condition and may be corrected + // by retrying with a backoff. Note that it is not always safe to retry + // non-idempotent operations. + // + // See litmus test above for deciding between FailedPrecondition, + // Aborted, and Unavailable. + // + // This error code will be generated by the gRPC framework during + // abrupt shutdown of a server process or network connection. + Unavailable Code = 14 + + // DataLoss indicates unrecoverable data loss or corruption. + // + // This error code will not be generated by the gRPC framework. + DataLoss Code = 15 + + // Unauthenticated indicates the request does not have valid + // authentication credentials for the operation. + // + // The gRPC framework will generate this error code when the + // authentication metadata is invalid or a Credentials callback fails, + // but also expect authentication middleware to generate it. + Unauthenticated Code = 16 + + _maxCode = 17 +) + +var strToCode = map[string]Code{ + `"OK"`: OK, + `"CANCELLED"`:/* [sic] */ Canceled, + `"UNKNOWN"`: Unknown, + `"INVALID_ARGUMENT"`: InvalidArgument, + `"DEADLINE_EXCEEDED"`: DeadlineExceeded, + `"NOT_FOUND"`: NotFound, + `"ALREADY_EXISTS"`: AlreadyExists, + `"PERMISSION_DENIED"`: PermissionDenied, + `"RESOURCE_EXHAUSTED"`: ResourceExhausted, + `"FAILED_PRECONDITION"`: FailedPrecondition, + `"ABORTED"`: Aborted, + `"OUT_OF_RANGE"`: OutOfRange, + `"UNIMPLEMENTED"`: Unimplemented, + `"INTERNAL"`: Internal, + `"UNAVAILABLE"`: Unavailable, + `"DATA_LOSS"`: DataLoss, + `"UNAUTHENTICATED"`: Unauthenticated, +} + +// UnmarshalJSON unmarshals b into the Code. +func (c *Code) UnmarshalJSON(b []byte) error { + // From json.Unmarshaler: By convention, to approximate the behavior of + // Unmarshal itself, Unmarshalers implement UnmarshalJSON([]byte("null")) as + // a no-op. + if string(b) == "null" { + return nil + } + if c == nil { + return fmt.Errorf("nil receiver passed to UnmarshalJSON") + } + + if ci, err := strconv.ParseUint(string(b), 10, 32); err == nil { + if ci >= _maxCode { + return fmt.Errorf("invalid code: %q", ci) + } + + *c = Code(ci) + return nil + } + + if jc, ok := strToCode[string(b)]; ok { + *c = jc + return nil + } + return fmt.Errorf("invalid code: %q", string(b)) +} diff --git a/vendor/google.golang.org/grpc/connectivity/connectivity.go b/vendor/google.golang.org/grpc/connectivity/connectivity.go new file mode 100644 index 000000000..34ec36fbf --- /dev/null +++ b/vendor/google.golang.org/grpc/connectivity/connectivity.go @@ -0,0 +1,73 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package connectivity defines connectivity semantics. +// For details, see https://github.com/grpc/grpc/blob/master/doc/connectivity-semantics-and-api.md. +// All APIs in this package are experimental. +package connectivity + +import ( + "context" + + "google.golang.org/grpc/grpclog" +) + +// State indicates the state of connectivity. +// It can be the state of a ClientConn or SubConn. +type State int + +func (s State) String() string { + switch s { + case Idle: + return "IDLE" + case Connecting: + return "CONNECTING" + case Ready: + return "READY" + case TransientFailure: + return "TRANSIENT_FAILURE" + case Shutdown: + return "SHUTDOWN" + default: + grpclog.Errorf("unknown connectivity state: %d", s) + return "Invalid-State" + } +} + +const ( + // Idle indicates the ClientConn is idle. + Idle State = iota + // Connecting indicates the ClientConn is connecting. + Connecting + // Ready indicates the ClientConn is ready for work. + Ready + // TransientFailure indicates the ClientConn has seen a failure but expects to recover. + TransientFailure + // Shutdown indicates the ClientConn has started shutting down. + Shutdown +) + +// Reporter reports the connectivity states. +type Reporter interface { + // CurrentState returns the current state of the reporter. + CurrentState() State + // WaitForStateChange blocks until the reporter's state is different from the given state, + // and returns true. + // It returns false if <-ctx.Done() can proceed (ctx got timeout or got canceled). + WaitForStateChange(context.Context, State) bool +} diff --git a/vendor/google.golang.org/grpc/credentials/credentials.go b/vendor/google.golang.org/grpc/credentials/credentials.go new file mode 100644 index 000000000..02766443a --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/credentials.go @@ -0,0 +1,289 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package credentials implements various credentials supported by gRPC library, +// which encapsulate all the state needed by a client to authenticate with a +// server and make various assertions, e.g., about the client's identity, role, +// or whether it is authorized to make a particular call. +package credentials // import "google.golang.org/grpc/credentials" + +import ( + "context" + "errors" + "fmt" + "net" + + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/attributes" + "google.golang.org/grpc/internal" +) + +// PerRPCCredentials defines the common interface for the credentials which need to +// attach security information to every RPC (e.g., oauth2). +type PerRPCCredentials interface { + // GetRequestMetadata gets the current request metadata, refreshing + // tokens if required. This should be called by the transport layer on + // each request, and the data should be populated in headers or other + // context. If a status code is returned, it will be used as the status + // for the RPC. uri is the URI of the entry point for the request. + // When supported by the underlying implementation, ctx can be used for + // timeout and cancellation. Additionally, RequestInfo data will be + // available via ctx to this call. + // TODO(zhaoq): Define the set of the qualified keys instead of leaving + // it as an arbitrary string. + GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) + // RequireTransportSecurity indicates whether the credentials requires + // transport security. + RequireTransportSecurity() bool +} + +// SecurityLevel defines the protection level on an established connection. +// +// This API is experimental. +type SecurityLevel int + +const ( + // Invalid indicates an invalid security level. + // The zero SecurityLevel value is invalid for backward compatibility. + Invalid SecurityLevel = iota + // NoSecurity indicates a connection is insecure. + NoSecurity + // IntegrityOnly indicates a connection only provides integrity protection. + IntegrityOnly + // PrivacyAndIntegrity indicates a connection provides both privacy and integrity protection. + PrivacyAndIntegrity +) + +// String returns SecurityLevel in a string format. +func (s SecurityLevel) String() string { + switch s { + case NoSecurity: + return "NoSecurity" + case IntegrityOnly: + return "IntegrityOnly" + case PrivacyAndIntegrity: + return "PrivacyAndIntegrity" + } + return fmt.Sprintf("invalid SecurityLevel: %v", int(s)) +} + +// CommonAuthInfo contains authenticated information common to AuthInfo implementations. +// It should be embedded in a struct implementing AuthInfo to provide additional information +// about the credentials. +// +// This API is experimental. +type CommonAuthInfo struct { + SecurityLevel SecurityLevel +} + +// GetCommonAuthInfo returns the pointer to CommonAuthInfo struct. +func (c *CommonAuthInfo) GetCommonAuthInfo() *CommonAuthInfo { + return c +} + +// ProtocolInfo provides information regarding the gRPC wire protocol version, +// security protocol, security protocol version in use, server name, etc. +type ProtocolInfo struct { + // ProtocolVersion is the gRPC wire protocol version. + ProtocolVersion string + // SecurityProtocol is the security protocol in use. + SecurityProtocol string + // SecurityVersion is the security protocol version. It is a static version string from the + // credentials, not a value that reflects per-connection protocol negotiation. To retrieve + // details about the credentials used for a connection, use the Peer's AuthInfo field instead. + // + // Deprecated: please use Peer.AuthInfo. + SecurityVersion string + // ServerName is the user-configured server name. + ServerName string +} + +// AuthInfo defines the common interface for the auth information the users are interested in. +// A struct that implements AuthInfo should embed CommonAuthInfo by including additional +// information about the credentials in it. +type AuthInfo interface { + AuthType() string +} + +// ErrConnDispatched indicates that rawConn has been dispatched out of gRPC +// and the caller should not close rawConn. +var ErrConnDispatched = errors.New("credentials: rawConn is dispatched out of gRPC") + +// TransportCredentials defines the common interface for all the live gRPC wire +// protocols and supported transport security protocols (e.g., TLS, SSL). +type TransportCredentials interface { + // ClientHandshake does the authentication handshake specified by the + // corresponding authentication protocol on rawConn for clients. It returns + // the authenticated connection and the corresponding auth information + // about the connection. The auth information should embed CommonAuthInfo + // to return additional information about the credentials. Implementations + // must use the provided context to implement timely cancellation. gRPC + // will try to reconnect if the error returned is a temporary error + // (io.EOF, context.DeadlineExceeded or err.Temporary() == true). If the + // returned error is a wrapper error, implementations should make sure that + // the error implements Temporary() to have the correct retry behaviors. + // Additionally, ClientHandshakeInfo data will be available via the context + // passed to this call. + // + // If the returned net.Conn is closed, it MUST close the net.Conn provided. + ClientHandshake(context.Context, string, net.Conn) (net.Conn, AuthInfo, error) + // ServerHandshake does the authentication handshake for servers. It returns + // the authenticated connection and the corresponding auth information about + // the connection. The auth information should embed CommonAuthInfo to return additional information + // about the credentials. + // + // If the returned net.Conn is closed, it MUST close the net.Conn provided. + ServerHandshake(net.Conn) (net.Conn, AuthInfo, error) + // Info provides the ProtocolInfo of this TransportCredentials. + Info() ProtocolInfo + // Clone makes a copy of this TransportCredentials. + Clone() TransportCredentials + // OverrideServerName overrides the server name used to verify the hostname on the returned certificates from the server. + // gRPC internals also use it to override the virtual hosting name if it is set. + // It must be called before dialing. Currently, this is only used by grpclb. + OverrideServerName(string) error +} + +// Bundle is a combination of TransportCredentials and PerRPCCredentials. +// +// It also contains a mode switching method, so it can be used as a combination +// of different credential policies. +// +// Bundle cannot be used together with individual TransportCredentials. +// PerRPCCredentials from Bundle will be appended to other PerRPCCredentials. +// +// This API is experimental. +type Bundle interface { + TransportCredentials() TransportCredentials + PerRPCCredentials() PerRPCCredentials + // NewWithMode should make a copy of Bundle, and switch mode. Modifying the + // existing Bundle may cause races. + // + // NewWithMode returns nil if the requested mode is not supported. + NewWithMode(mode string) (Bundle, error) +} + +// RequestInfo contains request data attached to the context passed to GetRequestMetadata calls. +// +// This API is experimental. +type RequestInfo struct { + // The method passed to Invoke or NewStream for this RPC. (For proto methods, this has the format "/some.Service/Method") + Method string + // AuthInfo contains the information from a security handshake (TransportCredentials.ClientHandshake, TransportCredentials.ServerHandshake) + AuthInfo AuthInfo +} + +// requestInfoKey is a struct to be used as the key when attaching a RequestInfo to a context object. +type requestInfoKey struct{} + +// RequestInfoFromContext extracts the RequestInfo from the context if it exists. +// +// This API is experimental. +func RequestInfoFromContext(ctx context.Context) (ri RequestInfo, ok bool) { + ri, ok = ctx.Value(requestInfoKey{}).(RequestInfo) + return +} + +// ClientHandshakeInfo holds data to be passed to ClientHandshake. This makes +// it possible to pass arbitrary data to the handshaker from gRPC, resolver, +// balancer etc. Individual credential implementations control the actual +// format of the data that they are willing to receive. +// +// This API is experimental. +type ClientHandshakeInfo struct { + // Attributes contains the attributes for the address. It could be provided + // by the gRPC, resolver, balancer etc. + Attributes *attributes.Attributes +} + +// clientHandshakeInfoKey is a struct used as the key to store +// ClientHandshakeInfo in a context. +type clientHandshakeInfoKey struct{} + +// ClientHandshakeInfoFromContext returns the ClientHandshakeInfo struct stored +// in ctx. +// +// This API is experimental. +func ClientHandshakeInfoFromContext(ctx context.Context) ClientHandshakeInfo { + chi, _ := ctx.Value(clientHandshakeInfoKey{}).(ClientHandshakeInfo) + return chi +} + +// CheckSecurityLevel checks if a connection's security level is greater than or equal to the specified one. +// It returns success if 1) the condition is satisified or 2) AuthInfo struct does not implement GetCommonAuthInfo() method +// or 3) CommonAuthInfo.SecurityLevel has an invalid zero value. For 2) and 3), it is for the purpose of backward-compatibility. +// +// This API is experimental. +func CheckSecurityLevel(ctx context.Context, level SecurityLevel) error { + type internalInfo interface { + GetCommonAuthInfo() *CommonAuthInfo + } + ri, _ := RequestInfoFromContext(ctx) + if ri.AuthInfo == nil { + return errors.New("unable to obtain SecurityLevel from context") + } + if ci, ok := ri.AuthInfo.(internalInfo); ok { + // CommonAuthInfo.SecurityLevel has an invalid value. + if ci.GetCommonAuthInfo().SecurityLevel == Invalid { + return nil + } + if ci.GetCommonAuthInfo().SecurityLevel < level { + return fmt.Errorf("requires SecurityLevel %v; connection has %v", level, ci.GetCommonAuthInfo().SecurityLevel) + } + } + // The condition is satisfied or AuthInfo struct does not implement GetCommonAuthInfo() method. + return nil +} + +func init() { + internal.NewRequestInfoContext = func(ctx context.Context, ri RequestInfo) context.Context { + return context.WithValue(ctx, requestInfoKey{}, ri) + } + internal.NewClientHandshakeInfoContext = func(ctx context.Context, chi ClientHandshakeInfo) context.Context { + return context.WithValue(ctx, clientHandshakeInfoKey{}, chi) + } +} + +// ChannelzSecurityInfo defines the interface that security protocols should implement +// in order to provide security info to channelz. +// +// This API is experimental. +type ChannelzSecurityInfo interface { + GetSecurityValue() ChannelzSecurityValue +} + +// ChannelzSecurityValue defines the interface that GetSecurityValue() return value +// should satisfy. This interface should only be satisfied by *TLSChannelzSecurityValue +// and *OtherChannelzSecurityValue. +// +// This API is experimental. +type ChannelzSecurityValue interface { + isChannelzSecurityValue() +} + +// OtherChannelzSecurityValue defines the struct that non-TLS protocol should return +// from GetSecurityValue(), which contains protocol specific security info. Note +// the Value field will be sent to users of channelz requesting channel info, and +// thus sensitive info should better be avoided. +// +// This API is experimental. +type OtherChannelzSecurityValue struct { + ChannelzSecurityValue + Name string + Value proto.Message +} diff --git a/vendor/google.golang.org/grpc/credentials/go12.go b/vendor/google.golang.org/grpc/credentials/go12.go new file mode 100644 index 000000000..ccbf35b33 --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/go12.go @@ -0,0 +1,30 @@ +// +build go1.12 + +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package credentials + +import "crypto/tls" + +// This init function adds cipher suite constants only defined in Go 1.12. +func init() { + cipherSuiteLookup[tls.TLS_AES_128_GCM_SHA256] = "TLS_AES_128_GCM_SHA256" + cipherSuiteLookup[tls.TLS_AES_256_GCM_SHA384] = "TLS_AES_256_GCM_SHA384" + cipherSuiteLookup[tls.TLS_CHACHA20_POLY1305_SHA256] = "TLS_CHACHA20_POLY1305_SHA256" +} diff --git a/vendor/google.golang.org/grpc/credentials/internal/syscallconn.go b/vendor/google.golang.org/grpc/credentials/internal/syscallconn.go new file mode 100644 index 000000000..2f4472bec --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/internal/syscallconn.go @@ -0,0 +1,61 @@ +// +build !appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package internal contains credentials-internal code. +package internal + +import ( + "net" + "syscall" +) + +type sysConn = syscall.Conn + +// syscallConn keeps reference of rawConn to support syscall.Conn for channelz. +// SyscallConn() (the method in interface syscall.Conn) is explicitly +// implemented on this type, +// +// Interface syscall.Conn is implemented by most net.Conn implementations (e.g. +// TCPConn, UnixConn), but is not part of net.Conn interface. So wrapper conns +// that embed net.Conn don't implement syscall.Conn. (Side note: tls.Conn +// doesn't embed net.Conn, so even if syscall.Conn is part of net.Conn, it won't +// help here). +type syscallConn struct { + net.Conn + // sysConn is a type alias of syscall.Conn. It's necessary because the name + // `Conn` collides with `net.Conn`. + sysConn +} + +// WrapSyscallConn tries to wrap rawConn and newConn into a net.Conn that +// implements syscall.Conn. rawConn will be used to support syscall, and newConn +// will be used for read/write. +// +// This function returns newConn if rawConn doesn't implement syscall.Conn. +func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn { + sysConn, ok := rawConn.(syscall.Conn) + if !ok { + return newConn + } + return &syscallConn{ + Conn: newConn, + sysConn: sysConn, + } +} diff --git a/vendor/google.golang.org/grpc/credentials/internal/syscallconn_appengine.go b/vendor/google.golang.org/grpc/credentials/internal/syscallconn_appengine.go new file mode 100644 index 000000000..d4346e9ea --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/internal/syscallconn_appengine.go @@ -0,0 +1,30 @@ +// +build appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package internal + +import ( + "net" +) + +// WrapSyscallConn returns newConn on appengine. +func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn { + return newConn +} diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go new file mode 100644 index 000000000..1ba6f3a6b --- /dev/null +++ b/vendor/google.golang.org/grpc/credentials/tls.go @@ -0,0 +1,259 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package credentials + +import ( + "context" + "crypto/tls" + "crypto/x509" + "fmt" + "io/ioutil" + "net" + "net/url" + + "google.golang.org/grpc/credentials/internal" + credinternal "google.golang.org/grpc/internal/credentials" +) + +// TLSInfo contains the auth information for a TLS authenticated connection. +// It implements the AuthInfo interface. +type TLSInfo struct { + State tls.ConnectionState + CommonAuthInfo + // This API is experimental. + SPIFFEID *url.URL +} + +// AuthType returns the type of TLSInfo as a string. +func (t TLSInfo) AuthType() string { + return "tls" +} + +// GetSecurityValue returns security info requested by channelz. +func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue { + v := &TLSChannelzSecurityValue{ + StandardName: cipherSuiteLookup[t.State.CipherSuite], + } + // Currently there's no way to get LocalCertificate info from tls package. + if len(t.State.PeerCertificates) > 0 { + v.RemoteCertificate = t.State.PeerCertificates[0].Raw + } + return v +} + +// tlsCreds is the credentials required for authenticating a connection using TLS. +type tlsCreds struct { + // TLS configuration + config *tls.Config +} + +func (c tlsCreds) Info() ProtocolInfo { + return ProtocolInfo{ + SecurityProtocol: "tls", + SecurityVersion: "1.2", + ServerName: c.config.ServerName, + } +} + +func (c *tlsCreds) ClientHandshake(ctx context.Context, authority string, rawConn net.Conn) (_ net.Conn, _ AuthInfo, err error) { + // use local cfg to avoid clobbering ServerName if using multiple endpoints + cfg := cloneTLSConfig(c.config) + if cfg.ServerName == "" { + serverName, _, err := net.SplitHostPort(authority) + if err != nil { + // If the authority had no host port or if the authority cannot be parsed, use it as-is. + serverName = authority + } + cfg.ServerName = serverName + } + conn := tls.Client(rawConn, cfg) + errChannel := make(chan error, 1) + go func() { + errChannel <- conn.Handshake() + close(errChannel) + }() + select { + case err := <-errChannel: + if err != nil { + conn.Close() + return nil, nil, err + } + case <-ctx.Done(): + conn.Close() + return nil, nil, ctx.Err() + } + tlsInfo := TLSInfo{ + State: conn.ConnectionState(), + CommonAuthInfo: CommonAuthInfo{ + SecurityLevel: PrivacyAndIntegrity, + }, + } + id := credinternal.SPIFFEIDFromState(conn.ConnectionState()) + if id != nil { + tlsInfo.SPIFFEID = id + } + return internal.WrapSyscallConn(rawConn, conn), tlsInfo, nil +} + +func (c *tlsCreds) ServerHandshake(rawConn net.Conn) (net.Conn, AuthInfo, error) { + conn := tls.Server(rawConn, c.config) + if err := conn.Handshake(); err != nil { + conn.Close() + return nil, nil, err + } + tlsInfo := TLSInfo{ + State: conn.ConnectionState(), + CommonAuthInfo: CommonAuthInfo{ + SecurityLevel: PrivacyAndIntegrity, + }, + } + id := credinternal.SPIFFEIDFromState(conn.ConnectionState()) + if id != nil { + tlsInfo.SPIFFEID = id + } + return internal.WrapSyscallConn(rawConn, conn), tlsInfo, nil +} + +func (c *tlsCreds) Clone() TransportCredentials { + return NewTLS(c.config) +} + +func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { + c.config.ServerName = serverNameOverride + return nil +} + +const alpnProtoStrH2 = "h2" + +func appendH2ToNextProtos(ps []string) []string { + for _, p := range ps { + if p == alpnProtoStrH2 { + return ps + } + } + ret := make([]string, 0, len(ps)+1) + ret = append(ret, ps...) + return append(ret, alpnProtoStrH2) +} + +// NewTLS uses c to construct a TransportCredentials based on TLS. +func NewTLS(c *tls.Config) TransportCredentials { + tc := &tlsCreds{cloneTLSConfig(c)} + tc.config.NextProtos = appendH2ToNextProtos(tc.config.NextProtos) + return tc +} + +// NewClientTLSFromCert constructs TLS credentials from the provided root +// certificate authority certificate(s) to validate server connections. If +// certificates to establish the identity of the client need to be included in +// the credentials (eg: for mTLS), use NewTLS instead, where a complete +// tls.Config can be specified. +// serverNameOverride is for testing only. If set to a non empty string, +// it will override the virtual host name of authority (e.g. :authority header +// field) in requests. +func NewClientTLSFromCert(cp *x509.CertPool, serverNameOverride string) TransportCredentials { + return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}) +} + +// NewClientTLSFromFile constructs TLS credentials from the provided root +// certificate authority certificate file(s) to validate server connections. If +// certificates to establish the identity of the client need to be included in +// the credentials (eg: for mTLS), use NewTLS instead, where a complete +// tls.Config can be specified. +// serverNameOverride is for testing only. If set to a non empty string, +// it will override the virtual host name of authority (e.g. :authority header +// field) in requests. +func NewClientTLSFromFile(certFile, serverNameOverride string) (TransportCredentials, error) { + b, err := ioutil.ReadFile(certFile) + if err != nil { + return nil, err + } + cp := x509.NewCertPool() + if !cp.AppendCertsFromPEM(b) { + return nil, fmt.Errorf("credentials: failed to append certificates") + } + return NewTLS(&tls.Config{ServerName: serverNameOverride, RootCAs: cp}), nil +} + +// NewServerTLSFromCert constructs TLS credentials from the input certificate for server. +func NewServerTLSFromCert(cert *tls.Certificate) TransportCredentials { + return NewTLS(&tls.Config{Certificates: []tls.Certificate{*cert}}) +} + +// NewServerTLSFromFile constructs TLS credentials from the input certificate file and key +// file for server. +func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + if err != nil { + return nil, err + } + return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil +} + +// TLSChannelzSecurityValue defines the struct that TLS protocol should return +// from GetSecurityValue(), containing security info like cipher and certificate used. +// +// This API is EXPERIMENTAL. +type TLSChannelzSecurityValue struct { + ChannelzSecurityValue + StandardName string + LocalCertificate []byte + RemoteCertificate []byte +} + +var cipherSuiteLookup = map[uint16]string{ + tls.TLS_RSA_WITH_RC4_128_SHA: "TLS_RSA_WITH_RC4_128_SHA", + tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + tls.TLS_RSA_WITH_AES_128_CBC_SHA: "TLS_RSA_WITH_AES_128_CBC_SHA", + tls.TLS_RSA_WITH_AES_256_CBC_SHA: "TLS_RSA_WITH_AES_256_CBC_SHA", + tls.TLS_RSA_WITH_AES_128_GCM_SHA256: "TLS_RSA_WITH_AES_128_GCM_SHA256", + tls.TLS_RSA_WITH_AES_256_GCM_SHA384: "TLS_RSA_WITH_AES_256_GCM_SHA384", + tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", + tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA: "TLS_ECDHE_RSA_WITH_RC4_128_SHA", + tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", + tls.TLS_FALLBACK_SCSV: "TLS_FALLBACK_SCSV", + tls.TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256", + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", +} + +// cloneTLSConfig returns a shallow clone of the exported +// fields of cfg, ignoring the unexported sync.Once, which +// contains a mutex and must not be copied. +// +// If cfg is nil, a new zero tls.Config is returned. +// +// TODO: inline this function if possible. +func cloneTLSConfig(cfg *tls.Config) *tls.Config { + if cfg == nil { + return &tls.Config{} + } + + return cfg.Clone() +} diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go new file mode 100644 index 000000000..decb4c5ee --- /dev/null +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -0,0 +1,605 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "fmt" + "net" + "time" + + "google.golang.org/grpc/backoff" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal" + internalbackoff "google.golang.org/grpc/internal/backoff" + "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/stats" +) + +// dialOptions configure a Dial call. dialOptions are set by the DialOption +// values passed to Dial. +type dialOptions struct { + unaryInt UnaryClientInterceptor + streamInt StreamClientInterceptor + + chainUnaryInts []UnaryClientInterceptor + chainStreamInts []StreamClientInterceptor + + cp Compressor + dc Decompressor + bs internalbackoff.Strategy + block bool + returnLastError bool + insecure bool + timeout time.Duration + scChan <-chan ServiceConfig + authority string + copts transport.ConnectOptions + callOptions []CallOption + // This is used by WithBalancerName dial option. + balancerBuilder balancer.Builder + channelzParentID int64 + disableServiceConfig bool + disableRetry bool + disableHealthCheck bool + healthCheckFunc internal.HealthChecker + minConnectTimeout func() time.Duration + defaultServiceConfig *ServiceConfig // defaultServiceConfig is parsed from defaultServiceConfigRawJSON. + defaultServiceConfigRawJSON *string + // This is used by ccResolverWrapper to backoff between successive calls to + // resolver.ResolveNow(). The user will have no need to configure this, but + // we need to be able to configure this in tests. + resolveNowBackoff func(int) time.Duration + resolvers []resolver.Builder + withProxy bool +} + +// DialOption configures how we set up the connection. +type DialOption interface { + apply(*dialOptions) +} + +// EmptyDialOption does not alter the dial configuration. It can be embedded in +// another structure to build custom dial options. +// +// This API is EXPERIMENTAL. +type EmptyDialOption struct{} + +func (EmptyDialOption) apply(*dialOptions) {} + +// funcDialOption wraps a function that modifies dialOptions into an +// implementation of the DialOption interface. +type funcDialOption struct { + f func(*dialOptions) +} + +func (fdo *funcDialOption) apply(do *dialOptions) { + fdo.f(do) +} + +func newFuncDialOption(f func(*dialOptions)) *funcDialOption { + return &funcDialOption{ + f: f, + } +} + +// WithWriteBufferSize determines how much data can be batched before doing a +// write on the wire. The corresponding memory allocation for this buffer will +// be twice the size to keep syscalls low. The default value for this buffer is +// 32KB. +// +// Zero will disable the write buffer such that each write will be on underlying +// connection. Note: A Send call may not directly translate to a write. +func WithWriteBufferSize(s int) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.WriteBufferSize = s + }) +} + +// WithReadBufferSize lets you set the size of read buffer, this determines how +// much data can be read at most for each read syscall. +// +// The default value for this buffer is 32KB. Zero will disable read buffer for +// a connection so data framer can access the underlying conn directly. +func WithReadBufferSize(s int) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.ReadBufferSize = s + }) +} + +// WithInitialWindowSize returns a DialOption which sets the value for initial +// window size on a stream. The lower bound for window size is 64K and any value +// smaller than that will be ignored. +func WithInitialWindowSize(s int32) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.InitialWindowSize = s + }) +} + +// WithInitialConnWindowSize returns a DialOption which sets the value for +// initial window size on a connection. The lower bound for window size is 64K +// and any value smaller than that will be ignored. +func WithInitialConnWindowSize(s int32) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.InitialConnWindowSize = s + }) +} + +// WithMaxMsgSize returns a DialOption which sets the maximum message size the +// client can receive. +// +// Deprecated: use WithDefaultCallOptions(MaxCallRecvMsgSize(s)) instead. Will +// be supported throughout 1.x. +func WithMaxMsgSize(s int) DialOption { + return WithDefaultCallOptions(MaxCallRecvMsgSize(s)) +} + +// WithDefaultCallOptions returns a DialOption which sets the default +// CallOptions for calls over the connection. +func WithDefaultCallOptions(cos ...CallOption) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.callOptions = append(o.callOptions, cos...) + }) +} + +// WithCodec returns a DialOption which sets a codec for message marshaling and +// unmarshaling. +// +// Deprecated: use WithDefaultCallOptions(ForceCodec(_)) instead. Will be +// supported throughout 1.x. +func WithCodec(c Codec) DialOption { + return WithDefaultCallOptions(CallCustomCodec(c)) +} + +// WithCompressor returns a DialOption which sets a Compressor to use for +// message compression. It has lower priority than the compressor set by the +// UseCompressor CallOption. +// +// Deprecated: use UseCompressor instead. Will be supported throughout 1.x. +func WithCompressor(cp Compressor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.cp = cp + }) +} + +// WithDecompressor returns a DialOption which sets a Decompressor to use for +// incoming message decompression. If incoming response messages are encoded +// using the decompressor's Type(), it will be used. Otherwise, the message +// encoding will be used to look up the compressor registered via +// encoding.RegisterCompressor, which will then be used to decompress the +// message. If no compressor is registered for the encoding, an Unimplemented +// status error will be returned. +// +// Deprecated: use encoding.RegisterCompressor instead. Will be supported +// throughout 1.x. +func WithDecompressor(dc Decompressor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.dc = dc + }) +} + +// WithBalancerName sets the balancer that the ClientConn will be initialized +// with. Balancer registered with balancerName will be used. This function +// panics if no balancer was registered by balancerName. +// +// The balancer cannot be overridden by balancer option specified by service +// config. +// +// Deprecated: use WithDefaultServiceConfig and WithDisableServiceConfig +// instead. Will be removed in a future 1.x release. +func WithBalancerName(balancerName string) DialOption { + builder := balancer.Get(balancerName) + if builder == nil { + panic(fmt.Sprintf("grpc.WithBalancerName: no balancer is registered for name %v", balancerName)) + } + return newFuncDialOption(func(o *dialOptions) { + o.balancerBuilder = builder + }) +} + +// WithServiceConfig returns a DialOption which has a channel to read the +// service configuration. +// +// Deprecated: service config should be received through name resolver or via +// WithDefaultServiceConfig, as specified at +// https://github.com/grpc/grpc/blob/master/doc/service_config.md. Will be +// removed in a future 1.x release. +func WithServiceConfig(c <-chan ServiceConfig) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.scChan = c + }) +} + +// WithConnectParams configures the dialer to use the provided ConnectParams. +// +// The backoff configuration specified as part of the ConnectParams overrides +// all defaults specified in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. Consider +// using the backoff.DefaultConfig as a base, in cases where you want to +// override only a subset of the backoff configuration. +// +// This API is EXPERIMENTAL. +func WithConnectParams(p ConnectParams) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.bs = internalbackoff.Exponential{Config: p.Backoff} + o.minConnectTimeout = func() time.Duration { + return p.MinConnectTimeout + } + }) +} + +// WithBackoffMaxDelay configures the dialer to use the provided maximum delay +// when backing off after failed connection attempts. +// +// Deprecated: use WithConnectParams instead. Will be supported throughout 1.x. +func WithBackoffMaxDelay(md time.Duration) DialOption { + return WithBackoffConfig(BackoffConfig{MaxDelay: md}) +} + +// WithBackoffConfig configures the dialer to use the provided backoff +// parameters after connection failures. +// +// Deprecated: use WithConnectParams instead. Will be supported throughout 1.x. +func WithBackoffConfig(b BackoffConfig) DialOption { + bc := backoff.DefaultConfig + bc.MaxDelay = b.MaxDelay + return withBackoff(internalbackoff.Exponential{Config: bc}) +} + +// withBackoff sets the backoff strategy used for connectRetryNum after a failed +// connection attempt. +// +// This can be exported if arbitrary backoff strategies are allowed by gRPC. +func withBackoff(bs internalbackoff.Strategy) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.bs = bs + }) +} + +// WithBlock returns a DialOption which makes caller of Dial blocks until the +// underlying connection is up. Without this, Dial returns immediately and +// connecting the server happens in background. +func WithBlock() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.block = true + }) +} + +// WithReturnConnectionError returns a DialOption which makes the client connection +// return a string containing both the last connection error that occurred and +// the context.DeadlineExceeded error. +// Implies WithBlock() +// +// This API is EXPERIMENTAL. +func WithReturnConnectionError() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.block = true + o.returnLastError = true + }) +} + +// WithInsecure returns a DialOption which disables transport security for this +// ClientConn. Note that transport security is required unless WithInsecure is +// set. +func WithInsecure() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.insecure = true + }) +} + +// WithNoProxy returns a DialOption which disables the use of proxies for this +// ClientConn. This is ignored if WithDialer or WithContextDialer are used. +// +// This API is EXPERIMENTAL. +func WithNoProxy() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.withProxy = false + }) +} + +// WithTransportCredentials returns a DialOption which configures a connection +// level security credentials (e.g., TLS/SSL). This should not be used together +// with WithCredentialsBundle. +func WithTransportCredentials(creds credentials.TransportCredentials) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.TransportCredentials = creds + }) +} + +// WithPerRPCCredentials returns a DialOption which sets credentials and places +// auth state on each outbound RPC. +func WithPerRPCCredentials(creds credentials.PerRPCCredentials) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.PerRPCCredentials = append(o.copts.PerRPCCredentials, creds) + }) +} + +// WithCredentialsBundle returns a DialOption to set a credentials bundle for +// the ClientConn.WithCreds. This should not be used together with +// WithTransportCredentials. +// +// This API is experimental. +func WithCredentialsBundle(b credentials.Bundle) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.CredsBundle = b + }) +} + +// WithTimeout returns a DialOption that configures a timeout for dialing a +// ClientConn initially. This is valid if and only if WithBlock() is present. +// +// Deprecated: use DialContext instead of Dial and context.WithTimeout +// instead. Will be supported throughout 1.x. +func WithTimeout(d time.Duration) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.timeout = d + }) +} + +// WithContextDialer returns a DialOption that sets a dialer to create +// connections. If FailOnNonTempDialError() is set to true, and an error is +// returned by f, gRPC checks the error's Temporary() method to decide if it +// should try to reconnect to the network address. +func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.Dialer = f + }) +} + +func init() { + internal.WithHealthCheckFunc = withHealthCheckFunc +} + +// WithDialer returns a DialOption that specifies a function to use for dialing +// network addresses. If FailOnNonTempDialError() is set to true, and an error +// is returned by f, gRPC checks the error's Temporary() method to decide if it +// should try to reconnect to the network address. +// +// Deprecated: use WithContextDialer instead. Will be supported throughout +// 1.x. +func WithDialer(f func(string, time.Duration) (net.Conn, error)) DialOption { + return WithContextDialer( + func(ctx context.Context, addr string) (net.Conn, error) { + if deadline, ok := ctx.Deadline(); ok { + return f(addr, time.Until(deadline)) + } + return f(addr, 0) + }) +} + +// WithStatsHandler returns a DialOption that specifies the stats handler for +// all the RPCs and underlying network connections in this ClientConn. +func WithStatsHandler(h stats.Handler) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.StatsHandler = h + }) +} + +// FailOnNonTempDialError returns a DialOption that specifies if gRPC fails on +// non-temporary dial errors. If f is true, and dialer returns a non-temporary +// error, gRPC will fail the connection to the network address and won't try to +// reconnect. The default value of FailOnNonTempDialError is false. +// +// FailOnNonTempDialError only affects the initial dial, and does not do +// anything useful unless you are also using WithBlock(). +// +// This is an EXPERIMENTAL API. +func FailOnNonTempDialError(f bool) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.FailOnNonTempDialError = f + }) +} + +// WithUserAgent returns a DialOption that specifies a user agent string for all +// the RPCs. +func WithUserAgent(s string) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.UserAgent = s + }) +} + +// WithKeepaliveParams returns a DialOption that specifies keepalive parameters +// for the client transport. +func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption { + if kp.Time < internal.KeepaliveMinPingTime { + logger.Warningf("Adjusting keepalive ping interval to minimum period of %v", internal.KeepaliveMinPingTime) + kp.Time = internal.KeepaliveMinPingTime + } + return newFuncDialOption(func(o *dialOptions) { + o.copts.KeepaliveParams = kp + }) +} + +// WithUnaryInterceptor returns a DialOption that specifies the interceptor for +// unary RPCs. +func WithUnaryInterceptor(f UnaryClientInterceptor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.unaryInt = f + }) +} + +// WithChainUnaryInterceptor returns a DialOption that specifies the chained +// interceptor for unary RPCs. The first interceptor will be the outer most, +// while the last interceptor will be the inner most wrapper around the real call. +// All interceptors added by this method will be chained, and the interceptor +// defined by WithUnaryInterceptor will always be prepended to the chain. +func WithChainUnaryInterceptor(interceptors ...UnaryClientInterceptor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.chainUnaryInts = append(o.chainUnaryInts, interceptors...) + }) +} + +// WithStreamInterceptor returns a DialOption that specifies the interceptor for +// streaming RPCs. +func WithStreamInterceptor(f StreamClientInterceptor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.streamInt = f + }) +} + +// WithChainStreamInterceptor returns a DialOption that specifies the chained +// interceptor for streaming RPCs. The first interceptor will be the outer most, +// while the last interceptor will be the inner most wrapper around the real call. +// All interceptors added by this method will be chained, and the interceptor +// defined by WithStreamInterceptor will always be prepended to the chain. +func WithChainStreamInterceptor(interceptors ...StreamClientInterceptor) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.chainStreamInts = append(o.chainStreamInts, interceptors...) + }) +} + +// WithAuthority returns a DialOption that specifies the value to be used as the +// :authority pseudo-header. This value only works with WithInsecure and has no +// effect if TransportCredentials are present. +func WithAuthority(a string) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.authority = a + }) +} + +// WithChannelzParentID returns a DialOption that specifies the channelz ID of +// current ClientConn's parent. This function is used in nested channel creation +// (e.g. grpclb dial). +// +// This API is EXPERIMENTAL. +func WithChannelzParentID(id int64) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.channelzParentID = id + }) +} + +// WithDisableServiceConfig returns a DialOption that causes gRPC to ignore any +// service config provided by the resolver and provides a hint to the resolver +// to not fetch service configs. +// +// Note that this dial option only disables service config from resolver. If +// default service config is provided, gRPC will use the default service config. +func WithDisableServiceConfig() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.disableServiceConfig = true + }) +} + +// WithDefaultServiceConfig returns a DialOption that configures the default +// service config, which will be used in cases where: +// +// 1. WithDisableServiceConfig is also used. +// 2. Resolver does not return a service config or if the resolver returns an +// invalid service config. +// +// This API is EXPERIMENTAL. +func WithDefaultServiceConfig(s string) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.defaultServiceConfigRawJSON = &s + }) +} + +// WithDisableRetry returns a DialOption that disables retries, even if the +// service config enables them. This does not impact transparent retries, which +// will happen automatically if no data is written to the wire or if the RPC is +// unprocessed by the remote server. +// +// Retry support is currently disabled by default, but will be enabled by +// default in the future. Until then, it may be enabled by setting the +// environment variable "GRPC_GO_RETRY" to "on". +// +// This API is EXPERIMENTAL. +func WithDisableRetry() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.disableRetry = true + }) +} + +// WithMaxHeaderListSize returns a DialOption that specifies the maximum +// (uncompressed) size of header list that the client is prepared to accept. +func WithMaxHeaderListSize(s uint32) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.copts.MaxHeaderListSize = &s + }) +} + +// WithDisableHealthCheck disables the LB channel health checking for all +// SubConns of this ClientConn. +// +// This API is EXPERIMENTAL. +func WithDisableHealthCheck() DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.disableHealthCheck = true + }) +} + +// withHealthCheckFunc replaces the default health check function with the +// provided one. It makes tests easier to change the health check function. +// +// For testing purpose only. +func withHealthCheckFunc(f internal.HealthChecker) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.healthCheckFunc = f + }) +} + +func defaultDialOptions() dialOptions { + return dialOptions{ + disableRetry: !envconfig.Retry, + healthCheckFunc: internal.HealthCheckFunc, + copts: transport.ConnectOptions{ + WriteBufferSize: defaultWriteBufSize, + ReadBufferSize: defaultReadBufSize, + }, + resolveNowBackoff: internalbackoff.DefaultExponential.Backoff, + withProxy: true, + } +} + +// withGetMinConnectDeadline specifies the function that clientconn uses to +// get minConnectDeadline. This can be used to make connection attempts happen +// faster/slower. +// +// For testing purpose only. +func withMinConnectDeadline(f func() time.Duration) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.minConnectTimeout = f + }) +} + +// withResolveNowBackoff specifies the function that clientconn uses to backoff +// between successive calls to resolver.ResolveNow(). +// +// For testing purpose only. +func withResolveNowBackoff(f func(int) time.Duration) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.resolveNowBackoff = f + }) +} + +// WithResolvers allows a list of resolver implementations to be registered +// locally with the ClientConn without needing to be globally registered via +// resolver.Register. They will be matched against the scheme used for the +// current Dial only, and will take precedence over the global registry. +// +// This API is EXPERIMENTAL. +func WithResolvers(rs ...resolver.Builder) DialOption { + return newFuncDialOption(func(o *dialOptions) { + o.resolvers = append(o.resolvers, rs...) + }) +} diff --git a/vendor/google.golang.org/grpc/doc.go b/vendor/google.golang.org/grpc/doc.go new file mode 100644 index 000000000..0022859ad --- /dev/null +++ b/vendor/google.golang.org/grpc/doc.go @@ -0,0 +1,26 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +//go:generate ./regenerate.sh + +/* +Package grpc implements an RPC system called gRPC. + +See grpc.io for more information about gRPC. +*/ +package grpc // import "google.golang.org/grpc" diff --git a/vendor/google.golang.org/grpc/encoding/encoding.go b/vendor/google.golang.org/grpc/encoding/encoding.go new file mode 100644 index 000000000..195e8448b --- /dev/null +++ b/vendor/google.golang.org/grpc/encoding/encoding.go @@ -0,0 +1,122 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package encoding defines the interface for the compressor and codec, and +// functions to register and retrieve compressors and codecs. +// +// This package is EXPERIMENTAL. +package encoding + +import ( + "io" + "strings" +) + +// Identity specifies the optional encoding for uncompressed streams. +// It is intended for grpc internal use only. +const Identity = "identity" + +// Compressor is used for compressing and decompressing when sending or +// receiving messages. +type Compressor interface { + // Compress writes the data written to wc to w after compressing it. If an + // error occurs while initializing the compressor, that error is returned + // instead. + Compress(w io.Writer) (io.WriteCloser, error) + // Decompress reads data from r, decompresses it, and provides the + // uncompressed data via the returned io.Reader. If an error occurs while + // initializing the decompressor, that error is returned instead. + Decompress(r io.Reader) (io.Reader, error) + // Name is the name of the compression codec and is used to set the content + // coding header. The result must be static; the result cannot change + // between calls. + Name() string + // EXPERIMENTAL: if a Compressor implements + // DecompressedSize(compressedBytes []byte) int, gRPC will call it + // to determine the size of the buffer allocated for the result of decompression. + // Return -1 to indicate unknown size. +} + +var registeredCompressor = make(map[string]Compressor) + +// RegisterCompressor registers the compressor with gRPC by its name. It can +// be activated when sending an RPC via grpc.UseCompressor(). It will be +// automatically accessed when receiving a message based on the content coding +// header. Servers also use it to send a response with the same encoding as +// the request. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple Compressors are +// registered with the same name, the one registered last will take effect. +func RegisterCompressor(c Compressor) { + registeredCompressor[c.Name()] = c +} + +// GetCompressor returns Compressor for the given compressor name. +func GetCompressor(name string) Compressor { + return registeredCompressor[name] +} + +// Codec defines the interface gRPC uses to encode and decode messages. Note +// that implementations of this interface must be thread safe; a Codec's +// methods can be called from concurrent goroutines. +type Codec interface { + // Marshal returns the wire format of v. + Marshal(v interface{}) ([]byte, error) + // Unmarshal parses the wire format into v. + Unmarshal(data []byte, v interface{}) error + // Name returns the name of the Codec implementation. The returned string + // will be used as part of content type in transmission. The result must be + // static; the result cannot change between calls. + Name() string +} + +var registeredCodecs = make(map[string]Codec) + +// RegisterCodec registers the provided Codec for use with all gRPC clients and +// servers. +// +// The Codec will be stored and looked up by result of its Name() method, which +// should match the content-subtype of the encoding handled by the Codec. This +// is case-insensitive, and is stored and looked up as lowercase. If the +// result of calling Name() is an empty string, RegisterCodec will panic. See +// Content-Type on +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple Compressors are +// registered with the same name, the one registered last will take effect. +func RegisterCodec(codec Codec) { + if codec == nil { + panic("cannot register a nil Codec") + } + if codec.Name() == "" { + panic("cannot register Codec with empty string result for Name()") + } + contentSubtype := strings.ToLower(codec.Name()) + registeredCodecs[contentSubtype] = codec +} + +// GetCodec gets a registered Codec by content-subtype, or nil if no Codec is +// registered for the content-subtype. +// +// The content-subtype is expected to be lowercase. +func GetCodec(contentSubtype string) Codec { + return registeredCodecs[contentSubtype] +} diff --git a/vendor/google.golang.org/grpc/encoding/proto/proto.go b/vendor/google.golang.org/grpc/encoding/proto/proto.go new file mode 100644 index 000000000..66b97a6f6 --- /dev/null +++ b/vendor/google.golang.org/grpc/encoding/proto/proto.go @@ -0,0 +1,110 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package proto defines the protobuf codec. Importing this package will +// register the codec. +package proto + +import ( + "math" + "sync" + + "github.com/golang/protobuf/proto" + "google.golang.org/grpc/encoding" +) + +// Name is the name registered for the proto compressor. +const Name = "proto" + +func init() { + encoding.RegisterCodec(codec{}) +} + +// codec is a Codec implementation with protobuf. It is the default codec for gRPC. +type codec struct{} + +type cachedProtoBuffer struct { + lastMarshaledSize uint32 + proto.Buffer +} + +func capToMaxInt32(val int) uint32 { + if val > math.MaxInt32 { + return uint32(math.MaxInt32) + } + return uint32(val) +} + +func marshal(v interface{}, cb *cachedProtoBuffer) ([]byte, error) { + protoMsg := v.(proto.Message) + newSlice := make([]byte, 0, cb.lastMarshaledSize) + + cb.SetBuf(newSlice) + cb.Reset() + if err := cb.Marshal(protoMsg); err != nil { + return nil, err + } + out := cb.Bytes() + cb.lastMarshaledSize = capToMaxInt32(len(out)) + return out, nil +} + +func (codec) Marshal(v interface{}) ([]byte, error) { + if pm, ok := v.(proto.Marshaler); ok { + // object can marshal itself, no need for buffer + return pm.Marshal() + } + + cb := protoBufferPool.Get().(*cachedProtoBuffer) + out, err := marshal(v, cb) + + // put back buffer and lose the ref to the slice + cb.SetBuf(nil) + protoBufferPool.Put(cb) + return out, err +} + +func (codec) Unmarshal(data []byte, v interface{}) error { + protoMsg := v.(proto.Message) + protoMsg.Reset() + + if pu, ok := protoMsg.(proto.Unmarshaler); ok { + // object can unmarshal itself, no need for buffer + return pu.Unmarshal(data) + } + + cb := protoBufferPool.Get().(*cachedProtoBuffer) + cb.SetBuf(data) + err := cb.Unmarshal(protoMsg) + cb.SetBuf(nil) + protoBufferPool.Put(cb) + return err +} + +func (codec) Name() string { + return Name +} + +var protoBufferPool = &sync.Pool{ + New: func() interface{} { + return &cachedProtoBuffer{ + Buffer: proto.Buffer{}, + lastMarshaledSize: 16, + } + }, +} diff --git a/vendor/google.golang.org/grpc/go.mod b/vendor/google.golang.org/grpc/go.mod new file mode 100644 index 000000000..31f2b01f6 --- /dev/null +++ b/vendor/google.golang.org/grpc/go.mod @@ -0,0 +1,15 @@ +module google.golang.org/grpc + +go 1.11 + +require ( + github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f + github.com/envoyproxy/go-control-plane v0.9.4 + github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b + github.com/golang/protobuf v1.3.3 + github.com/google/go-cmp v0.4.0 + golang.org/x/net v0.0.0-20190311183353-d8887717615a + golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be + golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 +) diff --git a/vendor/google.golang.org/grpc/go.sum b/vendor/google.golang.org/grpc/go.sum new file mode 100644 index 000000000..be8078eac --- /dev/null +++ b/vendor/google.golang.org/grpc/go.sum @@ -0,0 +1,68 @@ +cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4 h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1 h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135 h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/google.golang.org/grpc/grpclog/component.go b/vendor/google.golang.org/grpc/grpclog/component.go new file mode 100644 index 000000000..b513281a3 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/component.go @@ -0,0 +1,117 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpclog + +import ( + "fmt" + + "google.golang.org/grpc/internal/grpclog" +) + +// componentData records the settings for a component. +type componentData struct { + name string +} + +var cache = map[string]*componentData{} + +func (c *componentData) InfoDepth(depth int, args ...interface{}) { + args = append([]interface{}{"[" + string(c.name) + "]"}, args...) + grpclog.InfoDepth(depth+1, args...) +} + +func (c *componentData) WarningDepth(depth int, args ...interface{}) { + args = append([]interface{}{"[" + string(c.name) + "]"}, args...) + grpclog.WarningDepth(depth+1, args...) +} + +func (c *componentData) ErrorDepth(depth int, args ...interface{}) { + args = append([]interface{}{"[" + string(c.name) + "]"}, args...) + grpclog.ErrorDepth(depth+1, args...) +} + +func (c *componentData) FatalDepth(depth int, args ...interface{}) { + args = append([]interface{}{"[" + string(c.name) + "]"}, args...) + grpclog.FatalDepth(depth+1, args...) +} + +func (c *componentData) Info(args ...interface{}) { + c.InfoDepth(1, args...) +} + +func (c *componentData) Warning(args ...interface{}) { + c.WarningDepth(1, args...) +} + +func (c *componentData) Error(args ...interface{}) { + c.ErrorDepth(1, args...) +} + +func (c *componentData) Fatal(args ...interface{}) { + c.FatalDepth(1, args...) +} + +func (c *componentData) Infof(format string, args ...interface{}) { + c.InfoDepth(1, fmt.Sprintf(format, args...)) +} + +func (c *componentData) Warningf(format string, args ...interface{}) { + c.WarningDepth(1, fmt.Sprintf(format, args...)) +} + +func (c *componentData) Errorf(format string, args ...interface{}) { + c.ErrorDepth(1, fmt.Sprintf(format, args...)) +} + +func (c *componentData) Fatalf(format string, args ...interface{}) { + c.FatalDepth(1, fmt.Sprintf(format, args...)) +} + +func (c *componentData) Infoln(args ...interface{}) { + c.InfoDepth(1, args...) +} + +func (c *componentData) Warningln(args ...interface{}) { + c.WarningDepth(1, args...) +} + +func (c *componentData) Errorln(args ...interface{}) { + c.ErrorDepth(1, args...) +} + +func (c *componentData) Fatalln(args ...interface{}) { + c.FatalDepth(1, args...) +} + +func (c *componentData) V(l int) bool { + return grpclog.Logger.V(l) +} + +// Component creates a new component and returns it for logging. If a component +// with the name already exists, nothing will be created and it will be +// returned. SetLoggerV2 will panic if it is called with a logger created by +// Component. +func Component(componentName string) DepthLoggerV2 { + if cData, ok := cache[componentName]; ok { + return cData + } + c := &componentData{componentName} + cache[componentName] = c + return c +} diff --git a/vendor/google.golang.org/grpc/grpclog/grpclog.go b/vendor/google.golang.org/grpc/grpclog/grpclog.go new file mode 100644 index 000000000..c8bb2be34 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/grpclog.go @@ -0,0 +1,132 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpclog defines logging for grpc. +// +// All logs in transport and grpclb packages only go to verbose level 2. +// All logs in other packages in grpc are logged in spite of the verbosity level. +// +// In the default logger, +// severity level can be set by environment variable GRPC_GO_LOG_SEVERITY_LEVEL, +// verbosity level can be set by GRPC_GO_LOG_VERBOSITY_LEVEL. +package grpclog // import "google.golang.org/grpc/grpclog" + +import ( + "os" + + "google.golang.org/grpc/internal/grpclog" +) + +func init() { + SetLoggerV2(newLoggerV2()) +} + +// V reports whether verbosity level l is at least the requested verbose level. +func V(l int) bool { + return grpclog.Logger.V(l) +} + +// Info logs to the INFO log. +func Info(args ...interface{}) { + grpclog.Logger.Info(args...) +} + +// Infof logs to the INFO log. Arguments are handled in the manner of fmt.Printf. +func Infof(format string, args ...interface{}) { + grpclog.Logger.Infof(format, args...) +} + +// Infoln logs to the INFO log. Arguments are handled in the manner of fmt.Println. +func Infoln(args ...interface{}) { + grpclog.Logger.Infoln(args...) +} + +// Warning logs to the WARNING log. +func Warning(args ...interface{}) { + grpclog.Logger.Warning(args...) +} + +// Warningf logs to the WARNING log. Arguments are handled in the manner of fmt.Printf. +func Warningf(format string, args ...interface{}) { + grpclog.Logger.Warningf(format, args...) +} + +// Warningln logs to the WARNING log. Arguments are handled in the manner of fmt.Println. +func Warningln(args ...interface{}) { + grpclog.Logger.Warningln(args...) +} + +// Error logs to the ERROR log. +func Error(args ...interface{}) { + grpclog.Logger.Error(args...) +} + +// Errorf logs to the ERROR log. Arguments are handled in the manner of fmt.Printf. +func Errorf(format string, args ...interface{}) { + grpclog.Logger.Errorf(format, args...) +} + +// Errorln logs to the ERROR log. Arguments are handled in the manner of fmt.Println. +func Errorln(args ...interface{}) { + grpclog.Logger.Errorln(args...) +} + +// Fatal logs to the FATAL log. Arguments are handled in the manner of fmt.Print. +// It calls os.Exit() with exit code 1. +func Fatal(args ...interface{}) { + grpclog.Logger.Fatal(args...) + // Make sure fatal logs will exit. + os.Exit(1) +} + +// Fatalf logs to the FATAL log. Arguments are handled in the manner of fmt.Printf. +// It calls os.Exit() with exit code 1. +func Fatalf(format string, args ...interface{}) { + grpclog.Logger.Fatalf(format, args...) + // Make sure fatal logs will exit. + os.Exit(1) +} + +// Fatalln logs to the FATAL log. Arguments are handled in the manner of fmt.Println. +// It calle os.Exit()) with exit code 1. +func Fatalln(args ...interface{}) { + grpclog.Logger.Fatalln(args...) + // Make sure fatal logs will exit. + os.Exit(1) +} + +// Print prints to the logger. Arguments are handled in the manner of fmt.Print. +// +// Deprecated: use Info. +func Print(args ...interface{}) { + grpclog.Logger.Info(args...) +} + +// Printf prints to the logger. Arguments are handled in the manner of fmt.Printf. +// +// Deprecated: use Infof. +func Printf(format string, args ...interface{}) { + grpclog.Logger.Infof(format, args...) +} + +// Println prints to the logger. Arguments are handled in the manner of fmt.Println. +// +// Deprecated: use Infoln. +func Println(args ...interface{}) { + grpclog.Logger.Infoln(args...) +} diff --git a/vendor/google.golang.org/grpc/grpclog/logger.go b/vendor/google.golang.org/grpc/grpclog/logger.go new file mode 100644 index 000000000..ef06a4822 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/logger.go @@ -0,0 +1,87 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpclog + +import "google.golang.org/grpc/internal/grpclog" + +// Logger mimics golang's standard Logger as an interface. +// +// Deprecated: use LoggerV2. +type Logger interface { + Fatal(args ...interface{}) + Fatalf(format string, args ...interface{}) + Fatalln(args ...interface{}) + Print(args ...interface{}) + Printf(format string, args ...interface{}) + Println(args ...interface{}) +} + +// SetLogger sets the logger that is used in grpc. Call only from +// init() functions. +// +// Deprecated: use SetLoggerV2. +func SetLogger(l Logger) { + grpclog.Logger = &loggerWrapper{Logger: l} +} + +// loggerWrapper wraps Logger into a LoggerV2. +type loggerWrapper struct { + Logger +} + +func (g *loggerWrapper) Info(args ...interface{}) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Infoln(args ...interface{}) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Infof(format string, args ...interface{}) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) Warning(args ...interface{}) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Warningln(args ...interface{}) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Warningf(format string, args ...interface{}) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) Error(args ...interface{}) { + g.Logger.Print(args...) +} + +func (g *loggerWrapper) Errorln(args ...interface{}) { + g.Logger.Println(args...) +} + +func (g *loggerWrapper) Errorf(format string, args ...interface{}) { + g.Logger.Printf(format, args...) +} + +func (g *loggerWrapper) V(l int) bool { + // Returns true for all verbose level. + return true +} diff --git a/vendor/google.golang.org/grpc/grpclog/loggerv2.go b/vendor/google.golang.org/grpc/grpclog/loggerv2.go new file mode 100644 index 000000000..8eba2d0e0 --- /dev/null +++ b/vendor/google.golang.org/grpc/grpclog/loggerv2.go @@ -0,0 +1,218 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpclog + +import ( + "io" + "io/ioutil" + "log" + "os" + "strconv" + + "google.golang.org/grpc/internal/grpclog" +) + +// LoggerV2 does underlying logging work for grpclog. +type LoggerV2 interface { + // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. + Info(args ...interface{}) + // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. + Infoln(args ...interface{}) + // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. + Infof(format string, args ...interface{}) + // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. + Warning(args ...interface{}) + // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. + Warningln(args ...interface{}) + // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. + Warningf(format string, args ...interface{}) + // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. + Error(args ...interface{}) + // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + Errorln(args ...interface{}) + // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + Errorf(format string, args ...interface{}) + // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatal(args ...interface{}) + // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalln(args ...interface{}) + // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalf(format string, args ...interface{}) + // V reports whether verbosity level l is at least the requested verbose level. + V(l int) bool +} + +// SetLoggerV2 sets logger that is used in grpc to a V2 logger. +// Not mutex-protected, should be called before any gRPC functions. +func SetLoggerV2(l LoggerV2) { + if _, ok := l.(*componentData); ok { + panic("cannot use component logger as grpclog logger") + } + grpclog.Logger = l + grpclog.DepthLogger, _ = l.(grpclog.DepthLoggerV2) +} + +const ( + // infoLog indicates Info severity. + infoLog int = iota + // warningLog indicates Warning severity. + warningLog + // errorLog indicates Error severity. + errorLog + // fatalLog indicates Fatal severity. + fatalLog +) + +// severityName contains the string representation of each severity. +var severityName = []string{ + infoLog: "INFO", + warningLog: "WARNING", + errorLog: "ERROR", + fatalLog: "FATAL", +} + +// loggerT is the default logger used by grpclog. +type loggerT struct { + m []*log.Logger + v int +} + +// NewLoggerV2 creates a loggerV2 with the provided writers. +// Fatal logs will be written to errorW, warningW, infoW, followed by exit(1). +// Error logs will be written to errorW, warningW and infoW. +// Warning logs will be written to warningW and infoW. +// Info logs will be written to infoW. +func NewLoggerV2(infoW, warningW, errorW io.Writer) LoggerV2 { + return NewLoggerV2WithVerbosity(infoW, warningW, errorW, 0) +} + +// NewLoggerV2WithVerbosity creates a loggerV2 with the provided writers and +// verbosity level. +func NewLoggerV2WithVerbosity(infoW, warningW, errorW io.Writer, v int) LoggerV2 { + var m []*log.Logger + m = append(m, log.New(infoW, severityName[infoLog]+": ", log.LstdFlags)) + m = append(m, log.New(io.MultiWriter(infoW, warningW), severityName[warningLog]+": ", log.LstdFlags)) + ew := io.MultiWriter(infoW, warningW, errorW) // ew will be used for error and fatal. + m = append(m, log.New(ew, severityName[errorLog]+": ", log.LstdFlags)) + m = append(m, log.New(ew, severityName[fatalLog]+": ", log.LstdFlags)) + return &loggerT{m: m, v: v} +} + +// newLoggerV2 creates a loggerV2 to be used as default logger. +// All logs are written to stderr. +func newLoggerV2() LoggerV2 { + errorW := ioutil.Discard + warningW := ioutil.Discard + infoW := ioutil.Discard + + logLevel := os.Getenv("GRPC_GO_LOG_SEVERITY_LEVEL") + switch logLevel { + case "", "ERROR", "error": // If env is unset, set level to ERROR. + errorW = os.Stderr + case "WARNING", "warning": + warningW = os.Stderr + case "INFO", "info": + infoW = os.Stderr + } + + var v int + vLevel := os.Getenv("GRPC_GO_LOG_VERBOSITY_LEVEL") + if vl, err := strconv.Atoi(vLevel); err == nil { + v = vl + } + return NewLoggerV2WithVerbosity(infoW, warningW, errorW, v) +} + +func (g *loggerT) Info(args ...interface{}) { + g.m[infoLog].Print(args...) +} + +func (g *loggerT) Infoln(args ...interface{}) { + g.m[infoLog].Println(args...) +} + +func (g *loggerT) Infof(format string, args ...interface{}) { + g.m[infoLog].Printf(format, args...) +} + +func (g *loggerT) Warning(args ...interface{}) { + g.m[warningLog].Print(args...) +} + +func (g *loggerT) Warningln(args ...interface{}) { + g.m[warningLog].Println(args...) +} + +func (g *loggerT) Warningf(format string, args ...interface{}) { + g.m[warningLog].Printf(format, args...) +} + +func (g *loggerT) Error(args ...interface{}) { + g.m[errorLog].Print(args...) +} + +func (g *loggerT) Errorln(args ...interface{}) { + g.m[errorLog].Println(args...) +} + +func (g *loggerT) Errorf(format string, args ...interface{}) { + g.m[errorLog].Printf(format, args...) +} + +func (g *loggerT) Fatal(args ...interface{}) { + g.m[fatalLog].Fatal(args...) + // No need to call os.Exit() again because log.Logger.Fatal() calls os.Exit(). +} + +func (g *loggerT) Fatalln(args ...interface{}) { + g.m[fatalLog].Fatalln(args...) + // No need to call os.Exit() again because log.Logger.Fatal() calls os.Exit(). +} + +func (g *loggerT) Fatalf(format string, args ...interface{}) { + g.m[fatalLog].Fatalf(format, args...) + // No need to call os.Exit() again because log.Logger.Fatal() calls os.Exit(). +} + +func (g *loggerT) V(l int) bool { + return l <= g.v +} + +// DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements +// DepthLoggerV2, the below functions will be called with the appropriate stack +// depth set for trivial functions the logger may ignore. +// +// This API is EXPERIMENTAL. +type DepthLoggerV2 interface { + LoggerV2 + // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Print. + InfoDepth(depth int, args ...interface{}) + // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Print. + WarningDepth(depth int, args ...interface{}) + // ErrorDetph logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Print. + ErrorDepth(depth int, args ...interface{}) + // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Print. + FatalDepth(depth int, args ...interface{}) +} diff --git a/vendor/google.golang.org/grpc/install_gae.sh b/vendor/google.golang.org/grpc/install_gae.sh new file mode 100644 index 000000000..7c7bcada5 --- /dev/null +++ b/vendor/google.golang.org/grpc/install_gae.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +TMP=$(mktemp -d /tmp/sdk.XXX) \ +&& curl -o $TMP.zip "https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-1.9.68.zip" \ +&& unzip -q $TMP.zip -d $TMP \ +&& export PATH="$PATH:$TMP/go_appengine" diff --git a/vendor/google.golang.org/grpc/interceptor.go b/vendor/google.golang.org/grpc/interceptor.go new file mode 100644 index 000000000..8b7350022 --- /dev/null +++ b/vendor/google.golang.org/grpc/interceptor.go @@ -0,0 +1,77 @@ +/* + * + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" +) + +// UnaryInvoker is called by UnaryClientInterceptor to complete RPCs. +type UnaryInvoker func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, opts ...CallOption) error + +// UnaryClientInterceptor intercepts the execution of a unary RPC on the client. invoker is the handler to complete the RPC +// and it is the responsibility of the interceptor to call it. +// This is an EXPERIMENTAL API. +type UnaryClientInterceptor func(ctx context.Context, method string, req, reply interface{}, cc *ClientConn, invoker UnaryInvoker, opts ...CallOption) error + +// Streamer is called by StreamClientInterceptor to create a ClientStream. +type Streamer func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) + +// StreamClientInterceptor intercepts the creation of ClientStream. It may return a custom ClientStream to intercept all I/O +// operations. streamer is the handler to create a ClientStream and it is the responsibility of the interceptor to call it. +// This is an EXPERIMENTAL API. +type StreamClientInterceptor func(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, streamer Streamer, opts ...CallOption) (ClientStream, error) + +// UnaryServerInfo consists of various information about a unary RPC on +// server side. All per-rpc information may be mutated by the interceptor. +type UnaryServerInfo struct { + // Server is the service implementation the user provides. This is read-only. + Server interface{} + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string +} + +// UnaryHandler defines the handler invoked by UnaryServerInterceptor to complete the normal +// execution of a unary RPC. If a UnaryHandler returns an error, it should be produced by the +// status package, or else gRPC will use codes.Unknown as the status code and err.Error() as +// the status message of the RPC. +type UnaryHandler func(ctx context.Context, req interface{}) (interface{}, error) + +// UnaryServerInterceptor provides a hook to intercept the execution of a unary RPC on the server. info +// contains all the information of this RPC the interceptor can operate on. And handler is the wrapper +// of the service method implementation. It is the responsibility of the interceptor to invoke handler +// to complete the RPC. +type UnaryServerInterceptor func(ctx context.Context, req interface{}, info *UnaryServerInfo, handler UnaryHandler) (resp interface{}, err error) + +// StreamServerInfo consists of various information about a streaming RPC on +// server side. All per-rpc information may be mutated by the interceptor. +type StreamServerInfo struct { + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string + // IsClientStream indicates whether the RPC is a client streaming RPC. + IsClientStream bool + // IsServerStream indicates whether the RPC is a server streaming RPC. + IsServerStream bool +} + +// StreamServerInterceptor provides a hook to intercept the execution of a streaming RPC on the server. +// info contains all the information of this RPC the interceptor can operate on. And handler is the +// service method implementation. It is the responsibility of the interceptor to invoke handler to +// complete the RPC. +type StreamServerInterceptor func(srv interface{}, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error diff --git a/vendor/google.golang.org/grpc/internal/backoff/backoff.go b/vendor/google.golang.org/grpc/internal/backoff/backoff.go new file mode 100644 index 000000000..5fc0ee3da --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/backoff/backoff.go @@ -0,0 +1,73 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package backoff implement the backoff strategy for gRPC. +// +// This is kept in internal until the gRPC project decides whether or not to +// allow alternative backoff strategies. +package backoff + +import ( + "time" + + grpcbackoff "google.golang.org/grpc/backoff" + "google.golang.org/grpc/internal/grpcrand" +) + +// Strategy defines the methodology for backing off after a grpc connection +// failure. +type Strategy interface { + // Backoff returns the amount of time to wait before the next retry given + // the number of consecutive failures. + Backoff(retries int) time.Duration +} + +// DefaultExponential is an exponential backoff implementation using the +// default values for all the configurable knobs defined in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +var DefaultExponential = Exponential{Config: grpcbackoff.DefaultConfig} + +// Exponential implements exponential backoff algorithm as defined in +// https://github.com/grpc/grpc/blob/master/doc/connection-backoff.md. +type Exponential struct { + // Config contains all options to configure the backoff algorithm. + Config grpcbackoff.Config +} + +// Backoff returns the amount of time to wait before the next retry given the +// number of retries. +func (bc Exponential) Backoff(retries int) time.Duration { + if retries == 0 { + return bc.Config.BaseDelay + } + backoff, max := float64(bc.Config.BaseDelay), float64(bc.Config.MaxDelay) + for backoff < max && retries > 0 { + backoff *= bc.Config.Multiplier + retries-- + } + if backoff > max { + backoff = max + } + // Randomize backoff delays so that if a cluster of requests start at + // the same time, they won't operate in lockstep. + backoff *= 1 + bc.Config.Jitter*(grpcrand.Float64()*2-1) + if backoff < 0 { + return 0 + } + return time.Duration(backoff) +} diff --git a/vendor/google.golang.org/grpc/internal/balancerload/load.go b/vendor/google.golang.org/grpc/internal/balancerload/load.go new file mode 100644 index 000000000..3a905d966 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/balancerload/load.go @@ -0,0 +1,46 @@ +/* + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Package balancerload defines APIs to parse server loads in trailers. The +// parsed loads are sent to balancers in DoneInfo. +package balancerload + +import ( + "google.golang.org/grpc/metadata" +) + +// Parser converts loads from metadata into a concrete type. +type Parser interface { + // Parse parses loads from metadata. + Parse(md metadata.MD) interface{} +} + +var parser Parser + +// SetParser sets the load parser. +// +// Not mutex-protected, should be called before any gRPC functions. +func SetParser(lr Parser) { + parser = lr +} + +// Parse calls parser.Read(). +func Parse(md metadata.MD) interface{} { + if parser == nil { + return nil + } + return parser.Parse(md) +} diff --git a/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go new file mode 100644 index 000000000..5cc3aeddb --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/binarylog/binarylog.go @@ -0,0 +1,170 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package binarylog implementation binary logging as defined in +// https://github.com/grpc/proposal/blob/master/A16-binary-logging.md. +package binarylog + +import ( + "fmt" + "os" + + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/grpcutil" +) + +// Logger is the global binary logger. It can be used to get binary logger for +// each method. +type Logger interface { + getMethodLogger(methodName string) *MethodLogger +} + +// binLogger is the global binary logger for the binary. One of this should be +// built at init time from the configuration (environment variable or flags). +// +// It is used to get a methodLogger for each individual method. +var binLogger Logger + +var grpclogLogger = grpclog.Component("binarylog") + +// SetLogger sets the binarg logger. +// +// Only call this at init time. +func SetLogger(l Logger) { + binLogger = l +} + +// GetMethodLogger returns the methodLogger for the given methodName. +// +// methodName should be in the format of "/service/method". +// +// Each methodLogger returned by this method is a new instance. This is to +// generate sequence id within the call. +func GetMethodLogger(methodName string) *MethodLogger { + if binLogger == nil { + return nil + } + return binLogger.getMethodLogger(methodName) +} + +func init() { + const envStr = "GRPC_BINARY_LOG_FILTER" + configStr := os.Getenv(envStr) + binLogger = NewLoggerFromConfigString(configStr) +} + +type methodLoggerConfig struct { + // Max length of header and message. + hdr, msg uint64 +} + +type logger struct { + all *methodLoggerConfig + services map[string]*methodLoggerConfig + methods map[string]*methodLoggerConfig + + blacklist map[string]struct{} +} + +// newEmptyLogger creates an empty logger. The map fields need to be filled in +// using the set* functions. +func newEmptyLogger() *logger { + return &logger{} +} + +// Set method logger for "*". +func (l *logger) setDefaultMethodLogger(ml *methodLoggerConfig) error { + if l.all != nil { + return fmt.Errorf("conflicting global rules found") + } + l.all = ml + return nil +} + +// Set method logger for "service/*". +// +// New methodLogger with same service overrides the old one. +func (l *logger) setServiceMethodLogger(service string, ml *methodLoggerConfig) error { + if _, ok := l.services[service]; ok { + return fmt.Errorf("conflicting service rules for service %v found", service) + } + if l.services == nil { + l.services = make(map[string]*methodLoggerConfig) + } + l.services[service] = ml + return nil +} + +// Set method logger for "service/method". +// +// New methodLogger with same method overrides the old one. +func (l *logger) setMethodMethodLogger(method string, ml *methodLoggerConfig) error { + if _, ok := l.blacklist[method]; ok { + return fmt.Errorf("conflicting blacklist rules for method %v found", method) + } + if _, ok := l.methods[method]; ok { + return fmt.Errorf("conflicting method rules for method %v found", method) + } + if l.methods == nil { + l.methods = make(map[string]*methodLoggerConfig) + } + l.methods[method] = ml + return nil +} + +// Set blacklist method for "-service/method". +func (l *logger) setBlacklist(method string) error { + if _, ok := l.blacklist[method]; ok { + return fmt.Errorf("conflicting blacklist rules for method %v found", method) + } + if _, ok := l.methods[method]; ok { + return fmt.Errorf("conflicting method rules for method %v found", method) + } + if l.blacklist == nil { + l.blacklist = make(map[string]struct{}) + } + l.blacklist[method] = struct{}{} + return nil +} + +// getMethodLogger returns the methodLogger for the given methodName. +// +// methodName should be in the format of "/service/method". +// +// Each methodLogger returned by this method is a new instance. This is to +// generate sequence id within the call. +func (l *logger) getMethodLogger(methodName string) *MethodLogger { + s, m, err := grpcutil.ParseMethod(methodName) + if err != nil { + grpclogLogger.Infof("binarylogging: failed to parse %q: %v", methodName, err) + return nil + } + if ml, ok := l.methods[s+"/"+m]; ok { + return newMethodLogger(ml.hdr, ml.msg) + } + if _, ok := l.blacklist[s+"/"+m]; ok { + return nil + } + if ml, ok := l.services[s]; ok { + return newMethodLogger(ml.hdr, ml.msg) + } + if l.all == nil { + return nil + } + return newMethodLogger(l.all.hdr, l.all.msg) +} diff --git a/vendor/google.golang.org/grpc/internal/binarylog/binarylog_testutil.go b/vendor/google.golang.org/grpc/internal/binarylog/binarylog_testutil.go new file mode 100644 index 000000000..1ee00a39a --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/binarylog/binarylog_testutil.go @@ -0,0 +1,42 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// This file contains exported variables/functions that are exported for testing +// only. +// +// An ideal way for this would be to put those in a *_test.go but in binarylog +// package. But this doesn't work with staticcheck with go module. Error was: +// "MdToMetadataProto not declared by package binarylog". This could be caused +// by the way staticcheck looks for files for a certain package, which doesn't +// support *_test.go files. +// +// Move those to binary_test.go when staticcheck is fixed. + +package binarylog + +var ( + // AllLogger is a logger that logs all headers/messages for all RPCs. It's + // for testing only. + AllLogger = NewLoggerFromConfigString("*") + // MdToMetadataProto converts metadata to a binary logging proto message. + // It's for testing only. + MdToMetadataProto = mdToMetadataProto + // AddrToProto converts an address to a binary logging proto message. It's + // for testing only. + AddrToProto = addrToProto +) diff --git a/vendor/google.golang.org/grpc/internal/binarylog/env_config.go b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go new file mode 100644 index 000000000..d8f4e7602 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/binarylog/env_config.go @@ -0,0 +1,208 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package binarylog + +import ( + "errors" + "fmt" + "regexp" + "strconv" + "strings" +) + +// NewLoggerFromConfigString reads the string and build a logger. It can be used +// to build a new logger and assign it to binarylog.Logger. +// +// Example filter config strings: +// - "" Nothing will be logged +// - "*" All headers and messages will be fully logged. +// - "*{h}" Only headers will be logged. +// - "*{m:256}" Only the first 256 bytes of each message will be logged. +// - "Foo/*" Logs every method in service Foo +// - "Foo/*,-Foo/Bar" Logs every method in service Foo except method /Foo/Bar +// - "Foo/*,Foo/Bar{m:256}" Logs the first 256 bytes of each message in method +// /Foo/Bar, logs all headers and messages in every other method in service +// Foo. +// +// If two configs exist for one certain method or service, the one specified +// later overrides the previous config. +func NewLoggerFromConfigString(s string) Logger { + if s == "" { + return nil + } + l := newEmptyLogger() + methods := strings.Split(s, ",") + for _, method := range methods { + if err := l.fillMethodLoggerWithConfigString(method); err != nil { + grpclogLogger.Warningf("failed to parse binary log config: %v", err) + return nil + } + } + return l +} + +// fillMethodLoggerWithConfigString parses config, creates methodLogger and adds +// it to the right map in the logger. +func (l *logger) fillMethodLoggerWithConfigString(config string) error { + // "" is invalid. + if config == "" { + return errors.New("empty string is not a valid method binary logging config") + } + + // "-service/method", blacklist, no * or {} allowed. + if config[0] == '-' { + s, m, suffix, err := parseMethodConfigAndSuffix(config[1:]) + if err != nil { + return fmt.Errorf("invalid config: %q, %v", config, err) + } + if m == "*" { + return fmt.Errorf("invalid config: %q, %v", config, "* not allowed in blacklist config") + } + if suffix != "" { + return fmt.Errorf("invalid config: %q, %v", config, "header/message limit not allowed in blacklist config") + } + if err := l.setBlacklist(s + "/" + m); err != nil { + return fmt.Errorf("invalid config: %v", err) + } + return nil + } + + // "*{h:256;m:256}" + if config[0] == '*' { + hdr, msg, err := parseHeaderMessageLengthConfig(config[1:]) + if err != nil { + return fmt.Errorf("invalid config: %q, %v", config, err) + } + if err := l.setDefaultMethodLogger(&methodLoggerConfig{hdr: hdr, msg: msg}); err != nil { + return fmt.Errorf("invalid config: %v", err) + } + return nil + } + + s, m, suffix, err := parseMethodConfigAndSuffix(config) + if err != nil { + return fmt.Errorf("invalid config: %q, %v", config, err) + } + hdr, msg, err := parseHeaderMessageLengthConfig(suffix) + if err != nil { + return fmt.Errorf("invalid header/message length config: %q, %v", suffix, err) + } + if m == "*" { + if err := l.setServiceMethodLogger(s, &methodLoggerConfig{hdr: hdr, msg: msg}); err != nil { + return fmt.Errorf("invalid config: %v", err) + } + } else { + if err := l.setMethodMethodLogger(s+"/"+m, &methodLoggerConfig{hdr: hdr, msg: msg}); err != nil { + return fmt.Errorf("invalid config: %v", err) + } + } + return nil +} + +const ( + // TODO: this const is only used by env_config now. But could be useful for + // other config. Move to binarylog.go if necessary. + maxUInt = ^uint64(0) + + // For "p.s/m" plus any suffix. Suffix will be parsed again. See test for + // expected output. + longMethodConfigRegexpStr = `^([\w./]+)/((?:\w+)|[*])(.+)?$` + + // For suffix from above, "{h:123,m:123}". See test for expected output. + optionalLengthRegexpStr = `(?::(\d+))?` // Optional ":123". + headerConfigRegexpStr = `^{h` + optionalLengthRegexpStr + `}$` + messageConfigRegexpStr = `^{m` + optionalLengthRegexpStr + `}$` + headerMessageConfigRegexpStr = `^{h` + optionalLengthRegexpStr + `;m` + optionalLengthRegexpStr + `}$` +) + +var ( + longMethodConfigRegexp = regexp.MustCompile(longMethodConfigRegexpStr) + headerConfigRegexp = regexp.MustCompile(headerConfigRegexpStr) + messageConfigRegexp = regexp.MustCompile(messageConfigRegexpStr) + headerMessageConfigRegexp = regexp.MustCompile(headerMessageConfigRegexpStr) +) + +// Turn "service/method{h;m}" into "service", "method", "{h;m}". +func parseMethodConfigAndSuffix(c string) (service, method, suffix string, _ error) { + // Regexp result: + // + // in: "p.s/m{h:123,m:123}", + // out: []string{"p.s/m{h:123,m:123}", "p.s", "m", "{h:123,m:123}"}, + match := longMethodConfigRegexp.FindStringSubmatch(c) + if match == nil { + return "", "", "", fmt.Errorf("%q contains invalid substring", c) + } + service = match[1] + method = match[2] + suffix = match[3] + return +} + +// Turn "{h:123;m:345}" into 123, 345. +// +// Return maxUInt if length is unspecified. +func parseHeaderMessageLengthConfig(c string) (hdrLenStr, msgLenStr uint64, err error) { + if c == "" { + return maxUInt, maxUInt, nil + } + // Header config only. + if match := headerConfigRegexp.FindStringSubmatch(c); match != nil { + if s := match[1]; s != "" { + hdrLenStr, err = strconv.ParseUint(s, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to convert %q to uint", s) + } + return hdrLenStr, 0, nil + } + return maxUInt, 0, nil + } + + // Message config only. + if match := messageConfigRegexp.FindStringSubmatch(c); match != nil { + if s := match[1]; s != "" { + msgLenStr, err = strconv.ParseUint(s, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to convert %q to uint", s) + } + return 0, msgLenStr, nil + } + return 0, maxUInt, nil + } + + // Header and message config both. + if match := headerMessageConfigRegexp.FindStringSubmatch(c); match != nil { + // Both hdr and msg are specified, but one or two of them might be empty. + hdrLenStr = maxUInt + msgLenStr = maxUInt + if s := match[1]; s != "" { + hdrLenStr, err = strconv.ParseUint(s, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to convert %q to uint", s) + } + } + if s := match[2]; s != "" { + msgLenStr, err = strconv.ParseUint(s, 10, 64) + if err != nil { + return 0, 0, fmt.Errorf("failed to convert %q to uint", s) + } + } + return hdrLenStr, msgLenStr, nil + } + return 0, 0, fmt.Errorf("%q contains invalid substring", c) +} diff --git a/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go new file mode 100644 index 000000000..5e1083539 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/binarylog/method_logger.go @@ -0,0 +1,422 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package binarylog + +import ( + "net" + "strings" + "sync/atomic" + "time" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" + pb "google.golang.org/grpc/binarylog/grpc_binarylog_v1" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" +) + +type callIDGenerator struct { + id uint64 +} + +func (g *callIDGenerator) next() uint64 { + id := atomic.AddUint64(&g.id, 1) + return id +} + +// reset is for testing only, and doesn't need to be thread safe. +func (g *callIDGenerator) reset() { + g.id = 0 +} + +var idGen callIDGenerator + +// MethodLogger is the sub-logger for each method. +type MethodLogger struct { + headerMaxLen, messageMaxLen uint64 + + callID uint64 + idWithinCallGen *callIDGenerator + + sink Sink // TODO(blog): make this plugable. +} + +func newMethodLogger(h, m uint64) *MethodLogger { + return &MethodLogger{ + headerMaxLen: h, + messageMaxLen: m, + + callID: idGen.next(), + idWithinCallGen: &callIDGenerator{}, + + sink: defaultSink, // TODO(blog): make it plugable. + } +} + +// Log creates a proto binary log entry, and logs it to the sink. +func (ml *MethodLogger) Log(c LogEntryConfig) { + m := c.toProto() + timestamp, _ := ptypes.TimestampProto(time.Now()) + m.Timestamp = timestamp + m.CallId = ml.callID + m.SequenceIdWithinCall = ml.idWithinCallGen.next() + + switch pay := m.Payload.(type) { + case *pb.GrpcLogEntry_ClientHeader: + m.PayloadTruncated = ml.truncateMetadata(pay.ClientHeader.GetMetadata()) + case *pb.GrpcLogEntry_ServerHeader: + m.PayloadTruncated = ml.truncateMetadata(pay.ServerHeader.GetMetadata()) + case *pb.GrpcLogEntry_Message: + m.PayloadTruncated = ml.truncateMessage(pay.Message) + } + + ml.sink.Write(m) +} + +func (ml *MethodLogger) truncateMetadata(mdPb *pb.Metadata) (truncated bool) { + if ml.headerMaxLen == maxUInt { + return false + } + var ( + bytesLimit = ml.headerMaxLen + index int + ) + // At the end of the loop, index will be the first entry where the total + // size is greater than the limit: + // + // len(entry[:index]) <= ml.hdr && len(entry[:index+1]) > ml.hdr. + for ; index < len(mdPb.Entry); index++ { + entry := mdPb.Entry[index] + if entry.Key == "grpc-trace-bin" { + // "grpc-trace-bin" is a special key. It's kept in the log entry, + // but not counted towards the size limit. + continue + } + currentEntryLen := uint64(len(entry.Value)) + if currentEntryLen > bytesLimit { + break + } + bytesLimit -= currentEntryLen + } + truncated = index < len(mdPb.Entry) + mdPb.Entry = mdPb.Entry[:index] + return truncated +} + +func (ml *MethodLogger) truncateMessage(msgPb *pb.Message) (truncated bool) { + if ml.messageMaxLen == maxUInt { + return false + } + if ml.messageMaxLen >= uint64(len(msgPb.Data)) { + return false + } + msgPb.Data = msgPb.Data[:ml.messageMaxLen] + return true +} + +// LogEntryConfig represents the configuration for binary log entry. +type LogEntryConfig interface { + toProto() *pb.GrpcLogEntry +} + +// ClientHeader configs the binary log entry to be a ClientHeader entry. +type ClientHeader struct { + OnClientSide bool + Header metadata.MD + MethodName string + Authority string + Timeout time.Duration + // PeerAddr is required only when it's on server side. + PeerAddr net.Addr +} + +func (c *ClientHeader) toProto() *pb.GrpcLogEntry { + // This function doesn't need to set all the fields (e.g. seq ID). The Log + // function will set the fields when necessary. + clientHeader := &pb.ClientHeader{ + Metadata: mdToMetadataProto(c.Header), + MethodName: c.MethodName, + Authority: c.Authority, + } + if c.Timeout > 0 { + clientHeader.Timeout = ptypes.DurationProto(c.Timeout) + } + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_CLIENT_HEADER, + Payload: &pb.GrpcLogEntry_ClientHeader{ + ClientHeader: clientHeader, + }, + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + if c.PeerAddr != nil { + ret.Peer = addrToProto(c.PeerAddr) + } + return ret +} + +// ServerHeader configs the binary log entry to be a ServerHeader entry. +type ServerHeader struct { + OnClientSide bool + Header metadata.MD + // PeerAddr is required only when it's on client side. + PeerAddr net.Addr +} + +func (c *ServerHeader) toProto() *pb.GrpcLogEntry { + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_SERVER_HEADER, + Payload: &pb.GrpcLogEntry_ServerHeader{ + ServerHeader: &pb.ServerHeader{ + Metadata: mdToMetadataProto(c.Header), + }, + }, + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + if c.PeerAddr != nil { + ret.Peer = addrToProto(c.PeerAddr) + } + return ret +} + +// ClientMessage configs the binary log entry to be a ClientMessage entry. +type ClientMessage struct { + OnClientSide bool + // Message can be a proto.Message or []byte. Other messages formats are not + // supported. + Message interface{} +} + +func (c *ClientMessage) toProto() *pb.GrpcLogEntry { + var ( + data []byte + err error + ) + if m, ok := c.Message.(proto.Message); ok { + data, err = proto.Marshal(m) + if err != nil { + grpclogLogger.Infof("binarylogging: failed to marshal proto message: %v", err) + } + } else if b, ok := c.Message.([]byte); ok { + data = b + } else { + grpclogLogger.Infof("binarylogging: message to log is neither proto.message nor []byte") + } + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_CLIENT_MESSAGE, + Payload: &pb.GrpcLogEntry_Message{ + Message: &pb.Message{ + Length: uint32(len(data)), + Data: data, + }, + }, + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + return ret +} + +// ServerMessage configs the binary log entry to be a ServerMessage entry. +type ServerMessage struct { + OnClientSide bool + // Message can be a proto.Message or []byte. Other messages formats are not + // supported. + Message interface{} +} + +func (c *ServerMessage) toProto() *pb.GrpcLogEntry { + var ( + data []byte + err error + ) + if m, ok := c.Message.(proto.Message); ok { + data, err = proto.Marshal(m) + if err != nil { + grpclogLogger.Infof("binarylogging: failed to marshal proto message: %v", err) + } + } else if b, ok := c.Message.([]byte); ok { + data = b + } else { + grpclogLogger.Infof("binarylogging: message to log is neither proto.message nor []byte") + } + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_SERVER_MESSAGE, + Payload: &pb.GrpcLogEntry_Message{ + Message: &pb.Message{ + Length: uint32(len(data)), + Data: data, + }, + }, + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + return ret +} + +// ClientHalfClose configs the binary log entry to be a ClientHalfClose entry. +type ClientHalfClose struct { + OnClientSide bool +} + +func (c *ClientHalfClose) toProto() *pb.GrpcLogEntry { + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_CLIENT_HALF_CLOSE, + Payload: nil, // No payload here. + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + return ret +} + +// ServerTrailer configs the binary log entry to be a ServerTrailer entry. +type ServerTrailer struct { + OnClientSide bool + Trailer metadata.MD + // Err is the status error. + Err error + // PeerAddr is required only when it's on client side and the RPC is trailer + // only. + PeerAddr net.Addr +} + +func (c *ServerTrailer) toProto() *pb.GrpcLogEntry { + st, ok := status.FromError(c.Err) + if !ok { + grpclogLogger.Info("binarylogging: error in trailer is not a status error") + } + var ( + detailsBytes []byte + err error + ) + stProto := st.Proto() + if stProto != nil && len(stProto.Details) != 0 { + detailsBytes, err = proto.Marshal(stProto) + if err != nil { + grpclogLogger.Infof("binarylogging: failed to marshal status proto: %v", err) + } + } + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_SERVER_TRAILER, + Payload: &pb.GrpcLogEntry_Trailer{ + Trailer: &pb.Trailer{ + Metadata: mdToMetadataProto(c.Trailer), + StatusCode: uint32(st.Code()), + StatusMessage: st.Message(), + StatusDetails: detailsBytes, + }, + }, + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + if c.PeerAddr != nil { + ret.Peer = addrToProto(c.PeerAddr) + } + return ret +} + +// Cancel configs the binary log entry to be a Cancel entry. +type Cancel struct { + OnClientSide bool +} + +func (c *Cancel) toProto() *pb.GrpcLogEntry { + ret := &pb.GrpcLogEntry{ + Type: pb.GrpcLogEntry_EVENT_TYPE_CANCEL, + Payload: nil, + } + if c.OnClientSide { + ret.Logger = pb.GrpcLogEntry_LOGGER_CLIENT + } else { + ret.Logger = pb.GrpcLogEntry_LOGGER_SERVER + } + return ret +} + +// metadataKeyOmit returns whether the metadata entry with this key should be +// omitted. +func metadataKeyOmit(key string) bool { + switch key { + case "lb-token", ":path", ":authority", "content-encoding", "content-type", "user-agent", "te": + return true + case "grpc-trace-bin": // grpc-trace-bin is special because it's visiable to users. + return false + } + return strings.HasPrefix(key, "grpc-") +} + +func mdToMetadataProto(md metadata.MD) *pb.Metadata { + ret := &pb.Metadata{} + for k, vv := range md { + if metadataKeyOmit(k) { + continue + } + for _, v := range vv { + ret.Entry = append(ret.Entry, + &pb.MetadataEntry{ + Key: k, + Value: []byte(v), + }, + ) + } + } + return ret +} + +func addrToProto(addr net.Addr) *pb.Address { + ret := &pb.Address{} + switch a := addr.(type) { + case *net.TCPAddr: + if a.IP.To4() != nil { + ret.Type = pb.Address_TYPE_IPV4 + } else if a.IP.To16() != nil { + ret.Type = pb.Address_TYPE_IPV6 + } else { + ret.Type = pb.Address_TYPE_UNKNOWN + // Do not set address and port fields. + break + } + ret.Address = a.IP.String() + ret.IpPort = uint32(a.Port) + case *net.UnixAddr: + ret.Type = pb.Address_TYPE_UNIX + ret.Address = a.String() + default: + ret.Type = pb.Address_TYPE_UNKNOWN + } + return ret +} diff --git a/vendor/google.golang.org/grpc/internal/binarylog/sink.go b/vendor/google.golang.org/grpc/internal/binarylog/sink.go new file mode 100644 index 000000000..835f51040 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/binarylog/sink.go @@ -0,0 +1,161 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package binarylog + +import ( + "bufio" + "encoding/binary" + "fmt" + "io" + "io/ioutil" + "sync" + "time" + + "github.com/golang/protobuf/proto" + pb "google.golang.org/grpc/binarylog/grpc_binarylog_v1" +) + +var ( + defaultSink Sink = &noopSink{} // TODO(blog): change this default (file in /tmp). +) + +// SetDefaultSink sets the sink where binary logs will be written to. +// +// Not thread safe. Only set during initialization. +func SetDefaultSink(s Sink) { + if defaultSink != nil { + defaultSink.Close() + } + defaultSink = s +} + +// Sink writes log entry into the binary log sink. +type Sink interface { + // Write will be called to write the log entry into the sink. + // + // It should be thread-safe so it can be called in parallel. + Write(*pb.GrpcLogEntry) error + // Close will be called when the Sink is replaced by a new Sink. + Close() error +} + +type noopSink struct{} + +func (ns *noopSink) Write(*pb.GrpcLogEntry) error { return nil } +func (ns *noopSink) Close() error { return nil } + +// newWriterSink creates a binary log sink with the given writer. +// +// Write() marshals the proto message and writes it to the given writer. Each +// message is prefixed with a 4 byte big endian unsigned integer as the length. +// +// No buffer is done, Close() doesn't try to close the writer. +func newWriterSink(w io.Writer) *writerSink { + return &writerSink{out: w} +} + +type writerSink struct { + out io.Writer +} + +func (ws *writerSink) Write(e *pb.GrpcLogEntry) error { + b, err := proto.Marshal(e) + if err != nil { + grpclogLogger.Infof("binary logging: failed to marshal proto message: %v", err) + } + hdr := make([]byte, 4) + binary.BigEndian.PutUint32(hdr, uint32(len(b))) + if _, err := ws.out.Write(hdr); err != nil { + return err + } + if _, err := ws.out.Write(b); err != nil { + return err + } + return nil +} + +func (ws *writerSink) Close() error { return nil } + +type bufWriteCloserSink struct { + mu sync.Mutex + closer io.Closer + out *writerSink // out is built on buf. + buf *bufio.Writer // buf is kept for flush. + + writeStartOnce sync.Once + writeTicker *time.Ticker +} + +func (fs *bufWriteCloserSink) Write(e *pb.GrpcLogEntry) error { + // Start the write loop when Write is called. + fs.writeStartOnce.Do(fs.startFlushGoroutine) + fs.mu.Lock() + if err := fs.out.Write(e); err != nil { + fs.mu.Unlock() + return err + } + fs.mu.Unlock() + return nil +} + +const ( + bufFlushDuration = 60 * time.Second +) + +func (fs *bufWriteCloserSink) startFlushGoroutine() { + fs.writeTicker = time.NewTicker(bufFlushDuration) + go func() { + for range fs.writeTicker.C { + fs.mu.Lock() + fs.buf.Flush() + fs.mu.Unlock() + } + }() +} + +func (fs *bufWriteCloserSink) Close() error { + if fs.writeTicker != nil { + fs.writeTicker.Stop() + } + fs.mu.Lock() + fs.buf.Flush() + fs.closer.Close() + fs.out.Close() + fs.mu.Unlock() + return nil +} + +func newBufWriteCloserSink(o io.WriteCloser) Sink { + bufW := bufio.NewWriter(o) + return &bufWriteCloserSink{ + closer: o, + out: newWriterSink(bufW), + buf: bufW, + } +} + +// NewTempFileSink creates a temp file and returns a Sink that writes to this +// file. +func NewTempFileSink() (Sink, error) { + tempFile, err := ioutil.TempFile("/tmp", "grpcgo_binarylog_*.txt") + if err != nil { + return nil, fmt.Errorf("failed to create temp file: %v", err) + } + return newBufWriteCloserSink(tempFile), nil +} diff --git a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go new file mode 100644 index 000000000..9f6a0c120 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go @@ -0,0 +1,85 @@ +/* + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package buffer provides an implementation of an unbounded buffer. +package buffer + +import "sync" + +// Unbounded is an implementation of an unbounded buffer which does not use +// extra goroutines. This is typically used for passing updates from one entity +// to another within gRPC. +// +// All methods on this type are thread-safe and don't block on anything except +// the underlying mutex used for synchronization. +// +// Unbounded supports values of any type to be stored in it by using a channel +// of `interface{}`. This means that a call to Put() incurs an extra memory +// allocation, and also that users need a type assertion while reading. For +// performance critical code paths, using Unbounded is strongly discouraged and +// defining a new type specific implementation of this buffer is preferred. See +// internal/transport/transport.go for an example of this. +type Unbounded struct { + c chan interface{} + mu sync.Mutex + backlog []interface{} +} + +// NewUnbounded returns a new instance of Unbounded. +func NewUnbounded() *Unbounded { + return &Unbounded{c: make(chan interface{}, 1)} +} + +// Put adds t to the unbounded buffer. +func (b *Unbounded) Put(t interface{}) { + b.mu.Lock() + if len(b.backlog) == 0 { + select { + case b.c <- t: + b.mu.Unlock() + return + default: + } + } + b.backlog = append(b.backlog, t) + b.mu.Unlock() +} + +// Load sends the earliest buffered data, if any, onto the read channel +// returned by Get(). Users are expected to call this every time they read a +// value from the read channel. +func (b *Unbounded) Load() { + b.mu.Lock() + if len(b.backlog) > 0 { + select { + case b.c <- b.backlog[0]: + b.backlog[0] = nil + b.backlog = b.backlog[1:] + default: + } + } + b.mu.Unlock() +} + +// Get returns a read channel on which values added to the buffer, via Put(), +// are sent on. +// +// Upon reading a value from this channel, users are expected to call Load() to +// send the next buffered value onto the channel if there is any. +func (b *Unbounded) Get() <-chan interface{} { + return b.c +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/funcs.go b/vendor/google.golang.org/grpc/internal/channelz/funcs.go new file mode 100644 index 000000000..81d3dd33e --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/funcs.go @@ -0,0 +1,739 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package channelz defines APIs for enabling channelz service, entry +// registration/deletion, and accessing channelz data. It also defines channelz +// metric struct formats. +// +// All APIs in this package are experimental. +package channelz + +import ( + "fmt" + "sort" + "sync" + "sync/atomic" + "time" + + "google.golang.org/grpc/grpclog" +) + +const ( + defaultMaxTraceEntry int32 = 30 +) + +var ( + db dbWrapper + idGen idGenerator + // EntryPerPage defines the number of channelz entries to be shown on a web page. + EntryPerPage = int64(50) + curState int32 + maxTraceEntry = defaultMaxTraceEntry +) + +// TurnOn turns on channelz data collection. +func TurnOn() { + if !IsOn() { + NewChannelzStorage() + atomic.StoreInt32(&curState, 1) + } +} + +// IsOn returns whether channelz data collection is on. +func IsOn() bool { + return atomic.CompareAndSwapInt32(&curState, 1, 1) +} + +// SetMaxTraceEntry sets maximum number of trace entry per entity (i.e. channel/subchannel). +// Setting it to 0 will disable channel tracing. +func SetMaxTraceEntry(i int32) { + atomic.StoreInt32(&maxTraceEntry, i) +} + +// ResetMaxTraceEntryToDefault resets the maximum number of trace entry per entity to default. +func ResetMaxTraceEntryToDefault() { + atomic.StoreInt32(&maxTraceEntry, defaultMaxTraceEntry) +} + +func getMaxTraceEntry() int { + i := atomic.LoadInt32(&maxTraceEntry) + return int(i) +} + +// dbWarpper wraps around a reference to internal channelz data storage, and +// provide synchronized functionality to set and get the reference. +type dbWrapper struct { + mu sync.RWMutex + DB *channelMap +} + +func (d *dbWrapper) set(db *channelMap) { + d.mu.Lock() + d.DB = db + d.mu.Unlock() +} + +func (d *dbWrapper) get() *channelMap { + d.mu.RLock() + defer d.mu.RUnlock() + return d.DB +} + +// NewChannelzStorage initializes channelz data storage and id generator. +// +// This function returns a cleanup function to wait for all channelz state to be reset by the +// grpc goroutines when those entities get closed. By using this cleanup function, we make sure tests +// don't mess up each other, i.e. lingering goroutine from previous test doing entity removal happen +// to remove some entity just register by the new test, since the id space is the same. +// +// Note: This function is exported for testing purpose only. User should not call +// it in most cases. +func NewChannelzStorage() (cleanup func() error) { + db.set(&channelMap{ + topLevelChannels: make(map[int64]struct{}), + channels: make(map[int64]*channel), + listenSockets: make(map[int64]*listenSocket), + normalSockets: make(map[int64]*normalSocket), + servers: make(map[int64]*server), + subChannels: make(map[int64]*subChannel), + }) + idGen.reset() + return func() error { + var err error + cm := db.get() + if cm == nil { + return nil + } + for i := 0; i < 1000; i++ { + cm.mu.Lock() + if len(cm.topLevelChannels) == 0 && len(cm.servers) == 0 && len(cm.channels) == 0 && len(cm.subChannels) == 0 && len(cm.listenSockets) == 0 && len(cm.normalSockets) == 0 { + cm.mu.Unlock() + // all things stored in the channelz map have been cleared. + return nil + } + cm.mu.Unlock() + time.Sleep(10 * time.Millisecond) + } + + cm.mu.Lock() + err = fmt.Errorf("after 10s the channelz map has not been cleaned up yet, topchannels: %d, servers: %d, channels: %d, subchannels: %d, listen sockets: %d, normal sockets: %d", len(cm.topLevelChannels), len(cm.servers), len(cm.channels), len(cm.subChannels), len(cm.listenSockets), len(cm.normalSockets)) + cm.mu.Unlock() + return err + } +} + +// GetTopChannels returns a slice of top channel's ChannelMetric, along with a +// boolean indicating whether there's more top channels to be queried for. +// +// The arg id specifies that only top channel with id at or above it will be included +// in the result. The returned slice is up to a length of the arg maxResults or +// EntryPerPage if maxResults is zero, and is sorted in ascending id order. +func GetTopChannels(id int64, maxResults int64) ([]*ChannelMetric, bool) { + return db.get().GetTopChannels(id, maxResults) +} + +// GetServers returns a slice of server's ServerMetric, along with a +// boolean indicating whether there's more servers to be queried for. +// +// The arg id specifies that only server with id at or above it will be included +// in the result. The returned slice is up to a length of the arg maxResults or +// EntryPerPage if maxResults is zero, and is sorted in ascending id order. +func GetServers(id int64, maxResults int64) ([]*ServerMetric, bool) { + return db.get().GetServers(id, maxResults) +} + +// GetServerSockets returns a slice of server's (identified by id) normal socket's +// SocketMetric, along with a boolean indicating whether there's more sockets to +// be queried for. +// +// The arg startID specifies that only sockets with id at or above it will be +// included in the result. The returned slice is up to a length of the arg maxResults +// or EntryPerPage if maxResults is zero, and is sorted in ascending id order. +func GetServerSockets(id int64, startID int64, maxResults int64) ([]*SocketMetric, bool) { + return db.get().GetServerSockets(id, startID, maxResults) +} + +// GetChannel returns the ChannelMetric for the channel (identified by id). +func GetChannel(id int64) *ChannelMetric { + return db.get().GetChannel(id) +} + +// GetSubChannel returns the SubChannelMetric for the subchannel (identified by id). +func GetSubChannel(id int64) *SubChannelMetric { + return db.get().GetSubChannel(id) +} + +// GetSocket returns the SocketInternalMetric for the socket (identified by id). +func GetSocket(id int64) *SocketMetric { + return db.get().GetSocket(id) +} + +// GetServer returns the ServerMetric for the server (identified by id). +func GetServer(id int64) *ServerMetric { + return db.get().GetServer(id) +} + +// RegisterChannel registers the given channel c in channelz database with ref +// as its reference name, and add it to the child list of its parent (identified +// by pid). pid = 0 means no parent. It returns the unique channelz tracking id +// assigned to this channel. +func RegisterChannel(c Channel, pid int64, ref string) int64 { + id := idGen.genID() + cn := &channel{ + refName: ref, + c: c, + subChans: make(map[int64]string), + nestedChans: make(map[int64]string), + id: id, + pid: pid, + trace: &channelTrace{createdTime: time.Now(), events: make([]*TraceEvent, 0, getMaxTraceEntry())}, + } + if pid == 0 { + db.get().addChannel(id, cn, true, pid, ref) + } else { + db.get().addChannel(id, cn, false, pid, ref) + } + return id +} + +// RegisterSubChannel registers the given channel c in channelz database with ref +// as its reference name, and add it to the child list of its parent (identified +// by pid). It returns the unique channelz tracking id assigned to this subchannel. +func RegisterSubChannel(c Channel, pid int64, ref string) int64 { + if pid == 0 { + logger.Error("a SubChannel's parent id cannot be 0") + return 0 + } + id := idGen.genID() + sc := &subChannel{ + refName: ref, + c: c, + sockets: make(map[int64]string), + id: id, + pid: pid, + trace: &channelTrace{createdTime: time.Now(), events: make([]*TraceEvent, 0, getMaxTraceEntry())}, + } + db.get().addSubChannel(id, sc, pid, ref) + return id +} + +// RegisterServer registers the given server s in channelz database. It returns +// the unique channelz tracking id assigned to this server. +func RegisterServer(s Server, ref string) int64 { + id := idGen.genID() + svr := &server{ + refName: ref, + s: s, + sockets: make(map[int64]string), + listenSockets: make(map[int64]string), + id: id, + } + db.get().addServer(id, svr) + return id +} + +// RegisterListenSocket registers the given listen socket s in channelz database +// with ref as its reference name, and add it to the child list of its parent +// (identified by pid). It returns the unique channelz tracking id assigned to +// this listen socket. +func RegisterListenSocket(s Socket, pid int64, ref string) int64 { + if pid == 0 { + logger.Error("a ListenSocket's parent id cannot be 0") + return 0 + } + id := idGen.genID() + ls := &listenSocket{refName: ref, s: s, id: id, pid: pid} + db.get().addListenSocket(id, ls, pid, ref) + return id +} + +// RegisterNormalSocket registers the given normal socket s in channelz database +// with ref as its reference name, and add it to the child list of its parent +// (identified by pid). It returns the unique channelz tracking id assigned to +// this normal socket. +func RegisterNormalSocket(s Socket, pid int64, ref string) int64 { + if pid == 0 { + logger.Error("a NormalSocket's parent id cannot be 0") + return 0 + } + id := idGen.genID() + ns := &normalSocket{refName: ref, s: s, id: id, pid: pid} + db.get().addNormalSocket(id, ns, pid, ref) + return id +} + +// RemoveEntry removes an entry with unique channelz trakcing id to be id from +// channelz database. +func RemoveEntry(id int64) { + db.get().removeEntry(id) +} + +// TraceEventDesc is what the caller of AddTraceEvent should provide to describe the event to be added +// to the channel trace. +// The Parent field is optional. It is used for event that will be recorded in the entity's parent +// trace also. +type TraceEventDesc struct { + Desc string + Severity Severity + Parent *TraceEventDesc +} + +// AddTraceEvent adds trace related to the entity with specified id, using the provided TraceEventDesc. +func AddTraceEvent(l grpclog.DepthLoggerV2, id int64, depth int, desc *TraceEventDesc) { + for d := desc; d != nil; d = d.Parent { + switch d.Severity { + case CtUNKNOWN: + l.InfoDepth(depth+1, d.Desc) + case CtINFO: + l.InfoDepth(depth+1, d.Desc) + case CtWarning: + l.WarningDepth(depth+1, d.Desc) + case CtError: + l.ErrorDepth(depth+1, d.Desc) + } + } + if getMaxTraceEntry() == 0 { + return + } + db.get().traceEvent(id, desc) +} + +// channelMap is the storage data structure for channelz. +// Methods of channelMap can be divided in two two categories with respect to locking. +// 1. Methods acquire the global lock. +// 2. Methods that can only be called when global lock is held. +// A second type of method need always to be called inside a first type of method. +type channelMap struct { + mu sync.RWMutex + topLevelChannels map[int64]struct{} + servers map[int64]*server + channels map[int64]*channel + subChannels map[int64]*subChannel + listenSockets map[int64]*listenSocket + normalSockets map[int64]*normalSocket +} + +func (c *channelMap) addServer(id int64, s *server) { + c.mu.Lock() + s.cm = c + c.servers[id] = s + c.mu.Unlock() +} + +func (c *channelMap) addChannel(id int64, cn *channel, isTopChannel bool, pid int64, ref string) { + c.mu.Lock() + cn.cm = c + cn.trace.cm = c + c.channels[id] = cn + if isTopChannel { + c.topLevelChannels[id] = struct{}{} + } else { + c.findEntry(pid).addChild(id, cn) + } + c.mu.Unlock() +} + +func (c *channelMap) addSubChannel(id int64, sc *subChannel, pid int64, ref string) { + c.mu.Lock() + sc.cm = c + sc.trace.cm = c + c.subChannels[id] = sc + c.findEntry(pid).addChild(id, sc) + c.mu.Unlock() +} + +func (c *channelMap) addListenSocket(id int64, ls *listenSocket, pid int64, ref string) { + c.mu.Lock() + ls.cm = c + c.listenSockets[id] = ls + c.findEntry(pid).addChild(id, ls) + c.mu.Unlock() +} + +func (c *channelMap) addNormalSocket(id int64, ns *normalSocket, pid int64, ref string) { + c.mu.Lock() + ns.cm = c + c.normalSockets[id] = ns + c.findEntry(pid).addChild(id, ns) + c.mu.Unlock() +} + +// removeEntry triggers the removal of an entry, which may not indeed delete the entry, if it has to +// wait on the deletion of its children and until no other entity's channel trace references it. +// It may lead to a chain of entry deletion. For example, deleting the last socket of a gracefully +// shutting down server will lead to the server being also deleted. +func (c *channelMap) removeEntry(id int64) { + c.mu.Lock() + c.findEntry(id).triggerDelete() + c.mu.Unlock() +} + +// c.mu must be held by the caller +func (c *channelMap) decrTraceRefCount(id int64) { + e := c.findEntry(id) + if v, ok := e.(tracedChannel); ok { + v.decrTraceRefCount() + e.deleteSelfIfReady() + } +} + +// c.mu must be held by the caller. +func (c *channelMap) findEntry(id int64) entry { + var v entry + var ok bool + if v, ok = c.channels[id]; ok { + return v + } + if v, ok = c.subChannels[id]; ok { + return v + } + if v, ok = c.servers[id]; ok { + return v + } + if v, ok = c.listenSockets[id]; ok { + return v + } + if v, ok = c.normalSockets[id]; ok { + return v + } + return &dummyEntry{idNotFound: id} +} + +// c.mu must be held by the caller +// deleteEntry simply deletes an entry from the channelMap. Before calling this +// method, caller must check this entry is ready to be deleted, i.e removeEntry() +// has been called on it, and no children still exist. +// Conditionals are ordered by the expected frequency of deletion of each entity +// type, in order to optimize performance. +func (c *channelMap) deleteEntry(id int64) { + var ok bool + if _, ok = c.normalSockets[id]; ok { + delete(c.normalSockets, id) + return + } + if _, ok = c.subChannels[id]; ok { + delete(c.subChannels, id) + return + } + if _, ok = c.channels[id]; ok { + delete(c.channels, id) + delete(c.topLevelChannels, id) + return + } + if _, ok = c.listenSockets[id]; ok { + delete(c.listenSockets, id) + return + } + if _, ok = c.servers[id]; ok { + delete(c.servers, id) + return + } +} + +func (c *channelMap) traceEvent(id int64, desc *TraceEventDesc) { + c.mu.Lock() + child := c.findEntry(id) + childTC, ok := child.(tracedChannel) + if !ok { + c.mu.Unlock() + return + } + childTC.getChannelTrace().append(&TraceEvent{Desc: desc.Desc, Severity: desc.Severity, Timestamp: time.Now()}) + if desc.Parent != nil { + parent := c.findEntry(child.getParentID()) + var chanType RefChannelType + switch child.(type) { + case *channel: + chanType = RefChannel + case *subChannel: + chanType = RefSubChannel + } + if parentTC, ok := parent.(tracedChannel); ok { + parentTC.getChannelTrace().append(&TraceEvent{ + Desc: desc.Parent.Desc, + Severity: desc.Parent.Severity, + Timestamp: time.Now(), + RefID: id, + RefName: childTC.getRefName(), + RefType: chanType, + }) + childTC.incrTraceRefCount() + } + } + c.mu.Unlock() +} + +type int64Slice []int64 + +func (s int64Slice) Len() int { return len(s) } +func (s int64Slice) Swap(i, j int) { s[i], s[j] = s[j], s[i] } +func (s int64Slice) Less(i, j int) bool { return s[i] < s[j] } + +func copyMap(m map[int64]string) map[int64]string { + n := make(map[int64]string) + for k, v := range m { + n[k] = v + } + return n +} + +func min(a, b int64) int64 { + if a < b { + return a + } + return b +} + +func (c *channelMap) GetTopChannels(id int64, maxResults int64) ([]*ChannelMetric, bool) { + if maxResults <= 0 { + maxResults = EntryPerPage + } + c.mu.RLock() + l := int64(len(c.topLevelChannels)) + ids := make([]int64, 0, l) + cns := make([]*channel, 0, min(l, maxResults)) + + for k := range c.topLevelChannels { + ids = append(ids, k) + } + sort.Sort(int64Slice(ids)) + idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= id }) + count := int64(0) + var end bool + var t []*ChannelMetric + for i, v := range ids[idx:] { + if count == maxResults { + break + } + if cn, ok := c.channels[v]; ok { + cns = append(cns, cn) + t = append(t, &ChannelMetric{ + NestedChans: copyMap(cn.nestedChans), + SubChans: copyMap(cn.subChans), + }) + count++ + } + if i == len(ids[idx:])-1 { + end = true + break + } + } + c.mu.RUnlock() + if count == 0 { + end = true + } + + for i, cn := range cns { + t[i].ChannelData = cn.c.ChannelzMetric() + t[i].ID = cn.id + t[i].RefName = cn.refName + t[i].Trace = cn.trace.dumpData() + } + return t, end +} + +func (c *channelMap) GetServers(id, maxResults int64) ([]*ServerMetric, bool) { + if maxResults <= 0 { + maxResults = EntryPerPage + } + c.mu.RLock() + l := int64(len(c.servers)) + ids := make([]int64, 0, l) + ss := make([]*server, 0, min(l, maxResults)) + for k := range c.servers { + ids = append(ids, k) + } + sort.Sort(int64Slice(ids)) + idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= id }) + count := int64(0) + var end bool + var s []*ServerMetric + for i, v := range ids[idx:] { + if count == maxResults { + break + } + if svr, ok := c.servers[v]; ok { + ss = append(ss, svr) + s = append(s, &ServerMetric{ + ListenSockets: copyMap(svr.listenSockets), + }) + count++ + } + if i == len(ids[idx:])-1 { + end = true + break + } + } + c.mu.RUnlock() + if count == 0 { + end = true + } + + for i, svr := range ss { + s[i].ServerData = svr.s.ChannelzMetric() + s[i].ID = svr.id + s[i].RefName = svr.refName + } + return s, end +} + +func (c *channelMap) GetServerSockets(id int64, startID int64, maxResults int64) ([]*SocketMetric, bool) { + if maxResults <= 0 { + maxResults = EntryPerPage + } + var svr *server + var ok bool + c.mu.RLock() + if svr, ok = c.servers[id]; !ok { + // server with id doesn't exist. + c.mu.RUnlock() + return nil, true + } + svrskts := svr.sockets + l := int64(len(svrskts)) + ids := make([]int64, 0, l) + sks := make([]*normalSocket, 0, min(l, maxResults)) + for k := range svrskts { + ids = append(ids, k) + } + sort.Sort(int64Slice(ids)) + idx := sort.Search(len(ids), func(i int) bool { return ids[i] >= startID }) + count := int64(0) + var end bool + for i, v := range ids[idx:] { + if count == maxResults { + break + } + if ns, ok := c.normalSockets[v]; ok { + sks = append(sks, ns) + count++ + } + if i == len(ids[idx:])-1 { + end = true + break + } + } + c.mu.RUnlock() + if count == 0 { + end = true + } + var s []*SocketMetric + for _, ns := range sks { + sm := &SocketMetric{} + sm.SocketData = ns.s.ChannelzMetric() + sm.ID = ns.id + sm.RefName = ns.refName + s = append(s, sm) + } + return s, end +} + +func (c *channelMap) GetChannel(id int64) *ChannelMetric { + cm := &ChannelMetric{} + var cn *channel + var ok bool + c.mu.RLock() + if cn, ok = c.channels[id]; !ok { + // channel with id doesn't exist. + c.mu.RUnlock() + return nil + } + cm.NestedChans = copyMap(cn.nestedChans) + cm.SubChans = copyMap(cn.subChans) + // cn.c can be set to &dummyChannel{} when deleteSelfFromMap is called. Save a copy of cn.c when + // holding the lock to prevent potential data race. + chanCopy := cn.c + c.mu.RUnlock() + cm.ChannelData = chanCopy.ChannelzMetric() + cm.ID = cn.id + cm.RefName = cn.refName + cm.Trace = cn.trace.dumpData() + return cm +} + +func (c *channelMap) GetSubChannel(id int64) *SubChannelMetric { + cm := &SubChannelMetric{} + var sc *subChannel + var ok bool + c.mu.RLock() + if sc, ok = c.subChannels[id]; !ok { + // subchannel with id doesn't exist. + c.mu.RUnlock() + return nil + } + cm.Sockets = copyMap(sc.sockets) + // sc.c can be set to &dummyChannel{} when deleteSelfFromMap is called. Save a copy of sc.c when + // holding the lock to prevent potential data race. + chanCopy := sc.c + c.mu.RUnlock() + cm.ChannelData = chanCopy.ChannelzMetric() + cm.ID = sc.id + cm.RefName = sc.refName + cm.Trace = sc.trace.dumpData() + return cm +} + +func (c *channelMap) GetSocket(id int64) *SocketMetric { + sm := &SocketMetric{} + c.mu.RLock() + if ls, ok := c.listenSockets[id]; ok { + c.mu.RUnlock() + sm.SocketData = ls.s.ChannelzMetric() + sm.ID = ls.id + sm.RefName = ls.refName + return sm + } + if ns, ok := c.normalSockets[id]; ok { + c.mu.RUnlock() + sm.SocketData = ns.s.ChannelzMetric() + sm.ID = ns.id + sm.RefName = ns.refName + return sm + } + c.mu.RUnlock() + return nil +} + +func (c *channelMap) GetServer(id int64) *ServerMetric { + sm := &ServerMetric{} + var svr *server + var ok bool + c.mu.RLock() + if svr, ok = c.servers[id]; !ok { + c.mu.RUnlock() + return nil + } + sm.ListenSockets = copyMap(svr.listenSockets) + c.mu.RUnlock() + sm.ID = svr.id + sm.RefName = svr.refName + sm.ServerData = svr.s.ChannelzMetric() + return sm +} + +type idGenerator struct { + id int64 +} + +func (i *idGenerator) reset() { + atomic.StoreInt64(&i.id, 0) +} + +func (i *idGenerator) genID() int64 { + return atomic.AddInt64(&i.id, 1) +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/logging.go b/vendor/google.golang.org/grpc/internal/channelz/logging.go new file mode 100644 index 000000000..e94039ee2 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/logging.go @@ -0,0 +1,102 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +import ( + "fmt" + + "google.golang.org/grpc/grpclog" +) + +var logger = grpclog.Component("channelz") + +// Info logs and adds a trace event if channelz is on. +func Info(l grpclog.DepthLoggerV2, id int64, args ...interface{}) { + if IsOn() { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprint(args...), + Severity: CtINFO, + }) + } else { + l.InfoDepth(1, args...) + } +} + +// Infof logs and adds a trace event if channelz is on. +func Infof(l grpclog.DepthLoggerV2, id int64, format string, args ...interface{}) { + msg := fmt.Sprintf(format, args...) + if IsOn() { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: msg, + Severity: CtINFO, + }) + } else { + l.InfoDepth(1, msg) + } +} + +// Warning logs and adds a trace event if channelz is on. +func Warning(l grpclog.DepthLoggerV2, id int64, args ...interface{}) { + if IsOn() { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprint(args...), + Severity: CtWarning, + }) + } else { + l.WarningDepth(1, args...) + } +} + +// Warningf logs and adds a trace event if channelz is on. +func Warningf(l grpclog.DepthLoggerV2, id int64, format string, args ...interface{}) { + msg := fmt.Sprintf(format, args...) + if IsOn() { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: msg, + Severity: CtWarning, + }) + } else { + l.WarningDepth(1, msg) + } +} + +// Error logs and adds a trace event if channelz is on. +func Error(l grpclog.DepthLoggerV2, id int64, args ...interface{}) { + if IsOn() { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: fmt.Sprint(args...), + Severity: CtError, + }) + } else { + l.ErrorDepth(1, args...) + } +} + +// Errorf logs and adds a trace event if channelz is on. +func Errorf(l grpclog.DepthLoggerV2, id int64, format string, args ...interface{}) { + msg := fmt.Sprintf(format, args...) + if IsOn() { + AddTraceEvent(l, id, 1, &TraceEventDesc{ + Desc: msg, + Severity: CtError, + }) + } else { + l.ErrorDepth(1, msg) + } +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/types.go b/vendor/google.golang.org/grpc/internal/channelz/types.go new file mode 100644 index 000000000..075dc7d16 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/types.go @@ -0,0 +1,701 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +import ( + "net" + "sync" + "sync/atomic" + "time" + + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/credentials" +) + +// entry represents a node in the channelz database. +type entry interface { + // addChild adds a child e, whose channelz id is id to child list + addChild(id int64, e entry) + // deleteChild deletes a child with channelz id to be id from child list + deleteChild(id int64) + // triggerDelete tries to delete self from channelz database. However, if child + // list is not empty, then deletion from the database is on hold until the last + // child is deleted from database. + triggerDelete() + // deleteSelfIfReady check whether triggerDelete() has been called before, and whether child + // list is now empty. If both conditions are met, then delete self from database. + deleteSelfIfReady() + // getParentID returns parent ID of the entry. 0 value parent ID means no parent. + getParentID() int64 +} + +// dummyEntry is a fake entry to handle entry not found case. +type dummyEntry struct { + idNotFound int64 +} + +func (d *dummyEntry) addChild(id int64, e entry) { + // Note: It is possible for a normal program to reach here under race condition. + // For example, there could be a race between ClientConn.Close() info being propagated + // to addrConn and http2Client. ClientConn.Close() cancel the context and result + // in http2Client to error. The error info is then caught by transport monitor + // and before addrConn.tearDown() is called in side ClientConn.Close(). Therefore, + // the addrConn will create a new transport. And when registering the new transport in + // channelz, its parent addrConn could have already been torn down and deleted + // from channelz tracking, and thus reach the code here. + logger.Infof("attempt to add child of type %T with id %d to a parent (id=%d) that doesn't currently exist", e, id, d.idNotFound) +} + +func (d *dummyEntry) deleteChild(id int64) { + // It is possible for a normal program to reach here under race condition. + // Refer to the example described in addChild(). + logger.Infof("attempt to delete child with id %d from a parent (id=%d) that doesn't currently exist", id, d.idNotFound) +} + +func (d *dummyEntry) triggerDelete() { + logger.Warningf("attempt to delete an entry (id=%d) that doesn't currently exist", d.idNotFound) +} + +func (*dummyEntry) deleteSelfIfReady() { + // code should not reach here. deleteSelfIfReady is always called on an existing entry. +} + +func (*dummyEntry) getParentID() int64 { + return 0 +} + +// ChannelMetric defines the info channelz provides for a specific Channel, which +// includes ChannelInternalMetric and channelz-specific data, such as channelz id, +// child list, etc. +type ChannelMetric struct { + // ID is the channelz id of this channel. + ID int64 + // RefName is the human readable reference string of this channel. + RefName string + // ChannelData contains channel internal metric reported by the channel through + // ChannelzMetric(). + ChannelData *ChannelInternalMetric + // NestedChans tracks the nested channel type children of this channel in the format of + // a map from nested channel channelz id to corresponding reference string. + NestedChans map[int64]string + // SubChans tracks the subchannel type children of this channel in the format of a + // map from subchannel channelz id to corresponding reference string. + SubChans map[int64]string + // Sockets tracks the socket type children of this channel in the format of a map + // from socket channelz id to corresponding reference string. + // Note current grpc implementation doesn't allow channel having sockets directly, + // therefore, this is field is unused. + Sockets map[int64]string + // Trace contains the most recent traced events. + Trace *ChannelTrace +} + +// SubChannelMetric defines the info channelz provides for a specific SubChannel, +// which includes ChannelInternalMetric and channelz-specific data, such as +// channelz id, child list, etc. +type SubChannelMetric struct { + // ID is the channelz id of this subchannel. + ID int64 + // RefName is the human readable reference string of this subchannel. + RefName string + // ChannelData contains subchannel internal metric reported by the subchannel + // through ChannelzMetric(). + ChannelData *ChannelInternalMetric + // NestedChans tracks the nested channel type children of this subchannel in the format of + // a map from nested channel channelz id to corresponding reference string. + // Note current grpc implementation doesn't allow subchannel to have nested channels + // as children, therefore, this field is unused. + NestedChans map[int64]string + // SubChans tracks the subchannel type children of this subchannel in the format of a + // map from subchannel channelz id to corresponding reference string. + // Note current grpc implementation doesn't allow subchannel to have subchannels + // as children, therefore, this field is unused. + SubChans map[int64]string + // Sockets tracks the socket type children of this subchannel in the format of a map + // from socket channelz id to corresponding reference string. + Sockets map[int64]string + // Trace contains the most recent traced events. + Trace *ChannelTrace +} + +// ChannelInternalMetric defines the struct that the implementor of Channel interface +// should return from ChannelzMetric(). +type ChannelInternalMetric struct { + // current connectivity state of the channel. + State connectivity.State + // The target this channel originally tried to connect to. May be absent + Target string + // The number of calls started on the channel. + CallsStarted int64 + // The number of calls that have completed with an OK status. + CallsSucceeded int64 + // The number of calls that have a completed with a non-OK status. + CallsFailed int64 + // The last time a call was started on the channel. + LastCallStartedTimestamp time.Time +} + +// ChannelTrace stores traced events on a channel/subchannel and related info. +type ChannelTrace struct { + // EventNum is the number of events that ever got traced (i.e. including those that have been deleted) + EventNum int64 + // CreationTime is the creation time of the trace. + CreationTime time.Time + // Events stores the most recent trace events (up to $maxTraceEntry, newer event will overwrite the + // oldest one) + Events []*TraceEvent +} + +// TraceEvent represent a single trace event +type TraceEvent struct { + // Desc is a simple description of the trace event. + Desc string + // Severity states the severity of this trace event. + Severity Severity + // Timestamp is the event time. + Timestamp time.Time + // RefID is the id of the entity that gets referenced in the event. RefID is 0 if no other entity is + // involved in this event. + // e.g. SubChannel (id: 4[]) Created. --> RefID = 4, RefName = "" (inside []) + RefID int64 + // RefName is the reference name for the entity that gets referenced in the event. + RefName string + // RefType indicates the referenced entity type, i.e Channel or SubChannel. + RefType RefChannelType +} + +// Channel is the interface that should be satisfied in order to be tracked by +// channelz as Channel or SubChannel. +type Channel interface { + ChannelzMetric() *ChannelInternalMetric +} + +type dummyChannel struct{} + +func (d *dummyChannel) ChannelzMetric() *ChannelInternalMetric { + return &ChannelInternalMetric{} +} + +type channel struct { + refName string + c Channel + closeCalled bool + nestedChans map[int64]string + subChans map[int64]string + id int64 + pid int64 + cm *channelMap + trace *channelTrace + // traceRefCount is the number of trace events that reference this channel. + // Non-zero traceRefCount means the trace of this channel cannot be deleted. + traceRefCount int32 +} + +func (c *channel) addChild(id int64, e entry) { + switch v := e.(type) { + case *subChannel: + c.subChans[id] = v.refName + case *channel: + c.nestedChans[id] = v.refName + default: + logger.Errorf("cannot add a child (id = %d) of type %T to a channel", id, e) + } +} + +func (c *channel) deleteChild(id int64) { + delete(c.subChans, id) + delete(c.nestedChans, id) + c.deleteSelfIfReady() +} + +func (c *channel) triggerDelete() { + c.closeCalled = true + c.deleteSelfIfReady() +} + +func (c *channel) getParentID() int64 { + return c.pid +} + +// deleteSelfFromTree tries to delete the channel from the channelz entry relation tree, which means +// deleting the channel reference from its parent's child list. +// +// In order for a channel to be deleted from the tree, it must meet the criteria that, removal of the +// corresponding grpc object has been invoked, and the channel does not have any children left. +// +// The returned boolean value indicates whether the channel has been successfully deleted from tree. +func (c *channel) deleteSelfFromTree() (deleted bool) { + if !c.closeCalled || len(c.subChans)+len(c.nestedChans) != 0 { + return false + } + // not top channel + if c.pid != 0 { + c.cm.findEntry(c.pid).deleteChild(c.id) + } + return true +} + +// deleteSelfFromMap checks whether it is valid to delete the channel from the map, which means +// deleting the channel from channelz's tracking entirely. Users can no longer use id to query the +// channel, and its memory will be garbage collected. +// +// The trace reference count of the channel must be 0 in order to be deleted from the map. This is +// specified in the channel tracing gRFC that as long as some other trace has reference to an entity, +// the trace of the referenced entity must not be deleted. In order to release the resource allocated +// by grpc, the reference to the grpc object is reset to a dummy object. +// +// deleteSelfFromMap must be called after deleteSelfFromTree returns true. +// +// It returns a bool to indicate whether the channel can be safely deleted from map. +func (c *channel) deleteSelfFromMap() (delete bool) { + if c.getTraceRefCount() != 0 { + c.c = &dummyChannel{} + return false + } + return true +} + +// deleteSelfIfReady tries to delete the channel itself from the channelz database. +// The delete process includes two steps: +// 1. delete the channel from the entry relation tree, i.e. delete the channel reference from its +// parent's child list. +// 2. delete the channel from the map, i.e. delete the channel entirely from channelz. Lookup by id +// will return entry not found error. +func (c *channel) deleteSelfIfReady() { + if !c.deleteSelfFromTree() { + return + } + if !c.deleteSelfFromMap() { + return + } + c.cm.deleteEntry(c.id) + c.trace.clear() +} + +func (c *channel) getChannelTrace() *channelTrace { + return c.trace +} + +func (c *channel) incrTraceRefCount() { + atomic.AddInt32(&c.traceRefCount, 1) +} + +func (c *channel) decrTraceRefCount() { + atomic.AddInt32(&c.traceRefCount, -1) +} + +func (c *channel) getTraceRefCount() int { + i := atomic.LoadInt32(&c.traceRefCount) + return int(i) +} + +func (c *channel) getRefName() string { + return c.refName +} + +type subChannel struct { + refName string + c Channel + closeCalled bool + sockets map[int64]string + id int64 + pid int64 + cm *channelMap + trace *channelTrace + traceRefCount int32 +} + +func (sc *subChannel) addChild(id int64, e entry) { + if v, ok := e.(*normalSocket); ok { + sc.sockets[id] = v.refName + } else { + logger.Errorf("cannot add a child (id = %d) of type %T to a subChannel", id, e) + } +} + +func (sc *subChannel) deleteChild(id int64) { + delete(sc.sockets, id) + sc.deleteSelfIfReady() +} + +func (sc *subChannel) triggerDelete() { + sc.closeCalled = true + sc.deleteSelfIfReady() +} + +func (sc *subChannel) getParentID() int64 { + return sc.pid +} + +// deleteSelfFromTree tries to delete the subchannel from the channelz entry relation tree, which +// means deleting the subchannel reference from its parent's child list. +// +// In order for a subchannel to be deleted from the tree, it must meet the criteria that, removal of +// the corresponding grpc object has been invoked, and the subchannel does not have any children left. +// +// The returned boolean value indicates whether the channel has been successfully deleted from tree. +func (sc *subChannel) deleteSelfFromTree() (deleted bool) { + if !sc.closeCalled || len(sc.sockets) != 0 { + return false + } + sc.cm.findEntry(sc.pid).deleteChild(sc.id) + return true +} + +// deleteSelfFromMap checks whether it is valid to delete the subchannel from the map, which means +// deleting the subchannel from channelz's tracking entirely. Users can no longer use id to query +// the subchannel, and its memory will be garbage collected. +// +// The trace reference count of the subchannel must be 0 in order to be deleted from the map. This is +// specified in the channel tracing gRFC that as long as some other trace has reference to an entity, +// the trace of the referenced entity must not be deleted. In order to release the resource allocated +// by grpc, the reference to the grpc object is reset to a dummy object. +// +// deleteSelfFromMap must be called after deleteSelfFromTree returns true. +// +// It returns a bool to indicate whether the channel can be safely deleted from map. +func (sc *subChannel) deleteSelfFromMap() (delete bool) { + if sc.getTraceRefCount() != 0 { + // free the grpc struct (i.e. addrConn) + sc.c = &dummyChannel{} + return false + } + return true +} + +// deleteSelfIfReady tries to delete the subchannel itself from the channelz database. +// The delete process includes two steps: +// 1. delete the subchannel from the entry relation tree, i.e. delete the subchannel reference from +// its parent's child list. +// 2. delete the subchannel from the map, i.e. delete the subchannel entirely from channelz. Lookup +// by id will return entry not found error. +func (sc *subChannel) deleteSelfIfReady() { + if !sc.deleteSelfFromTree() { + return + } + if !sc.deleteSelfFromMap() { + return + } + sc.cm.deleteEntry(sc.id) + sc.trace.clear() +} + +func (sc *subChannel) getChannelTrace() *channelTrace { + return sc.trace +} + +func (sc *subChannel) incrTraceRefCount() { + atomic.AddInt32(&sc.traceRefCount, 1) +} + +func (sc *subChannel) decrTraceRefCount() { + atomic.AddInt32(&sc.traceRefCount, -1) +} + +func (sc *subChannel) getTraceRefCount() int { + i := atomic.LoadInt32(&sc.traceRefCount) + return int(i) +} + +func (sc *subChannel) getRefName() string { + return sc.refName +} + +// SocketMetric defines the info channelz provides for a specific Socket, which +// includes SocketInternalMetric and channelz-specific data, such as channelz id, etc. +type SocketMetric struct { + // ID is the channelz id of this socket. + ID int64 + // RefName is the human readable reference string of this socket. + RefName string + // SocketData contains socket internal metric reported by the socket through + // ChannelzMetric(). + SocketData *SocketInternalMetric +} + +// SocketInternalMetric defines the struct that the implementor of Socket interface +// should return from ChannelzMetric(). +type SocketInternalMetric struct { + // The number of streams that have been started. + StreamsStarted int64 + // The number of streams that have ended successfully: + // On client side, receiving frame with eos bit set. + // On server side, sending frame with eos bit set. + StreamsSucceeded int64 + // The number of streams that have ended unsuccessfully: + // On client side, termination without receiving frame with eos bit set. + // On server side, termination without sending frame with eos bit set. + StreamsFailed int64 + // The number of messages successfully sent on this socket. + MessagesSent int64 + MessagesReceived int64 + // The number of keep alives sent. This is typically implemented with HTTP/2 + // ping messages. + KeepAlivesSent int64 + // The last time a stream was created by this endpoint. Usually unset for + // servers. + LastLocalStreamCreatedTimestamp time.Time + // The last time a stream was created by the remote endpoint. Usually unset + // for clients. + LastRemoteStreamCreatedTimestamp time.Time + // The last time a message was sent by this endpoint. + LastMessageSentTimestamp time.Time + // The last time a message was received by this endpoint. + LastMessageReceivedTimestamp time.Time + // The amount of window, granted to the local endpoint by the remote endpoint. + // This may be slightly out of date due to network latency. This does NOT + // include stream level or TCP level flow control info. + LocalFlowControlWindow int64 + // The amount of window, granted to the remote endpoint by the local endpoint. + // This may be slightly out of date due to network latency. This does NOT + // include stream level or TCP level flow control info. + RemoteFlowControlWindow int64 + // The locally bound address. + LocalAddr net.Addr + // The remote bound address. May be absent. + RemoteAddr net.Addr + // Optional, represents the name of the remote endpoint, if different than + // the original target name. + RemoteName string + SocketOptions *SocketOptionData + Security credentials.ChannelzSecurityValue +} + +// Socket is the interface that should be satisfied in order to be tracked by +// channelz as Socket. +type Socket interface { + ChannelzMetric() *SocketInternalMetric +} + +type listenSocket struct { + refName string + s Socket + id int64 + pid int64 + cm *channelMap +} + +func (ls *listenSocket) addChild(id int64, e entry) { + logger.Errorf("cannot add a child (id = %d) of type %T to a listen socket", id, e) +} + +func (ls *listenSocket) deleteChild(id int64) { + logger.Errorf("cannot delete a child (id = %d) from a listen socket", id) +} + +func (ls *listenSocket) triggerDelete() { + ls.cm.deleteEntry(ls.id) + ls.cm.findEntry(ls.pid).deleteChild(ls.id) +} + +func (ls *listenSocket) deleteSelfIfReady() { + logger.Errorf("cannot call deleteSelfIfReady on a listen socket") +} + +func (ls *listenSocket) getParentID() int64 { + return ls.pid +} + +type normalSocket struct { + refName string + s Socket + id int64 + pid int64 + cm *channelMap +} + +func (ns *normalSocket) addChild(id int64, e entry) { + logger.Errorf("cannot add a child (id = %d) of type %T to a normal socket", id, e) +} + +func (ns *normalSocket) deleteChild(id int64) { + logger.Errorf("cannot delete a child (id = %d) from a normal socket", id) +} + +func (ns *normalSocket) triggerDelete() { + ns.cm.deleteEntry(ns.id) + ns.cm.findEntry(ns.pid).deleteChild(ns.id) +} + +func (ns *normalSocket) deleteSelfIfReady() { + logger.Errorf("cannot call deleteSelfIfReady on a normal socket") +} + +func (ns *normalSocket) getParentID() int64 { + return ns.pid +} + +// ServerMetric defines the info channelz provides for a specific Server, which +// includes ServerInternalMetric and channelz-specific data, such as channelz id, +// child list, etc. +type ServerMetric struct { + // ID is the channelz id of this server. + ID int64 + // RefName is the human readable reference string of this server. + RefName string + // ServerData contains server internal metric reported by the server through + // ChannelzMetric(). + ServerData *ServerInternalMetric + // ListenSockets tracks the listener socket type children of this server in the + // format of a map from socket channelz id to corresponding reference string. + ListenSockets map[int64]string +} + +// ServerInternalMetric defines the struct that the implementor of Server interface +// should return from ChannelzMetric(). +type ServerInternalMetric struct { + // The number of incoming calls started on the server. + CallsStarted int64 + // The number of incoming calls that have completed with an OK status. + CallsSucceeded int64 + // The number of incoming calls that have a completed with a non-OK status. + CallsFailed int64 + // The last time a call was started on the server. + LastCallStartedTimestamp time.Time +} + +// Server is the interface to be satisfied in order to be tracked by channelz as +// Server. +type Server interface { + ChannelzMetric() *ServerInternalMetric +} + +type server struct { + refName string + s Server + closeCalled bool + sockets map[int64]string + listenSockets map[int64]string + id int64 + cm *channelMap +} + +func (s *server) addChild(id int64, e entry) { + switch v := e.(type) { + case *normalSocket: + s.sockets[id] = v.refName + case *listenSocket: + s.listenSockets[id] = v.refName + default: + logger.Errorf("cannot add a child (id = %d) of type %T to a server", id, e) + } +} + +func (s *server) deleteChild(id int64) { + delete(s.sockets, id) + delete(s.listenSockets, id) + s.deleteSelfIfReady() +} + +func (s *server) triggerDelete() { + s.closeCalled = true + s.deleteSelfIfReady() +} + +func (s *server) deleteSelfIfReady() { + if !s.closeCalled || len(s.sockets)+len(s.listenSockets) != 0 { + return + } + s.cm.deleteEntry(s.id) +} + +func (s *server) getParentID() int64 { + return 0 +} + +type tracedChannel interface { + getChannelTrace() *channelTrace + incrTraceRefCount() + decrTraceRefCount() + getRefName() string +} + +type channelTrace struct { + cm *channelMap + createdTime time.Time + eventCount int64 + mu sync.Mutex + events []*TraceEvent +} + +func (c *channelTrace) append(e *TraceEvent) { + c.mu.Lock() + if len(c.events) == getMaxTraceEntry() { + del := c.events[0] + c.events = c.events[1:] + if del.RefID != 0 { + // start recursive cleanup in a goroutine to not block the call originated from grpc. + go func() { + // need to acquire c.cm.mu lock to call the unlocked attemptCleanup func. + c.cm.mu.Lock() + c.cm.decrTraceRefCount(del.RefID) + c.cm.mu.Unlock() + }() + } + } + e.Timestamp = time.Now() + c.events = append(c.events, e) + c.eventCount++ + c.mu.Unlock() +} + +func (c *channelTrace) clear() { + c.mu.Lock() + for _, e := range c.events { + if e.RefID != 0 { + // caller should have already held the c.cm.mu lock. + c.cm.decrTraceRefCount(e.RefID) + } + } + c.mu.Unlock() +} + +// Severity is the severity level of a trace event. +// The canonical enumeration of all valid values is here: +// https://github.com/grpc/grpc-proto/blob/9b13d199cc0d4703c7ea26c9c330ba695866eb23/grpc/channelz/v1/channelz.proto#L126. +type Severity int + +const ( + // CtUNKNOWN indicates unknown severity of a trace event. + CtUNKNOWN Severity = iota + // CtINFO indicates info level severity of a trace event. + CtINFO + // CtWarning indicates warning level severity of a trace event. + CtWarning + // CtError indicates error level severity of a trace event. + CtError +) + +// RefChannelType is the type of the entity being referenced in a trace event. +type RefChannelType int + +const ( + // RefChannel indicates the referenced entity is a Channel. + RefChannel RefChannelType = iota + // RefSubChannel indicates the referenced entity is a SubChannel. + RefSubChannel +) + +func (c *channelTrace) dumpData() *ChannelTrace { + c.mu.Lock() + ct := &ChannelTrace{EventNum: c.eventCount, CreationTime: c.createdTime} + ct.Events = c.events[:len(c.events)] + c.mu.Unlock() + return ct +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/types_linux.go b/vendor/google.golang.org/grpc/internal/channelz/types_linux.go new file mode 100644 index 000000000..692dd6181 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/types_linux.go @@ -0,0 +1,53 @@ +// +build !appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +import ( + "syscall" + + "golang.org/x/sys/unix" +) + +// SocketOptionData defines the struct to hold socket option data, and related +// getter function to obtain info from fd. +type SocketOptionData struct { + Linger *unix.Linger + RecvTimeout *unix.Timeval + SendTimeout *unix.Timeval + TCPInfo *unix.TCPInfo +} + +// Getsockopt defines the function to get socket options requested by channelz. +// It is to be passed to syscall.RawConn.Control(). +func (s *SocketOptionData) Getsockopt(fd uintptr) { + if v, err := unix.GetsockoptLinger(int(fd), syscall.SOL_SOCKET, syscall.SO_LINGER); err == nil { + s.Linger = v + } + if v, err := unix.GetsockoptTimeval(int(fd), syscall.SOL_SOCKET, syscall.SO_RCVTIMEO); err == nil { + s.RecvTimeout = v + } + if v, err := unix.GetsockoptTimeval(int(fd), syscall.SOL_SOCKET, syscall.SO_SNDTIMEO); err == nil { + s.SendTimeout = v + } + if v, err := unix.GetsockoptTCPInfo(int(fd), syscall.SOL_TCP, syscall.TCP_INFO); err == nil { + s.TCPInfo = v + } +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/types_nonlinux.go b/vendor/google.golang.org/grpc/internal/channelz/types_nonlinux.go new file mode 100644 index 000000000..19c2fc521 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/types_nonlinux.go @@ -0,0 +1,42 @@ +// +build !linux appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +import ( + "sync" +) + +var once sync.Once + +// SocketOptionData defines the struct to hold socket option data, and related +// getter function to obtain info from fd. +// Windows OS doesn't support Socket Option +type SocketOptionData struct { +} + +// Getsockopt defines the function to get socket options requested by channelz. +// It is to be passed to syscall.RawConn.Control(). +// Windows OS doesn't support Socket Option +func (s *SocketOptionData) Getsockopt(fd uintptr) { + once.Do(func() { + logger.Warning("Channelz: socket options are not supported on non-linux os and appengine.") + }) +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/util_linux.go b/vendor/google.golang.org/grpc/internal/channelz/util_linux.go new file mode 100644 index 000000000..fdf409d55 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/util_linux.go @@ -0,0 +1,39 @@ +// +build linux,!appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +import ( + "syscall" +) + +// GetSocketOption gets the socket option info of the conn. +func GetSocketOption(socket interface{}) *SocketOptionData { + c, ok := socket.(syscall.Conn) + if !ok { + return nil + } + data := &SocketOptionData{} + if rawConn, err := c.SyscallConn(); err == nil { + rawConn.Control(data.Getsockopt) + return data + } + return nil +} diff --git a/vendor/google.golang.org/grpc/internal/channelz/util_nonlinux.go b/vendor/google.golang.org/grpc/internal/channelz/util_nonlinux.go new file mode 100644 index 000000000..8864a0811 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/channelz/util_nonlinux.go @@ -0,0 +1,26 @@ +// +build !linux appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package channelz + +// GetSocketOption gets the socket option info of the conn. +func GetSocketOption(c interface{}) *SocketOptionData { + return nil +} diff --git a/vendor/google.golang.org/grpc/internal/credentials/go110.go b/vendor/google.golang.org/grpc/internal/credentials/go110.go new file mode 100644 index 000000000..d55b52036 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/credentials/go110.go @@ -0,0 +1,65 @@ +// +build go1.10 + +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package credentials defines APIs for parsing SPIFFE ID. +// +// All APIs in this package are experimental. +package credentials + +import ( + "crypto/tls" + "net/url" + + "google.golang.org/grpc/grpclog" +) + +// SPIFFEIDFromState parses the SPIFFE ID from State. If the SPIFFE ID format +// is invalid, return nil with warning. +func SPIFFEIDFromState(state tls.ConnectionState) *url.URL { + if len(state.PeerCertificates) == 0 || len(state.PeerCertificates[0].URIs) == 0 { + return nil + } + var spiffeID *url.URL + for _, uri := range state.PeerCertificates[0].URIs { + if uri == nil || uri.Scheme != "spiffe" || uri.Opaque != "" || (uri.User != nil && uri.User.Username() != "") { + continue + } + // From this point, we assume the uri is intended for a SPIFFE ID. + if len(uri.String()) > 2048 { + grpclog.Warning("invalid SPIFFE ID: total ID length larger than 2048 bytes") + return nil + } + if len(uri.Host) == 0 || len(uri.RawPath) == 0 || len(uri.Path) == 0 { + grpclog.Warning("invalid SPIFFE ID: domain or workload ID is empty") + return nil + } + if len(uri.Host) > 255 { + grpclog.Warning("invalid SPIFFE ID: domain length larger than 255 characters") + return nil + } + // A valid SPIFFE certificate can only have exactly one URI SAN field. + if len(state.PeerCertificates[0].URIs) > 1 { + grpclog.Warning("invalid SPIFFE ID: multiple URI SANs") + return nil + } + spiffeID = uri + } + return spiffeID +} diff --git a/vendor/google.golang.org/grpc/internal/credentials/gobefore110.go b/vendor/google.golang.org/grpc/internal/credentials/gobefore110.go new file mode 100644 index 000000000..743713e19 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/credentials/gobefore110.go @@ -0,0 +1,31 @@ +// +build !go1.10 + +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package credentials + +import ( + "crypto/tls" + "net/url" +) + +//TODO(ZhenLian): delete this file when we remove Go 1.9 tests. +func SPIFFEIDFromState(state tls.ConnectionState) *url.URL { + return nil +} diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go new file mode 100644 index 000000000..73931a94b --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -0,0 +1,38 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package envconfig contains grpc settings configured by environment variables. +package envconfig + +import ( + "os" + "strings" +) + +const ( + prefix = "GRPC_GO_" + retryStr = prefix + "RETRY" + txtErrIgnoreStr = prefix + "IGNORE_TXT_ERRORS" +) + +var ( + // Retry is set if retry is explicitly enabled via "GRPC_GO_RETRY=on". + Retry = strings.EqualFold(os.Getenv(retryStr), "on") + // TXTErrIgnore is set if TXT errors should be ignored ("GRPC_GO_IGNORE_TXT_ERRORS" is not "false"). + TXTErrIgnore = !strings.EqualFold(os.Getenv(txtErrIgnoreStr), "false") +) diff --git a/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go b/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go new file mode 100644 index 000000000..745a166f0 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpclog/grpclog.go @@ -0,0 +1,123 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpclog (internal) defines depth logging for grpc. +package grpclog + +import ( + "os" +) + +// Logger is the logger used for the non-depth log functions. +var Logger LoggerV2 + +// DepthLogger is the logger used for the depth log functions. +var DepthLogger DepthLoggerV2 + +// InfoDepth logs to the INFO log at the specified depth. +func InfoDepth(depth int, args ...interface{}) { + if DepthLogger != nil { + DepthLogger.InfoDepth(depth, args...) + } else { + Logger.Infoln(args...) + } +} + +// WarningDepth logs to the WARNING log at the specified depth. +func WarningDepth(depth int, args ...interface{}) { + if DepthLogger != nil { + DepthLogger.WarningDepth(depth, args...) + } else { + Logger.Warningln(args...) + } +} + +// ErrorDepth logs to the ERROR log at the specified depth. +func ErrorDepth(depth int, args ...interface{}) { + if DepthLogger != nil { + DepthLogger.ErrorDepth(depth, args...) + } else { + Logger.Errorln(args...) + } +} + +// FatalDepth logs to the FATAL log at the specified depth. +func FatalDepth(depth int, args ...interface{}) { + if DepthLogger != nil { + DepthLogger.FatalDepth(depth, args...) + } else { + Logger.Fatalln(args...) + } + os.Exit(1) +} + +// LoggerV2 does underlying logging work for grpclog. +// This is a copy of the LoggerV2 defined in the external grpclog package. It +// is defined here to avoid a circular dependency. +type LoggerV2 interface { + // Info logs to INFO log. Arguments are handled in the manner of fmt.Print. + Info(args ...interface{}) + // Infoln logs to INFO log. Arguments are handled in the manner of fmt.Println. + Infoln(args ...interface{}) + // Infof logs to INFO log. Arguments are handled in the manner of fmt.Printf. + Infof(format string, args ...interface{}) + // Warning logs to WARNING log. Arguments are handled in the manner of fmt.Print. + Warning(args ...interface{}) + // Warningln logs to WARNING log. Arguments are handled in the manner of fmt.Println. + Warningln(args ...interface{}) + // Warningf logs to WARNING log. Arguments are handled in the manner of fmt.Printf. + Warningf(format string, args ...interface{}) + // Error logs to ERROR log. Arguments are handled in the manner of fmt.Print. + Error(args ...interface{}) + // Errorln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + Errorln(args ...interface{}) + // Errorf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + Errorf(format string, args ...interface{}) + // Fatal logs to ERROR log. Arguments are handled in the manner of fmt.Print. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatal(args ...interface{}) + // Fatalln logs to ERROR log. Arguments are handled in the manner of fmt.Println. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalln(args ...interface{}) + // Fatalf logs to ERROR log. Arguments are handled in the manner of fmt.Printf. + // gRPC ensures that all Fatal logs will exit with os.Exit(1). + // Implementations may also call os.Exit() with a non-zero exit code. + Fatalf(format string, args ...interface{}) + // V reports whether verbosity level l is at least the requested verbose level. + V(l int) bool +} + +// DepthLoggerV2 logs at a specified call frame. If a LoggerV2 also implements +// DepthLoggerV2, the below functions will be called with the appropriate stack +// depth set for trivial functions the logger may ignore. +// This is a copy of the DepthLoggerV2 defined in the external grpclog package. +// It is defined here to avoid a circular dependency. +// +// This API is EXPERIMENTAL. +type DepthLoggerV2 interface { + // InfoDepth logs to INFO log at the specified depth. Arguments are handled in the manner of fmt.Print. + InfoDepth(depth int, args ...interface{}) + // WarningDepth logs to WARNING log at the specified depth. Arguments are handled in the manner of fmt.Print. + WarningDepth(depth int, args ...interface{}) + // ErrorDetph logs to ERROR log at the specified depth. Arguments are handled in the manner of fmt.Print. + ErrorDepth(depth int, args ...interface{}) + // FatalDepth logs to FATAL log at the specified depth. Arguments are handled in the manner of fmt.Print. + FatalDepth(depth int, args ...interface{}) +} diff --git a/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go b/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go new file mode 100644 index 000000000..82af70e96 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpclog/prefixLogger.go @@ -0,0 +1,81 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpclog + +import ( + "fmt" +) + +// PrefixLogger does logging with a prefix. +// +// Logging method on a nil logs without any prefix. +type PrefixLogger struct { + logger DepthLoggerV2 + prefix string +} + +// Infof does info logging. +func (pl *PrefixLogger) Infof(format string, args ...interface{}) { + if pl != nil { + // Handle nil, so the tests can pass in a nil logger. + format = pl.prefix + format + pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) + return + } + InfoDepth(1, fmt.Sprintf(format, args...)) +} + +// Warningf does warning logging. +func (pl *PrefixLogger) Warningf(format string, args ...interface{}) { + if pl != nil { + format = pl.prefix + format + pl.logger.WarningDepth(1, fmt.Sprintf(format, args...)) + return + } + WarningDepth(1, fmt.Sprintf(format, args...)) +} + +// Errorf does error logging. +func (pl *PrefixLogger) Errorf(format string, args ...interface{}) { + if pl != nil { + format = pl.prefix + format + pl.logger.ErrorDepth(1, fmt.Sprintf(format, args...)) + return + } + ErrorDepth(1, fmt.Sprintf(format, args...)) +} + +// Debugf does info logging at verbose level 2. +func (pl *PrefixLogger) Debugf(format string, args ...interface{}) { + if !Logger.V(2) { + return + } + if pl != nil { + // Handle nil, so the tests can pass in a nil logger. + format = pl.prefix + format + pl.logger.InfoDepth(1, fmt.Sprintf(format, args...)) + return + } + InfoDepth(1, fmt.Sprintf(format, args...)) +} + +// NewPrefixLogger creates a prefix logger with the given prefix. +func NewPrefixLogger(logger DepthLoggerV2, prefix string) *PrefixLogger { + return &PrefixLogger{logger: logger, prefix: prefix} +} diff --git a/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go new file mode 100644 index 000000000..200b115ca --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcrand/grpcrand.go @@ -0,0 +1,56 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpcrand implements math/rand functions in a concurrent-safe way +// with a global random source, independent of math/rand's global source. +package grpcrand + +import ( + "math/rand" + "sync" + "time" +) + +var ( + r = rand.New(rand.NewSource(time.Now().UnixNano())) + mu sync.Mutex +) + +// Int63n implements rand.Int63n on the grpcrand global source. +func Int63n(n int64) int64 { + mu.Lock() + res := r.Int63n(n) + mu.Unlock() + return res +} + +// Intn implements rand.Intn on the grpcrand global source. +func Intn(n int) int { + mu.Lock() + res := r.Intn(n) + mu.Unlock() + return res +} + +// Float64 implements rand.Float64 on the grpcrand global source. +func Float64() float64 { + mu.Lock() + res := r.Float64() + mu.Unlock() + return res +} diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/event.go b/vendor/google.golang.org/grpc/internal/grpcsync/event.go new file mode 100644 index 000000000..fbe697c37 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcsync/event.go @@ -0,0 +1,61 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpcsync implements additional synchronization primitives built upon +// the sync package. +package grpcsync + +import ( + "sync" + "sync/atomic" +) + +// Event represents a one-time event that may occur in the future. +type Event struct { + fired int32 + c chan struct{} + o sync.Once +} + +// Fire causes e to complete. It is safe to call multiple times, and +// concurrently. It returns true iff this call to Fire caused the signaling +// channel returned by Done to close. +func (e *Event) Fire() bool { + ret := false + e.o.Do(func() { + atomic.StoreInt32(&e.fired, 1) + close(e.c) + ret = true + }) + return ret +} + +// Done returns a channel that will be closed when Fire is called. +func (e *Event) Done() <-chan struct{} { + return e.c +} + +// HasFired returns true if Fire has been called. +func (e *Event) HasFired() bool { + return atomic.LoadInt32(&e.fired) == 1 +} + +// NewEvent returns a new, ready-to-use Event. +func NewEvent() *Event { + return &Event{c: make(chan struct{})} +} diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go b/vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go new file mode 100644 index 000000000..b25b0baec --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcutil/encode_duration.go @@ -0,0 +1,63 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpcutil + +import ( + "strconv" + "time" +) + +const maxTimeoutValue int64 = 100000000 - 1 + +// div does integer division and round-up the result. Note that this is +// equivalent to (d+r-1)/r but has less chance to overflow. +func div(d, r time.Duration) int64 { + if d%r > 0 { + return int64(d/r + 1) + } + return int64(d / r) +} + +// EncodeDuration encodes the duration to the format grpc-timeout header +// accepts. +// +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests +func EncodeDuration(t time.Duration) string { + // TODO: This is simplistic and not bandwidth efficient. Improve it. + if t <= 0 { + return "0n" + } + if d := div(t, time.Nanosecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "n" + } + if d := div(t, time.Microsecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "u" + } + if d := div(t, time.Millisecond); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "m" + } + if d := div(t, time.Second); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "S" + } + if d := div(t, time.Minute); d <= maxTimeoutValue { + return strconv.FormatInt(d, 10) + "M" + } + // Note that maxTimeoutValue * time.Hour > MaxInt64. + return strconv.FormatInt(div(t, time.Hour), 10) + "H" +} diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/metadata.go b/vendor/google.golang.org/grpc/internal/grpcutil/metadata.go new file mode 100644 index 000000000..6f22bd891 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcutil/metadata.go @@ -0,0 +1,40 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpcutil + +import ( + "context" + + "google.golang.org/grpc/metadata" +) + +type mdExtraKey struct{} + +// WithExtraMetadata creates a new context with incoming md attached. +func WithExtraMetadata(ctx context.Context, md metadata.MD) context.Context { + return context.WithValue(ctx, mdExtraKey{}, md) +} + +// ExtraMetadata returns the incoming metadata in ctx if it exists. The +// returned MD should not be modified. Writing to it may cause races. +// Modification should be made to copies of the returned MD. +func ExtraMetadata(ctx context.Context) (md metadata.MD, ok bool) { + md, ok = ctx.Value(mdExtraKey{}).(metadata.MD) + return +} diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/method.go b/vendor/google.golang.org/grpc/internal/grpcutil/method.go new file mode 100644 index 000000000..4e7475060 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcutil/method.go @@ -0,0 +1,84 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpcutil + +import ( + "errors" + "strings" +) + +// ParseMethod splits service and method from the input. It expects format +// "/service/method". +// +func ParseMethod(methodName string) (service, method string, _ error) { + if !strings.HasPrefix(methodName, "/") { + return "", "", errors.New("invalid method name: should start with /") + } + methodName = methodName[1:] + + pos := strings.LastIndex(methodName, "/") + if pos < 0 { + return "", "", errors.New("invalid method name: suffix /method is missing") + } + return methodName[:pos], methodName[pos+1:], nil +} + +const baseContentType = "application/grpc" + +// ContentSubtype returns the content-subtype for the given content-type. The +// given content-type must be a valid content-type that starts with +// "application/grpc". A content-subtype will follow "application/grpc" after a +// "+" or ";". See +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. +// +// If contentType is not a valid content-type for gRPC, the boolean +// will be false, otherwise true. If content-type == "application/grpc", +// "application/grpc+", or "application/grpc;", the boolean will be true, +// but no content-subtype will be returned. +// +// contentType is assumed to be lowercase already. +func ContentSubtype(contentType string) (string, bool) { + if contentType == baseContentType { + return "", true + } + if !strings.HasPrefix(contentType, baseContentType) { + return "", false + } + // guaranteed since != baseContentType and has baseContentType prefix + switch contentType[len(baseContentType)] { + case '+', ';': + // this will return true for "application/grpc+" or "application/grpc;" + // which the previous validContentType function tested to be valid, so we + // just say that no content-subtype is specified in this case + return contentType[len(baseContentType)+1:], true + default: + return "", false + } +} + +// ContentType builds full content type with the given sub-type. +// +// contentSubtype is assumed to be lowercase +func ContentType(contentSubtype string) string { + if contentSubtype == "" { + return baseContentType + } + return baseContentType + "+" + contentSubtype +} diff --git a/vendor/google.golang.org/grpc/internal/grpcutil/target.go b/vendor/google.golang.org/grpc/internal/grpcutil/target.go new file mode 100644 index 000000000..80b33cdaf --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/grpcutil/target.go @@ -0,0 +1,55 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package grpcutil provides a bunch of utility functions to be used across the +// gRPC codebase. +package grpcutil + +import ( + "strings" + + "google.golang.org/grpc/resolver" +) + +// split2 returns the values from strings.SplitN(s, sep, 2). +// If sep is not found, it returns ("", "", false) instead. +func split2(s, sep string) (string, string, bool) { + spl := strings.SplitN(s, sep, 2) + if len(spl) < 2 { + return "", "", false + } + return spl[0], spl[1], true +} + +// ParseTarget splits target into a resolver.Target struct containing scheme, +// authority and endpoint. +// +// If target is not a valid scheme://authority/endpoint, it returns {Endpoint: +// target}. +func ParseTarget(target string) (ret resolver.Target) { + var ok bool + ret.Scheme, ret.Endpoint, ok = split2(target, "://") + if !ok { + return resolver.Target{Endpoint: target} + } + ret.Authority, ret.Endpoint, ok = split2(ret.Endpoint, "/") + if !ok { + return resolver.Target{Endpoint: target} + } + return ret +} diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go new file mode 100644 index 000000000..818ca8579 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -0,0 +1,76 @@ +/* + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package internal contains gRPC-internal code, to avoid polluting +// the godoc of the top-level grpc package. It must not import any grpc +// symbols to avoid circular dependencies. +package internal + +import ( + "context" + "time" + + "google.golang.org/grpc/connectivity" + "google.golang.org/grpc/serviceconfig" +) + +var ( + // WithHealthCheckFunc is set by dialoptions.go + WithHealthCheckFunc interface{} // func (HealthChecker) DialOption + // HealthCheckFunc is used to provide client-side LB channel health checking + HealthCheckFunc HealthChecker + // BalancerUnregister is exported by package balancer to unregister a balancer. + BalancerUnregister func(name string) + // KeepaliveMinPingTime is the minimum ping interval. This must be 10s by + // default, but tests may wish to set it lower for convenience. + KeepaliveMinPingTime = 10 * time.Second + // NewRequestInfoContext creates a new context based on the argument context attaching + // the passed in RequestInfo to the new context. + NewRequestInfoContext interface{} // func(context.Context, credentials.RequestInfo) context.Context + // NewClientHandshakeInfoContext returns a copy of the input context with + // the passed in ClientHandshakeInfo struct added to it. + NewClientHandshakeInfoContext interface{} // func(context.Context, credentials.ClientHandshakeInfo) context.Context + // ParseServiceConfigForTesting is for creating a fake + // ClientConn for resolver testing only + ParseServiceConfigForTesting interface{} // func(string) *serviceconfig.ParseResult + // EqualServiceConfigForTesting is for testing service config generation and + // parsing. Both a and b should be returned by ParseServiceConfigForTesting. + // This function compares the config without rawJSON stripped, in case the + // there's difference in white space. + EqualServiceConfigForTesting func(a, b serviceconfig.Config) bool +) + +// HealthChecker defines the signature of the client-side LB channel health checking function. +// +// The implementation is expected to create a health checking RPC stream by +// calling newStream(), watch for the health status of serviceName, and report +// it's health back by calling setConnectivityState(). +// +// The health checking protocol is defined at: +// https://github.com/grpc/grpc/blob/master/doc/health-checking.md +type HealthChecker func(ctx context.Context, newStream func(string) (interface{}, error), setConnectivityState func(connectivity.State, error), serviceName string) error + +const ( + // CredsBundleModeFallback switches GoogleDefaultCreds to fallback mode. + CredsBundleModeFallback = "fallback" + // CredsBundleModeBalancer switches GoogleDefaultCreds to grpclb balancer + // mode. + CredsBundleModeBalancer = "balancer" + // CredsBundleModeBackendFromBalancer switches GoogleDefaultCreds to mode + // that supports backend returned by grpclb balancer. + CredsBundleModeBackendFromBalancer = "backend-from-balancer" +) diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go new file mode 100644 index 000000000..304235566 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -0,0 +1,446 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package dns implements a dns resolver to be installed as the default resolver +// in grpc. +package dns + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net" + "os" + "strconv" + "strings" + "sync" + "time" + + grpclbstate "google.golang.org/grpc/balancer/grpclb/state" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/envconfig" + "google.golang.org/grpc/internal/grpcrand" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" +) + +// EnableSRVLookups controls whether the DNS resolver attempts to fetch gRPCLB +// addresses from SRV records. Must not be changed after init time. +var EnableSRVLookups = false + +var logger = grpclog.Component("dns") + +func init() { + resolver.Register(NewBuilder()) +} + +const ( + defaultPort = "443" + defaultDNSSvrPort = "53" + golang = "GO" + // txtPrefix is the prefix string to be prepended to the host name for txt record lookup. + txtPrefix = "_grpc_config." + // In DNS, service config is encoded in a TXT record via the mechanism + // described in RFC-1464 using the attribute name grpc_config. + txtAttribute = "grpc_config=" +) + +var ( + errMissingAddr = errors.New("dns resolver: missing address") + + // Addresses ending with a colon that is supposed to be the separator + // between host and port is not allowed. E.g. "::" is a valid address as + // it is an IPv6 address (host only) and "[::]:" is invalid as it ends with + // a colon as the host and port separator + errEndsWithColon = errors.New("dns resolver: missing port after port-separator colon") +) + +var ( + defaultResolver netResolver = net.DefaultResolver + // To prevent excessive re-resolution, we enforce a rate limit on DNS + // resolution requests. + minDNSResRate = 30 * time.Second +) + +var customAuthorityDialler = func(authority string) func(ctx context.Context, network, address string) (net.Conn, error) { + return func(ctx context.Context, network, address string) (net.Conn, error) { + var dialer net.Dialer + return dialer.DialContext(ctx, network, authority) + } +} + +var customAuthorityResolver = func(authority string) (netResolver, error) { + host, port, err := parseTarget(authority, defaultDNSSvrPort) + if err != nil { + return nil, err + } + + authorityWithPort := net.JoinHostPort(host, port) + + return &net.Resolver{ + PreferGo: true, + Dial: customAuthorityDialler(authorityWithPort), + }, nil +} + +// NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. +func NewBuilder() resolver.Builder { + return &dnsBuilder{} +} + +type dnsBuilder struct{} + +// Build creates and starts a DNS resolver that watches the name resolution of the target. +func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { + host, port, err := parseTarget(target.Endpoint, defaultPort) + if err != nil { + return nil, err + } + + // IP address. + if ipAddr, ok := formatIP(host); ok { + addr := []resolver.Address{{Addr: ipAddr + ":" + port}} + cc.UpdateState(resolver.State{Addresses: addr}) + return deadResolver{}, nil + } + + // DNS address (non-IP). + ctx, cancel := context.WithCancel(context.Background()) + d := &dnsResolver{ + host: host, + port: port, + ctx: ctx, + cancel: cancel, + cc: cc, + rn: make(chan struct{}, 1), + disableServiceConfig: opts.DisableServiceConfig, + } + + if target.Authority == "" { + d.resolver = defaultResolver + } else { + d.resolver, err = customAuthorityResolver(target.Authority) + if err != nil { + return nil, err + } + } + + d.wg.Add(1) + go d.watcher() + d.ResolveNow(resolver.ResolveNowOptions{}) + return d, nil +} + +// Scheme returns the naming scheme of this resolver builder, which is "dns". +func (b *dnsBuilder) Scheme() string { + return "dns" +} + +type netResolver interface { + LookupHost(ctx context.Context, host string) (addrs []string, err error) + LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) + LookupTXT(ctx context.Context, name string) (txts []string, err error) +} + +// deadResolver is a resolver that does nothing. +type deadResolver struct{} + +func (deadResolver) ResolveNow(resolver.ResolveNowOptions) {} + +func (deadResolver) Close() {} + +// dnsResolver watches for the name resolution update for a non-IP target. +type dnsResolver struct { + host string + port string + resolver netResolver + ctx context.Context + cancel context.CancelFunc + cc resolver.ClientConn + // rn channel is used by ResolveNow() to force an immediate resolution of the target. + rn chan struct{} + // wg is used to enforce Close() to return after the watcher() goroutine has finished. + // Otherwise, data race will be possible. [Race Example] in dns_resolver_test we + // replace the real lookup functions with mocked ones to facilitate testing. + // If Close() doesn't wait for watcher() goroutine finishes, race detector sometimes + // will warns lookup (READ the lookup function pointers) inside watcher() goroutine + // has data race with replaceNetFunc (WRITE the lookup function pointers). + wg sync.WaitGroup + disableServiceConfig bool +} + +// ResolveNow invoke an immediate resolution of the target that this dnsResolver watches. +func (d *dnsResolver) ResolveNow(resolver.ResolveNowOptions) { + select { + case d.rn <- struct{}{}: + default: + } +} + +// Close closes the dnsResolver. +func (d *dnsResolver) Close() { + d.cancel() + d.wg.Wait() +} + +func (d *dnsResolver) watcher() { + defer d.wg.Done() + for { + select { + case <-d.ctx.Done(): + return + case <-d.rn: + } + + state, err := d.lookup() + if err != nil { + d.cc.ReportError(err) + } else { + d.cc.UpdateState(*state) + } + + // Sleep to prevent excessive re-resolutions. Incoming resolution requests + // will be queued in d.rn. + t := time.NewTimer(minDNSResRate) + select { + case <-t.C: + case <-d.ctx.Done(): + t.Stop() + return + } + } +} + +func (d *dnsResolver) lookupSRV() ([]resolver.Address, error) { + if !EnableSRVLookups { + return nil, nil + } + var newAddrs []resolver.Address + _, srvs, err := d.resolver.LookupSRV(d.ctx, "grpclb", "tcp", d.host) + if err != nil { + err = handleDNSError(err, "SRV") // may become nil + return nil, err + } + for _, s := range srvs { + lbAddrs, err := d.resolver.LookupHost(d.ctx, s.Target) + if err != nil { + err = handleDNSError(err, "A") // may become nil + if err == nil { + // If there are other SRV records, look them up and ignore this + // one that does not exist. + continue + } + return nil, err + } + for _, a := range lbAddrs { + ip, ok := formatIP(a) + if !ok { + return nil, fmt.Errorf("dns: error parsing A record IP address %v", a) + } + addr := ip + ":" + strconv.Itoa(int(s.Port)) + newAddrs = append(newAddrs, resolver.Address{Addr: addr, ServerName: s.Target}) + } + } + return newAddrs, nil +} + +var filterError = func(err error) error { + if dnsErr, ok := err.(*net.DNSError); ok && !dnsErr.IsTimeout && !dnsErr.IsTemporary { + // Timeouts and temporary errors should be communicated to gRPC to + // attempt another DNS query (with backoff). Other errors should be + // suppressed (they may represent the absence of a TXT record). + return nil + } + return err +} + +func handleDNSError(err error, lookupType string) error { + err = filterError(err) + if err != nil { + err = fmt.Errorf("dns: %v record lookup error: %v", lookupType, err) + logger.Info(err) + } + return err +} + +func (d *dnsResolver) lookupTXT() *serviceconfig.ParseResult { + ss, err := d.resolver.LookupTXT(d.ctx, txtPrefix+d.host) + if err != nil { + if envconfig.TXTErrIgnore { + return nil + } + if err = handleDNSError(err, "TXT"); err != nil { + return &serviceconfig.ParseResult{Err: err} + } + return nil + } + var res string + for _, s := range ss { + res += s + } + + // TXT record must have "grpc_config=" attribute in order to be used as service config. + if !strings.HasPrefix(res, txtAttribute) { + logger.Warningf("dns: TXT record %v missing %v attribute", res, txtAttribute) + // This is not an error; it is the equivalent of not having a service config. + return nil + } + sc := canaryingSC(strings.TrimPrefix(res, txtAttribute)) + return d.cc.ParseServiceConfig(sc) +} + +func (d *dnsResolver) lookupHost() ([]resolver.Address, error) { + var newAddrs []resolver.Address + addrs, err := d.resolver.LookupHost(d.ctx, d.host) + if err != nil { + err = handleDNSError(err, "A") + return nil, err + } + for _, a := range addrs { + ip, ok := formatIP(a) + if !ok { + return nil, fmt.Errorf("dns: error parsing A record IP address %v", a) + } + addr := ip + ":" + d.port + newAddrs = append(newAddrs, resolver.Address{Addr: addr}) + } + return newAddrs, nil +} + +func (d *dnsResolver) lookup() (*resolver.State, error) { + srv, srvErr := d.lookupSRV() + addrs, hostErr := d.lookupHost() + if hostErr != nil && (srvErr != nil || len(srv) == 0) { + return nil, hostErr + } + + state := resolver.State{Addresses: addrs} + if len(srv) > 0 { + state = grpclbstate.Set(state, &grpclbstate.State{BalancerAddresses: srv}) + } + if !d.disableServiceConfig { + state.ServiceConfig = d.lookupTXT() + } + return &state, nil +} + +// formatIP returns ok = false if addr is not a valid textual representation of an IP address. +// If addr is an IPv4 address, return the addr and ok = true. +// If addr is an IPv6 address, return the addr enclosed in square brackets and ok = true. +func formatIP(addr string) (addrIP string, ok bool) { + ip := net.ParseIP(addr) + if ip == nil { + return "", false + } + if ip.To4() != nil { + return addr, true + } + return "[" + addr + "]", true +} + +// parseTarget takes the user input target string and default port, returns formatted host and port info. +// If target doesn't specify a port, set the port to be the defaultPort. +// If target is in IPv6 format and host-name is enclosed in square brackets, brackets +// are stripped when setting the host. +// examples: +// target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443" +// target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80" +// target: "[ipv6-host]" defaultPort: "443" returns host: "ipv6-host", port: "443" +// target: ":80" defaultPort: "443" returns host: "localhost", port: "80" +func parseTarget(target, defaultPort string) (host, port string, err error) { + if target == "" { + return "", "", errMissingAddr + } + if ip := net.ParseIP(target); ip != nil { + // target is an IPv4 or IPv6(without brackets) address + return target, defaultPort, nil + } + if host, port, err = net.SplitHostPort(target); err == nil { + if port == "" { + // If the port field is empty (target ends with colon), e.g. "[::1]:", this is an error. + return "", "", errEndsWithColon + } + // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port + if host == "" { + // Keep consistent with net.Dial(): If the host is empty, as in ":80", the local system is assumed. + host = "localhost" + } + return host, port, nil + } + if host, port, err = net.SplitHostPort(target + ":" + defaultPort); err == nil { + // target doesn't have port + return host, port, nil + } + return "", "", fmt.Errorf("invalid target address %v, error info: %v", target, err) +} + +type rawChoice struct { + ClientLanguage *[]string `json:"clientLanguage,omitempty"` + Percentage *int `json:"percentage,omitempty"` + ClientHostName *[]string `json:"clientHostName,omitempty"` + ServiceConfig *json.RawMessage `json:"serviceConfig,omitempty"` +} + +func containsString(a *[]string, b string) bool { + if a == nil { + return true + } + for _, c := range *a { + if c == b { + return true + } + } + return false +} + +func chosenByPercentage(a *int) bool { + if a == nil { + return true + } + return grpcrand.Intn(100)+1 <= *a +} + +func canaryingSC(js string) string { + if js == "" { + return "" + } + var rcs []rawChoice + err := json.Unmarshal([]byte(js), &rcs) + if err != nil { + logger.Warningf("dns: error parsing service config json: %v", err) + return "" + } + cliHostname, err := os.Hostname() + if err != nil { + logger.Warningf("dns: error getting client hostname: %v", err) + return "" + } + var sc string + for _, c := range rcs { + if !containsString(c.ClientLanguage, golang) || + !chosenByPercentage(c.Percentage) || + !containsString(c.ClientHostName, cliHostname) || + c.ServiceConfig == nil { + continue + } + sc = string(*c.ServiceConfig) + break + } + return sc +} diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/go113.go b/vendor/google.golang.org/grpc/internal/resolver/dns/go113.go new file mode 100644 index 000000000..8783a8cf8 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/go113.go @@ -0,0 +1,33 @@ +// +build go1.13 + +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package dns + +import "net" + +func init() { + filterError = func(err error) error { + if dnsErr, ok := err.(*net.DNSError); ok && dnsErr.IsNotFound { + // The name does not exist; not an error. + return nil + } + return err + } +} diff --git a/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go b/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go new file mode 100644 index 000000000..520d9229e --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/resolver/passthrough/passthrough.go @@ -0,0 +1,57 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package passthrough implements a pass-through resolver. It sends the target +// name without scheme back to gRPC as resolved address. +package passthrough + +import "google.golang.org/grpc/resolver" + +const scheme = "passthrough" + +type passthroughBuilder struct{} + +func (*passthroughBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error) { + r := &passthroughResolver{ + target: target, + cc: cc, + } + r.start() + return r, nil +} + +func (*passthroughBuilder) Scheme() string { + return scheme +} + +type passthroughResolver struct { + target resolver.Target + cc resolver.ClientConn +} + +func (r *passthroughResolver) start() { + r.cc.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: r.target.Endpoint}}}) +} + +func (*passthroughResolver) ResolveNow(o resolver.ResolveNowOptions) {} + +func (*passthroughResolver) Close() {} + +func init() { + resolver.Register(&passthroughBuilder{}) +} diff --git a/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go b/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go new file mode 100644 index 000000000..9b26414d4 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/serviceconfig/serviceconfig.go @@ -0,0 +1,90 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package serviceconfig contains utility functions to parse service config. +package serviceconfig + +import ( + "encoding/json" + "fmt" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/grpclog" + externalserviceconfig "google.golang.org/grpc/serviceconfig" +) + +// BalancerConfig is the balancer config part that service config's +// loadBalancingConfig fields can be unmarshalled to. It's a json unmarshaller. +// +// https://github.com/grpc/grpc-proto/blob/54713b1e8bc6ed2d4f25fb4dff527842150b91b2/grpc/service_config/service_config.proto#L247 +type BalancerConfig struct { + Name string + Config externalserviceconfig.LoadBalancingConfig +} + +type intermediateBalancerConfig []map[string]json.RawMessage + +// UnmarshalJSON implements json unmarshaller. +func (bc *BalancerConfig) UnmarshalJSON(b []byte) error { + var ir intermediateBalancerConfig + err := json.Unmarshal(b, &ir) + if err != nil { + return err + } + + for i, lbcfg := range ir { + if len(lbcfg) != 1 { + return fmt.Errorf("invalid loadBalancingConfig: entry %v does not contain exactly 1 policy/config pair: %q", i, lbcfg) + } + var ( + name string + jsonCfg json.RawMessage + ) + // Get the key:value pair from the map. + for name, jsonCfg = range lbcfg { + } + builder := balancer.Get(name) + if builder == nil { + // If the balancer is not registered, move on to the next config. + // This is not an error. + continue + } + bc.Name = name + + parser, ok := builder.(balancer.ConfigParser) + if !ok { + if string(jsonCfg) != "{}" { + grpclog.Warningf("non-empty balancer configuration %q, but balancer does not implement ParseConfig", string(jsonCfg)) + } + // Stop at this, though the builder doesn't support parsing config. + return nil + } + + cfg, err := parser.ParseConfig(jsonCfg) + if err != nil { + return fmt.Errorf("error parsing loadBalancingConfig for policy %q: %v", name, err) + } + bc.Config = cfg + return nil + } + // This is reached when the for loop iterates over all entries, but didn't + // return. This means we had a loadBalancingConfig slice but did not + // encounter a registered policy. The config is considered invalid in this + // case. + return fmt.Errorf("invalid loadBalancingConfig: no supported policies found") +} diff --git a/vendor/google.golang.org/grpc/internal/status/status.go b/vendor/google.golang.org/grpc/internal/status/status.go new file mode 100644 index 000000000..710223b8d --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/status/status.go @@ -0,0 +1,162 @@ +/* + * + * Copyright 2020 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package status implements errors returned by gRPC. These errors are +// serialized and transmitted on the wire between server and client, and allow +// for additional data to be transmitted via the Details field in the status +// proto. gRPC service handlers should return an error created by this +// package, and gRPC clients should expect a corresponding error to be +// returned from the RPC call. +// +// This package upholds the invariants that a non-nil error may not +// contain an OK code, and an OK code must result in a nil error. +package status + +import ( + "errors" + "fmt" + + "github.com/golang/protobuf/proto" + "github.com/golang/protobuf/ptypes" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" +) + +// Status represents an RPC status code, message, and details. It is immutable +// and should be created with New, Newf, or FromProto. +type Status struct { + s *spb.Status +} + +// New returns a Status representing c and msg. +func New(c codes.Code, msg string) *Status { + return &Status{s: &spb.Status{Code: int32(c), Message: msg}} +} + +// Newf returns New(c, fmt.Sprintf(format, a...)). +func Newf(c codes.Code, format string, a ...interface{}) *Status { + return New(c, fmt.Sprintf(format, a...)) +} + +// FromProto returns a Status representing s. +func FromProto(s *spb.Status) *Status { + return &Status{s: proto.Clone(s).(*spb.Status)} +} + +// Err returns an error representing c and msg. If c is OK, returns nil. +func Err(c codes.Code, msg string) error { + return New(c, msg).Err() +} + +// Errorf returns Error(c, fmt.Sprintf(format, a...)). +func Errorf(c codes.Code, format string, a ...interface{}) error { + return Err(c, fmt.Sprintf(format, a...)) +} + +// Code returns the status code contained in s. +func (s *Status) Code() codes.Code { + if s == nil || s.s == nil { + return codes.OK + } + return codes.Code(s.s.Code) +} + +// Message returns the message contained in s. +func (s *Status) Message() string { + if s == nil || s.s == nil { + return "" + } + return s.s.Message +} + +// Proto returns s's status as an spb.Status proto message. +func (s *Status) Proto() *spb.Status { + if s == nil { + return nil + } + return proto.Clone(s.s).(*spb.Status) +} + +// Err returns an immutable error representing s; returns nil if s.Code() is OK. +func (s *Status) Err() error { + if s.Code() == codes.OK { + return nil + } + return &Error{e: s.Proto()} +} + +// WithDetails returns a new status with the provided details messages appended to the status. +// If any errors are encountered, it returns nil and the first error encountered. +func (s *Status) WithDetails(details ...proto.Message) (*Status, error) { + if s.Code() == codes.OK { + return nil, errors.New("no error details for status with code OK") + } + // s.Code() != OK implies that s.Proto() != nil. + p := s.Proto() + for _, detail := range details { + any, err := ptypes.MarshalAny(detail) + if err != nil { + return nil, err + } + p.Details = append(p.Details, any) + } + return &Status{s: p}, nil +} + +// Details returns a slice of details messages attached to the status. +// If a detail cannot be decoded, the error is returned in place of the detail. +func (s *Status) Details() []interface{} { + if s == nil || s.s == nil { + return nil + } + details := make([]interface{}, 0, len(s.s.Details)) + for _, any := range s.s.Details { + detail := &ptypes.DynamicAny{} + if err := ptypes.UnmarshalAny(any, detail); err != nil { + details = append(details, err) + continue + } + details = append(details, detail.Message) + } + return details +} + +// Error wraps a pointer of a status proto. It implements error and Status, +// and a nil *Error should never be returned by this package. +type Error struct { + e *spb.Status +} + +func (e *Error) Error() string { + return fmt.Sprintf("rpc error: code = %s desc = %s", codes.Code(e.e.GetCode()), e.e.GetMessage()) +} + +// GRPCStatus returns the Status represented by se. +func (e *Error) GRPCStatus() *Status { + return FromProto(e.e) +} + +// Is implements future error.Is functionality. +// A Error is equivalent if the code and message are identical. +func (e *Error) Is(target error) bool { + tse, ok := target.(*Error) + if !ok { + return false + } + return proto.Equal(e.e, tse.e) +} diff --git a/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go b/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go new file mode 100644 index 000000000..c50468a0f --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/syscall/syscall_linux.go @@ -0,0 +1,116 @@ +// +build !appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package syscall provides functionalities that grpc uses to get low-level operating system +// stats/info. +package syscall + +import ( + "fmt" + "net" + "syscall" + "time" + + "golang.org/x/sys/unix" + "google.golang.org/grpc/grpclog" +) + +var logger = grpclog.Component("core") + +// GetCPUTime returns the how much CPU time has passed since the start of this process. +func GetCPUTime() int64 { + var ts unix.Timespec + if err := unix.ClockGettime(unix.CLOCK_PROCESS_CPUTIME_ID, &ts); err != nil { + logger.Fatal(err) + } + return ts.Nano() +} + +// Rusage is an alias for syscall.Rusage under linux non-appengine environment. +type Rusage syscall.Rusage + +// GetRusage returns the resource usage of current process. +func GetRusage() (rusage *Rusage) { + rusage = new(Rusage) + syscall.Getrusage(syscall.RUSAGE_SELF, (*syscall.Rusage)(rusage)) + return +} + +// CPUTimeDiff returns the differences of user CPU time and system CPU time used +// between two Rusage structs. +func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) { + f := (*syscall.Rusage)(first) + l := (*syscall.Rusage)(latest) + var ( + utimeDiffs = l.Utime.Sec - f.Utime.Sec + utimeDiffus = l.Utime.Usec - f.Utime.Usec + stimeDiffs = l.Stime.Sec - f.Stime.Sec + stimeDiffus = l.Stime.Usec - f.Stime.Usec + ) + + uTimeElapsed := float64(utimeDiffs) + float64(utimeDiffus)*1.0e-6 + sTimeElapsed := float64(stimeDiffs) + float64(stimeDiffus)*1.0e-6 + + return uTimeElapsed, sTimeElapsed +} + +// SetTCPUserTimeout sets the TCP user timeout on a connection's socket +func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error { + tcpconn, ok := conn.(*net.TCPConn) + if !ok { + // not a TCP connection. exit early + return nil + } + rawConn, err := tcpconn.SyscallConn() + if err != nil { + return fmt.Errorf("error getting raw connection: %v", err) + } + err = rawConn.Control(func(fd uintptr) { + err = syscall.SetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT, int(timeout/time.Millisecond)) + }) + if err != nil { + return fmt.Errorf("error setting option on socket: %v", err) + } + + return nil +} + +// GetTCPUserTimeout gets the TCP user timeout on a connection's socket +func GetTCPUserTimeout(conn net.Conn) (opt int, err error) { + tcpconn, ok := conn.(*net.TCPConn) + if !ok { + err = fmt.Errorf("conn is not *net.TCPConn. got %T", conn) + return + } + rawConn, err := tcpconn.SyscallConn() + if err != nil { + err = fmt.Errorf("error getting raw connection: %v", err) + return + } + err = rawConn.Control(func(fd uintptr) { + opt, err = syscall.GetsockoptInt(int(fd), syscall.IPPROTO_TCP, unix.TCP_USER_TIMEOUT) + }) + if err != nil { + err = fmt.Errorf("error getting option on socket: %v", err) + return + } + + return +} diff --git a/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go b/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go new file mode 100644 index 000000000..adae60d65 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/syscall/syscall_nonlinux.go @@ -0,0 +1,76 @@ +// +build !linux appengine + +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package syscall provides functionalities that grpc uses to get low-level +// operating system stats/info. +package syscall + +import ( + "net" + "sync" + "time" + + "google.golang.org/grpc/grpclog" +) + +var once sync.Once +var logger = grpclog.Component("core") + +func log() { + once.Do(func() { + logger.Info("CPU time info is unavailable on non-linux or appengine environment.") + }) +} + +// GetCPUTime returns the how much CPU time has passed since the start of this process. +// It always returns 0 under non-linux or appengine environment. +func GetCPUTime() int64 { + log() + return 0 +} + +// Rusage is an empty struct under non-linux or appengine environment. +type Rusage struct{} + +// GetRusage is a no-op function under non-linux or appengine environment. +func GetRusage() (rusage *Rusage) { + log() + return nil +} + +// CPUTimeDiff returns the differences of user CPU time and system CPU time used +// between two Rusage structs. It a no-op function for non-linux or appengine environment. +func CPUTimeDiff(first *Rusage, latest *Rusage) (float64, float64) { + log() + return 0, 0 +} + +// SetTCPUserTimeout is a no-op function under non-linux or appengine environments +func SetTCPUserTimeout(conn net.Conn, timeout time.Duration) error { + log() + return nil +} + +// GetTCPUserTimeout is a no-op function under non-linux or appengine environments +// a negative return value indicates the operation is not supported +func GetTCPUserTimeout(conn net.Conn) (int, error) { + log() + return -1, nil +} diff --git a/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go b/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go new file mode 100644 index 000000000..070680edb --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/bdp_estimator.go @@ -0,0 +1,141 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "sync" + "time" +) + +const ( + // bdpLimit is the maximum value the flow control windows will be increased + // to. TCP typically limits this to 4MB, but some systems go up to 16MB. + // Since this is only a limit, it is safe to make it optimistic. + bdpLimit = (1 << 20) * 16 + // alpha is a constant factor used to keep a moving average + // of RTTs. + alpha = 0.9 + // If the current bdp sample is greater than or equal to + // our beta * our estimated bdp and the current bandwidth + // sample is the maximum bandwidth observed so far, we + // increase our bbp estimate by a factor of gamma. + beta = 0.66 + // To put our bdp to be smaller than or equal to twice the real BDP, + // we should multiply our current sample with 4/3, however to round things out + // we use 2 as the multiplication factor. + gamma = 2 +) + +// Adding arbitrary data to ping so that its ack can be identified. +// Easter-egg: what does the ping message say? +var bdpPing = &ping{data: [8]byte{2, 4, 16, 16, 9, 14, 7, 7}} + +type bdpEstimator struct { + // sentAt is the time when the ping was sent. + sentAt time.Time + + mu sync.Mutex + // bdp is the current bdp estimate. + bdp uint32 + // sample is the number of bytes received in one measurement cycle. + sample uint32 + // bwMax is the maximum bandwidth noted so far (bytes/sec). + bwMax float64 + // bool to keep track of the beginning of a new measurement cycle. + isSent bool + // Callback to update the window sizes. + updateFlowControl func(n uint32) + // sampleCount is the number of samples taken so far. + sampleCount uint64 + // round trip time (seconds) + rtt float64 +} + +// timesnap registers the time bdp ping was sent out so that +// network rtt can be calculated when its ack is received. +// It is called (by controller) when the bdpPing is +// being written on the wire. +func (b *bdpEstimator) timesnap(d [8]byte) { + if bdpPing.data != d { + return + } + b.sentAt = time.Now() +} + +// add adds bytes to the current sample for calculating bdp. +// It returns true only if a ping must be sent. This can be used +// by the caller (handleData) to make decision about batching +// a window update with it. +func (b *bdpEstimator) add(n uint32) bool { + b.mu.Lock() + defer b.mu.Unlock() + if b.bdp == bdpLimit { + return false + } + if !b.isSent { + b.isSent = true + b.sample = n + b.sentAt = time.Time{} + b.sampleCount++ + return true + } + b.sample += n + return false +} + +// calculate is called when an ack for a bdp ping is received. +// Here we calculate the current bdp and bandwidth sample and +// decide if the flow control windows should go up. +func (b *bdpEstimator) calculate(d [8]byte) { + // Check if the ping acked for was the bdp ping. + if bdpPing.data != d { + return + } + b.mu.Lock() + rttSample := time.Since(b.sentAt).Seconds() + if b.sampleCount < 10 { + // Bootstrap rtt with an average of first 10 rtt samples. + b.rtt += (rttSample - b.rtt) / float64(b.sampleCount) + } else { + // Heed to the recent past more. + b.rtt += (rttSample - b.rtt) * float64(alpha) + } + b.isSent = false + // The number of bytes accumulated so far in the sample is smaller + // than or equal to 1.5 times the real BDP on a saturated connection. + bwCurrent := float64(b.sample) / (b.rtt * float64(1.5)) + if bwCurrent > b.bwMax { + b.bwMax = bwCurrent + } + // If the current sample (which is smaller than or equal to the 1.5 times the real BDP) is + // greater than or equal to 2/3rd our perceived bdp AND this is the maximum bandwidth seen so far, we + // should update our perception of the network BDP. + if float64(b.sample) >= beta*float64(b.bdp) && bwCurrent == b.bwMax && b.bdp != bdpLimit { + sampleFloat := float64(b.sample) + b.bdp = uint32(gamma * sampleFloat) + if b.bdp > bdpLimit { + b.bdp = bdpLimit + } + bdp := b.bdp + b.mu.Unlock() + b.updateFlowControl(bdp) + return + } + b.mu.Unlock() +} diff --git a/vendor/google.golang.org/grpc/internal/transport/controlbuf.go b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go new file mode 100644 index 000000000..40ef23923 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/controlbuf.go @@ -0,0 +1,942 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "bytes" + "fmt" + "runtime" + "sync" + "sync/atomic" + + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" +) + +var updateHeaderTblSize = func(e *hpack.Encoder, v uint32) { + e.SetMaxDynamicTableSizeLimit(v) +} + +type itemNode struct { + it interface{} + next *itemNode +} + +type itemList struct { + head *itemNode + tail *itemNode +} + +func (il *itemList) enqueue(i interface{}) { + n := &itemNode{it: i} + if il.tail == nil { + il.head, il.tail = n, n + return + } + il.tail.next = n + il.tail = n +} + +// peek returns the first item in the list without removing it from the +// list. +func (il *itemList) peek() interface{} { + return il.head.it +} + +func (il *itemList) dequeue() interface{} { + if il.head == nil { + return nil + } + i := il.head.it + il.head = il.head.next + if il.head == nil { + il.tail = nil + } + return i +} + +func (il *itemList) dequeueAll() *itemNode { + h := il.head + il.head, il.tail = nil, nil + return h +} + +func (il *itemList) isEmpty() bool { + return il.head == nil +} + +// The following defines various control items which could flow through +// the control buffer of transport. They represent different aspects of +// control tasks, e.g., flow control, settings, streaming resetting, etc. + +// maxQueuedTransportResponseFrames is the most queued "transport response" +// frames we will buffer before preventing new reads from occurring on the +// transport. These are control frames sent in response to client requests, +// such as RST_STREAM due to bad headers or settings acks. +const maxQueuedTransportResponseFrames = 50 + +type cbItem interface { + isTransportResponseFrame() bool +} + +// registerStream is used to register an incoming stream with loopy writer. +type registerStream struct { + streamID uint32 + wq *writeQuota +} + +func (*registerStream) isTransportResponseFrame() bool { return false } + +// headerFrame is also used to register stream on the client-side. +type headerFrame struct { + streamID uint32 + hf []hpack.HeaderField + endStream bool // Valid on server side. + initStream func(uint32) error // Used only on the client side. + onWrite func() + wq *writeQuota // write quota for the stream created. + cleanup *cleanupStream // Valid on the server side. + onOrphaned func(error) // Valid on client-side +} + +func (h *headerFrame) isTransportResponseFrame() bool { + return h.cleanup != nil && h.cleanup.rst // Results in a RST_STREAM +} + +type cleanupStream struct { + streamID uint32 + rst bool + rstCode http2.ErrCode + onWrite func() +} + +func (c *cleanupStream) isTransportResponseFrame() bool { return c.rst } // Results in a RST_STREAM + +type dataFrame struct { + streamID uint32 + endStream bool + h []byte + d []byte + // onEachWrite is called every time + // a part of d is written out. + onEachWrite func() +} + +func (*dataFrame) isTransportResponseFrame() bool { return false } + +type incomingWindowUpdate struct { + streamID uint32 + increment uint32 +} + +func (*incomingWindowUpdate) isTransportResponseFrame() bool { return false } + +type outgoingWindowUpdate struct { + streamID uint32 + increment uint32 +} + +func (*outgoingWindowUpdate) isTransportResponseFrame() bool { + return false // window updates are throttled by thresholds +} + +type incomingSettings struct { + ss []http2.Setting +} + +func (*incomingSettings) isTransportResponseFrame() bool { return true } // Results in a settings ACK + +type outgoingSettings struct { + ss []http2.Setting +} + +func (*outgoingSettings) isTransportResponseFrame() bool { return false } + +type incomingGoAway struct { +} + +func (*incomingGoAway) isTransportResponseFrame() bool { return false } + +type goAway struct { + code http2.ErrCode + debugData []byte + headsUp bool + closeConn bool +} + +func (*goAway) isTransportResponseFrame() bool { return false } + +type ping struct { + ack bool + data [8]byte +} + +func (*ping) isTransportResponseFrame() bool { return true } + +type outFlowControlSizeRequest struct { + resp chan uint32 +} + +func (*outFlowControlSizeRequest) isTransportResponseFrame() bool { return false } + +type outStreamState int + +const ( + active outStreamState = iota + empty + waitingOnStreamQuota +) + +type outStream struct { + id uint32 + state outStreamState + itl *itemList + bytesOutStanding int + wq *writeQuota + + next *outStream + prev *outStream +} + +func (s *outStream) deleteSelf() { + if s.prev != nil { + s.prev.next = s.next + } + if s.next != nil { + s.next.prev = s.prev + } + s.next, s.prev = nil, nil +} + +type outStreamList struct { + // Following are sentinel objects that mark the + // beginning and end of the list. They do not + // contain any item lists. All valid objects are + // inserted in between them. + // This is needed so that an outStream object can + // deleteSelf() in O(1) time without knowing which + // list it belongs to. + head *outStream + tail *outStream +} + +func newOutStreamList() *outStreamList { + head, tail := new(outStream), new(outStream) + head.next = tail + tail.prev = head + return &outStreamList{ + head: head, + tail: tail, + } +} + +func (l *outStreamList) enqueue(s *outStream) { + e := l.tail.prev + e.next = s + s.prev = e + s.next = l.tail + l.tail.prev = s +} + +// remove from the beginning of the list. +func (l *outStreamList) dequeue() *outStream { + b := l.head.next + if b == l.tail { + return nil + } + b.deleteSelf() + return b +} + +// controlBuffer is a way to pass information to loopy. +// Information is passed as specific struct types called control frames. +// A control frame not only represents data, messages or headers to be sent out +// but can also be used to instruct loopy to update its internal state. +// It shouldn't be confused with an HTTP2 frame, although some of the control frames +// like dataFrame and headerFrame do go out on wire as HTTP2 frames. +type controlBuffer struct { + ch chan struct{} + done <-chan struct{} + mu sync.Mutex + consumerWaiting bool + list *itemList + err error + + // transportResponseFrames counts the number of queued items that represent + // the response of an action initiated by the peer. trfChan is created + // when transportResponseFrames >= maxQueuedTransportResponseFrames and is + // closed and nilled when transportResponseFrames drops below the + // threshold. Both fields are protected by mu. + transportResponseFrames int + trfChan atomic.Value // *chan struct{} +} + +func newControlBuffer(done <-chan struct{}) *controlBuffer { + return &controlBuffer{ + ch: make(chan struct{}, 1), + list: &itemList{}, + done: done, + } +} + +// throttle blocks if there are too many incomingSettings/cleanupStreams in the +// controlbuf. +func (c *controlBuffer) throttle() { + ch, _ := c.trfChan.Load().(*chan struct{}) + if ch != nil { + select { + case <-*ch: + case <-c.done: + } + } +} + +func (c *controlBuffer) put(it cbItem) error { + _, err := c.executeAndPut(nil, it) + return err +} + +func (c *controlBuffer) executeAndPut(f func(it interface{}) bool, it cbItem) (bool, error) { + var wakeUp bool + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return false, c.err + } + if f != nil { + if !f(it) { // f wasn't successful + c.mu.Unlock() + return false, nil + } + } + if c.consumerWaiting { + wakeUp = true + c.consumerWaiting = false + } + c.list.enqueue(it) + if it.isTransportResponseFrame() { + c.transportResponseFrames++ + if c.transportResponseFrames == maxQueuedTransportResponseFrames { + // We are adding the frame that puts us over the threshold; create + // a throttling channel. + ch := make(chan struct{}) + c.trfChan.Store(&ch) + } + } + c.mu.Unlock() + if wakeUp { + select { + case c.ch <- struct{}{}: + default: + } + } + return true, nil +} + +// Note argument f should never be nil. +func (c *controlBuffer) execute(f func(it interface{}) bool, it interface{}) (bool, error) { + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return false, c.err + } + if !f(it) { // f wasn't successful + c.mu.Unlock() + return false, nil + } + c.mu.Unlock() + return true, nil +} + +func (c *controlBuffer) get(block bool) (interface{}, error) { + for { + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return nil, c.err + } + if !c.list.isEmpty() { + h := c.list.dequeue().(cbItem) + if h.isTransportResponseFrame() { + if c.transportResponseFrames == maxQueuedTransportResponseFrames { + // We are removing the frame that put us over the + // threshold; close and clear the throttling channel. + ch := c.trfChan.Load().(*chan struct{}) + close(*ch) + c.trfChan.Store((*chan struct{})(nil)) + } + c.transportResponseFrames-- + } + c.mu.Unlock() + return h, nil + } + if !block { + c.mu.Unlock() + return nil, nil + } + c.consumerWaiting = true + c.mu.Unlock() + select { + case <-c.ch: + case <-c.done: + c.finish() + return nil, ErrConnClosing + } + } +} + +func (c *controlBuffer) finish() { + c.mu.Lock() + if c.err != nil { + c.mu.Unlock() + return + } + c.err = ErrConnClosing + // There may be headers for streams in the control buffer. + // These streams need to be cleaned out since the transport + // is still not aware of these yet. + for head := c.list.dequeueAll(); head != nil; head = head.next { + hdr, ok := head.it.(*headerFrame) + if !ok { + continue + } + if hdr.onOrphaned != nil { // It will be nil on the server-side. + hdr.onOrphaned(ErrConnClosing) + } + } + c.mu.Unlock() +} + +type side int + +const ( + clientSide side = iota + serverSide +) + +// Loopy receives frames from the control buffer. +// Each frame is handled individually; most of the work done by loopy goes +// into handling data frames. Loopy maintains a queue of active streams, and each +// stream maintains a queue of data frames; as loopy receives data frames +// it gets added to the queue of the relevant stream. +// Loopy goes over this list of active streams by processing one node every iteration, +// thereby closely resemebling to a round-robin scheduling over all streams. While +// processing a stream, loopy writes out data bytes from this stream capped by the min +// of http2MaxFrameLen, connection-level flow control and stream-level flow control. +type loopyWriter struct { + side side + cbuf *controlBuffer + sendQuota uint32 + oiws uint32 // outbound initial window size. + // estdStreams is map of all established streams that are not cleaned-up yet. + // On client-side, this is all streams whose headers were sent out. + // On server-side, this is all streams whose headers were received. + estdStreams map[uint32]*outStream // Established streams. + // activeStreams is a linked-list of all streams that have data to send and some + // stream-level flow control quota. + // Each of these streams internally have a list of data items(and perhaps trailers + // on the server-side) to be sent out. + activeStreams *outStreamList + framer *framer + hBuf *bytes.Buffer // The buffer for HPACK encoding. + hEnc *hpack.Encoder // HPACK encoder. + bdpEst *bdpEstimator + draining bool + + // Side-specific handlers + ssGoAwayHandler func(*goAway) (bool, error) +} + +func newLoopyWriter(s side, fr *framer, cbuf *controlBuffer, bdpEst *bdpEstimator) *loopyWriter { + var buf bytes.Buffer + l := &loopyWriter{ + side: s, + cbuf: cbuf, + sendQuota: defaultWindowSize, + oiws: defaultWindowSize, + estdStreams: make(map[uint32]*outStream), + activeStreams: newOutStreamList(), + framer: fr, + hBuf: &buf, + hEnc: hpack.NewEncoder(&buf), + bdpEst: bdpEst, + } + return l +} + +const minBatchSize = 1000 + +// run should be run in a separate goroutine. +// It reads control frames from controlBuf and processes them by: +// 1. Updating loopy's internal state, or/and +// 2. Writing out HTTP2 frames on the wire. +// +// Loopy keeps all active streams with data to send in a linked-list. +// All streams in the activeStreams linked-list must have both: +// 1. Data to send, and +// 2. Stream level flow control quota available. +// +// In each iteration of run loop, other than processing the incoming control +// frame, loopy calls processData, which processes one node from the activeStreams linked-list. +// This results in writing of HTTP2 frames into an underlying write buffer. +// When there's no more control frames to read from controlBuf, loopy flushes the write buffer. +// As an optimization, to increase the batch size for each flush, loopy yields the processor, once +// if the batch size is too low to give stream goroutines a chance to fill it up. +func (l *loopyWriter) run() (err error) { + defer func() { + if err == ErrConnClosing { + // Don't log ErrConnClosing as error since it happens + // 1. When the connection is closed by some other known issue. + // 2. User closed the connection. + // 3. A graceful close of connection. + if logger.V(logLevel) { + logger.Infof("transport: loopyWriter.run returning. %v", err) + } + err = nil + } + }() + for { + it, err := l.cbuf.get(true) + if err != nil { + return err + } + if err = l.handle(it); err != nil { + return err + } + if _, err = l.processData(); err != nil { + return err + } + gosched := true + hasdata: + for { + it, err := l.cbuf.get(false) + if err != nil { + return err + } + if it != nil { + if err = l.handle(it); err != nil { + return err + } + if _, err = l.processData(); err != nil { + return err + } + continue hasdata + } + isEmpty, err := l.processData() + if err != nil { + return err + } + if !isEmpty { + continue hasdata + } + if gosched { + gosched = false + if l.framer.writer.offset < minBatchSize { + runtime.Gosched() + continue hasdata + } + } + l.framer.writer.Flush() + break hasdata + + } + } +} + +func (l *loopyWriter) outgoingWindowUpdateHandler(w *outgoingWindowUpdate) error { + return l.framer.fr.WriteWindowUpdate(w.streamID, w.increment) +} + +func (l *loopyWriter) incomingWindowUpdateHandler(w *incomingWindowUpdate) error { + // Otherwise update the quota. + if w.streamID == 0 { + l.sendQuota += w.increment + return nil + } + // Find the stream and update it. + if str, ok := l.estdStreams[w.streamID]; ok { + str.bytesOutStanding -= int(w.increment) + if strQuota := int(l.oiws) - str.bytesOutStanding; strQuota > 0 && str.state == waitingOnStreamQuota { + str.state = active + l.activeStreams.enqueue(str) + return nil + } + } + return nil +} + +func (l *loopyWriter) outgoingSettingsHandler(s *outgoingSettings) error { + return l.framer.fr.WriteSettings(s.ss...) +} + +func (l *loopyWriter) incomingSettingsHandler(s *incomingSettings) error { + if err := l.applySettings(s.ss); err != nil { + return err + } + return l.framer.fr.WriteSettingsAck() +} + +func (l *loopyWriter) registerStreamHandler(h *registerStream) error { + str := &outStream{ + id: h.streamID, + state: empty, + itl: &itemList{}, + wq: h.wq, + } + l.estdStreams[h.streamID] = str + return nil +} + +func (l *loopyWriter) headerHandler(h *headerFrame) error { + if l.side == serverSide { + str, ok := l.estdStreams[h.streamID] + if !ok { + if logger.V(logLevel) { + logger.Warningf("transport: loopy doesn't recognize the stream: %d", h.streamID) + } + return nil + } + // Case 1.A: Server is responding back with headers. + if !h.endStream { + return l.writeHeader(h.streamID, h.endStream, h.hf, h.onWrite) + } + // else: Case 1.B: Server wants to close stream. + + if str.state != empty { // either active or waiting on stream quota. + // add it str's list of items. + str.itl.enqueue(h) + return nil + } + if err := l.writeHeader(h.streamID, h.endStream, h.hf, h.onWrite); err != nil { + return err + } + return l.cleanupStreamHandler(h.cleanup) + } + // Case 2: Client wants to originate stream. + str := &outStream{ + id: h.streamID, + state: empty, + itl: &itemList{}, + wq: h.wq, + } + str.itl.enqueue(h) + return l.originateStream(str) +} + +func (l *loopyWriter) originateStream(str *outStream) error { + hdr := str.itl.dequeue().(*headerFrame) + if err := hdr.initStream(str.id); err != nil { + if err == ErrConnClosing { + return err + } + // Other errors(errStreamDrain) need not close transport. + return nil + } + if err := l.writeHeader(str.id, hdr.endStream, hdr.hf, hdr.onWrite); err != nil { + return err + } + l.estdStreams[str.id] = str + return nil +} + +func (l *loopyWriter) writeHeader(streamID uint32, endStream bool, hf []hpack.HeaderField, onWrite func()) error { + if onWrite != nil { + onWrite() + } + l.hBuf.Reset() + for _, f := range hf { + if err := l.hEnc.WriteField(f); err != nil { + if logger.V(logLevel) { + logger.Warningf("transport: loopyWriter.writeHeader encountered error while encoding headers: %v", err) + } + } + } + var ( + err error + endHeaders, first bool + ) + first = true + for !endHeaders { + size := l.hBuf.Len() + if size > http2MaxFrameLen { + size = http2MaxFrameLen + } else { + endHeaders = true + } + if first { + first = false + err = l.framer.fr.WriteHeaders(http2.HeadersFrameParam{ + StreamID: streamID, + BlockFragment: l.hBuf.Next(size), + EndStream: endStream, + EndHeaders: endHeaders, + }) + } else { + err = l.framer.fr.WriteContinuation( + streamID, + endHeaders, + l.hBuf.Next(size), + ) + } + if err != nil { + return err + } + } + return nil +} + +func (l *loopyWriter) preprocessData(df *dataFrame) error { + str, ok := l.estdStreams[df.streamID] + if !ok { + return nil + } + // If we got data for a stream it means that + // stream was originated and the headers were sent out. + str.itl.enqueue(df) + if str.state == empty { + str.state = active + l.activeStreams.enqueue(str) + } + return nil +} + +func (l *loopyWriter) pingHandler(p *ping) error { + if !p.ack { + l.bdpEst.timesnap(p.data) + } + return l.framer.fr.WritePing(p.ack, p.data) + +} + +func (l *loopyWriter) outFlowControlSizeRequestHandler(o *outFlowControlSizeRequest) error { + o.resp <- l.sendQuota + return nil +} + +func (l *loopyWriter) cleanupStreamHandler(c *cleanupStream) error { + c.onWrite() + if str, ok := l.estdStreams[c.streamID]; ok { + // On the server side it could be a trailers-only response or + // a RST_STREAM before stream initialization thus the stream might + // not be established yet. + delete(l.estdStreams, c.streamID) + str.deleteSelf() + } + if c.rst { // If RST_STREAM needs to be sent. + if err := l.framer.fr.WriteRSTStream(c.streamID, c.rstCode); err != nil { + return err + } + } + if l.side == clientSide && l.draining && len(l.estdStreams) == 0 { + return ErrConnClosing + } + return nil +} + +func (l *loopyWriter) incomingGoAwayHandler(*incomingGoAway) error { + if l.side == clientSide { + l.draining = true + if len(l.estdStreams) == 0 { + return ErrConnClosing + } + } + return nil +} + +func (l *loopyWriter) goAwayHandler(g *goAway) error { + // Handling of outgoing GoAway is very specific to side. + if l.ssGoAwayHandler != nil { + draining, err := l.ssGoAwayHandler(g) + if err != nil { + return err + } + l.draining = draining + } + return nil +} + +func (l *loopyWriter) handle(i interface{}) error { + switch i := i.(type) { + case *incomingWindowUpdate: + return l.incomingWindowUpdateHandler(i) + case *outgoingWindowUpdate: + return l.outgoingWindowUpdateHandler(i) + case *incomingSettings: + return l.incomingSettingsHandler(i) + case *outgoingSettings: + return l.outgoingSettingsHandler(i) + case *headerFrame: + return l.headerHandler(i) + case *registerStream: + return l.registerStreamHandler(i) + case *cleanupStream: + return l.cleanupStreamHandler(i) + case *incomingGoAway: + return l.incomingGoAwayHandler(i) + case *dataFrame: + return l.preprocessData(i) + case *ping: + return l.pingHandler(i) + case *goAway: + return l.goAwayHandler(i) + case *outFlowControlSizeRequest: + return l.outFlowControlSizeRequestHandler(i) + default: + return fmt.Errorf("transport: unknown control message type %T", i) + } +} + +func (l *loopyWriter) applySettings(ss []http2.Setting) error { + for _, s := range ss { + switch s.ID { + case http2.SettingInitialWindowSize: + o := l.oiws + l.oiws = s.Val + if o < l.oiws { + // If the new limit is greater make all depleted streams active. + for _, stream := range l.estdStreams { + if stream.state == waitingOnStreamQuota { + stream.state = active + l.activeStreams.enqueue(stream) + } + } + } + case http2.SettingHeaderTableSize: + updateHeaderTblSize(l.hEnc, s.Val) + } + } + return nil +} + +// processData removes the first stream from active streams, writes out at most 16KB +// of its data and then puts it at the end of activeStreams if there's still more data +// to be sent and stream has some stream-level flow control. +func (l *loopyWriter) processData() (bool, error) { + if l.sendQuota == 0 { + return true, nil + } + str := l.activeStreams.dequeue() // Remove the first stream. + if str == nil { + return true, nil + } + dataItem := str.itl.peek().(*dataFrame) // Peek at the first data item this stream. + // A data item is represented by a dataFrame, since it later translates into + // multiple HTTP2 data frames. + // Every dataFrame has two buffers; h that keeps grpc-message header and d that is acutal data. + // As an optimization to keep wire traffic low, data from d is copied to h to make as big as the + // maximum possilbe HTTP2 frame size. + + if len(dataItem.h) == 0 && len(dataItem.d) == 0 { // Empty data frame + // Client sends out empty data frame with endStream = true + if err := l.framer.fr.WriteData(dataItem.streamID, dataItem.endStream, nil); err != nil { + return false, err + } + str.itl.dequeue() // remove the empty data item from stream + if str.itl.isEmpty() { + str.state = empty + } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // the next item is trailers. + if err := l.writeHeader(trailer.streamID, trailer.endStream, trailer.hf, trailer.onWrite); err != nil { + return false, err + } + if err := l.cleanupStreamHandler(trailer.cleanup); err != nil { + return false, nil + } + } else { + l.activeStreams.enqueue(str) + } + return false, nil + } + var ( + buf []byte + ) + // Figure out the maximum size we can send + maxSize := http2MaxFrameLen + if strQuota := int(l.oiws) - str.bytesOutStanding; strQuota <= 0 { // stream-level flow control. + str.state = waitingOnStreamQuota + return false, nil + } else if maxSize > strQuota { + maxSize = strQuota + } + if maxSize > int(l.sendQuota) { // connection-level flow control. + maxSize = int(l.sendQuota) + } + // Compute how much of the header and data we can send within quota and max frame length + hSize := min(maxSize, len(dataItem.h)) + dSize := min(maxSize-hSize, len(dataItem.d)) + if hSize != 0 { + if dSize == 0 { + buf = dataItem.h + } else { + // We can add some data to grpc message header to distribute bytes more equally across frames. + // Copy on the stack to avoid generating garbage + var localBuf [http2MaxFrameLen]byte + copy(localBuf[:hSize], dataItem.h) + copy(localBuf[hSize:], dataItem.d[:dSize]) + buf = localBuf[:hSize+dSize] + } + } else { + buf = dataItem.d + } + + size := hSize + dSize + + // Now that outgoing flow controls are checked we can replenish str's write quota + str.wq.replenish(size) + var endStream bool + // If this is the last data message on this stream and all of it can be written in this iteration. + if dataItem.endStream && len(dataItem.h)+len(dataItem.d) <= size { + endStream = true + } + if dataItem.onEachWrite != nil { + dataItem.onEachWrite() + } + if err := l.framer.fr.WriteData(dataItem.streamID, endStream, buf[:size]); err != nil { + return false, err + } + str.bytesOutStanding += size + l.sendQuota -= uint32(size) + dataItem.h = dataItem.h[hSize:] + dataItem.d = dataItem.d[dSize:] + + if len(dataItem.h) == 0 && len(dataItem.d) == 0 { // All the data from that message was written out. + str.itl.dequeue() + } + if str.itl.isEmpty() { + str.state = empty + } else if trailer, ok := str.itl.peek().(*headerFrame); ok { // The next item is trailers. + if err := l.writeHeader(trailer.streamID, trailer.endStream, trailer.hf, trailer.onWrite); err != nil { + return false, err + } + if err := l.cleanupStreamHandler(trailer.cleanup); err != nil { + return false, err + } + } else if int(l.oiws)-str.bytesOutStanding <= 0 { // Ran out of stream quota. + str.state = waitingOnStreamQuota + } else { // Otherwise add it back to the list of active streams. + l.activeStreams.enqueue(str) + } + return false, nil +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} diff --git a/vendor/google.golang.org/grpc/internal/transport/defaults.go b/vendor/google.golang.org/grpc/internal/transport/defaults.go new file mode 100644 index 000000000..9fa306b2e --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/defaults.go @@ -0,0 +1,49 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "math" + "time" +) + +const ( + // The default value of flow control window size in HTTP2 spec. + defaultWindowSize = 65535 + // The initial window size for flow control. + initialWindowSize = defaultWindowSize // for an RPC + infinity = time.Duration(math.MaxInt64) + defaultClientKeepaliveTime = infinity + defaultClientKeepaliveTimeout = 20 * time.Second + defaultMaxStreamsClient = 100 + defaultMaxConnectionIdle = infinity + defaultMaxConnectionAge = infinity + defaultMaxConnectionAgeGrace = infinity + defaultServerKeepaliveTime = 2 * time.Hour + defaultServerKeepaliveTimeout = 20 * time.Second + defaultKeepalivePolicyMinTime = 5 * time.Minute + // max window limit set by HTTP2 Specs. + maxWindowSize = math.MaxInt32 + // defaultWriteQuota is the default value for number of data + // bytes that each stream can schedule before some of it being + // flushed out. + defaultWriteQuota = 64 * 1024 + defaultClientMaxHeaderListSize = uint32(16 << 20) + defaultServerMaxHeaderListSize = uint32(16 << 20) +) diff --git a/vendor/google.golang.org/grpc/internal/transport/flowcontrol.go b/vendor/google.golang.org/grpc/internal/transport/flowcontrol.go new file mode 100644 index 000000000..f262edd8e --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/flowcontrol.go @@ -0,0 +1,217 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "fmt" + "math" + "sync" + "sync/atomic" +) + +// writeQuota is a soft limit on the amount of data a stream can +// schedule before some of it is written out. +type writeQuota struct { + quota int32 + // get waits on read from when quota goes less than or equal to zero. + // replenish writes on it when quota goes positive again. + ch chan struct{} + // done is triggered in error case. + done <-chan struct{} + // replenish is called by loopyWriter to give quota back to. + // It is implemented as a field so that it can be updated + // by tests. + replenish func(n int) +} + +func newWriteQuota(sz int32, done <-chan struct{}) *writeQuota { + w := &writeQuota{ + quota: sz, + ch: make(chan struct{}, 1), + done: done, + } + w.replenish = w.realReplenish + return w +} + +func (w *writeQuota) get(sz int32) error { + for { + if atomic.LoadInt32(&w.quota) > 0 { + atomic.AddInt32(&w.quota, -sz) + return nil + } + select { + case <-w.ch: + continue + case <-w.done: + return errStreamDone + } + } +} + +func (w *writeQuota) realReplenish(n int) { + sz := int32(n) + a := atomic.AddInt32(&w.quota, sz) + b := a - sz + if b <= 0 && a > 0 { + select { + case w.ch <- struct{}{}: + default: + } + } +} + +type trInFlow struct { + limit uint32 + unacked uint32 + effectiveWindowSize uint32 +} + +func (f *trInFlow) newLimit(n uint32) uint32 { + d := n - f.limit + f.limit = n + f.updateEffectiveWindowSize() + return d +} + +func (f *trInFlow) onData(n uint32) uint32 { + f.unacked += n + if f.unacked >= f.limit/4 { + w := f.unacked + f.unacked = 0 + f.updateEffectiveWindowSize() + return w + } + f.updateEffectiveWindowSize() + return 0 +} + +func (f *trInFlow) reset() uint32 { + w := f.unacked + f.unacked = 0 + f.updateEffectiveWindowSize() + return w +} + +func (f *trInFlow) updateEffectiveWindowSize() { + atomic.StoreUint32(&f.effectiveWindowSize, f.limit-f.unacked) +} + +func (f *trInFlow) getSize() uint32 { + return atomic.LoadUint32(&f.effectiveWindowSize) +} + +// TODO(mmukhi): Simplify this code. +// inFlow deals with inbound flow control +type inFlow struct { + mu sync.Mutex + // The inbound flow control limit for pending data. + limit uint32 + // pendingData is the overall data which have been received but not been + // consumed by applications. + pendingData uint32 + // The amount of data the application has consumed but grpc has not sent + // window update for them. Used to reduce window update frequency. + pendingUpdate uint32 + // delta is the extra window update given by receiver when an application + // is reading data bigger in size than the inFlow limit. + delta uint32 +} + +// newLimit updates the inflow window to a new value n. +// It assumes that n is always greater than the old limit. +func (f *inFlow) newLimit(n uint32) uint32 { + f.mu.Lock() + d := n - f.limit + f.limit = n + f.mu.Unlock() + return d +} + +func (f *inFlow) maybeAdjust(n uint32) uint32 { + if n > uint32(math.MaxInt32) { + n = uint32(math.MaxInt32) + } + f.mu.Lock() + defer f.mu.Unlock() + // estSenderQuota is the receiver's view of the maximum number of bytes the sender + // can send without a window update. + estSenderQuota := int32(f.limit - (f.pendingData + f.pendingUpdate)) + // estUntransmittedData is the maximum number of bytes the sends might not have put + // on the wire yet. A value of 0 or less means that we have already received all or + // more bytes than the application is requesting to read. + estUntransmittedData := int32(n - f.pendingData) // Casting into int32 since it could be negative. + // This implies that unless we send a window update, the sender won't be able to send all the bytes + // for this message. Therefore we must send an update over the limit since there's an active read + // request from the application. + if estUntransmittedData > estSenderQuota { + // Sender's window shouldn't go more than 2^31 - 1 as specified in the HTTP spec. + if f.limit+n > maxWindowSize { + f.delta = maxWindowSize - f.limit + } else { + // Send a window update for the whole message and not just the difference between + // estUntransmittedData and estSenderQuota. This will be helpful in case the message + // is padded; We will fallback on the current available window(at least a 1/4th of the limit). + f.delta = n + } + return f.delta + } + return 0 +} + +// onData is invoked when some data frame is received. It updates pendingData. +func (f *inFlow) onData(n uint32) error { + f.mu.Lock() + f.pendingData += n + if f.pendingData+f.pendingUpdate > f.limit+f.delta { + limit := f.limit + rcvd := f.pendingData + f.pendingUpdate + f.mu.Unlock() + return fmt.Errorf("received %d-bytes data exceeding the limit %d bytes", rcvd, limit) + } + f.mu.Unlock() + return nil +} + +// onRead is invoked when the application reads the data. It returns the window size +// to be sent to the peer. +func (f *inFlow) onRead(n uint32) uint32 { + f.mu.Lock() + if f.pendingData == 0 { + f.mu.Unlock() + return 0 + } + f.pendingData -= n + if n > f.delta { + n -= f.delta + f.delta = 0 + } else { + f.delta -= n + n = 0 + } + f.pendingUpdate += n + if f.pendingUpdate >= f.limit/4 { + wu := f.pendingUpdate + f.pendingUpdate = 0 + f.mu.Unlock() + return wu + } + f.mu.Unlock() + return 0 +} diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go new file mode 100644 index 000000000..05d3871e6 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -0,0 +1,463 @@ +/* + * + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// This file is the implementation of a gRPC server using HTTP/2 which +// uses the standard Go http2 Server implementation (via the +// http.Handler interface), rather than speaking low-level HTTP/2 +// frames itself. It is the implementation of *grpc.Server.ServeHTTP. + +package transport + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "net" + "net/http" + "strings" + "sync" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/http2" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" +) + +// NewServerHandlerTransport returns a ServerTransport handling gRPC +// from inside an http.Handler. It requires that the http Server +// supports HTTP/2. +func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats stats.Handler) (ServerTransport, error) { + if r.ProtoMajor != 2 { + return nil, errors.New("gRPC requires HTTP/2") + } + if r.Method != "POST" { + return nil, errors.New("invalid gRPC request method") + } + contentType := r.Header.Get("Content-Type") + // TODO: do we assume contentType is lowercase? we did before + contentSubtype, validContentType := grpcutil.ContentSubtype(contentType) + if !validContentType { + return nil, errors.New("invalid gRPC request content-type") + } + if _, ok := w.(http.Flusher); !ok { + return nil, errors.New("gRPC requires a ResponseWriter supporting http.Flusher") + } + + st := &serverHandlerTransport{ + rw: w, + req: r, + closedCh: make(chan struct{}), + writes: make(chan func()), + contentType: contentType, + contentSubtype: contentSubtype, + stats: stats, + } + + if v := r.Header.Get("grpc-timeout"); v != "" { + to, err := decodeTimeout(v) + if err != nil { + return nil, status.Errorf(codes.Internal, "malformed time-out: %v", err) + } + st.timeoutSet = true + st.timeout = to + } + + metakv := []string{"content-type", contentType} + if r.Host != "" { + metakv = append(metakv, ":authority", r.Host) + } + for k, vv := range r.Header { + k = strings.ToLower(k) + if isReservedHeader(k) && !isWhitelistedHeader(k) { + continue + } + for _, v := range vv { + v, err := decodeMetadataHeader(k, v) + if err != nil { + return nil, status.Errorf(codes.Internal, "malformed binary metadata: %v", err) + } + metakv = append(metakv, k, v) + } + } + st.headerMD = metadata.Pairs(metakv...) + + return st, nil +} + +// serverHandlerTransport is an implementation of ServerTransport +// which replies to exactly one gRPC request (exactly one HTTP request), +// using the net/http.Handler interface. This http.Handler is guaranteed +// at this point to be speaking over HTTP/2, so it's able to speak valid +// gRPC. +type serverHandlerTransport struct { + rw http.ResponseWriter + req *http.Request + timeoutSet bool + timeout time.Duration + + headerMD metadata.MD + + closeOnce sync.Once + closedCh chan struct{} // closed on Close + + // writes is a channel of code to run serialized in the + // ServeHTTP (HandleStreams) goroutine. The channel is closed + // when WriteStatus is called. + writes chan func() + + // block concurrent WriteStatus calls + // e.g. grpc/(*serverStream).SendMsg/RecvMsg + writeStatusMu sync.Mutex + + // we just mirror the request content-type + contentType string + // we store both contentType and contentSubtype so we don't keep recreating them + // TODO make sure this is consistent across handler_server and http2_server + contentSubtype string + + stats stats.Handler +} + +func (ht *serverHandlerTransport) Close() error { + ht.closeOnce.Do(ht.closeCloseChanOnce) + return nil +} + +func (ht *serverHandlerTransport) closeCloseChanOnce() { close(ht.closedCh) } + +func (ht *serverHandlerTransport) RemoteAddr() net.Addr { return strAddr(ht.req.RemoteAddr) } + +// strAddr is a net.Addr backed by either a TCP "ip:port" string, or +// the empty string if unknown. +type strAddr string + +func (a strAddr) Network() string { + if a != "" { + // Per the documentation on net/http.Request.RemoteAddr, if this is + // set, it's set to the IP:port of the peer (hence, TCP): + // https://golang.org/pkg/net/http/#Request + // + // If we want to support Unix sockets later, we can + // add our own grpc-specific convention within the + // grpc codebase to set RemoteAddr to a different + // format, or probably better: we can attach it to the + // context and use that from serverHandlerTransport.RemoteAddr. + return "tcp" + } + return "" +} + +func (a strAddr) String() string { return string(a) } + +// do runs fn in the ServeHTTP goroutine. +func (ht *serverHandlerTransport) do(fn func()) error { + select { + case <-ht.closedCh: + return ErrConnClosing + case ht.writes <- fn: + return nil + } +} + +func (ht *serverHandlerTransport) WriteStatus(s *Stream, st *status.Status) error { + ht.writeStatusMu.Lock() + defer ht.writeStatusMu.Unlock() + + headersWritten := s.updateHeaderSent() + err := ht.do(func() { + if !headersWritten { + ht.writePendingHeaders(s) + } + + // And flush, in case no header or body has been sent yet. + // This forces a separation of headers and trailers if this is the + // first call (for example, in end2end tests's TestNoService). + ht.rw.(http.Flusher).Flush() + + h := ht.rw.Header() + h.Set("Grpc-Status", fmt.Sprintf("%d", st.Code())) + if m := st.Message(); m != "" { + h.Set("Grpc-Message", encodeGrpcMessage(m)) + } + + if p := st.Proto(); p != nil && len(p.Details) > 0 { + stBytes, err := proto.Marshal(p) + if err != nil { + // TODO: return error instead, when callers are able to handle it. + panic(err) + } + + h.Set("Grpc-Status-Details-Bin", encodeBinHeader(stBytes)) + } + + if md := s.Trailer(); len(md) > 0 { + for k, vv := range md { + // Clients don't tolerate reading restricted headers after some non restricted ones were sent. + if isReservedHeader(k) { + continue + } + for _, v := range vv { + // http2 ResponseWriter mechanism to send undeclared Trailers after + // the headers have possibly been written. + h.Add(http2.TrailerPrefix+k, encodeMetadataHeader(k, v)) + } + } + } + }) + + if err == nil { // transport has not been closed + if ht.stats != nil { + // Note: The trailer fields are compressed with hpack after this call returns. + // No WireLength field is set here. + ht.stats.HandleRPC(s.Context(), &stats.OutTrailer{ + Trailer: s.trailer.Copy(), + }) + } + } + ht.Close() + return err +} + +// writePendingHeaders sets common and custom headers on the first +// write call (Write, WriteHeader, or WriteStatus) +func (ht *serverHandlerTransport) writePendingHeaders(s *Stream) { + ht.writeCommonHeaders(s) + ht.writeCustomHeaders(s) +} + +// writeCommonHeaders sets common headers on the first write +// call (Write, WriteHeader, or WriteStatus). +func (ht *serverHandlerTransport) writeCommonHeaders(s *Stream) { + h := ht.rw.Header() + h["Date"] = nil // suppress Date to make tests happy; TODO: restore + h.Set("Content-Type", ht.contentType) + + // Predeclare trailers we'll set later in WriteStatus (after the body). + // This is a SHOULD in the HTTP RFC, and the way you add (known) + // Trailers per the net/http.ResponseWriter contract. + // See https://golang.org/pkg/net/http/#ResponseWriter + // and https://golang.org/pkg/net/http/#example_ResponseWriter_trailers + h.Add("Trailer", "Grpc-Status") + h.Add("Trailer", "Grpc-Message") + h.Add("Trailer", "Grpc-Status-Details-Bin") + + if s.sendCompress != "" { + h.Set("Grpc-Encoding", s.sendCompress) + } +} + +// writeCustomHeaders sets custom headers set on the stream via SetHeader +// on the first write call (Write, WriteHeader, or WriteStatus). +func (ht *serverHandlerTransport) writeCustomHeaders(s *Stream) { + h := ht.rw.Header() + + s.hdrMu.Lock() + for k, vv := range s.header { + if isReservedHeader(k) { + continue + } + for _, v := range vv { + h.Add(k, encodeMetadataHeader(k, v)) + } + } + + s.hdrMu.Unlock() +} + +func (ht *serverHandlerTransport) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { + headersWritten := s.updateHeaderSent() + return ht.do(func() { + if !headersWritten { + ht.writePendingHeaders(s) + } + ht.rw.Write(hdr) + ht.rw.Write(data) + ht.rw.(http.Flusher).Flush() + }) +} + +func (ht *serverHandlerTransport) WriteHeader(s *Stream, md metadata.MD) error { + if err := s.SetHeader(md); err != nil { + return err + } + + headersWritten := s.updateHeaderSent() + err := ht.do(func() { + if !headersWritten { + ht.writePendingHeaders(s) + } + + ht.rw.WriteHeader(200) + ht.rw.(http.Flusher).Flush() + }) + + if err == nil { + if ht.stats != nil { + // Note: The header fields are compressed with hpack after this call returns. + // No WireLength field is set here. + ht.stats.HandleRPC(s.Context(), &stats.OutHeader{ + Header: md.Copy(), + Compression: s.sendCompress, + }) + } + } + return err +} + +func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream), traceCtx func(context.Context, string) context.Context) { + // With this transport type there will be exactly 1 stream: this HTTP request. + + ctx := ht.req.Context() + var cancel context.CancelFunc + if ht.timeoutSet { + ctx, cancel = context.WithTimeout(ctx, ht.timeout) + } else { + ctx, cancel = context.WithCancel(ctx) + } + + // requestOver is closed when the status has been written via WriteStatus. + requestOver := make(chan struct{}) + go func() { + select { + case <-requestOver: + case <-ht.closedCh: + case <-ht.req.Context().Done(): + } + cancel() + ht.Close() + }() + + req := ht.req + + s := &Stream{ + id: 0, // irrelevant + requestRead: func(int) {}, + cancel: cancel, + buf: newRecvBuffer(), + st: ht, + method: req.URL.Path, + recvCompress: req.Header.Get("grpc-encoding"), + contentSubtype: ht.contentSubtype, + } + pr := &peer.Peer{ + Addr: ht.RemoteAddr(), + } + if req.TLS != nil { + pr.AuthInfo = credentials.TLSInfo{State: *req.TLS, CommonAuthInfo: credentials.CommonAuthInfo{SecurityLevel: credentials.PrivacyAndIntegrity}} + } + ctx = metadata.NewIncomingContext(ctx, ht.headerMD) + s.ctx = peer.NewContext(ctx, pr) + if ht.stats != nil { + s.ctx = ht.stats.TagRPC(s.ctx, &stats.RPCTagInfo{FullMethodName: s.method}) + inHeader := &stats.InHeader{ + FullMethod: s.method, + RemoteAddr: ht.RemoteAddr(), + Compression: s.recvCompress, + } + ht.stats.HandleRPC(s.ctx, inHeader) + } + s.trReader = &transportReader{ + reader: &recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: s.buf, freeBuffer: func(*bytes.Buffer) {}}, + windowHandler: func(int) {}, + } + + // readerDone is closed when the Body.Read-ing goroutine exits. + readerDone := make(chan struct{}) + go func() { + defer close(readerDone) + + // TODO: minimize garbage, optimize recvBuffer code/ownership + const readSize = 8196 + for buf := make([]byte, readSize); ; { + n, err := req.Body.Read(buf) + if n > 0 { + s.buf.put(recvMsg{buffer: bytes.NewBuffer(buf[:n:n])}) + buf = buf[n:] + } + if err != nil { + s.buf.put(recvMsg{err: mapRecvMsgError(err)}) + return + } + if len(buf) == 0 { + buf = make([]byte, readSize) + } + } + }() + + // startStream is provided by the *grpc.Server's serveStreams. + // It starts a goroutine serving s and exits immediately. + // The goroutine that is started is the one that then calls + // into ht, calling WriteHeader, Write, WriteStatus, Close, etc. + startStream(s) + + ht.runStream() + close(requestOver) + + // Wait for reading goroutine to finish. + req.Body.Close() + <-readerDone +} + +func (ht *serverHandlerTransport) runStream() { + for { + select { + case fn := <-ht.writes: + fn() + case <-ht.closedCh: + return + } + } +} + +func (ht *serverHandlerTransport) IncrMsgSent() {} + +func (ht *serverHandlerTransport) IncrMsgRecv() {} + +func (ht *serverHandlerTransport) Drain() { + panic("Drain() is not implemented") +} + +// mapRecvMsgError returns the non-nil err into the appropriate +// error value as expected by callers of *grpc.parser.recvMsg. +// In particular, in can only be: +// * io.EOF +// * io.ErrUnexpectedEOF +// * of type transport.ConnectionError +// * an error from the status package +func mapRecvMsgError(err error) error { + if err == io.EOF || err == io.ErrUnexpectedEOF { + return err + } + if se, ok := err.(http2.StreamError); ok { + if code, ok := http2ErrConvTab[se.Code]; ok { + return status.Error(code, se.Error()) + } + } + if strings.Contains(err.Error(), "body closed by handler") { + return status.Error(codes.Canceled, err.Error()) + } + return connectionErrorf(true, err, err.Error()) +} diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go new file mode 100644 index 000000000..e7f232113 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -0,0 +1,1485 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "context" + "fmt" + "io" + "math" + "net" + "strconv" + "strings" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + "google.golang.org/grpc/internal/grpcutil" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/syscall" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" +) + +// clientConnectionCounter counts the number of connections a client has +// initiated (equal to the number of http2Clients created). Must be accessed +// atomically. +var clientConnectionCounter uint64 + +// http2Client implements the ClientTransport interface with HTTP2. +type http2Client struct { + lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. + ctx context.Context + cancel context.CancelFunc + ctxDone <-chan struct{} // Cache the ctx.Done() chan. + userAgent string + md interface{} + conn net.Conn // underlying communication channel + loopy *loopyWriter + remoteAddr net.Addr + localAddr net.Addr + authInfo credentials.AuthInfo // auth info about the connection + + readerDone chan struct{} // sync point to enable testing. + writerDone chan struct{} // sync point to enable testing. + // goAway is closed to notify the upper layer (i.e., addrConn.transportMonitor) + // that the server sent GoAway on this transport. + goAway chan struct{} + + framer *framer + // controlBuf delivers all the control related tasks (e.g., window + // updates, reset streams, and various settings) to the controller. + controlBuf *controlBuffer + fc *trInFlow + // The scheme used: https if TLS is on, http otherwise. + scheme string + + isSecure bool + + perRPCCreds []credentials.PerRPCCredentials + + kp keepalive.ClientParameters + keepaliveEnabled bool + + statsHandler stats.Handler + + initialWindowSize int32 + + // configured by peer through SETTINGS_MAX_HEADER_LIST_SIZE + maxSendHeaderListSize *uint32 + + bdpEst *bdpEstimator + // onPrefaceReceipt is a callback that client transport calls upon + // receiving server preface to signal that a succefull HTTP2 + // connection was established. + onPrefaceReceipt func() + + maxConcurrentStreams uint32 + streamQuota int64 + streamsQuotaAvailable chan struct{} + waitingStreams uint32 + nextID uint32 + + mu sync.Mutex // guard the following variables + state transportState + activeStreams map[uint32]*Stream + // prevGoAway ID records the Last-Stream-ID in the previous GOAway frame. + prevGoAwayID uint32 + // goAwayReason records the http2.ErrCode and debug data received with the + // GoAway frame. + goAwayReason GoAwayReason + // A condition variable used to signal when the keepalive goroutine should + // go dormant. The condition for dormancy is based on the number of active + // streams and the `PermitWithoutStream` keepalive client parameter. And + // since the number of active streams is guarded by the above mutex, we use + // the same for this condition variable as well. + kpDormancyCond *sync.Cond + // A boolean to track whether the keepalive goroutine is dormant or not. + // This is checked before attempting to signal the above condition + // variable. + kpDormant bool + + // Fields below are for channelz metric collection. + channelzID int64 // channelz unique identification number + czData *channelzData + + onGoAway func(GoAwayReason) + onClose func() + + bufferPool *bufferPool + + connectionID uint64 +} + +func dial(ctx context.Context, fn func(context.Context, string) (net.Conn, error), addr string) (net.Conn, error) { + if fn != nil { + return fn(ctx, addr) + } + return (&net.Dialer{}).DialContext(ctx, "tcp", addr) +} + +func isTemporary(err error) bool { + switch err := err.(type) { + case interface { + Temporary() bool + }: + return err.Temporary() + case interface { + Timeout() bool + }: + // Timeouts may be resolved upon retry, and are thus treated as + // temporary. + return err.Timeout() + } + return true +} + +// newHTTP2Client constructs a connected ClientTransport to addr based on HTTP2 +// and starts to receive messages on it. Non-nil error returns if construction +// fails. +func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onPrefaceReceipt func(), onGoAway func(GoAwayReason), onClose func()) (_ *http2Client, err error) { + scheme := "http" + ctx, cancel := context.WithCancel(ctx) + defer func() { + if err != nil { + cancel() + } + }() + + conn, err := dial(connectCtx, opts.Dialer, addr.Addr) + if err != nil { + if opts.FailOnNonTempDialError { + return nil, connectionErrorf(isTemporary(err), err, "transport: error while dialing: %v", err) + } + return nil, connectionErrorf(true, err, "transport: Error while dialing %v", err) + } + // Any further errors will close the underlying connection + defer func(conn net.Conn) { + if err != nil { + conn.Close() + } + }(conn) + kp := opts.KeepaliveParams + // Validate keepalive parameters. + if kp.Time == 0 { + kp.Time = defaultClientKeepaliveTime + } + if kp.Timeout == 0 { + kp.Timeout = defaultClientKeepaliveTimeout + } + keepaliveEnabled := false + if kp.Time != infinity { + if err = syscall.SetTCPUserTimeout(conn, kp.Timeout); err != nil { + return nil, connectionErrorf(false, err, "transport: failed to set TCP_USER_TIMEOUT: %v", err) + } + keepaliveEnabled = true + } + var ( + isSecure bool + authInfo credentials.AuthInfo + ) + transportCreds := opts.TransportCredentials + perRPCCreds := opts.PerRPCCredentials + + if b := opts.CredsBundle; b != nil { + if t := b.TransportCredentials(); t != nil { + transportCreds = t + } + if t := b.PerRPCCredentials(); t != nil { + perRPCCreds = append(perRPCCreds, t) + } + } + if transportCreds != nil { + // gRPC, resolver, balancer etc. can specify arbitrary data in the + // Attributes field of resolver.Address, which is shoved into connectCtx + // and passed to the credential handshaker. This makes it possible for + // address specific arbitrary data to reach the credential handshaker. + contextWithHandshakeInfo := internal.NewClientHandshakeInfoContext.(func(context.Context, credentials.ClientHandshakeInfo) context.Context) + connectCtx = contextWithHandshakeInfo(connectCtx, credentials.ClientHandshakeInfo{Attributes: addr.Attributes}) + conn, authInfo, err = transportCreds.ClientHandshake(connectCtx, addr.ServerName, conn) + if err != nil { + return nil, connectionErrorf(isTemporary(err), err, "transport: authentication handshake failed: %v", err) + } + isSecure = true + if transportCreds.Info().SecurityProtocol == "tls" { + scheme = "https" + } + } + dynamicWindow := true + icwz := int32(initialWindowSize) + if opts.InitialConnWindowSize >= defaultWindowSize { + icwz = opts.InitialConnWindowSize + dynamicWindow = false + } + writeBufSize := opts.WriteBufferSize + readBufSize := opts.ReadBufferSize + maxHeaderListSize := defaultClientMaxHeaderListSize + if opts.MaxHeaderListSize != nil { + maxHeaderListSize = *opts.MaxHeaderListSize + } + t := &http2Client{ + ctx: ctx, + ctxDone: ctx.Done(), // Cache Done chan. + cancel: cancel, + userAgent: opts.UserAgent, + md: addr.Metadata, + conn: conn, + remoteAddr: conn.RemoteAddr(), + localAddr: conn.LocalAddr(), + authInfo: authInfo, + readerDone: make(chan struct{}), + writerDone: make(chan struct{}), + goAway: make(chan struct{}), + framer: newFramer(conn, writeBufSize, readBufSize, maxHeaderListSize), + fc: &trInFlow{limit: uint32(icwz)}, + scheme: scheme, + activeStreams: make(map[uint32]*Stream), + isSecure: isSecure, + perRPCCreds: perRPCCreds, + kp: kp, + statsHandler: opts.StatsHandler, + initialWindowSize: initialWindowSize, + onPrefaceReceipt: onPrefaceReceipt, + nextID: 1, + maxConcurrentStreams: defaultMaxStreamsClient, + streamQuota: defaultMaxStreamsClient, + streamsQuotaAvailable: make(chan struct{}, 1), + czData: new(channelzData), + onGoAway: onGoAway, + onClose: onClose, + keepaliveEnabled: keepaliveEnabled, + bufferPool: newBufferPool(), + } + t.controlBuf = newControlBuffer(t.ctxDone) + if opts.InitialWindowSize >= defaultWindowSize { + t.initialWindowSize = opts.InitialWindowSize + dynamicWindow = false + } + if dynamicWindow { + t.bdpEst = &bdpEstimator{ + bdp: initialWindowSize, + updateFlowControl: t.updateFlowControl, + } + } + if t.statsHandler != nil { + t.ctx = t.statsHandler.TagConn(t.ctx, &stats.ConnTagInfo{ + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + }) + connBegin := &stats.ConnBegin{ + Client: true, + } + t.statsHandler.HandleConn(t.ctx, connBegin) + } + if channelz.IsOn() { + t.channelzID = channelz.RegisterNormalSocket(t, opts.ChannelzParentID, fmt.Sprintf("%s -> %s", t.localAddr, t.remoteAddr)) + } + if t.keepaliveEnabled { + t.kpDormancyCond = sync.NewCond(&t.mu) + go t.keepalive() + } + // Start the reader goroutine for incoming message. Each transport has + // a dedicated goroutine which reads HTTP2 frame from network. Then it + // dispatches the frame to the corresponding stream entity. + go t.reader() + + // Send connection preface to server. + n, err := t.conn.Write(clientPreface) + if err != nil { + t.Close() + return nil, connectionErrorf(true, err, "transport: failed to write client preface: %v", err) + } + if n != len(clientPreface) { + t.Close() + return nil, connectionErrorf(true, err, "transport: preface mismatch, wrote %d bytes; want %d", n, len(clientPreface)) + } + var ss []http2.Setting + + if t.initialWindowSize != defaultWindowSize { + ss = append(ss, http2.Setting{ + ID: http2.SettingInitialWindowSize, + Val: uint32(t.initialWindowSize), + }) + } + if opts.MaxHeaderListSize != nil { + ss = append(ss, http2.Setting{ + ID: http2.SettingMaxHeaderListSize, + Val: *opts.MaxHeaderListSize, + }) + } + err = t.framer.fr.WriteSettings(ss...) + if err != nil { + t.Close() + return nil, connectionErrorf(true, err, "transport: failed to write initial settings frame: %v", err) + } + // Adjust the connection flow control window if needed. + if delta := uint32(icwz - defaultWindowSize); delta > 0 { + if err := t.framer.fr.WriteWindowUpdate(0, delta); err != nil { + t.Close() + return nil, connectionErrorf(true, err, "transport: failed to write window update: %v", err) + } + } + + t.connectionID = atomic.AddUint64(&clientConnectionCounter, 1) + + if err := t.framer.writer.Flush(); err != nil { + return nil, err + } + go func() { + t.loopy = newLoopyWriter(clientSide, t.framer, t.controlBuf, t.bdpEst) + err := t.loopy.run() + if err != nil { + if logger.V(logLevel) { + logger.Errorf("transport: loopyWriter.run returning. Err: %v", err) + } + } + // If it's a connection error, let reader goroutine handle it + // since there might be data in the buffers. + if _, ok := err.(net.Error); !ok { + t.conn.Close() + } + close(t.writerDone) + }() + return t, nil +} + +func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { + // TODO(zhaoq): Handle uint32 overflow of Stream.id. + s := &Stream{ + ct: t, + done: make(chan struct{}), + method: callHdr.Method, + sendCompress: callHdr.SendCompress, + buf: newRecvBuffer(), + headerChan: make(chan struct{}), + contentSubtype: callHdr.ContentSubtype, + } + s.wq = newWriteQuota(defaultWriteQuota, s.done) + s.requestRead = func(n int) { + t.adjustWindow(s, uint32(n)) + } + // The client side stream context should have exactly the same life cycle with the user provided context. + // That means, s.ctx should be read-only. And s.ctx is done iff ctx is done. + // So we use the original context here instead of creating a copy. + s.ctx = ctx + s.trReader = &transportReader{ + reader: &recvBufferReader{ + ctx: s.ctx, + ctxDone: s.ctx.Done(), + recv: s.buf, + closeStream: func(err error) { + t.CloseStream(s, err) + }, + freeBuffer: t.bufferPool.put, + }, + windowHandler: func(n int) { + t.updateWindow(s, uint32(n)) + }, + } + return s +} + +func (t *http2Client) getPeer() *peer.Peer { + return &peer.Peer{ + Addr: t.remoteAddr, + AuthInfo: t.authInfo, + } +} + +func (t *http2Client) createHeaderFields(ctx context.Context, callHdr *CallHdr) ([]hpack.HeaderField, error) { + aud := t.createAudience(callHdr) + ri := credentials.RequestInfo{ + Method: callHdr.Method, + AuthInfo: t.authInfo, + } + ctxWithRequestInfo := internal.NewRequestInfoContext.(func(context.Context, credentials.RequestInfo) context.Context)(ctx, ri) + authData, err := t.getTrAuthData(ctxWithRequestInfo, aud) + if err != nil { + return nil, err + } + callAuthData, err := t.getCallAuthData(ctxWithRequestInfo, aud, callHdr) + if err != nil { + return nil, err + } + // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields + // first and create a slice of that exact size. + // Make the slice of certain predictable size to reduce allocations made by append. + hfLen := 7 // :method, :scheme, :path, :authority, content-type, user-agent, te + hfLen += len(authData) + len(callAuthData) + headerFields := make([]hpack.HeaderField, 0, hfLen) + headerFields = append(headerFields, hpack.HeaderField{Name: ":method", Value: "POST"}) + headerFields = append(headerFields, hpack.HeaderField{Name: ":scheme", Value: t.scheme}) + headerFields = append(headerFields, hpack.HeaderField{Name: ":path", Value: callHdr.Method}) + headerFields = append(headerFields, hpack.HeaderField{Name: ":authority", Value: callHdr.Host}) + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: grpcutil.ContentType(callHdr.ContentSubtype)}) + headerFields = append(headerFields, hpack.HeaderField{Name: "user-agent", Value: t.userAgent}) + headerFields = append(headerFields, hpack.HeaderField{Name: "te", Value: "trailers"}) + if callHdr.PreviousAttempts > 0 { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-previous-rpc-attempts", Value: strconv.Itoa(callHdr.PreviousAttempts)}) + } + + if callHdr.SendCompress != "" { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: callHdr.SendCompress}) + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-accept-encoding", Value: callHdr.SendCompress}) + } + if dl, ok := ctx.Deadline(); ok { + // Send out timeout regardless its value. The server can detect timeout context by itself. + // TODO(mmukhi): Perhaps this field should be updated when actually writing out to the wire. + timeout := time.Until(dl) + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-timeout", Value: grpcutil.EncodeDuration(timeout)}) + } + for k, v := range authData { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + for k, v := range callAuthData { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + if b := stats.OutgoingTags(ctx); b != nil { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-tags-bin", Value: encodeBinHeader(b)}) + } + if b := stats.OutgoingTrace(ctx); b != nil { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-trace-bin", Value: encodeBinHeader(b)}) + } + + if md, added, ok := metadata.FromOutgoingContextRaw(ctx); ok { + var k string + for k, vv := range md { + // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. + if isReservedHeader(k) { + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + for _, vv := range added { + for i, v := range vv { + if i%2 == 0 { + k = v + continue + } + // HTTP doesn't allow you to set pseudoheaders after non pseudoheaders were set. + if isReservedHeader(k) { + continue + } + headerFields = append(headerFields, hpack.HeaderField{Name: strings.ToLower(k), Value: encodeMetadataHeader(k, v)}) + } + } + } + if md, ok := t.md.(*metadata.MD); ok { + for k, vv := range *md { + if isReservedHeader(k) { + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + } + return headerFields, nil +} + +func (t *http2Client) createAudience(callHdr *CallHdr) string { + // Create an audience string only if needed. + if len(t.perRPCCreds) == 0 && callHdr.Creds == nil { + return "" + } + // Construct URI required to get auth request metadata. + // Omit port if it is the default one. + host := strings.TrimSuffix(callHdr.Host, ":443") + pos := strings.LastIndex(callHdr.Method, "/") + if pos == -1 { + pos = len(callHdr.Method) + } + return "https://" + host + callHdr.Method[:pos] +} + +func (t *http2Client) getTrAuthData(ctx context.Context, audience string) (map[string]string, error) { + if len(t.perRPCCreds) == 0 { + return nil, nil + } + authData := map[string]string{} + for _, c := range t.perRPCCreds { + data, err := c.GetRequestMetadata(ctx, audience) + if err != nil { + if _, ok := status.FromError(err); ok { + return nil, err + } + + return nil, status.Errorf(codes.Unauthenticated, "transport: %v", err) + } + for k, v := range data { + // Capital header names are illegal in HTTP/2. + k = strings.ToLower(k) + authData[k] = v + } + } + return authData, nil +} + +func (t *http2Client) getCallAuthData(ctx context.Context, audience string, callHdr *CallHdr) (map[string]string, error) { + var callAuthData map[string]string + // Check if credentials.PerRPCCredentials were provided via call options. + // Note: if these credentials are provided both via dial options and call + // options, then both sets of credentials will be applied. + if callCreds := callHdr.Creds; callCreds != nil { + if !t.isSecure && callCreds.RequireTransportSecurity() { + return nil, status.Error(codes.Unauthenticated, "transport: cannot send secure credentials on an insecure connection") + } + data, err := callCreds.GetRequestMetadata(ctx, audience) + if err != nil { + return nil, status.Errorf(codes.Internal, "transport: %v", err) + } + callAuthData = make(map[string]string, len(data)) + for k, v := range data { + // Capital header names are illegal in HTTP/2 + k = strings.ToLower(k) + callAuthData[k] = v + } + } + return callAuthData, nil +} + +// PerformedIOError wraps an error to indicate IO may have been performed +// before the error occurred. +type PerformedIOError struct { + Err error +} + +// Error implements error. +func (p PerformedIOError) Error() string { + return p.Err.Error() +} + +// NewStream creates a stream and registers it into the transport as "active" +// streams. +func (t *http2Client) NewStream(ctx context.Context, callHdr *CallHdr) (_ *Stream, err error) { + ctx = peer.NewContext(ctx, t.getPeer()) + headerFields, err := t.createHeaderFields(ctx, callHdr) + if err != nil { + // We may have performed I/O in the per-RPC creds callback, so do not + // allow transparent retry. + return nil, PerformedIOError{err} + } + s := t.newStream(ctx, callHdr) + cleanup := func(err error) { + if s.swapState(streamDone) == streamDone { + // If it was already done, return. + return + } + // The stream was unprocessed by the server. + atomic.StoreUint32(&s.unprocessed, 1) + s.write(recvMsg{err: err}) + close(s.done) + // If headerChan isn't closed, then close it. + if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { + close(s.headerChan) + } + } + hdr := &headerFrame{ + hf: headerFields, + endStream: false, + initStream: func(id uint32) error { + t.mu.Lock() + if state := t.state; state != reachable { + t.mu.Unlock() + // Do a quick cleanup. + err := error(errStreamDrain) + if state == closing { + err = ErrConnClosing + } + cleanup(err) + return err + } + t.activeStreams[id] = s + if channelz.IsOn() { + atomic.AddInt64(&t.czData.streamsStarted, 1) + atomic.StoreInt64(&t.czData.lastStreamCreatedTime, time.Now().UnixNano()) + } + // If the keepalive goroutine has gone dormant, wake it up. + if t.kpDormant { + t.kpDormancyCond.Signal() + } + t.mu.Unlock() + return nil + }, + onOrphaned: cleanup, + wq: s.wq, + } + firstTry := true + var ch chan struct{} + checkForStreamQuota := func(it interface{}) bool { + if t.streamQuota <= 0 { // Can go negative if server decreases it. + if firstTry { + t.waitingStreams++ + } + ch = t.streamsQuotaAvailable + return false + } + if !firstTry { + t.waitingStreams-- + } + t.streamQuota-- + h := it.(*headerFrame) + h.streamID = t.nextID + t.nextID += 2 + s.id = h.streamID + s.fc = &inFlow{limit: uint32(t.initialWindowSize)} + if t.streamQuota > 0 && t.waitingStreams > 0 { + select { + case t.streamsQuotaAvailable <- struct{}{}: + default: + } + } + return true + } + var hdrListSizeErr error + checkForHeaderListSize := func(it interface{}) bool { + if t.maxSendHeaderListSize == nil { + return true + } + hdrFrame := it.(*headerFrame) + var sz int64 + for _, f := range hdrFrame.hf { + if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { + hdrListSizeErr = status.Errorf(codes.Internal, "header list size to send violates the maximum size (%d bytes) set by server", *t.maxSendHeaderListSize) + return false + } + } + return true + } + for { + success, err := t.controlBuf.executeAndPut(func(it interface{}) bool { + if !checkForStreamQuota(it) { + return false + } + if !checkForHeaderListSize(it) { + return false + } + return true + }, hdr) + if err != nil { + return nil, err + } + if success { + break + } + if hdrListSizeErr != nil { + return nil, hdrListSizeErr + } + firstTry = false + select { + case <-ch: + case <-s.ctx.Done(): + return nil, ContextErr(s.ctx.Err()) + case <-t.goAway: + return nil, errStreamDrain + case <-t.ctx.Done(): + return nil, ErrConnClosing + } + } + if t.statsHandler != nil { + header, ok := metadata.FromOutgoingContext(ctx) + if ok { + header.Set("user-agent", t.userAgent) + } else { + header = metadata.Pairs("user-agent", t.userAgent) + } + // Note: The header fields are compressed with hpack after this call returns. + // No WireLength field is set here. + outHeader := &stats.OutHeader{ + Client: true, + FullMethod: callHdr.Method, + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + Compression: callHdr.SendCompress, + Header: header, + } + t.statsHandler.HandleRPC(s.ctx, outHeader) + } + return s, nil +} + +// CloseStream clears the footprint of a stream when the stream is not needed any more. +// This must not be executed in reader's goroutine. +func (t *http2Client) CloseStream(s *Stream, err error) { + var ( + rst bool + rstCode http2.ErrCode + ) + if err != nil { + rst = true + rstCode = http2.ErrCodeCancel + } + t.closeStream(s, err, rst, rstCode, status.Convert(err), nil, false) +} + +func (t *http2Client) closeStream(s *Stream, err error, rst bool, rstCode http2.ErrCode, st *status.Status, mdata map[string][]string, eosReceived bool) { + // Set stream status to done. + if s.swapState(streamDone) == streamDone { + // If it was already done, return. If multiple closeStream calls + // happen simultaneously, wait for the first to finish. + <-s.done + return + } + // status and trailers can be updated here without any synchronization because the stream goroutine will + // only read it after it sees an io.EOF error from read or write and we'll write those errors + // only after updating this. + s.status = st + if len(mdata) > 0 { + s.trailer = mdata + } + if err != nil { + // This will unblock reads eventually. + s.write(recvMsg{err: err}) + } + // If headerChan isn't closed, then close it. + if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { + s.noHeaders = true + close(s.headerChan) + } + cleanup := &cleanupStream{ + streamID: s.id, + onWrite: func() { + t.mu.Lock() + if t.activeStreams != nil { + delete(t.activeStreams, s.id) + } + t.mu.Unlock() + if channelz.IsOn() { + if eosReceived { + atomic.AddInt64(&t.czData.streamsSucceeded, 1) + } else { + atomic.AddInt64(&t.czData.streamsFailed, 1) + } + } + }, + rst: rst, + rstCode: rstCode, + } + addBackStreamQuota := func(interface{}) bool { + t.streamQuota++ + if t.streamQuota > 0 && t.waitingStreams > 0 { + select { + case t.streamsQuotaAvailable <- struct{}{}: + default: + } + } + return true + } + t.controlBuf.executeAndPut(addBackStreamQuota, cleanup) + // This will unblock write. + close(s.done) +} + +// Close kicks off the shutdown process of the transport. This should be called +// only once on a transport. Once it is called, the transport should not be +// accessed any more. +// +// This method blocks until the addrConn that initiated this transport is +// re-connected. This happens because t.onClose() begins reconnect logic at the +// addrConn level and blocks until the addrConn is successfully connected. +func (t *http2Client) Close() error { + t.mu.Lock() + // Make sure we only Close once. + if t.state == closing { + t.mu.Unlock() + return nil + } + // Call t.onClose before setting the state to closing to prevent the client + // from attempting to create new streams ASAP. + t.onClose() + t.state = closing + streams := t.activeStreams + t.activeStreams = nil + if t.kpDormant { + // If the keepalive goroutine is blocked on this condition variable, we + // should unblock it so that the goroutine eventually exits. + t.kpDormancyCond.Signal() + } + t.mu.Unlock() + t.controlBuf.finish() + t.cancel() + err := t.conn.Close() + if channelz.IsOn() { + channelz.RemoveEntry(t.channelzID) + } + // Notify all active streams. + for _, s := range streams { + t.closeStream(s, ErrConnClosing, false, http2.ErrCodeNo, status.New(codes.Unavailable, ErrConnClosing.Desc), nil, false) + } + if t.statsHandler != nil { + connEnd := &stats.ConnEnd{ + Client: true, + } + t.statsHandler.HandleConn(t.ctx, connEnd) + } + return err +} + +// GracefulClose sets the state to draining, which prevents new streams from +// being created and causes the transport to be closed when the last active +// stream is closed. If there are no active streams, the transport is closed +// immediately. This does nothing if the transport is already draining or +// closing. +func (t *http2Client) GracefulClose() { + t.mu.Lock() + // Make sure we move to draining only from active. + if t.state == draining || t.state == closing { + t.mu.Unlock() + return + } + t.state = draining + active := len(t.activeStreams) + t.mu.Unlock() + if active == 0 { + t.Close() + return + } + t.controlBuf.put(&incomingGoAway{}) +} + +// Write formats the data into HTTP2 data frame(s) and sends it out. The caller +// should proceed only if Write returns nil. +func (t *http2Client) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { + if opts.Last { + // If it's the last message, update stream state. + if !s.compareAndSwapState(streamActive, streamWriteDone) { + return errStreamDone + } + } else if s.getState() != streamActive { + return errStreamDone + } + df := &dataFrame{ + streamID: s.id, + endStream: opts.Last, + h: hdr, + d: data, + } + if hdr != nil || data != nil { // If it's not an empty data frame, check quota. + if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { + return err + } + } + return t.controlBuf.put(df) +} + +func (t *http2Client) getStream(f http2.Frame) *Stream { + t.mu.Lock() + s := t.activeStreams[f.Header().StreamID] + t.mu.Unlock() + return s +} + +// adjustWindow sends out extra window update over the initial window size +// of stream if the application is requesting data larger in size than +// the window. +func (t *http2Client) adjustWindow(s *Stream, n uint32) { + if w := s.fc.maybeAdjust(n); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w}) + } +} + +// updateWindow adjusts the inbound quota for the stream. +// Window updates will be sent out when the cumulative quota +// exceeds the corresponding threshold. +func (t *http2Client) updateWindow(s *Stream, n uint32) { + if w := s.fc.onRead(n); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w}) + } +} + +// updateFlowControl updates the incoming flow control windows +// for the transport and the stream based on the current bdp +// estimation. +func (t *http2Client) updateFlowControl(n uint32) { + t.mu.Lock() + for _, s := range t.activeStreams { + s.fc.newLimit(n) + } + t.mu.Unlock() + updateIWS := func(interface{}) bool { + t.initialWindowSize = int32(n) + return true + } + t.controlBuf.executeAndPut(updateIWS, &outgoingWindowUpdate{streamID: 0, increment: t.fc.newLimit(n)}) + t.controlBuf.put(&outgoingSettings{ + ss: []http2.Setting{ + { + ID: http2.SettingInitialWindowSize, + Val: n, + }, + }, + }) +} + +func (t *http2Client) handleData(f *http2.DataFrame) { + size := f.Header().Length + var sendBDPPing bool + if t.bdpEst != nil { + sendBDPPing = t.bdpEst.add(size) + } + // Decouple connection's flow control from application's read. + // An update on connection's flow control should not depend on + // whether user application has read the data or not. Such a + // restriction is already imposed on the stream's flow control, + // and therefore the sender will be blocked anyways. + // Decoupling the connection flow control will prevent other + // active(fast) streams from starving in presence of slow or + // inactive streams. + // + if w := t.fc.onData(size); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{ + streamID: 0, + increment: w, + }) + } + if sendBDPPing { + // Avoid excessive ping detection (e.g. in an L7 proxy) + // by sending a window update prior to the BDP ping. + + if w := t.fc.reset(); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{ + streamID: 0, + increment: w, + }) + } + + t.controlBuf.put(bdpPing) + } + // Select the right stream to dispatch. + s := t.getStream(f) + if s == nil { + return + } + if size > 0 { + if err := s.fc.onData(size); err != nil { + t.closeStream(s, io.EOF, true, http2.ErrCodeFlowControl, status.New(codes.Internal, err.Error()), nil, false) + return + } + if f.Header().Flags.Has(http2.FlagDataPadded) { + if w := s.fc.onRead(size - uint32(len(f.Data()))); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{s.id, w}) + } + } + // TODO(bradfitz, zhaoq): A copy is required here because there is no + // guarantee f.Data() is consumed before the arrival of next frame. + // Can this copy be eliminated? + if len(f.Data()) > 0 { + buffer := t.bufferPool.get() + buffer.Reset() + buffer.Write(f.Data()) + s.write(recvMsg{buffer: buffer}) + } + } + // The server has closed the stream without sending trailers. Record that + // the read direction is closed, and set the status appropriately. + if f.FrameHeader.Flags.Has(http2.FlagDataEndStream) { + t.closeStream(s, io.EOF, false, http2.ErrCodeNo, status.New(codes.Internal, "server closed the stream without sending trailers"), nil, true) + } +} + +func (t *http2Client) handleRSTStream(f *http2.RSTStreamFrame) { + s := t.getStream(f) + if s == nil { + return + } + if f.ErrCode == http2.ErrCodeRefusedStream { + // The stream was unprocessed by the server. + atomic.StoreUint32(&s.unprocessed, 1) + } + statusCode, ok := http2ErrConvTab[f.ErrCode] + if !ok { + if logger.V(logLevel) { + logger.Warningf("transport: http2Client.handleRSTStream found no mapped gRPC status for the received http2 error %v", f.ErrCode) + } + statusCode = codes.Unknown + } + if statusCode == codes.Canceled { + if d, ok := s.ctx.Deadline(); ok && !d.After(time.Now()) { + // Our deadline was already exceeded, and that was likely the cause + // of this cancelation. Alter the status code accordingly. + statusCode = codes.DeadlineExceeded + } + } + t.closeStream(s, io.EOF, false, http2.ErrCodeNo, status.Newf(statusCode, "stream terminated by RST_STREAM with error code: %v", f.ErrCode), nil, false) +} + +func (t *http2Client) handleSettings(f *http2.SettingsFrame, isFirst bool) { + if f.IsAck() { + return + } + var maxStreams *uint32 + var ss []http2.Setting + var updateFuncs []func() + f.ForeachSetting(func(s http2.Setting) error { + switch s.ID { + case http2.SettingMaxConcurrentStreams: + maxStreams = new(uint32) + *maxStreams = s.Val + case http2.SettingMaxHeaderListSize: + updateFuncs = append(updateFuncs, func() { + t.maxSendHeaderListSize = new(uint32) + *t.maxSendHeaderListSize = s.Val + }) + default: + ss = append(ss, s) + } + return nil + }) + if isFirst && maxStreams == nil { + maxStreams = new(uint32) + *maxStreams = math.MaxUint32 + } + sf := &incomingSettings{ + ss: ss, + } + if maxStreams != nil { + updateStreamQuota := func() { + delta := int64(*maxStreams) - int64(t.maxConcurrentStreams) + t.maxConcurrentStreams = *maxStreams + t.streamQuota += delta + if delta > 0 && t.waitingStreams > 0 { + close(t.streamsQuotaAvailable) // wake all of them up. + t.streamsQuotaAvailable = make(chan struct{}, 1) + } + } + updateFuncs = append(updateFuncs, updateStreamQuota) + } + t.controlBuf.executeAndPut(func(interface{}) bool { + for _, f := range updateFuncs { + f() + } + return true + }, sf) +} + +func (t *http2Client) handlePing(f *http2.PingFrame) { + if f.IsAck() { + // Maybe it's a BDP ping. + if t.bdpEst != nil { + t.bdpEst.calculate(f.Data) + } + return + } + pingAck := &ping{ack: true} + copy(pingAck.data[:], f.Data[:]) + t.controlBuf.put(pingAck) +} + +func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { + t.mu.Lock() + if t.state == closing { + t.mu.Unlock() + return + } + if f.ErrCode == http2.ErrCodeEnhanceYourCalm { + if logger.V(logLevel) { + logger.Infof("Client received GoAway with http2.ErrCodeEnhanceYourCalm.") + } + } + id := f.LastStreamID + if id > 0 && id%2 != 1 { + t.mu.Unlock() + t.Close() + return + } + // A client can receive multiple GoAways from the server (see + // https://github.com/grpc/grpc-go/issues/1387). The idea is that the first + // GoAway will be sent with an ID of MaxInt32 and the second GoAway will be + // sent after an RTT delay with the ID of the last stream the server will + // process. + // + // Therefore, when we get the first GoAway we don't necessarily close any + // streams. While in case of second GoAway we close all streams created after + // the GoAwayId. This way streams that were in-flight while the GoAway from + // server was being sent don't get killed. + select { + case <-t.goAway: // t.goAway has been closed (i.e.,multiple GoAways). + // If there are multiple GoAways the first one should always have an ID greater than the following ones. + if id > t.prevGoAwayID { + t.mu.Unlock() + t.Close() + return + } + default: + t.setGoAwayReason(f) + close(t.goAway) + t.controlBuf.put(&incomingGoAway{}) + // Notify the clientconn about the GOAWAY before we set the state to + // draining, to allow the client to stop attempting to create streams + // before disallowing new streams on this connection. + t.onGoAway(t.goAwayReason) + t.state = draining + } + // All streams with IDs greater than the GoAwayId + // and smaller than the previous GoAway ID should be killed. + upperLimit := t.prevGoAwayID + if upperLimit == 0 { // This is the first GoAway Frame. + upperLimit = math.MaxUint32 // Kill all streams after the GoAway ID. + } + for streamID, stream := range t.activeStreams { + if streamID > id && streamID <= upperLimit { + // The stream was unprocessed by the server. + atomic.StoreUint32(&stream.unprocessed, 1) + t.closeStream(stream, errStreamDrain, false, http2.ErrCodeNo, statusGoAway, nil, false) + } + } + t.prevGoAwayID = id + active := len(t.activeStreams) + t.mu.Unlock() + if active == 0 { + t.Close() + } +} + +// setGoAwayReason sets the value of t.goAwayReason based +// on the GoAway frame received. +// It expects a lock on transport's mutext to be held by +// the caller. +func (t *http2Client) setGoAwayReason(f *http2.GoAwayFrame) { + t.goAwayReason = GoAwayNoReason + switch f.ErrCode { + case http2.ErrCodeEnhanceYourCalm: + if string(f.DebugData()) == "too_many_pings" { + t.goAwayReason = GoAwayTooManyPings + } + } +} + +func (t *http2Client) GetGoAwayReason() GoAwayReason { + t.mu.Lock() + defer t.mu.Unlock() + return t.goAwayReason +} + +func (t *http2Client) handleWindowUpdate(f *http2.WindowUpdateFrame) { + t.controlBuf.put(&incomingWindowUpdate{ + streamID: f.Header().StreamID, + increment: f.Increment, + }) +} + +// operateHeaders takes action on the decoded headers. +func (t *http2Client) operateHeaders(frame *http2.MetaHeadersFrame) { + s := t.getStream(frame) + if s == nil { + return + } + endStream := frame.StreamEnded() + atomic.StoreUint32(&s.bytesReceived, 1) + initialHeader := atomic.LoadUint32(&s.headerChanClosed) == 0 + + if !initialHeader && !endStream { + // As specified by gRPC over HTTP2, a HEADERS frame (and associated CONTINUATION frames) can only appear at the start or end of a stream. Therefore, second HEADERS frame must have EOS bit set. + st := status.New(codes.Internal, "a HEADERS frame cannot appear in the middle of a stream") + t.closeStream(s, st.Err(), true, http2.ErrCodeProtocol, st, nil, false) + return + } + + state := &decodeState{} + // Initialize isGRPC value to be !initialHeader, since if a gRPC Response-Headers has already been received, then it means that the peer is speaking gRPC and we are in gRPC mode. + state.data.isGRPC = !initialHeader + if err := state.decodeHeader(frame); err != nil { + t.closeStream(s, err, true, http2.ErrCodeProtocol, status.Convert(err), nil, endStream) + return + } + + isHeader := false + defer func() { + if t.statsHandler != nil { + if isHeader { + inHeader := &stats.InHeader{ + Client: true, + WireLength: int(frame.Header().Length), + Header: s.header.Copy(), + Compression: s.recvCompress, + } + t.statsHandler.HandleRPC(s.ctx, inHeader) + } else { + inTrailer := &stats.InTrailer{ + Client: true, + WireLength: int(frame.Header().Length), + Trailer: s.trailer.Copy(), + } + t.statsHandler.HandleRPC(s.ctx, inTrailer) + } + } + }() + + // If headerChan hasn't been closed yet + if atomic.CompareAndSwapUint32(&s.headerChanClosed, 0, 1) { + s.headerValid = true + if !endStream { + // HEADERS frame block carries a Response-Headers. + isHeader = true + // These values can be set without any synchronization because + // stream goroutine will read it only after seeing a closed + // headerChan which we'll close after setting this. + s.recvCompress = state.data.encoding + if len(state.data.mdata) > 0 { + s.header = state.data.mdata + } + } else { + // HEADERS frame block carries a Trailers-Only. + s.noHeaders = true + } + close(s.headerChan) + } + + if !endStream { + return + } + + // if client received END_STREAM from server while stream was still active, send RST_STREAM + rst := s.getState() == streamActive + t.closeStream(s, io.EOF, rst, http2.ErrCodeNo, state.status(), state.data.mdata, true) +} + +// reader runs as a separate goroutine in charge of reading data from network +// connection. +// +// TODO(zhaoq): currently one reader per transport. Investigate whether this is +// optimal. +// TODO(zhaoq): Check the validity of the incoming frame sequence. +func (t *http2Client) reader() { + defer close(t.readerDone) + // Check the validity of server preface. + frame, err := t.framer.fr.ReadFrame() + if err != nil { + t.Close() // this kicks off resetTransport, so must be last before return + return + } + t.conn.SetReadDeadline(time.Time{}) // reset deadline once we get the settings frame (we didn't time out, yay!) + if t.keepaliveEnabled { + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) + } + sf, ok := frame.(*http2.SettingsFrame) + if !ok { + t.Close() // this kicks off resetTransport, so must be last before return + return + } + t.onPrefaceReceipt() + t.handleSettings(sf, true) + + // loop to keep reading incoming messages on this transport. + for { + t.controlBuf.throttle() + frame, err := t.framer.fr.ReadFrame() + if t.keepaliveEnabled { + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) + } + if err != nil { + // Abort an active stream if the http2.Framer returns a + // http2.StreamError. This can happen only if the server's response + // is malformed http2. + if se, ok := err.(http2.StreamError); ok { + t.mu.Lock() + s := t.activeStreams[se.StreamID] + t.mu.Unlock() + if s != nil { + // use error detail to provide better err message + code := http2ErrConvTab[se.Code] + msg := t.framer.fr.ErrorDetail().Error() + t.closeStream(s, status.Error(code, msg), true, http2.ErrCodeProtocol, status.New(code, msg), nil, false) + } + continue + } else { + // Transport error. + t.Close() + return + } + } + switch frame := frame.(type) { + case *http2.MetaHeadersFrame: + t.operateHeaders(frame) + case *http2.DataFrame: + t.handleData(frame) + case *http2.RSTStreamFrame: + t.handleRSTStream(frame) + case *http2.SettingsFrame: + t.handleSettings(frame, false) + case *http2.PingFrame: + t.handlePing(frame) + case *http2.GoAwayFrame: + t.handleGoAway(frame) + case *http2.WindowUpdateFrame: + t.handleWindowUpdate(frame) + default: + if logger.V(logLevel) { + logger.Errorf("transport: http2Client.reader got unhandled frame type %v.", frame) + } + } + } +} + +func minTime(a, b time.Duration) time.Duration { + if a < b { + return a + } + return b +} + +// keepalive running in a separate goroutune makes sure the connection is alive by sending pings. +func (t *http2Client) keepalive() { + p := &ping{data: [8]byte{}} + // True iff a ping has been sent, and no data has been received since then. + outstandingPing := false + // Amount of time remaining before which we should receive an ACK for the + // last sent ping. + timeoutLeft := time.Duration(0) + // Records the last value of t.lastRead before we go block on the timer. + // This is required to check for read activity since then. + prevNano := time.Now().UnixNano() + timer := time.NewTimer(t.kp.Time) + for { + select { + case <-timer.C: + lastRead := atomic.LoadInt64(&t.lastRead) + if lastRead > prevNano { + // There has been read activity since the last time we were here. + outstandingPing = false + // Next timer should fire at kp.Time seconds from lastRead time. + timer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano())) + prevNano = lastRead + continue + } + if outstandingPing && timeoutLeft <= 0 { + t.Close() + return + } + t.mu.Lock() + if t.state == closing { + // If the transport is closing, we should exit from the + // keepalive goroutine here. If not, we could have a race + // between the call to Signal() from Close() and the call to + // Wait() here, whereby the keepalive goroutine ends up + // blocking on the condition variable which will never be + // signalled again. + t.mu.Unlock() + return + } + if len(t.activeStreams) < 1 && !t.kp.PermitWithoutStream { + // If a ping was sent out previously (because there were active + // streams at that point) which wasn't acked and its timeout + // hadn't fired, but we got here and are about to go dormant, + // we should make sure that we unconditionally send a ping once + // we awaken. + outstandingPing = false + t.kpDormant = true + t.kpDormancyCond.Wait() + } + t.kpDormant = false + t.mu.Unlock() + + // We get here either because we were dormant and a new stream was + // created which unblocked the Wait() call, or because the + // keepalive timer expired. In both cases, we need to send a ping. + if !outstandingPing { + if channelz.IsOn() { + atomic.AddInt64(&t.czData.kpCount, 1) + } + t.controlBuf.put(p) + timeoutLeft = t.kp.Timeout + outstandingPing = true + } + // The amount of time to sleep here is the minimum of kp.Time and + // timeoutLeft. This will ensure that we wait only for kp.Time + // before sending out the next ping (for cases where the ping is + // acked). + sleepDuration := minTime(t.kp.Time, timeoutLeft) + timeoutLeft -= sleepDuration + timer.Reset(sleepDuration) + case <-t.ctx.Done(): + if !timer.Stop() { + <-timer.C + } + return + } + } +} + +func (t *http2Client) Error() <-chan struct{} { + return t.ctx.Done() +} + +func (t *http2Client) GoAway() <-chan struct{} { + return t.goAway +} + +func (t *http2Client) ChannelzMetric() *channelz.SocketInternalMetric { + s := channelz.SocketInternalMetric{ + StreamsStarted: atomic.LoadInt64(&t.czData.streamsStarted), + StreamsSucceeded: atomic.LoadInt64(&t.czData.streamsSucceeded), + StreamsFailed: atomic.LoadInt64(&t.czData.streamsFailed), + MessagesSent: atomic.LoadInt64(&t.czData.msgSent), + MessagesReceived: atomic.LoadInt64(&t.czData.msgRecv), + KeepAlivesSent: atomic.LoadInt64(&t.czData.kpCount), + LastLocalStreamCreatedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastStreamCreatedTime)), + LastMessageSentTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgSentTime)), + LastMessageReceivedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgRecvTime)), + LocalFlowControlWindow: int64(t.fc.getSize()), + SocketOptions: channelz.GetSocketOption(t.conn), + LocalAddr: t.localAddr, + RemoteAddr: t.remoteAddr, + // RemoteName : + } + if au, ok := t.authInfo.(credentials.ChannelzSecurityInfo); ok { + s.Security = au.GetSecurityValue() + } + s.RemoteFlowControlWindow = t.getOutFlowWindow() + return &s +} + +func (t *http2Client) RemoteAddr() net.Addr { return t.remoteAddr } + +func (t *http2Client) IncrMsgSent() { + atomic.AddInt64(&t.czData.msgSent, 1) + atomic.StoreInt64(&t.czData.lastMsgSentTime, time.Now().UnixNano()) +} + +func (t *http2Client) IncrMsgRecv() { + atomic.AddInt64(&t.czData.msgRecv, 1) + atomic.StoreInt64(&t.czData.lastMsgRecvTime, time.Now().UnixNano()) +} + +func (t *http2Client) getOutFlowWindow() int64 { + resp := make(chan uint32, 1) + timer := time.NewTimer(time.Second) + defer timer.Stop() + t.controlBuf.put(&outFlowControlSizeRequest{resp}) + select { + case sz := <-resp: + return int64(sz) + case <-t.ctxDone: + return -1 + case <-timer.C: + return -2 + } +} diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go new file mode 100644 index 000000000..04cbedf79 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -0,0 +1,1264 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "math" + "net" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + "google.golang.org/grpc/internal/grpcutil" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcrand" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" +) + +var ( + // ErrIllegalHeaderWrite indicates that setting header is illegal because of + // the stream's state. + ErrIllegalHeaderWrite = errors.New("transport: the stream is done or WriteHeader was already called") + // ErrHeaderListSizeLimitViolation indicates that the header list size is larger + // than the limit set by peer. + ErrHeaderListSizeLimitViolation = errors.New("transport: trying to send header list size larger than the limit set by peer") +) + +// serverConnectionCounter counts the number of connections a server has seen +// (equal to the number of http2Servers created). Must be accessed atomically. +var serverConnectionCounter uint64 + +// http2Server implements the ServerTransport interface with HTTP2. +type http2Server struct { + lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. + ctx context.Context + done chan struct{} + conn net.Conn + loopy *loopyWriter + readerDone chan struct{} // sync point to enable testing. + writerDone chan struct{} // sync point to enable testing. + remoteAddr net.Addr + localAddr net.Addr + maxStreamID uint32 // max stream ID ever seen + authInfo credentials.AuthInfo // auth info about the connection + inTapHandle tap.ServerInHandle + framer *framer + // The max number of concurrent streams. + maxStreams uint32 + // controlBuf delivers all the control related tasks (e.g., window + // updates, reset streams, and various settings) to the controller. + controlBuf *controlBuffer + fc *trInFlow + stats stats.Handler + // Keepalive and max-age parameters for the server. + kp keepalive.ServerParameters + // Keepalive enforcement policy. + kep keepalive.EnforcementPolicy + // The time instance last ping was received. + lastPingAt time.Time + // Number of times the client has violated keepalive ping policy so far. + pingStrikes uint8 + // Flag to signify that number of ping strikes should be reset to 0. + // This is set whenever data or header frames are sent. + // 1 means yes. + resetPingStrikes uint32 // Accessed atomically. + initialWindowSize int32 + bdpEst *bdpEstimator + maxSendHeaderListSize *uint32 + + mu sync.Mutex // guard the following + + // drainChan is initialized when drain(...) is called the first time. + // After which the server writes out the first GoAway(with ID 2^31-1) frame. + // Then an independent goroutine will be launched to later send the second GoAway. + // During this time we don't want to write another first GoAway(with ID 2^31 -1) frame. + // Thus call to drain(...) will be a no-op if drainChan is already initialized since draining is + // already underway. + drainChan chan struct{} + state transportState + activeStreams map[uint32]*Stream + // idle is the time instant when the connection went idle. + // This is either the beginning of the connection or when the number of + // RPCs go down to 0. + // When the connection is busy, this value is set to 0. + idle time.Time + + // Fields below are for channelz metric collection. + channelzID int64 // channelz unique identification number + czData *channelzData + bufferPool *bufferPool + + connectionID uint64 +} + +// newHTTP2Server constructs a ServerTransport based on HTTP2. ConnectionError is +// returned if something goes wrong. +func newHTTP2Server(conn net.Conn, config *ServerConfig) (_ ServerTransport, err error) { + writeBufSize := config.WriteBufferSize + readBufSize := config.ReadBufferSize + maxHeaderListSize := defaultServerMaxHeaderListSize + if config.MaxHeaderListSize != nil { + maxHeaderListSize = *config.MaxHeaderListSize + } + framer := newFramer(conn, writeBufSize, readBufSize, maxHeaderListSize) + // Send initial settings as connection preface to client. + isettings := []http2.Setting{{ + ID: http2.SettingMaxFrameSize, + Val: http2MaxFrameLen, + }} + // TODO(zhaoq): Have a better way to signal "no limit" because 0 is + // permitted in the HTTP2 spec. + maxStreams := config.MaxStreams + if maxStreams == 0 { + maxStreams = math.MaxUint32 + } else { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingMaxConcurrentStreams, + Val: maxStreams, + }) + } + dynamicWindow := true + iwz := int32(initialWindowSize) + if config.InitialWindowSize >= defaultWindowSize { + iwz = config.InitialWindowSize + dynamicWindow = false + } + icwz := int32(initialWindowSize) + if config.InitialConnWindowSize >= defaultWindowSize { + icwz = config.InitialConnWindowSize + dynamicWindow = false + } + if iwz != defaultWindowSize { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingInitialWindowSize, + Val: uint32(iwz)}) + } + if config.MaxHeaderListSize != nil { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingMaxHeaderListSize, + Val: *config.MaxHeaderListSize, + }) + } + if config.HeaderTableSize != nil { + isettings = append(isettings, http2.Setting{ + ID: http2.SettingHeaderTableSize, + Val: *config.HeaderTableSize, + }) + } + if err := framer.fr.WriteSettings(isettings...); err != nil { + return nil, connectionErrorf(false, err, "transport: %v", err) + } + // Adjust the connection flow control window if needed. + if delta := uint32(icwz - defaultWindowSize); delta > 0 { + if err := framer.fr.WriteWindowUpdate(0, delta); err != nil { + return nil, connectionErrorf(false, err, "transport: %v", err) + } + } + kp := config.KeepaliveParams + if kp.MaxConnectionIdle == 0 { + kp.MaxConnectionIdle = defaultMaxConnectionIdle + } + if kp.MaxConnectionAge == 0 { + kp.MaxConnectionAge = defaultMaxConnectionAge + } + // Add a jitter to MaxConnectionAge. + kp.MaxConnectionAge += getJitter(kp.MaxConnectionAge) + if kp.MaxConnectionAgeGrace == 0 { + kp.MaxConnectionAgeGrace = defaultMaxConnectionAgeGrace + } + if kp.Time == 0 { + kp.Time = defaultServerKeepaliveTime + } + if kp.Timeout == 0 { + kp.Timeout = defaultServerKeepaliveTimeout + } + kep := config.KeepalivePolicy + if kep.MinTime == 0 { + kep.MinTime = defaultKeepalivePolicyMinTime + } + done := make(chan struct{}) + t := &http2Server{ + ctx: context.Background(), + done: done, + conn: conn, + remoteAddr: conn.RemoteAddr(), + localAddr: conn.LocalAddr(), + authInfo: config.AuthInfo, + framer: framer, + readerDone: make(chan struct{}), + writerDone: make(chan struct{}), + maxStreams: maxStreams, + inTapHandle: config.InTapHandle, + fc: &trInFlow{limit: uint32(icwz)}, + state: reachable, + activeStreams: make(map[uint32]*Stream), + stats: config.StatsHandler, + kp: kp, + idle: time.Now(), + kep: kep, + initialWindowSize: iwz, + czData: new(channelzData), + bufferPool: newBufferPool(), + } + t.controlBuf = newControlBuffer(t.done) + if dynamicWindow { + t.bdpEst = &bdpEstimator{ + bdp: initialWindowSize, + updateFlowControl: t.updateFlowControl, + } + } + if t.stats != nil { + t.ctx = t.stats.TagConn(t.ctx, &stats.ConnTagInfo{ + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + }) + connBegin := &stats.ConnBegin{} + t.stats.HandleConn(t.ctx, connBegin) + } + if channelz.IsOn() { + t.channelzID = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.remoteAddr, t.localAddr)) + } + + t.connectionID = atomic.AddUint64(&serverConnectionCounter, 1) + + t.framer.writer.Flush() + + defer func() { + if err != nil { + t.Close() + } + }() + + // Check the validity of client preface. + preface := make([]byte, len(clientPreface)) + if _, err := io.ReadFull(t.conn, preface); err != nil { + return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to receive the preface from client: %v", err) + } + if !bytes.Equal(preface, clientPreface) { + return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams received bogus greeting from client: %q", preface) + } + + frame, err := t.framer.fr.ReadFrame() + if err == io.EOF || err == io.ErrUnexpectedEOF { + return nil, err + } + if err != nil { + return nil, connectionErrorf(false, err, "transport: http2Server.HandleStreams failed to read initial settings frame: %v", err) + } + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) + sf, ok := frame.(*http2.SettingsFrame) + if !ok { + return nil, connectionErrorf(false, nil, "transport: http2Server.HandleStreams saw invalid preface type %T from client", frame) + } + t.handleSettings(sf) + + go func() { + t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst) + t.loopy.ssGoAwayHandler = t.outgoingGoAwayHandler + if err := t.loopy.run(); err != nil { + if logger.V(logLevel) { + logger.Errorf("transport: loopyWriter.run returning. Err: %v", err) + } + } + t.conn.Close() + close(t.writerDone) + }() + go t.keepalive() + return t, nil +} + +// operateHeader takes action on the decoded headers. +func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(*Stream), traceCtx func(context.Context, string) context.Context) (fatal bool) { + streamID := frame.Header().StreamID + state := &decodeState{ + serverSide: true, + } + if err := state.decodeHeader(frame); err != nil { + if se, ok := status.FromError(err); ok { + t.controlBuf.put(&cleanupStream{ + streamID: streamID, + rst: true, + rstCode: statusCodeConvTab[se.Code()], + onWrite: func() {}, + }) + } + return false + } + + buf := newRecvBuffer() + s := &Stream{ + id: streamID, + st: t, + buf: buf, + fc: &inFlow{limit: uint32(t.initialWindowSize)}, + recvCompress: state.data.encoding, + method: state.data.method, + contentSubtype: state.data.contentSubtype, + } + if frame.StreamEnded() { + // s is just created by the caller. No lock needed. + s.state = streamReadDone + } + if state.data.timeoutSet { + s.ctx, s.cancel = context.WithTimeout(t.ctx, state.data.timeout) + } else { + s.ctx, s.cancel = context.WithCancel(t.ctx) + } + pr := &peer.Peer{ + Addr: t.remoteAddr, + } + // Attach Auth info if there is any. + if t.authInfo != nil { + pr.AuthInfo = t.authInfo + } + s.ctx = peer.NewContext(s.ctx, pr) + // Attach the received metadata to the context. + if len(state.data.mdata) > 0 { + s.ctx = metadata.NewIncomingContext(s.ctx, state.data.mdata) + } + if state.data.statsTags != nil { + s.ctx = stats.SetIncomingTags(s.ctx, state.data.statsTags) + } + if state.data.statsTrace != nil { + s.ctx = stats.SetIncomingTrace(s.ctx, state.data.statsTrace) + } + if t.inTapHandle != nil { + var err error + info := &tap.Info{ + FullMethodName: state.data.method, + } + s.ctx, err = t.inTapHandle(s.ctx, info) + if err != nil { + if logger.V(logLevel) { + logger.Warningf("transport: http2Server.operateHeaders got an error from InTapHandle: %v", err) + } + t.controlBuf.put(&cleanupStream{ + streamID: s.id, + rst: true, + rstCode: http2.ErrCodeRefusedStream, + onWrite: func() {}, + }) + s.cancel() + return false + } + } + t.mu.Lock() + if t.state != reachable { + t.mu.Unlock() + s.cancel() + return false + } + if uint32(len(t.activeStreams)) >= t.maxStreams { + t.mu.Unlock() + t.controlBuf.put(&cleanupStream{ + streamID: streamID, + rst: true, + rstCode: http2.ErrCodeRefusedStream, + onWrite: func() {}, + }) + s.cancel() + return false + } + if streamID%2 != 1 || streamID <= t.maxStreamID { + t.mu.Unlock() + // illegal gRPC stream id. + if logger.V(logLevel) { + logger.Errorf("transport: http2Server.HandleStreams received an illegal stream id: %v", streamID) + } + s.cancel() + return true + } + t.maxStreamID = streamID + t.activeStreams[streamID] = s + if len(t.activeStreams) == 1 { + t.idle = time.Time{} + } + t.mu.Unlock() + if channelz.IsOn() { + atomic.AddInt64(&t.czData.streamsStarted, 1) + atomic.StoreInt64(&t.czData.lastStreamCreatedTime, time.Now().UnixNano()) + } + s.requestRead = func(n int) { + t.adjustWindow(s, uint32(n)) + } + s.ctx = traceCtx(s.ctx, s.method) + if t.stats != nil { + s.ctx = t.stats.TagRPC(s.ctx, &stats.RPCTagInfo{FullMethodName: s.method}) + inHeader := &stats.InHeader{ + FullMethod: s.method, + RemoteAddr: t.remoteAddr, + LocalAddr: t.localAddr, + Compression: s.recvCompress, + WireLength: int(frame.Header().Length), + Header: metadata.MD(state.data.mdata).Copy(), + } + t.stats.HandleRPC(s.ctx, inHeader) + } + s.ctxDone = s.ctx.Done() + s.wq = newWriteQuota(defaultWriteQuota, s.ctxDone) + s.trReader = &transportReader{ + reader: &recvBufferReader{ + ctx: s.ctx, + ctxDone: s.ctxDone, + recv: s.buf, + freeBuffer: t.bufferPool.put, + }, + windowHandler: func(n int) { + t.updateWindow(s, uint32(n)) + }, + } + // Register the stream with loopy. + t.controlBuf.put(®isterStream{ + streamID: s.id, + wq: s.wq, + }) + handle(s) + return false +} + +// HandleStreams receives incoming streams using the given handler. This is +// typically run in a separate goroutine. +// traceCtx attaches trace to ctx and returns the new context. +func (t *http2Server) HandleStreams(handle func(*Stream), traceCtx func(context.Context, string) context.Context) { + defer close(t.readerDone) + for { + t.controlBuf.throttle() + frame, err := t.framer.fr.ReadFrame() + atomic.StoreInt64(&t.lastRead, time.Now().UnixNano()) + if err != nil { + if se, ok := err.(http2.StreamError); ok { + if logger.V(logLevel) { + logger.Warningf("transport: http2Server.HandleStreams encountered http2.StreamError: %v", se) + } + t.mu.Lock() + s := t.activeStreams[se.StreamID] + t.mu.Unlock() + if s != nil { + t.closeStream(s, true, se.Code, false) + } else { + t.controlBuf.put(&cleanupStream{ + streamID: se.StreamID, + rst: true, + rstCode: se.Code, + onWrite: func() {}, + }) + } + continue + } + if err == io.EOF || err == io.ErrUnexpectedEOF { + t.Close() + return + } + if logger.V(logLevel) { + logger.Warningf("transport: http2Server.HandleStreams failed to read frame: %v", err) + } + t.Close() + return + } + switch frame := frame.(type) { + case *http2.MetaHeadersFrame: + if t.operateHeaders(frame, handle, traceCtx) { + t.Close() + break + } + case *http2.DataFrame: + t.handleData(frame) + case *http2.RSTStreamFrame: + t.handleRSTStream(frame) + case *http2.SettingsFrame: + t.handleSettings(frame) + case *http2.PingFrame: + t.handlePing(frame) + case *http2.WindowUpdateFrame: + t.handleWindowUpdate(frame) + case *http2.GoAwayFrame: + // TODO: Handle GoAway from the client appropriately. + default: + if logger.V(logLevel) { + logger.Errorf("transport: http2Server.HandleStreams found unhandled frame type %v.", frame) + } + } + } +} + +func (t *http2Server) getStream(f http2.Frame) (*Stream, bool) { + t.mu.Lock() + defer t.mu.Unlock() + if t.activeStreams == nil { + // The transport is closing. + return nil, false + } + s, ok := t.activeStreams[f.Header().StreamID] + if !ok { + // The stream is already done. + return nil, false + } + return s, true +} + +// adjustWindow sends out extra window update over the initial window size +// of stream if the application is requesting data larger in size than +// the window. +func (t *http2Server) adjustWindow(s *Stream, n uint32) { + if w := s.fc.maybeAdjust(n); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, increment: w}) + } + +} + +// updateWindow adjusts the inbound quota for the stream and the transport. +// Window updates will deliver to the controller for sending when +// the cumulative quota exceeds the corresponding threshold. +func (t *http2Server) updateWindow(s *Stream, n uint32) { + if w := s.fc.onRead(n); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{streamID: s.id, + increment: w, + }) + } +} + +// updateFlowControl updates the incoming flow control windows +// for the transport and the stream based on the current bdp +// estimation. +func (t *http2Server) updateFlowControl(n uint32) { + t.mu.Lock() + for _, s := range t.activeStreams { + s.fc.newLimit(n) + } + t.initialWindowSize = int32(n) + t.mu.Unlock() + t.controlBuf.put(&outgoingWindowUpdate{ + streamID: 0, + increment: t.fc.newLimit(n), + }) + t.controlBuf.put(&outgoingSettings{ + ss: []http2.Setting{ + { + ID: http2.SettingInitialWindowSize, + Val: n, + }, + }, + }) + +} + +func (t *http2Server) handleData(f *http2.DataFrame) { + size := f.Header().Length + var sendBDPPing bool + if t.bdpEst != nil { + sendBDPPing = t.bdpEst.add(size) + } + // Decouple connection's flow control from application's read. + // An update on connection's flow control should not depend on + // whether user application has read the data or not. Such a + // restriction is already imposed on the stream's flow control, + // and therefore the sender will be blocked anyways. + // Decoupling the connection flow control will prevent other + // active(fast) streams from starving in presence of slow or + // inactive streams. + if w := t.fc.onData(size); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{ + streamID: 0, + increment: w, + }) + } + if sendBDPPing { + // Avoid excessive ping detection (e.g. in an L7 proxy) + // by sending a window update prior to the BDP ping. + if w := t.fc.reset(); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{ + streamID: 0, + increment: w, + }) + } + t.controlBuf.put(bdpPing) + } + // Select the right stream to dispatch. + s, ok := t.getStream(f) + if !ok { + return + } + if size > 0 { + if err := s.fc.onData(size); err != nil { + t.closeStream(s, true, http2.ErrCodeFlowControl, false) + return + } + if f.Header().Flags.Has(http2.FlagDataPadded) { + if w := s.fc.onRead(size - uint32(len(f.Data()))); w > 0 { + t.controlBuf.put(&outgoingWindowUpdate{s.id, w}) + } + } + // TODO(bradfitz, zhaoq): A copy is required here because there is no + // guarantee f.Data() is consumed before the arrival of next frame. + // Can this copy be eliminated? + if len(f.Data()) > 0 { + buffer := t.bufferPool.get() + buffer.Reset() + buffer.Write(f.Data()) + s.write(recvMsg{buffer: buffer}) + } + } + if f.Header().Flags.Has(http2.FlagDataEndStream) { + // Received the end of stream from the client. + s.compareAndSwapState(streamActive, streamReadDone) + s.write(recvMsg{err: io.EOF}) + } +} + +func (t *http2Server) handleRSTStream(f *http2.RSTStreamFrame) { + // If the stream is not deleted from the transport's active streams map, then do a regular close stream. + if s, ok := t.getStream(f); ok { + t.closeStream(s, false, 0, false) + return + } + // If the stream is already deleted from the active streams map, then put a cleanupStream item into controlbuf to delete the stream from loopy writer's established streams map. + t.controlBuf.put(&cleanupStream{ + streamID: f.Header().StreamID, + rst: false, + rstCode: 0, + onWrite: func() {}, + }) +} + +func (t *http2Server) handleSettings(f *http2.SettingsFrame) { + if f.IsAck() { + return + } + var ss []http2.Setting + var updateFuncs []func() + f.ForeachSetting(func(s http2.Setting) error { + switch s.ID { + case http2.SettingMaxHeaderListSize: + updateFuncs = append(updateFuncs, func() { + t.maxSendHeaderListSize = new(uint32) + *t.maxSendHeaderListSize = s.Val + }) + default: + ss = append(ss, s) + } + return nil + }) + t.controlBuf.executeAndPut(func(interface{}) bool { + for _, f := range updateFuncs { + f() + } + return true + }, &incomingSettings{ + ss: ss, + }) +} + +const ( + maxPingStrikes = 2 + defaultPingTimeout = 2 * time.Hour +) + +func (t *http2Server) handlePing(f *http2.PingFrame) { + if f.IsAck() { + if f.Data == goAwayPing.data && t.drainChan != nil { + close(t.drainChan) + return + } + // Maybe it's a BDP ping. + if t.bdpEst != nil { + t.bdpEst.calculate(f.Data) + } + return + } + pingAck := &ping{ack: true} + copy(pingAck.data[:], f.Data[:]) + t.controlBuf.put(pingAck) + + now := time.Now() + defer func() { + t.lastPingAt = now + }() + // A reset ping strikes means that we don't need to check for policy + // violation for this ping and the pingStrikes counter should be set + // to 0. + if atomic.CompareAndSwapUint32(&t.resetPingStrikes, 1, 0) { + t.pingStrikes = 0 + return + } + t.mu.Lock() + ns := len(t.activeStreams) + t.mu.Unlock() + if ns < 1 && !t.kep.PermitWithoutStream { + // Keepalive shouldn't be active thus, this new ping should + // have come after at least defaultPingTimeout. + if t.lastPingAt.Add(defaultPingTimeout).After(now) { + t.pingStrikes++ + } + } else { + // Check if keepalive policy is respected. + if t.lastPingAt.Add(t.kep.MinTime).After(now) { + t.pingStrikes++ + } + } + + if t.pingStrikes > maxPingStrikes { + // Send goaway and close the connection. + if logger.V(logLevel) { + logger.Errorf("transport: Got too many pings from the client, closing the connection.") + } + t.controlBuf.put(&goAway{code: http2.ErrCodeEnhanceYourCalm, debugData: []byte("too_many_pings"), closeConn: true}) + } +} + +func (t *http2Server) handleWindowUpdate(f *http2.WindowUpdateFrame) { + t.controlBuf.put(&incomingWindowUpdate{ + streamID: f.Header().StreamID, + increment: f.Increment, + }) +} + +func appendHeaderFieldsFromMD(headerFields []hpack.HeaderField, md metadata.MD) []hpack.HeaderField { + for k, vv := range md { + if isReservedHeader(k) { + // Clients don't tolerate reading restricted headers after some non restricted ones were sent. + continue + } + for _, v := range vv { + headerFields = append(headerFields, hpack.HeaderField{Name: k, Value: encodeMetadataHeader(k, v)}) + } + } + return headerFields +} + +func (t *http2Server) checkForHeaderListSize(it interface{}) bool { + if t.maxSendHeaderListSize == nil { + return true + } + hdrFrame := it.(*headerFrame) + var sz int64 + for _, f := range hdrFrame.hf { + if sz += int64(f.Size()); sz > int64(*t.maxSendHeaderListSize) { + if logger.V(logLevel) { + logger.Errorf("header list size to send violates the maximum size (%d bytes) set by client", *t.maxSendHeaderListSize) + } + return false + } + } + return true +} + +// WriteHeader sends the header metadata md back to the client. +func (t *http2Server) WriteHeader(s *Stream, md metadata.MD) error { + if s.updateHeaderSent() || s.getState() == streamDone { + return ErrIllegalHeaderWrite + } + s.hdrMu.Lock() + if md.Len() > 0 { + if s.header.Len() > 0 { + s.header = metadata.Join(s.header, md) + } else { + s.header = md + } + } + if err := t.writeHeaderLocked(s); err != nil { + s.hdrMu.Unlock() + return err + } + s.hdrMu.Unlock() + return nil +} + +func (t *http2Server) setResetPingStrikes() { + atomic.StoreUint32(&t.resetPingStrikes, 1) +} + +func (t *http2Server) writeHeaderLocked(s *Stream) error { + // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields + // first and create a slice of that exact size. + headerFields := make([]hpack.HeaderField, 0, 2) // at least :status, content-type will be there if none else. + headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"}) + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: grpcutil.ContentType(s.contentSubtype)}) + if s.sendCompress != "" { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-encoding", Value: s.sendCompress}) + } + headerFields = appendHeaderFieldsFromMD(headerFields, s.header) + success, err := t.controlBuf.executeAndPut(t.checkForHeaderListSize, &headerFrame{ + streamID: s.id, + hf: headerFields, + endStream: false, + onWrite: t.setResetPingStrikes, + }) + if !success { + if err != nil { + return err + } + t.closeStream(s, true, http2.ErrCodeInternal, false) + return ErrHeaderListSizeLimitViolation + } + if t.stats != nil { + // Note: Headers are compressed with hpack after this call returns. + // No WireLength field is set here. + outHeader := &stats.OutHeader{ + Header: s.header.Copy(), + Compression: s.sendCompress, + } + t.stats.HandleRPC(s.Context(), outHeader) + } + return nil +} + +// WriteStatus sends stream status to the client and terminates the stream. +// There is no further I/O operations being able to perform on this stream. +// TODO(zhaoq): Now it indicates the end of entire stream. Revisit if early +// OK is adopted. +func (t *http2Server) WriteStatus(s *Stream, st *status.Status) error { + if s.getState() == streamDone { + return nil + } + s.hdrMu.Lock() + // TODO(mmukhi): Benchmark if the performance gets better if count the metadata and other header fields + // first and create a slice of that exact size. + headerFields := make([]hpack.HeaderField, 0, 2) // grpc-status and grpc-message will be there if none else. + if !s.updateHeaderSent() { // No headers have been sent. + if len(s.header) > 0 { // Send a separate header frame. + if err := t.writeHeaderLocked(s); err != nil { + s.hdrMu.Unlock() + return err + } + } else { // Send a trailer only response. + headerFields = append(headerFields, hpack.HeaderField{Name: ":status", Value: "200"}) + headerFields = append(headerFields, hpack.HeaderField{Name: "content-type", Value: grpcutil.ContentType(s.contentSubtype)}) + } + } + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status", Value: strconv.Itoa(int(st.Code()))}) + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-message", Value: encodeGrpcMessage(st.Message())}) + + if p := st.Proto(); p != nil && len(p.Details) > 0 { + stBytes, err := proto.Marshal(p) + if err != nil { + // TODO: return error instead, when callers are able to handle it. + logger.Errorf("transport: failed to marshal rpc status: %v, error: %v", p, err) + } else { + headerFields = append(headerFields, hpack.HeaderField{Name: "grpc-status-details-bin", Value: encodeBinHeader(stBytes)}) + } + } + + // Attach the trailer metadata. + headerFields = appendHeaderFieldsFromMD(headerFields, s.trailer) + trailingHeader := &headerFrame{ + streamID: s.id, + hf: headerFields, + endStream: true, + onWrite: t.setResetPingStrikes, + } + s.hdrMu.Unlock() + success, err := t.controlBuf.execute(t.checkForHeaderListSize, trailingHeader) + if !success { + if err != nil { + return err + } + t.closeStream(s, true, http2.ErrCodeInternal, false) + return ErrHeaderListSizeLimitViolation + } + // Send a RST_STREAM after the trailers if the client has not already half-closed. + rst := s.getState() == streamActive + t.finishStream(s, rst, http2.ErrCodeNo, trailingHeader, true) + if t.stats != nil { + // Note: The trailer fields are compressed with hpack after this call returns. + // No WireLength field is set here. + t.stats.HandleRPC(s.Context(), &stats.OutTrailer{ + Trailer: s.trailer.Copy(), + }) + } + return nil +} + +// Write converts the data into HTTP2 data frame and sends it out. Non-nil error +// is returns if it fails (e.g., framing error, transport error). +func (t *http2Server) Write(s *Stream, hdr []byte, data []byte, opts *Options) error { + if !s.isHeaderSent() { // Headers haven't been written yet. + if err := t.WriteHeader(s, nil); err != nil { + if _, ok := err.(ConnectionError); ok { + return err + } + // TODO(mmukhi, dfawley): Make sure this is the right code to return. + return status.Errorf(codes.Internal, "transport: %v", err) + } + } else { + // Writing headers checks for this condition. + if s.getState() == streamDone { + // TODO(mmukhi, dfawley): Should the server write also return io.EOF? + s.cancel() + select { + case <-t.done: + return ErrConnClosing + default: + } + return ContextErr(s.ctx.Err()) + } + } + df := &dataFrame{ + streamID: s.id, + h: hdr, + d: data, + onEachWrite: t.setResetPingStrikes, + } + if err := s.wq.get(int32(len(hdr) + len(data))); err != nil { + select { + case <-t.done: + return ErrConnClosing + default: + } + return ContextErr(s.ctx.Err()) + } + return t.controlBuf.put(df) +} + +// keepalive running in a separate goroutine does the following: +// 1. Gracefully closes an idle connection after a duration of keepalive.MaxConnectionIdle. +// 2. Gracefully closes any connection after a duration of keepalive.MaxConnectionAge. +// 3. Forcibly closes a connection after an additive period of keepalive.MaxConnectionAgeGrace over keepalive.MaxConnectionAge. +// 4. Makes sure a connection is alive by sending pings with a frequency of keepalive.Time and closes a non-responsive connection +// after an additional duration of keepalive.Timeout. +func (t *http2Server) keepalive() { + p := &ping{} + // True iff a ping has been sent, and no data has been received since then. + outstandingPing := false + // Amount of time remaining before which we should receive an ACK for the + // last sent ping. + kpTimeoutLeft := time.Duration(0) + // Records the last value of t.lastRead before we go block on the timer. + // This is required to check for read activity since then. + prevNano := time.Now().UnixNano() + // Initialize the different timers to their default values. + idleTimer := time.NewTimer(t.kp.MaxConnectionIdle) + ageTimer := time.NewTimer(t.kp.MaxConnectionAge) + kpTimer := time.NewTimer(t.kp.Time) + defer func() { + // We need to drain the underlying channel in these timers after a call + // to Stop(), only if we are interested in resetting them. Clearly we + // are not interested in resetting them here. + idleTimer.Stop() + ageTimer.Stop() + kpTimer.Stop() + }() + + for { + select { + case <-idleTimer.C: + t.mu.Lock() + idle := t.idle + if idle.IsZero() { // The connection is non-idle. + t.mu.Unlock() + idleTimer.Reset(t.kp.MaxConnectionIdle) + continue + } + val := t.kp.MaxConnectionIdle - time.Since(idle) + t.mu.Unlock() + if val <= 0 { + // The connection has been idle for a duration of keepalive.MaxConnectionIdle or more. + // Gracefully close the connection. + t.drain(http2.ErrCodeNo, []byte{}) + return + } + idleTimer.Reset(val) + case <-ageTimer.C: + t.drain(http2.ErrCodeNo, []byte{}) + ageTimer.Reset(t.kp.MaxConnectionAgeGrace) + select { + case <-ageTimer.C: + // Close the connection after grace period. + if logger.V(logLevel) { + logger.Infof("transport: closing server transport due to maximum connection age.") + } + t.Close() + case <-t.done: + } + return + case <-kpTimer.C: + lastRead := atomic.LoadInt64(&t.lastRead) + if lastRead > prevNano { + // There has been read activity since the last time we were + // here. Setup the timer to fire at kp.Time seconds from + // lastRead time and continue. + outstandingPing = false + kpTimer.Reset(time.Duration(lastRead) + t.kp.Time - time.Duration(time.Now().UnixNano())) + prevNano = lastRead + continue + } + if outstandingPing && kpTimeoutLeft <= 0 { + if logger.V(logLevel) { + logger.Infof("transport: closing server transport due to idleness.") + } + t.Close() + return + } + if !outstandingPing { + if channelz.IsOn() { + atomic.AddInt64(&t.czData.kpCount, 1) + } + t.controlBuf.put(p) + kpTimeoutLeft = t.kp.Timeout + outstandingPing = true + } + // The amount of time to sleep here is the minimum of kp.Time and + // timeoutLeft. This will ensure that we wait only for kp.Time + // before sending out the next ping (for cases where the ping is + // acked). + sleepDuration := minTime(t.kp.Time, kpTimeoutLeft) + kpTimeoutLeft -= sleepDuration + kpTimer.Reset(sleepDuration) + case <-t.done: + return + } + } +} + +// Close starts shutting down the http2Server transport. +// TODO(zhaoq): Now the destruction is not blocked on any pending streams. This +// could cause some resource issue. Revisit this later. +func (t *http2Server) Close() error { + t.mu.Lock() + if t.state == closing { + t.mu.Unlock() + return errors.New("transport: Close() was already called") + } + t.state = closing + streams := t.activeStreams + t.activeStreams = nil + t.mu.Unlock() + t.controlBuf.finish() + close(t.done) + err := t.conn.Close() + if channelz.IsOn() { + channelz.RemoveEntry(t.channelzID) + } + // Cancel all active streams. + for _, s := range streams { + s.cancel() + } + if t.stats != nil { + connEnd := &stats.ConnEnd{} + t.stats.HandleConn(t.ctx, connEnd) + } + return err +} + +// deleteStream deletes the stream s from transport's active streams. +func (t *http2Server) deleteStream(s *Stream, eosReceived bool) { + // In case stream sending and receiving are invoked in separate + // goroutines (e.g., bi-directional streaming), cancel needs to be + // called to interrupt the potential blocking on other goroutines. + s.cancel() + + t.mu.Lock() + if _, ok := t.activeStreams[s.id]; ok { + delete(t.activeStreams, s.id) + if len(t.activeStreams) == 0 { + t.idle = time.Now() + } + } + t.mu.Unlock() + + if channelz.IsOn() { + if eosReceived { + atomic.AddInt64(&t.czData.streamsSucceeded, 1) + } else { + atomic.AddInt64(&t.czData.streamsFailed, 1) + } + } +} + +// finishStream closes the stream and puts the trailing headerFrame into controlbuf. +func (t *http2Server) finishStream(s *Stream, rst bool, rstCode http2.ErrCode, hdr *headerFrame, eosReceived bool) { + oldState := s.swapState(streamDone) + if oldState == streamDone { + // If the stream was already done, return. + return + } + + hdr.cleanup = &cleanupStream{ + streamID: s.id, + rst: rst, + rstCode: rstCode, + onWrite: func() { + t.deleteStream(s, eosReceived) + }, + } + t.controlBuf.put(hdr) +} + +// closeStream clears the footprint of a stream when the stream is not needed any more. +func (t *http2Server) closeStream(s *Stream, rst bool, rstCode http2.ErrCode, eosReceived bool) { + s.swapState(streamDone) + t.deleteStream(s, eosReceived) + + t.controlBuf.put(&cleanupStream{ + streamID: s.id, + rst: rst, + rstCode: rstCode, + onWrite: func() {}, + }) +} + +func (t *http2Server) RemoteAddr() net.Addr { + return t.remoteAddr +} + +func (t *http2Server) Drain() { + t.drain(http2.ErrCodeNo, []byte{}) +} + +func (t *http2Server) drain(code http2.ErrCode, debugData []byte) { + t.mu.Lock() + defer t.mu.Unlock() + if t.drainChan != nil { + return + } + t.drainChan = make(chan struct{}) + t.controlBuf.put(&goAway{code: code, debugData: debugData, headsUp: true}) +} + +var goAwayPing = &ping{data: [8]byte{1, 6, 1, 8, 0, 3, 3, 9}} + +// Handles outgoing GoAway and returns true if loopy needs to put itself +// in draining mode. +func (t *http2Server) outgoingGoAwayHandler(g *goAway) (bool, error) { + t.mu.Lock() + if t.state == closing { // TODO(mmukhi): This seems unnecessary. + t.mu.Unlock() + // The transport is closing. + return false, ErrConnClosing + } + sid := t.maxStreamID + if !g.headsUp { + // Stop accepting more streams now. + t.state = draining + if len(t.activeStreams) == 0 { + g.closeConn = true + } + t.mu.Unlock() + if err := t.framer.fr.WriteGoAway(sid, g.code, g.debugData); err != nil { + return false, err + } + if g.closeConn { + // Abruptly close the connection following the GoAway (via + // loopywriter). But flush out what's inside the buffer first. + t.framer.writer.Flush() + return false, fmt.Errorf("transport: Connection closing") + } + return true, nil + } + t.mu.Unlock() + // For a graceful close, send out a GoAway with stream ID of MaxUInt32, + // Follow that with a ping and wait for the ack to come back or a timer + // to expire. During this time accept new streams since they might have + // originated before the GoAway reaches the client. + // After getting the ack or timer expiration send out another GoAway this + // time with an ID of the max stream server intends to process. + if err := t.framer.fr.WriteGoAway(math.MaxUint32, http2.ErrCodeNo, []byte{}); err != nil { + return false, err + } + if err := t.framer.fr.WritePing(false, goAwayPing.data); err != nil { + return false, err + } + go func() { + timer := time.NewTimer(time.Minute) + defer timer.Stop() + select { + case <-t.drainChan: + case <-timer.C: + case <-t.done: + return + } + t.controlBuf.put(&goAway{code: g.code, debugData: g.debugData}) + }() + return false, nil +} + +func (t *http2Server) ChannelzMetric() *channelz.SocketInternalMetric { + s := channelz.SocketInternalMetric{ + StreamsStarted: atomic.LoadInt64(&t.czData.streamsStarted), + StreamsSucceeded: atomic.LoadInt64(&t.czData.streamsSucceeded), + StreamsFailed: atomic.LoadInt64(&t.czData.streamsFailed), + MessagesSent: atomic.LoadInt64(&t.czData.msgSent), + MessagesReceived: atomic.LoadInt64(&t.czData.msgRecv), + KeepAlivesSent: atomic.LoadInt64(&t.czData.kpCount), + LastRemoteStreamCreatedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastStreamCreatedTime)), + LastMessageSentTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgSentTime)), + LastMessageReceivedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgRecvTime)), + LocalFlowControlWindow: int64(t.fc.getSize()), + SocketOptions: channelz.GetSocketOption(t.conn), + LocalAddr: t.localAddr, + RemoteAddr: t.remoteAddr, + // RemoteName : + } + if au, ok := t.authInfo.(credentials.ChannelzSecurityInfo); ok { + s.Security = au.GetSecurityValue() + } + s.RemoteFlowControlWindow = t.getOutFlowWindow() + return &s +} + +func (t *http2Server) IncrMsgSent() { + atomic.AddInt64(&t.czData.msgSent, 1) + atomic.StoreInt64(&t.czData.lastMsgSentTime, time.Now().UnixNano()) +} + +func (t *http2Server) IncrMsgRecv() { + atomic.AddInt64(&t.czData.msgRecv, 1) + atomic.StoreInt64(&t.czData.lastMsgRecvTime, time.Now().UnixNano()) +} + +func (t *http2Server) getOutFlowWindow() int64 { + resp := make(chan uint32, 1) + timer := time.NewTimer(time.Second) + defer timer.Stop() + t.controlBuf.put(&outFlowControlSizeRequest{resp}) + select { + case sz := <-resp: + return int64(sz) + case <-t.done: + return -1 + case <-timer.C: + return -2 + } +} + +func getJitter(v time.Duration) time.Duration { + if v == infinity { + return 0 + } + // Generate a jitter between +/- 10% of the value. + r := int64(v / 10) + j := grpcrand.Int63n(2*r) - r + return time.Duration(j) +} diff --git a/vendor/google.golang.org/grpc/internal/transport/http_util.go b/vendor/google.golang.org/grpc/internal/transport/http_util.go new file mode 100644 index 000000000..5e1e7a65d --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/http_util.go @@ -0,0 +1,607 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package transport + +import ( + "bufio" + "bytes" + "encoding/base64" + "fmt" + "io" + "math" + "net" + "net/http" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/golang/protobuf/proto" + "golang.org/x/net/http2" + "golang.org/x/net/http2/hpack" + spb "google.golang.org/genproto/googleapis/rpc/status" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/status" +) + +const ( + // http2MaxFrameLen specifies the max length of a HTTP2 frame. + http2MaxFrameLen = 16384 // 16KB frame + // http://http2.github.io/http2-spec/#SettingValues + http2InitHeaderTableSize = 4096 + // baseContentType is the base content-type for gRPC. This is a valid + // content-type on it's own, but can also include a content-subtype such as + // "proto" as a suffix after "+" or ";". See + // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests + // for more details. + +) + +var ( + clientPreface = []byte(http2.ClientPreface) + http2ErrConvTab = map[http2.ErrCode]codes.Code{ + http2.ErrCodeNo: codes.Internal, + http2.ErrCodeProtocol: codes.Internal, + http2.ErrCodeInternal: codes.Internal, + http2.ErrCodeFlowControl: codes.ResourceExhausted, + http2.ErrCodeSettingsTimeout: codes.Internal, + http2.ErrCodeStreamClosed: codes.Internal, + http2.ErrCodeFrameSize: codes.Internal, + http2.ErrCodeRefusedStream: codes.Unavailable, + http2.ErrCodeCancel: codes.Canceled, + http2.ErrCodeCompression: codes.Internal, + http2.ErrCodeConnect: codes.Internal, + http2.ErrCodeEnhanceYourCalm: codes.ResourceExhausted, + http2.ErrCodeInadequateSecurity: codes.PermissionDenied, + http2.ErrCodeHTTP11Required: codes.Internal, + } + statusCodeConvTab = map[codes.Code]http2.ErrCode{ + codes.Internal: http2.ErrCodeInternal, + codes.Canceled: http2.ErrCodeCancel, + codes.Unavailable: http2.ErrCodeRefusedStream, + codes.ResourceExhausted: http2.ErrCodeEnhanceYourCalm, + codes.PermissionDenied: http2.ErrCodeInadequateSecurity, + } + // HTTPStatusConvTab is the HTTP status code to gRPC error code conversion table. + HTTPStatusConvTab = map[int]codes.Code{ + // 400 Bad Request - INTERNAL. + http.StatusBadRequest: codes.Internal, + // 401 Unauthorized - UNAUTHENTICATED. + http.StatusUnauthorized: codes.Unauthenticated, + // 403 Forbidden - PERMISSION_DENIED. + http.StatusForbidden: codes.PermissionDenied, + // 404 Not Found - UNIMPLEMENTED. + http.StatusNotFound: codes.Unimplemented, + // 429 Too Many Requests - UNAVAILABLE. + http.StatusTooManyRequests: codes.Unavailable, + // 502 Bad Gateway - UNAVAILABLE. + http.StatusBadGateway: codes.Unavailable, + // 503 Service Unavailable - UNAVAILABLE. + http.StatusServiceUnavailable: codes.Unavailable, + // 504 Gateway timeout - UNAVAILABLE. + http.StatusGatewayTimeout: codes.Unavailable, + } + logger = grpclog.Component("transport") +) + +type parsedHeaderData struct { + encoding string + // statusGen caches the stream status received from the trailer the server + // sent. Client side only. Do not access directly. After all trailers are + // parsed, use the status method to retrieve the status. + statusGen *status.Status + // rawStatusCode and rawStatusMsg are set from the raw trailer fields and are not + // intended for direct access outside of parsing. + rawStatusCode *int + rawStatusMsg string + httpStatus *int + // Server side only fields. + timeoutSet bool + timeout time.Duration + method string + // key-value metadata map from the peer. + mdata map[string][]string + statsTags []byte + statsTrace []byte + contentSubtype string + + // isGRPC field indicates whether the peer is speaking gRPC (otherwise HTTP). + // + // We are in gRPC mode (peer speaking gRPC) if: + // * We are client side and have already received a HEADER frame that indicates gRPC peer. + // * The header contains valid a content-type, i.e. a string starts with "application/grpc" + // And we should handle error specific to gRPC. + // + // Otherwise (i.e. a content-type string starts without "application/grpc", or does not exist), we + // are in HTTP fallback mode, and should handle error specific to HTTP. + isGRPC bool + grpcErr error + httpErr error + contentTypeErr string +} + +// decodeState configures decoding criteria and records the decoded data. +type decodeState struct { + // whether decoding on server side or not + serverSide bool + + // Records the states during HPACK decoding. It will be filled with info parsed from HTTP HEADERS + // frame once decodeHeader function has been invoked and returned. + data parsedHeaderData +} + +// isReservedHeader checks whether hdr belongs to HTTP2 headers +// reserved by gRPC protocol. Any other headers are classified as the +// user-specified metadata. +func isReservedHeader(hdr string) bool { + if hdr != "" && hdr[0] == ':' { + return true + } + switch hdr { + case "content-type", + "user-agent", + "grpc-message-type", + "grpc-encoding", + "grpc-message", + "grpc-status", + "grpc-timeout", + "grpc-status-details-bin", + // Intentionally exclude grpc-previous-rpc-attempts and + // grpc-retry-pushback-ms, which are "reserved", but their API + // intentionally works via metadata. + "te": + return true + default: + return false + } +} + +// isWhitelistedHeader checks whether hdr should be propagated into metadata +// visible to users, even though it is classified as "reserved", above. +func isWhitelistedHeader(hdr string) bool { + switch hdr { + case ":authority", "user-agent": + return true + default: + return false + } +} + +func (d *decodeState) status() *status.Status { + if d.data.statusGen == nil { + // No status-details were provided; generate status using code/msg. + d.data.statusGen = status.New(codes.Code(int32(*(d.data.rawStatusCode))), d.data.rawStatusMsg) + } + return d.data.statusGen +} + +const binHdrSuffix = "-bin" + +func encodeBinHeader(v []byte) string { + return base64.RawStdEncoding.EncodeToString(v) +} + +func decodeBinHeader(v string) ([]byte, error) { + if len(v)%4 == 0 { + // Input was padded, or padding was not necessary. + return base64.StdEncoding.DecodeString(v) + } + return base64.RawStdEncoding.DecodeString(v) +} + +func encodeMetadataHeader(k, v string) string { + if strings.HasSuffix(k, binHdrSuffix) { + return encodeBinHeader(([]byte)(v)) + } + return v +} + +func decodeMetadataHeader(k, v string) (string, error) { + if strings.HasSuffix(k, binHdrSuffix) { + b, err := decodeBinHeader(v) + return string(b), err + } + return v, nil +} + +func (d *decodeState) decodeHeader(frame *http2.MetaHeadersFrame) error { + // frame.Truncated is set to true when framer detects that the current header + // list size hits MaxHeaderListSize limit. + if frame.Truncated { + return status.Error(codes.Internal, "peer header list size exceeded limit") + } + + for _, hf := range frame.Fields { + d.processHeaderField(hf) + } + + if d.data.isGRPC { + if d.data.grpcErr != nil { + return d.data.grpcErr + } + if d.serverSide { + return nil + } + if d.data.rawStatusCode == nil && d.data.statusGen == nil { + // gRPC status doesn't exist. + // Set rawStatusCode to be unknown and return nil error. + // So that, if the stream has ended this Unknown status + // will be propagated to the user. + // Otherwise, it will be ignored. In which case, status from + // a later trailer, that has StreamEnded flag set, is propagated. + code := int(codes.Unknown) + d.data.rawStatusCode = &code + } + return nil + } + + // HTTP fallback mode + if d.data.httpErr != nil { + return d.data.httpErr + } + + var ( + code = codes.Internal // when header does not include HTTP status, return INTERNAL + ok bool + ) + + if d.data.httpStatus != nil { + code, ok = HTTPStatusConvTab[*(d.data.httpStatus)] + if !ok { + code = codes.Unknown + } + } + + return status.Error(code, d.constructHTTPErrMsg()) +} + +// constructErrMsg constructs error message to be returned in HTTP fallback mode. +// Format: HTTP status code and its corresponding message + content-type error message. +func (d *decodeState) constructHTTPErrMsg() string { + var errMsgs []string + + if d.data.httpStatus == nil { + errMsgs = append(errMsgs, "malformed header: missing HTTP status") + } else { + errMsgs = append(errMsgs, fmt.Sprintf("%s: HTTP status code %d", http.StatusText(*(d.data.httpStatus)), *d.data.httpStatus)) + } + + if d.data.contentTypeErr == "" { + errMsgs = append(errMsgs, "transport: missing content-type field") + } else { + errMsgs = append(errMsgs, d.data.contentTypeErr) + } + + return strings.Join(errMsgs, "; ") +} + +func (d *decodeState) addMetadata(k, v string) { + if d.data.mdata == nil { + d.data.mdata = make(map[string][]string) + } + d.data.mdata[k] = append(d.data.mdata[k], v) +} + +func (d *decodeState) processHeaderField(f hpack.HeaderField) { + switch f.Name { + case "content-type": + contentSubtype, validContentType := grpcutil.ContentSubtype(f.Value) + if !validContentType { + d.data.contentTypeErr = fmt.Sprintf("transport: received the unexpected content-type %q", f.Value) + return + } + d.data.contentSubtype = contentSubtype + // TODO: do we want to propagate the whole content-type in the metadata, + // or come up with a way to just propagate the content-subtype if it was set? + // ie {"content-type": "application/grpc+proto"} or {"content-subtype": "proto"} + // in the metadata? + d.addMetadata(f.Name, f.Value) + d.data.isGRPC = true + case "grpc-encoding": + d.data.encoding = f.Value + case "grpc-status": + code, err := strconv.Atoi(f.Value) + if err != nil { + d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-status: %v", err) + return + } + d.data.rawStatusCode = &code + case "grpc-message": + d.data.rawStatusMsg = decodeGrpcMessage(f.Value) + case "grpc-status-details-bin": + v, err := decodeBinHeader(f.Value) + if err != nil { + d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err) + return + } + s := &spb.Status{} + if err := proto.Unmarshal(v, s); err != nil { + d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-status-details-bin: %v", err) + return + } + d.data.statusGen = status.FromProto(s) + case "grpc-timeout": + d.data.timeoutSet = true + var err error + if d.data.timeout, err = decodeTimeout(f.Value); err != nil { + d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed time-out: %v", err) + } + case ":path": + d.data.method = f.Value + case ":status": + code, err := strconv.Atoi(f.Value) + if err != nil { + d.data.httpErr = status.Errorf(codes.Internal, "transport: malformed http-status: %v", err) + return + } + d.data.httpStatus = &code + case "grpc-tags-bin": + v, err := decodeBinHeader(f.Value) + if err != nil { + d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-tags-bin: %v", err) + return + } + d.data.statsTags = v + d.addMetadata(f.Name, string(v)) + case "grpc-trace-bin": + v, err := decodeBinHeader(f.Value) + if err != nil { + d.data.grpcErr = status.Errorf(codes.Internal, "transport: malformed grpc-trace-bin: %v", err) + return + } + d.data.statsTrace = v + d.addMetadata(f.Name, string(v)) + default: + if isReservedHeader(f.Name) && !isWhitelistedHeader(f.Name) { + break + } + v, err := decodeMetadataHeader(f.Name, f.Value) + if err != nil { + if logger.V(logLevel) { + logger.Errorf("Failed to decode metadata header (%q, %q): %v", f.Name, f.Value, err) + } + return + } + d.addMetadata(f.Name, v) + } +} + +type timeoutUnit uint8 + +const ( + hour timeoutUnit = 'H' + minute timeoutUnit = 'M' + second timeoutUnit = 'S' + millisecond timeoutUnit = 'm' + microsecond timeoutUnit = 'u' + nanosecond timeoutUnit = 'n' +) + +func timeoutUnitToDuration(u timeoutUnit) (d time.Duration, ok bool) { + switch u { + case hour: + return time.Hour, true + case minute: + return time.Minute, true + case second: + return time.Second, true + case millisecond: + return time.Millisecond, true + case microsecond: + return time.Microsecond, true + case nanosecond: + return time.Nanosecond, true + default: + } + return +} + +func decodeTimeout(s string) (time.Duration, error) { + size := len(s) + if size < 2 { + return 0, fmt.Errorf("transport: timeout string is too short: %q", s) + } + if size > 9 { + // Spec allows for 8 digits plus the unit. + return 0, fmt.Errorf("transport: timeout string is too long: %q", s) + } + unit := timeoutUnit(s[size-1]) + d, ok := timeoutUnitToDuration(unit) + if !ok { + return 0, fmt.Errorf("transport: timeout unit is not recognized: %q", s) + } + t, err := strconv.ParseInt(s[:size-1], 10, 64) + if err != nil { + return 0, err + } + const maxHours = math.MaxInt64 / int64(time.Hour) + if d == time.Hour && t > maxHours { + // This timeout would overflow math.MaxInt64; clamp it. + return time.Duration(math.MaxInt64), nil + } + return d * time.Duration(t), nil +} + +const ( + spaceByte = ' ' + tildeByte = '~' + percentByte = '%' +) + +// encodeGrpcMessage is used to encode status code in header field +// "grpc-message". It does percent encoding and also replaces invalid utf-8 +// characters with Unicode replacement character. +// +// It checks to see if each individual byte in msg is an allowable byte, and +// then either percent encoding or passing it through. When percent encoding, +// the byte is converted into hexadecimal notation with a '%' prepended. +func encodeGrpcMessage(msg string) string { + if msg == "" { + return "" + } + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + c := msg[i] + if !(c >= spaceByte && c <= tildeByte && c != percentByte) { + return encodeGrpcMessageUnchecked(msg) + } + } + return msg +} + +func encodeGrpcMessageUnchecked(msg string) string { + var buf bytes.Buffer + for len(msg) > 0 { + r, size := utf8.DecodeRuneInString(msg) + for _, b := range []byte(string(r)) { + if size > 1 { + // If size > 1, r is not ascii. Always do percent encoding. + buf.WriteString(fmt.Sprintf("%%%02X", b)) + continue + } + + // The for loop is necessary even if size == 1. r could be + // utf8.RuneError. + // + // fmt.Sprintf("%%%02X", utf8.RuneError) gives "%FFFD". + if b >= spaceByte && b <= tildeByte && b != percentByte { + buf.WriteByte(b) + } else { + buf.WriteString(fmt.Sprintf("%%%02X", b)) + } + } + msg = msg[size:] + } + return buf.String() +} + +// decodeGrpcMessage decodes the msg encoded by encodeGrpcMessage. +func decodeGrpcMessage(msg string) string { + if msg == "" { + return "" + } + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + if msg[i] == percentByte && i+2 < lenMsg { + return decodeGrpcMessageUnchecked(msg) + } + } + return msg +} + +func decodeGrpcMessageUnchecked(msg string) string { + var buf bytes.Buffer + lenMsg := len(msg) + for i := 0; i < lenMsg; i++ { + c := msg[i] + if c == percentByte && i+2 < lenMsg { + parsed, err := strconv.ParseUint(msg[i+1:i+3], 16, 8) + if err != nil { + buf.WriteByte(c) + } else { + buf.WriteByte(byte(parsed)) + i += 2 + } + } else { + buf.WriteByte(c) + } + } + return buf.String() +} + +type bufWriter struct { + buf []byte + offset int + batchSize int + conn net.Conn + err error + + onFlush func() +} + +func newBufWriter(conn net.Conn, batchSize int) *bufWriter { + return &bufWriter{ + buf: make([]byte, batchSize*2), + batchSize: batchSize, + conn: conn, + } +} + +func (w *bufWriter) Write(b []byte) (n int, err error) { + if w.err != nil { + return 0, w.err + } + if w.batchSize == 0 { // Buffer has been disabled. + return w.conn.Write(b) + } + for len(b) > 0 { + nn := copy(w.buf[w.offset:], b) + b = b[nn:] + w.offset += nn + n += nn + if w.offset >= w.batchSize { + err = w.Flush() + } + } + return n, err +} + +func (w *bufWriter) Flush() error { + if w.err != nil { + return w.err + } + if w.offset == 0 { + return nil + } + if w.onFlush != nil { + w.onFlush() + } + _, w.err = w.conn.Write(w.buf[:w.offset]) + w.offset = 0 + return w.err +} + +type framer struct { + writer *bufWriter + fr *http2.Framer +} + +func newFramer(conn net.Conn, writeBufferSize, readBufferSize int, maxHeaderListSize uint32) *framer { + if writeBufferSize < 0 { + writeBufferSize = 0 + } + var r io.Reader = conn + if readBufferSize > 0 { + r = bufio.NewReaderSize(r, readBufferSize) + } + w := newBufWriter(conn, writeBufferSize) + f := &framer{ + writer: w, + fr: http2.NewFramer(w, r), + } + f.fr.SetMaxReadFrameSize(http2MaxFrameLen) + // Opt-in to Frame reuse API on framer to reduce garbage. + // Frames aren't safe to read from after a subsequent call to ReadFrame. + f.fr.SetReuseFrames() + f.fr.MaxHeaderListSize = maxHeaderListSize + f.fr.ReadMetaHeaders = hpack.NewDecoder(http2InitHeaderTableSize, nil) + return f +} diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go new file mode 100644 index 000000000..b74030a96 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -0,0 +1,804 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package transport defines and implements message oriented communication +// channel to complete various transactions (e.g., an RPC). It is meant for +// grpc-internal usage and is not intended to be imported directly by users. +package transport + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "net" + "sync" + "sync/atomic" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" +) + +const logLevel = 2 + +type bufferPool struct { + pool sync.Pool +} + +func newBufferPool() *bufferPool { + return &bufferPool{ + pool: sync.Pool{ + New: func() interface{} { + return new(bytes.Buffer) + }, + }, + } +} + +func (p *bufferPool) get() *bytes.Buffer { + return p.pool.Get().(*bytes.Buffer) +} + +func (p *bufferPool) put(b *bytes.Buffer) { + p.pool.Put(b) +} + +// recvMsg represents the received msg from the transport. All transport +// protocol specific info has been removed. +type recvMsg struct { + buffer *bytes.Buffer + // nil: received some data + // io.EOF: stream is completed. data is nil. + // other non-nil error: transport failure. data is nil. + err error +} + +// recvBuffer is an unbounded channel of recvMsg structs. +// +// Note: recvBuffer differs from buffer.Unbounded only in the fact that it +// holds a channel of recvMsg structs instead of objects implementing "item" +// interface. recvBuffer is written to much more often and using strict recvMsg +// structs helps avoid allocation in "recvBuffer.put" +type recvBuffer struct { + c chan recvMsg + mu sync.Mutex + backlog []recvMsg + err error +} + +func newRecvBuffer() *recvBuffer { + b := &recvBuffer{ + c: make(chan recvMsg, 1), + } + return b +} + +func (b *recvBuffer) put(r recvMsg) { + b.mu.Lock() + if b.err != nil { + b.mu.Unlock() + // An error had occurred earlier, don't accept more + // data or errors. + return + } + b.err = r.err + if len(b.backlog) == 0 { + select { + case b.c <- r: + b.mu.Unlock() + return + default: + } + } + b.backlog = append(b.backlog, r) + b.mu.Unlock() +} + +func (b *recvBuffer) load() { + b.mu.Lock() + if len(b.backlog) > 0 { + select { + case b.c <- b.backlog[0]: + b.backlog[0] = recvMsg{} + b.backlog = b.backlog[1:] + default: + } + } + b.mu.Unlock() +} + +// get returns the channel that receives a recvMsg in the buffer. +// +// Upon receipt of a recvMsg, the caller should call load to send another +// recvMsg onto the channel if there is any. +func (b *recvBuffer) get() <-chan recvMsg { + return b.c +} + +// recvBufferReader implements io.Reader interface to read the data from +// recvBuffer. +type recvBufferReader struct { + closeStream func(error) // Closes the client transport stream with the given error and nil trailer metadata. + ctx context.Context + ctxDone <-chan struct{} // cache of ctx.Done() (for performance). + recv *recvBuffer + last *bytes.Buffer // Stores the remaining data in the previous calls. + err error + freeBuffer func(*bytes.Buffer) +} + +// Read reads the next len(p) bytes from last. If last is drained, it tries to +// read additional data from recv. It blocks if there no additional data available +// in recv. If Read returns any non-nil error, it will continue to return that error. +func (r *recvBufferReader) Read(p []byte) (n int, err error) { + if r.err != nil { + return 0, r.err + } + if r.last != nil { + // Read remaining data left in last call. + copied, _ := r.last.Read(p) + if r.last.Len() == 0 { + r.freeBuffer(r.last) + r.last = nil + } + return copied, nil + } + if r.closeStream != nil { + n, r.err = r.readClient(p) + } else { + n, r.err = r.read(p) + } + return n, r.err +} + +func (r *recvBufferReader) read(p []byte) (n int, err error) { + select { + case <-r.ctxDone: + return 0, ContextErr(r.ctx.Err()) + case m := <-r.recv.get(): + return r.readAdditional(m, p) + } +} + +func (r *recvBufferReader) readClient(p []byte) (n int, err error) { + // If the context is canceled, then closes the stream with nil metadata. + // closeStream writes its error parameter to r.recv as a recvMsg. + // r.readAdditional acts on that message and returns the necessary error. + select { + case <-r.ctxDone: + // Note that this adds the ctx error to the end of recv buffer, and + // reads from the head. This will delay the error until recv buffer is + // empty, thus will delay ctx cancellation in Recv(). + // + // It's done this way to fix a race between ctx cancel and trailer. The + // race was, stream.Recv() may return ctx error if ctxDone wins the + // race, but stream.Trailer() may return a non-nil md because the stream + // was not marked as done when trailer is received. This closeStream + // call will mark stream as done, thus fix the race. + // + // TODO: delaying ctx error seems like a unnecessary side effect. What + // we really want is to mark the stream as done, and return ctx error + // faster. + r.closeStream(ContextErr(r.ctx.Err())) + m := <-r.recv.get() + return r.readAdditional(m, p) + case m := <-r.recv.get(): + return r.readAdditional(m, p) + } +} + +func (r *recvBufferReader) readAdditional(m recvMsg, p []byte) (n int, err error) { + r.recv.load() + if m.err != nil { + return 0, m.err + } + copied, _ := m.buffer.Read(p) + if m.buffer.Len() == 0 { + r.freeBuffer(m.buffer) + r.last = nil + } else { + r.last = m.buffer + } + return copied, nil +} + +type streamState uint32 + +const ( + streamActive streamState = iota + streamWriteDone // EndStream sent + streamReadDone // EndStream received + streamDone // the entire stream is finished. +) + +// Stream represents an RPC in the transport layer. +type Stream struct { + id uint32 + st ServerTransport // nil for client side Stream + ct *http2Client // nil for server side Stream + ctx context.Context // the associated context of the stream + cancel context.CancelFunc // always nil for client side Stream + done chan struct{} // closed at the end of stream to unblock writers. On the client side. + ctxDone <-chan struct{} // same as done chan but for server side. Cache of ctx.Done() (for performance) + method string // the associated RPC method of the stream + recvCompress string + sendCompress string + buf *recvBuffer + trReader io.Reader + fc *inFlow + wq *writeQuota + + // Callback to state application's intentions to read data. This + // is used to adjust flow control, if needed. + requestRead func(int) + + headerChan chan struct{} // closed to indicate the end of header metadata. + headerChanClosed uint32 // set when headerChan is closed. Used to avoid closing headerChan multiple times. + // headerValid indicates whether a valid header was received. Only + // meaningful after headerChan is closed (always call waitOnHeader() before + // reading its value). Not valid on server side. + headerValid bool + + // hdrMu protects header and trailer metadata on the server-side. + hdrMu sync.Mutex + // On client side, header keeps the received header metadata. + // + // On server side, header keeps the header set by SetHeader(). The complete + // header will merged into this after t.WriteHeader() is called. + header metadata.MD + trailer metadata.MD // the key-value map of trailer metadata. + + noHeaders bool // set if the client never received headers (set only after the stream is done). + + // On the server-side, headerSent is atomically set to 1 when the headers are sent out. + headerSent uint32 + + state streamState + + // On client-side it is the status error received from the server. + // On server-side it is unused. + status *status.Status + + bytesReceived uint32 // indicates whether any bytes have been received on this stream + unprocessed uint32 // set if the server sends a refused stream or GOAWAY including this stream + + // contentSubtype is the content-subtype for requests. + // this must be lowercase or the behavior is undefined. + contentSubtype string +} + +// isHeaderSent is only valid on the server-side. +func (s *Stream) isHeaderSent() bool { + return atomic.LoadUint32(&s.headerSent) == 1 +} + +// updateHeaderSent updates headerSent and returns true +// if it was alreay set. It is valid only on server-side. +func (s *Stream) updateHeaderSent() bool { + return atomic.SwapUint32(&s.headerSent, 1) == 1 +} + +func (s *Stream) swapState(st streamState) streamState { + return streamState(atomic.SwapUint32((*uint32)(&s.state), uint32(st))) +} + +func (s *Stream) compareAndSwapState(oldState, newState streamState) bool { + return atomic.CompareAndSwapUint32((*uint32)(&s.state), uint32(oldState), uint32(newState)) +} + +func (s *Stream) getState() streamState { + return streamState(atomic.LoadUint32((*uint32)(&s.state))) +} + +func (s *Stream) waitOnHeader() { + if s.headerChan == nil { + // On the server headerChan is always nil since a stream originates + // only after having received headers. + return + } + select { + case <-s.ctx.Done(): + // Close the stream to prevent headers/trailers from changing after + // this function returns. + s.ct.CloseStream(s, ContextErr(s.ctx.Err())) + // headerChan could possibly not be closed yet if closeStream raced + // with operateHeaders; wait until it is closed explicitly here. + <-s.headerChan + case <-s.headerChan: + } +} + +// RecvCompress returns the compression algorithm applied to the inbound +// message. It is empty string if there is no compression applied. +func (s *Stream) RecvCompress() string { + s.waitOnHeader() + return s.recvCompress +} + +// SetSendCompress sets the compression algorithm to the stream. +func (s *Stream) SetSendCompress(str string) { + s.sendCompress = str +} + +// Done returns a channel which is closed when it receives the final status +// from the server. +func (s *Stream) Done() <-chan struct{} { + return s.done +} + +// Header returns the header metadata of the stream. +// +// On client side, it acquires the key-value pairs of header metadata once it is +// available. It blocks until i) the metadata is ready or ii) there is no header +// metadata or iii) the stream is canceled/expired. +// +// On server side, it returns the out header after t.WriteHeader is called. It +// does not block and must not be called until after WriteHeader. +func (s *Stream) Header() (metadata.MD, error) { + if s.headerChan == nil { + // On server side, return the header in stream. It will be the out + // header after t.WriteHeader is called. + return s.header.Copy(), nil + } + s.waitOnHeader() + if !s.headerValid { + return nil, s.status.Err() + } + return s.header.Copy(), nil +} + +// TrailersOnly blocks until a header or trailers-only frame is received and +// then returns true if the stream was trailers-only. If the stream ends +// before headers are received, returns true, nil. Client-side only. +func (s *Stream) TrailersOnly() bool { + s.waitOnHeader() + return s.noHeaders +} + +// Trailer returns the cached trailer metedata. Note that if it is not called +// after the entire stream is done, it could return an empty MD. Client +// side only. +// It can be safely read only after stream has ended that is either read +// or write have returned io.EOF. +func (s *Stream) Trailer() metadata.MD { + c := s.trailer.Copy() + return c +} + +// ContentSubtype returns the content-subtype for a request. For example, a +// content-subtype of "proto" will result in a content-type of +// "application/grpc+proto". This will always be lowercase. See +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. +func (s *Stream) ContentSubtype() string { + return s.contentSubtype +} + +// Context returns the context of the stream. +func (s *Stream) Context() context.Context { + return s.ctx +} + +// Method returns the method for the stream. +func (s *Stream) Method() string { + return s.method +} + +// Status returns the status received from the server. +// Status can be read safely only after the stream has ended, +// that is, after Done() is closed. +func (s *Stream) Status() *status.Status { + return s.status +} + +// SetHeader sets the header metadata. This can be called multiple times. +// Server side only. +// This should not be called in parallel to other data writes. +func (s *Stream) SetHeader(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + if s.isHeaderSent() || s.getState() == streamDone { + return ErrIllegalHeaderWrite + } + s.hdrMu.Lock() + s.header = metadata.Join(s.header, md) + s.hdrMu.Unlock() + return nil +} + +// SendHeader sends the given header metadata. The given metadata is +// combined with any metadata set by previous calls to SetHeader and +// then written to the transport stream. +func (s *Stream) SendHeader(md metadata.MD) error { + return s.st.WriteHeader(s, md) +} + +// SetTrailer sets the trailer metadata which will be sent with the RPC status +// by the server. This can be called multiple times. Server side only. +// This should not be called parallel to other data writes. +func (s *Stream) SetTrailer(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + if s.getState() == streamDone { + return ErrIllegalHeaderWrite + } + s.hdrMu.Lock() + s.trailer = metadata.Join(s.trailer, md) + s.hdrMu.Unlock() + return nil +} + +func (s *Stream) write(m recvMsg) { + s.buf.put(m) +} + +// Read reads all p bytes from the wire for this stream. +func (s *Stream) Read(p []byte) (n int, err error) { + // Don't request a read if there was an error earlier + if er := s.trReader.(*transportReader).er; er != nil { + return 0, er + } + s.requestRead(len(p)) + return io.ReadFull(s.trReader, p) +} + +// tranportReader reads all the data available for this Stream from the transport and +// passes them into the decoder, which converts them into a gRPC message stream. +// The error is io.EOF when the stream is done or another non-nil error if +// the stream broke. +type transportReader struct { + reader io.Reader + // The handler to control the window update procedure for both this + // particular stream and the associated transport. + windowHandler func(int) + er error +} + +func (t *transportReader) Read(p []byte) (n int, err error) { + n, err = t.reader.Read(p) + if err != nil { + t.er = err + return + } + t.windowHandler(n) + return +} + +// BytesReceived indicates whether any bytes have been received on this stream. +func (s *Stream) BytesReceived() bool { + return atomic.LoadUint32(&s.bytesReceived) == 1 +} + +// Unprocessed indicates whether the server did not process this stream -- +// i.e. it sent a refused stream or GOAWAY including this stream ID. +func (s *Stream) Unprocessed() bool { + return atomic.LoadUint32(&s.unprocessed) == 1 +} + +// GoString is implemented by Stream so context.String() won't +// race when printing %#v. +func (s *Stream) GoString() string { + return fmt.Sprintf("", s, s.method) +} + +// state of transport +type transportState int + +const ( + reachable transportState = iota + closing + draining +) + +// ServerConfig consists of all the configurations to establish a server transport. +type ServerConfig struct { + MaxStreams uint32 + AuthInfo credentials.AuthInfo + InTapHandle tap.ServerInHandle + StatsHandler stats.Handler + KeepaliveParams keepalive.ServerParameters + KeepalivePolicy keepalive.EnforcementPolicy + InitialWindowSize int32 + InitialConnWindowSize int32 + WriteBufferSize int + ReadBufferSize int + ChannelzParentID int64 + MaxHeaderListSize *uint32 + HeaderTableSize *uint32 +} + +// NewServerTransport creates a ServerTransport with conn or non-nil error +// if it fails. +func NewServerTransport(protocol string, conn net.Conn, config *ServerConfig) (ServerTransport, error) { + return newHTTP2Server(conn, config) +} + +// ConnectOptions covers all relevant options for communicating with the server. +type ConnectOptions struct { + // UserAgent is the application user agent. + UserAgent string + // Dialer specifies how to dial a network address. + Dialer func(context.Context, string) (net.Conn, error) + // FailOnNonTempDialError specifies if gRPC fails on non-temporary dial errors. + FailOnNonTempDialError bool + // PerRPCCredentials stores the PerRPCCredentials required to issue RPCs. + PerRPCCredentials []credentials.PerRPCCredentials + // TransportCredentials stores the Authenticator required to setup a client + // connection. Only one of TransportCredentials and CredsBundle is non-nil. + TransportCredentials credentials.TransportCredentials + // CredsBundle is the credentials bundle to be used. Only one of + // TransportCredentials and CredsBundle is non-nil. + CredsBundle credentials.Bundle + // KeepaliveParams stores the keepalive parameters. + KeepaliveParams keepalive.ClientParameters + // StatsHandler stores the handler for stats. + StatsHandler stats.Handler + // InitialWindowSize sets the initial window size for a stream. + InitialWindowSize int32 + // InitialConnWindowSize sets the initial window size for a connection. + InitialConnWindowSize int32 + // WriteBufferSize sets the size of write buffer which in turn determines how much data can be batched before it's written on the wire. + WriteBufferSize int + // ReadBufferSize sets the size of read buffer, which in turn determines how much data can be read at most for one read syscall. + ReadBufferSize int + // ChannelzParentID sets the addrConn id which initiate the creation of this client transport. + ChannelzParentID int64 + // MaxHeaderListSize sets the max (uncompressed) size of header list that is prepared to be received. + MaxHeaderListSize *uint32 +} + +// NewClientTransport establishes the transport with the required ConnectOptions +// and returns it to the caller. +func NewClientTransport(connectCtx, ctx context.Context, addr resolver.Address, opts ConnectOptions, onPrefaceReceipt func(), onGoAway func(GoAwayReason), onClose func()) (ClientTransport, error) { + return newHTTP2Client(connectCtx, ctx, addr, opts, onPrefaceReceipt, onGoAway, onClose) +} + +// Options provides additional hints and information for message +// transmission. +type Options struct { + // Last indicates whether this write is the last piece for + // this stream. + Last bool +} + +// CallHdr carries the information of a particular RPC. +type CallHdr struct { + // Host specifies the peer's host. + Host string + + // Method specifies the operation to perform. + Method string + + // SendCompress specifies the compression algorithm applied on + // outbound message. + SendCompress string + + // Creds specifies credentials.PerRPCCredentials for a call. + Creds credentials.PerRPCCredentials + + // ContentSubtype specifies the content-subtype for a request. For example, a + // content-subtype of "proto" will result in a content-type of + // "application/grpc+proto". The value of ContentSubtype must be all + // lowercase, otherwise the behavior is undefined. See + // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests + // for more details. + ContentSubtype string + + PreviousAttempts int // value of grpc-previous-rpc-attempts header to set +} + +// ClientTransport is the common interface for all gRPC client-side transport +// implementations. +type ClientTransport interface { + // Close tears down this transport. Once it returns, the transport + // should not be accessed any more. The caller must make sure this + // is called only once. + Close() error + + // GracefulClose starts to tear down the transport: the transport will stop + // accepting new RPCs and NewStream will return error. Once all streams are + // finished, the transport will close. + // + // It does not block. + GracefulClose() + + // Write sends the data for the given stream. A nil stream indicates + // the write is to be performed on the transport as a whole. + Write(s *Stream, hdr []byte, data []byte, opts *Options) error + + // NewStream creates a Stream for an RPC. + NewStream(ctx context.Context, callHdr *CallHdr) (*Stream, error) + + // CloseStream clears the footprint of a stream when the stream is + // not needed any more. The err indicates the error incurred when + // CloseStream is called. Must be called when a stream is finished + // unless the associated transport is closing. + CloseStream(stream *Stream, err error) + + // Error returns a channel that is closed when some I/O error + // happens. Typically the caller should have a goroutine to monitor + // this in order to take action (e.g., close the current transport + // and create a new one) in error case. It should not return nil + // once the transport is initiated. + Error() <-chan struct{} + + // GoAway returns a channel that is closed when ClientTransport + // receives the draining signal from the server (e.g., GOAWAY frame in + // HTTP/2). + GoAway() <-chan struct{} + + // GetGoAwayReason returns the reason why GoAway frame was received. + GetGoAwayReason() GoAwayReason + + // RemoteAddr returns the remote network address. + RemoteAddr() net.Addr + + // IncrMsgSent increments the number of message sent through this transport. + IncrMsgSent() + + // IncrMsgRecv increments the number of message received through this transport. + IncrMsgRecv() +} + +// ServerTransport is the common interface for all gRPC server-side transport +// implementations. +// +// Methods may be called concurrently from multiple goroutines, but +// Write methods for a given Stream will be called serially. +type ServerTransport interface { + // HandleStreams receives incoming streams using the given handler. + HandleStreams(func(*Stream), func(context.Context, string) context.Context) + + // WriteHeader sends the header metadata for the given stream. + // WriteHeader may not be called on all streams. + WriteHeader(s *Stream, md metadata.MD) error + + // Write sends the data for the given stream. + // Write may not be called on all streams. + Write(s *Stream, hdr []byte, data []byte, opts *Options) error + + // WriteStatus sends the status of a stream to the client. WriteStatus is + // the final call made on a stream and always occurs. + WriteStatus(s *Stream, st *status.Status) error + + // Close tears down the transport. Once it is called, the transport + // should not be accessed any more. All the pending streams and their + // handlers will be terminated asynchronously. + Close() error + + // RemoteAddr returns the remote network address. + RemoteAddr() net.Addr + + // Drain notifies the client this ServerTransport stops accepting new RPCs. + Drain() + + // IncrMsgSent increments the number of message sent through this transport. + IncrMsgSent() + + // IncrMsgRecv increments the number of message received through this transport. + IncrMsgRecv() +} + +// connectionErrorf creates an ConnectionError with the specified error description. +func connectionErrorf(temp bool, e error, format string, a ...interface{}) ConnectionError { + return ConnectionError{ + Desc: fmt.Sprintf(format, a...), + temp: temp, + err: e, + } +} + +// ConnectionError is an error that results in the termination of the +// entire connection and the retry of all the active streams. +type ConnectionError struct { + Desc string + temp bool + err error +} + +func (e ConnectionError) Error() string { + return fmt.Sprintf("connection error: desc = %q", e.Desc) +} + +// Temporary indicates if this connection error is temporary or fatal. +func (e ConnectionError) Temporary() bool { + return e.temp +} + +// Origin returns the original error of this connection error. +func (e ConnectionError) Origin() error { + // Never return nil error here. + // If the original error is nil, return itself. + if e.err == nil { + return e + } + return e.err +} + +var ( + // ErrConnClosing indicates that the transport is closing. + ErrConnClosing = connectionErrorf(true, nil, "transport is closing") + // errStreamDrain indicates that the stream is rejected because the + // connection is draining. This could be caused by goaway or balancer + // removing the address. + errStreamDrain = status.Error(codes.Unavailable, "the connection is draining") + // errStreamDone is returned from write at the client side to indiacte application + // layer of an error. + errStreamDone = errors.New("the stream is done") + // StatusGoAway indicates that the server sent a GOAWAY that included this + // stream's ID in unprocessed RPCs. + statusGoAway = status.New(codes.Unavailable, "the stream is rejected because server is draining the connection") +) + +// GoAwayReason contains the reason for the GoAway frame received. +type GoAwayReason uint8 + +const ( + // GoAwayInvalid indicates that no GoAway frame is received. + GoAwayInvalid GoAwayReason = 0 + // GoAwayNoReason is the default value when GoAway frame is received. + GoAwayNoReason GoAwayReason = 1 + // GoAwayTooManyPings indicates that a GoAway frame with + // ErrCodeEnhanceYourCalm was received and that the debug data said + // "too_many_pings". + GoAwayTooManyPings GoAwayReason = 2 +) + +// channelzData is used to store channelz related data for http2Client and http2Server. +// These fields cannot be embedded in the original structs (e.g. http2Client), since to do atomic +// operation on int64 variable on 32-bit machine, user is responsible to enforce memory alignment. +// Here, by grouping those int64 fields inside a struct, we are enforcing the alignment. +type channelzData struct { + kpCount int64 + // The number of streams that have started, including already finished ones. + streamsStarted int64 + // Client side: The number of streams that have ended successfully by receiving + // EoS bit set frame from server. + // Server side: The number of streams that have ended successfully by sending + // frame with EoS bit set. + streamsSucceeded int64 + streamsFailed int64 + // lastStreamCreatedTime stores the timestamp that the last stream gets created. It is of int64 type + // instead of time.Time since it's more costly to atomically update time.Time variable than int64 + // variable. The same goes for lastMsgSentTime and lastMsgRecvTime. + lastStreamCreatedTime int64 + msgSent int64 + msgRecv int64 + lastMsgSentTime int64 + lastMsgRecvTime int64 +} + +// ContextErr converts the error from context package into a status error. +func ContextErr(err error) error { + switch err { + case context.DeadlineExceeded: + return status.Error(codes.DeadlineExceeded, err.Error()) + case context.Canceled: + return status.Error(codes.Canceled, err.Error()) + } + return status.Errorf(codes.Internal, "Unexpected error from context packet: %v", err) +} diff --git a/vendor/google.golang.org/grpc/keepalive/keepalive.go b/vendor/google.golang.org/grpc/keepalive/keepalive.go new file mode 100644 index 000000000..34d31b5e7 --- /dev/null +++ b/vendor/google.golang.org/grpc/keepalive/keepalive.go @@ -0,0 +1,85 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package keepalive defines configurable parameters for point-to-point +// healthcheck. +package keepalive + +import ( + "time" +) + +// ClientParameters is used to set keepalive parameters on the client-side. +// These configure how the client will actively probe to notice when a +// connection is broken and send pings so intermediaries will be aware of the +// liveness of the connection. Make sure these parameters are set in +// coordination with the keepalive policy on the server, as incompatible +// settings can result in closing of connection. +type ClientParameters struct { + // After a duration of this time if the client doesn't see any activity it + // pings the server to see if the transport is still alive. + // If set below 10s, a minimum value of 10s will be used instead. + Time time.Duration // The current default value is infinity. + // After having pinged for keepalive check, the client waits for a duration + // of Timeout and if no activity is seen even after that the connection is + // closed. + Timeout time.Duration // The current default value is 20 seconds. + // If true, client sends keepalive pings even with no active RPCs. If false, + // when there are no active RPCs, Time and Timeout will be ignored and no + // keepalive pings will be sent. + PermitWithoutStream bool // false by default. +} + +// ServerParameters is used to set keepalive and max-age parameters on the +// server-side. +type ServerParameters struct { + // MaxConnectionIdle is a duration for the amount of time after which an + // idle connection would be closed by sending a GoAway. Idleness duration is + // defined since the most recent time the number of outstanding RPCs became + // zero or the connection establishment. + MaxConnectionIdle time.Duration // The current default value is infinity. + // MaxConnectionAge is a duration for the maximum amount of time a + // connection may exist before it will be closed by sending a GoAway. A + // random jitter of +/-10% will be added to MaxConnectionAge to spread out + // connection storms. + MaxConnectionAge time.Duration // The current default value is infinity. + // MaxConnectionAgeGrace is an additive period after MaxConnectionAge after + // which the connection will be forcibly closed. + MaxConnectionAgeGrace time.Duration // The current default value is infinity. + // After a duration of this time if the server doesn't see any activity it + // pings the client to see if the transport is still alive. + // If set below 1s, a minimum value of 1s will be used instead. + Time time.Duration // The current default value is 2 hours. + // After having pinged for keepalive check, the server waits for a duration + // of Timeout and if no activity is seen even after that the connection is + // closed. + Timeout time.Duration // The current default value is 20 seconds. +} + +// EnforcementPolicy is used to set keepalive enforcement policy on the +// server-side. Server will close connection with a client that violates this +// policy. +type EnforcementPolicy struct { + // MinTime is the minimum amount of time a client should wait before sending + // a keepalive ping. + MinTime time.Duration // The current default value is 5 minutes. + // If true, server allows keepalive pings even when there are no active + // streams(RPCs). If false, and client sends ping when there are no active + // streams, server will send GOAWAY and close the connection. + PermitWithoutStream bool // false by default. +} diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go new file mode 100644 index 000000000..cf6d1b947 --- /dev/null +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -0,0 +1,209 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package metadata define the structure of the metadata supported by gRPC library. +// Please refer to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md +// for more information about custom-metadata. +package metadata // import "google.golang.org/grpc/metadata" + +import ( + "context" + "fmt" + "strings" +) + +// DecodeKeyValue returns k, v, nil. +// +// Deprecated: use k and v directly instead. +func DecodeKeyValue(k, v string) (string, string, error) { + return k, v, nil +} + +// MD is a mapping from metadata keys to values. Users should use the following +// two convenience functions New and Pairs to generate MD. +type MD map[string][]string + +// New creates an MD from a given key-value map. +// +// Only the following ASCII characters are allowed in keys: +// - digits: 0-9 +// - uppercase letters: A-Z (normalized to lower) +// - lowercase letters: a-z +// - special characters: -_. +// Uppercase letters are automatically converted to lowercase. +// +// Keys beginning with "grpc-" are reserved for grpc-internal use only and may +// result in errors if set in metadata. +func New(m map[string]string) MD { + md := MD{} + for k, val := range m { + key := strings.ToLower(k) + md[key] = append(md[key], val) + } + return md +} + +// Pairs returns an MD formed by the mapping of key, value ... +// Pairs panics if len(kv) is odd. +// +// Only the following ASCII characters are allowed in keys: +// - digits: 0-9 +// - uppercase letters: A-Z (normalized to lower) +// - lowercase letters: a-z +// - special characters: -_. +// Uppercase letters are automatically converted to lowercase. +// +// Keys beginning with "grpc-" are reserved for grpc-internal use only and may +// result in errors if set in metadata. +func Pairs(kv ...string) MD { + if len(kv)%2 == 1 { + panic(fmt.Sprintf("metadata: Pairs got the odd number of input pairs for metadata: %d", len(kv))) + } + md := MD{} + var key string + for i, s := range kv { + if i%2 == 0 { + key = strings.ToLower(s) + continue + } + md[key] = append(md[key], s) + } + return md +} + +// Len returns the number of items in md. +func (md MD) Len() int { + return len(md) +} + +// Copy returns a copy of md. +func (md MD) Copy() MD { + return Join(md) +} + +// Get obtains the values for a given key. +func (md MD) Get(k string) []string { + k = strings.ToLower(k) + return md[k] +} + +// Set sets the value of a given key with a slice of values. +func (md MD) Set(k string, vals ...string) { + if len(vals) == 0 { + return + } + k = strings.ToLower(k) + md[k] = vals +} + +// Append adds the values to key k, not overwriting what was already stored at that key. +func (md MD) Append(k string, vals ...string) { + if len(vals) == 0 { + return + } + k = strings.ToLower(k) + md[k] = append(md[k], vals...) +} + +// Join joins any number of mds into a single MD. +// The order of values for each key is determined by the order in which +// the mds containing those values are presented to Join. +func Join(mds ...MD) MD { + out := MD{} + for _, md := range mds { + for k, v := range md { + out[k] = append(out[k], v...) + } + } + return out +} + +type mdIncomingKey struct{} +type mdOutgoingKey struct{} + +// NewIncomingContext creates a new context with incoming md attached. +func NewIncomingContext(ctx context.Context, md MD) context.Context { + return context.WithValue(ctx, mdIncomingKey{}, md) +} + +// NewOutgoingContext creates a new context with outgoing md attached. If used +// in conjunction with AppendToOutgoingContext, NewOutgoingContext will +// overwrite any previously-appended metadata. +func NewOutgoingContext(ctx context.Context, md MD) context.Context { + return context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md}) +} + +// AppendToOutgoingContext returns a new context with the provided kv merged +// with any existing metadata in the context. Please refer to the +// documentation of Pairs for a description of kv. +func AppendToOutgoingContext(ctx context.Context, kv ...string) context.Context { + if len(kv)%2 == 1 { + panic(fmt.Sprintf("metadata: AppendToOutgoingContext got an odd number of input pairs for metadata: %d", len(kv))) + } + md, _ := ctx.Value(mdOutgoingKey{}).(rawMD) + added := make([][]string, len(md.added)+1) + copy(added, md.added) + added[len(added)-1] = make([]string, len(kv)) + copy(added[len(added)-1], kv) + return context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md.md, added: added}) +} + +// FromIncomingContext returns the incoming metadata in ctx if it exists. The +// returned MD should not be modified. Writing to it may cause races. +// Modification should be made to copies of the returned MD. +func FromIncomingContext(ctx context.Context) (md MD, ok bool) { + md, ok = ctx.Value(mdIncomingKey{}).(MD) + return +} + +// FromOutgoingContextRaw returns the un-merged, intermediary contents +// of rawMD. Remember to perform strings.ToLower on the keys. The returned +// MD should not be modified. Writing to it may cause races. Modification +// should be made to copies of the returned MD. +// +// This is intended for gRPC-internal use ONLY. +func FromOutgoingContextRaw(ctx context.Context) (MD, [][]string, bool) { + raw, ok := ctx.Value(mdOutgoingKey{}).(rawMD) + if !ok { + return nil, nil, false + } + + return raw.md, raw.added, true +} + +// FromOutgoingContext returns the outgoing metadata in ctx if it exists. The +// returned MD should not be modified. Writing to it may cause races. +// Modification should be made to copies of the returned MD. +func FromOutgoingContext(ctx context.Context) (MD, bool) { + raw, ok := ctx.Value(mdOutgoingKey{}).(rawMD) + if !ok { + return nil, false + } + + mds := make([]MD, 0, len(raw.added)+1) + mds = append(mds, raw.md) + for _, vv := range raw.added { + mds = append(mds, Pairs(vv...)) + } + return Join(mds...), ok +} + +type rawMD struct { + md MD + added [][]string +} diff --git a/vendor/google.golang.org/grpc/peer/peer.go b/vendor/google.golang.org/grpc/peer/peer.go new file mode 100644 index 000000000..e01d219ff --- /dev/null +++ b/vendor/google.golang.org/grpc/peer/peer.go @@ -0,0 +1,51 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package peer defines various peer information associated with RPCs and +// corresponding utils. +package peer + +import ( + "context" + "net" + + "google.golang.org/grpc/credentials" +) + +// Peer contains the information of the peer for an RPC, such as the address +// and authentication information. +type Peer struct { + // Addr is the peer address. + Addr net.Addr + // AuthInfo is the authentication information of the transport. + // It is nil if there is no transport security being used. + AuthInfo credentials.AuthInfo +} + +type peerKey struct{} + +// NewContext creates a new context with peer information attached. +func NewContext(ctx context.Context, p *Peer) context.Context { + return context.WithValue(ctx, peerKey{}, p) +} + +// FromContext returns the peer information in ctx if it exists. +func FromContext(ctx context.Context) (p *Peer, ok bool) { + p, ok = ctx.Value(peerKey{}).(*Peer) + return +} diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go new file mode 100644 index 000000000..a58174b6f --- /dev/null +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -0,0 +1,177 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "io" + "sync" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/status" +) + +// pickerWrapper is a wrapper of balancer.Picker. It blocks on certain pick +// actions and unblock when there's a picker update. +type pickerWrapper struct { + mu sync.Mutex + done bool + blockingCh chan struct{} + picker balancer.Picker +} + +func newPickerWrapper() *pickerWrapper { + return &pickerWrapper{blockingCh: make(chan struct{})} +} + +// updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. +func (pw *pickerWrapper) updatePicker(p balancer.Picker) { + pw.mu.Lock() + if pw.done { + pw.mu.Unlock() + return + } + pw.picker = p + // pw.blockingCh should never be nil. + close(pw.blockingCh) + pw.blockingCh = make(chan struct{}) + pw.mu.Unlock() +} + +func doneChannelzWrapper(acw *acBalancerWrapper, done func(balancer.DoneInfo)) func(balancer.DoneInfo) { + acw.mu.Lock() + ac := acw.ac + acw.mu.Unlock() + ac.incrCallsStarted() + return func(b balancer.DoneInfo) { + if b.Err != nil && b.Err != io.EOF { + ac.incrCallsFailed() + } else { + ac.incrCallsSucceeded() + } + if done != nil { + done(b) + } + } +} + +// pick returns the transport that will be used for the RPC. +// It may block in the following cases: +// - there's no picker +// - the current picker returns ErrNoSubConnAvailable +// - the current picker returns other errors and failfast is false. +// - the subConn returned by the current picker is not READY +// When one of these situations happens, pick blocks until the picker gets updated. +func (pw *pickerWrapper) pick(ctx context.Context, failfast bool, info balancer.PickInfo) (transport.ClientTransport, func(balancer.DoneInfo), error) { + var ch chan struct{} + + var lastPickErr error + for { + pw.mu.Lock() + if pw.done { + pw.mu.Unlock() + return nil, nil, ErrClientConnClosing + } + + if pw.picker == nil { + ch = pw.blockingCh + } + if ch == pw.blockingCh { + // This could happen when either: + // - pw.picker is nil (the previous if condition), or + // - has called pick on the current picker. + pw.mu.Unlock() + select { + case <-ctx.Done(): + var errStr string + if lastPickErr != nil { + errStr = "latest balancer error: " + lastPickErr.Error() + } else { + errStr = ctx.Err().Error() + } + switch ctx.Err() { + case context.DeadlineExceeded: + return nil, nil, status.Error(codes.DeadlineExceeded, errStr) + case context.Canceled: + return nil, nil, status.Error(codes.Canceled, errStr) + } + case <-ch: + } + continue + } + + ch = pw.blockingCh + p := pw.picker + pw.mu.Unlock() + + pickResult, err := p.Pick(info) + + if err != nil { + if err == balancer.ErrNoSubConnAvailable { + continue + } + if _, ok := status.FromError(err); ok { + // Status error: end the RPC unconditionally with this status. + return nil, nil, err + } + // For all other errors, wait for ready RPCs should block and other + // RPCs should fail with unavailable. + if !failfast { + lastPickErr = err + continue + } + return nil, nil, status.Error(codes.Unavailable, err.Error()) + } + + acw, ok := pickResult.SubConn.(*acBalancerWrapper) + if !ok { + logger.Error("subconn returned from pick is not *acBalancerWrapper") + continue + } + if t, ok := acw.getAddrConn().getReadyTransport(); ok { + if channelz.IsOn() { + return t, doneChannelzWrapper(acw, pickResult.Done), nil + } + return t, pickResult.Done, nil + } + if pickResult.Done != nil { + // Calling done with nil error, no bytes sent and no bytes received. + // DoneInfo with default value works. + pickResult.Done(balancer.DoneInfo{}) + } + logger.Infof("blockingPicker: the picked transport is not ready, loop back to repick") + // If ok == false, ac.state is not READY. + // A valid picker always returns READY subConn. This means the state of ac + // just changed, and picker will be updated shortly. + // continue back to the beginning of the for loop to repick. + } +} + +func (pw *pickerWrapper) close() { + pw.mu.Lock() + defer pw.mu.Unlock() + if pw.done { + return + } + pw.done = true + close(pw.blockingCh) +} diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/pickfirst.go new file mode 100644 index 000000000..56e33f6c7 --- /dev/null +++ b/vendor/google.golang.org/grpc/pickfirst.go @@ -0,0 +1,136 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "errors" + "fmt" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/connectivity" +) + +// PickFirstBalancerName is the name of the pick_first balancer. +const PickFirstBalancerName = "pick_first" + +func newPickfirstBuilder() balancer.Builder { + return &pickfirstBuilder{} +} + +type pickfirstBuilder struct{} + +func (*pickfirstBuilder) Build(cc balancer.ClientConn, opt balancer.BuildOptions) balancer.Balancer { + return &pickfirstBalancer{cc: cc} +} + +func (*pickfirstBuilder) Name() string { + return PickFirstBalancerName +} + +type pickfirstBalancer struct { + state connectivity.State + cc balancer.ClientConn + sc balancer.SubConn +} + +func (b *pickfirstBalancer) ResolverError(err error) { + switch b.state { + case connectivity.TransientFailure, connectivity.Idle, connectivity.Connecting: + // Set a failing picker if we don't have a good picker. + b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.TransientFailure, + Picker: &picker{err: fmt.Errorf("name resolver error: %v", err)}, + }) + } + if logger.V(2) { + logger.Infof("pickfirstBalancer: ResolverError called with error %v", err) + } +} + +func (b *pickfirstBalancer) UpdateClientConnState(cs balancer.ClientConnState) error { + if len(cs.ResolverState.Addresses) == 0 { + b.ResolverError(errors.New("produced zero addresses")) + return balancer.ErrBadResolverState + } + if b.sc == nil { + var err error + b.sc, err = b.cc.NewSubConn(cs.ResolverState.Addresses, balancer.NewSubConnOptions{}) + if err != nil { + if logger.V(2) { + logger.Errorf("pickfirstBalancer: failed to NewSubConn: %v", err) + } + b.state = connectivity.TransientFailure + b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.TransientFailure, + Picker: &picker{err: fmt.Errorf("error creating connection: %v", err)}, + }) + return balancer.ErrBadResolverState + } + b.state = connectivity.Idle + b.cc.UpdateState(balancer.State{ConnectivityState: connectivity.Idle, Picker: &picker{result: balancer.PickResult{SubConn: b.sc}}}) + b.sc.Connect() + } else { + b.sc.UpdateAddresses(cs.ResolverState.Addresses) + b.sc.Connect() + } + return nil +} + +func (b *pickfirstBalancer) UpdateSubConnState(sc balancer.SubConn, s balancer.SubConnState) { + if logger.V(2) { + logger.Infof("pickfirstBalancer: UpdateSubConnState: %p, %v", sc, s) + } + if b.sc != sc { + if logger.V(2) { + logger.Infof("pickfirstBalancer: ignored state change because sc is not recognized") + } + return + } + b.state = s.ConnectivityState + if s.ConnectivityState == connectivity.Shutdown { + b.sc = nil + return + } + + switch s.ConnectivityState { + case connectivity.Ready, connectivity.Idle: + b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &picker{result: balancer.PickResult{SubConn: sc}}}) + case connectivity.Connecting: + b.cc.UpdateState(balancer.State{ConnectivityState: s.ConnectivityState, Picker: &picker{err: balancer.ErrNoSubConnAvailable}}) + case connectivity.TransientFailure: + b.cc.UpdateState(balancer.State{ + ConnectivityState: s.ConnectivityState, + Picker: &picker{err: s.ConnectionError}, + }) + } +} + +func (b *pickfirstBalancer) Close() { +} + +type picker struct { + result balancer.PickResult + err error +} + +func (p *picker) Pick(info balancer.PickInfo) (balancer.PickResult, error) { + return p.result, p.err +} + +func init() { + balancer.Register(newPickfirstBuilder()) +} diff --git a/vendor/google.golang.org/grpc/preloader.go b/vendor/google.golang.org/grpc/preloader.go new file mode 100644 index 000000000..76acbbcc9 --- /dev/null +++ b/vendor/google.golang.org/grpc/preloader.go @@ -0,0 +1,64 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// PreparedMsg is responsible for creating a Marshalled and Compressed object. +// +// This API is EXPERIMENTAL. +type PreparedMsg struct { + // Struct for preparing msg before sending them + encodedData []byte + hdr []byte + payload []byte +} + +// Encode marshalls and compresses the message using the codec and compressor for the stream. +func (p *PreparedMsg) Encode(s Stream, msg interface{}) error { + ctx := s.Context() + rpcInfo, ok := rpcInfoFromContext(ctx) + if !ok { + return status.Errorf(codes.Internal, "grpc: unable to get rpcInfo") + } + + // check if the context has the relevant information to prepareMsg + if rpcInfo.preloaderInfo == nil { + return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo is nil") + } + if rpcInfo.preloaderInfo.codec == nil { + return status.Errorf(codes.Internal, "grpc: rpcInfo.preloaderInfo.codec is nil") + } + + // prepare the msg + data, err := encode(rpcInfo.preloaderInfo.codec, msg) + if err != nil { + return err + } + p.encodedData = data + compData, err := compress(data, rpcInfo.preloaderInfo.cp, rpcInfo.preloaderInfo.comp) + if err != nil { + return err + } + p.hdr, p.payload = msgHeader(data, compData) + return nil +} diff --git a/vendor/google.golang.org/grpc/proxy.go b/vendor/google.golang.org/grpc/proxy.go new file mode 100644 index 000000000..f8f69bfb7 --- /dev/null +++ b/vendor/google.golang.org/grpc/proxy.go @@ -0,0 +1,152 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "bufio" + "context" + "encoding/base64" + "errors" + "fmt" + "io" + "net" + "net/http" + "net/http/httputil" + "net/url" +) + +const proxyAuthHeaderKey = "Proxy-Authorization" + +var ( + // errDisabled indicates that proxy is disabled for the address. + errDisabled = errors.New("proxy is disabled for the address") + // The following variable will be overwritten in the tests. + httpProxyFromEnvironment = http.ProxyFromEnvironment +) + +func mapAddress(ctx context.Context, address string) (*url.URL, error) { + req := &http.Request{ + URL: &url.URL{ + Scheme: "https", + Host: address, + }, + } + url, err := httpProxyFromEnvironment(req) + if err != nil { + return nil, err + } + if url == nil { + return nil, errDisabled + } + return url, nil +} + +// To read a response from a net.Conn, http.ReadResponse() takes a bufio.Reader. +// It's possible that this reader reads more than what's need for the response and stores +// those bytes in the buffer. +// bufConn wraps the original net.Conn and the bufio.Reader to make sure we don't lose the +// bytes in the buffer. +type bufConn struct { + net.Conn + r io.Reader +} + +func (c *bufConn) Read(b []byte) (int, error) { + return c.r.Read(b) +} + +func basicAuth(username, password string) string { + auth := username + ":" + password + return base64.StdEncoding.EncodeToString([]byte(auth)) +} + +func doHTTPConnectHandshake(ctx context.Context, conn net.Conn, backendAddr string, proxyURL *url.URL) (_ net.Conn, err error) { + defer func() { + if err != nil { + conn.Close() + } + }() + + req := &http.Request{ + Method: http.MethodConnect, + URL: &url.URL{Host: backendAddr}, + Header: map[string][]string{"User-Agent": {grpcUA}}, + } + if t := proxyURL.User; t != nil { + u := t.Username() + p, _ := t.Password() + req.Header.Add(proxyAuthHeaderKey, "Basic "+basicAuth(u, p)) + } + + if err := sendHTTPRequest(ctx, req, conn); err != nil { + return nil, fmt.Errorf("failed to write the HTTP request: %v", err) + } + + r := bufio.NewReader(conn) + resp, err := http.ReadResponse(r, req) + if err != nil { + return nil, fmt.Errorf("reading server HTTP response: %v", err) + } + defer resp.Body.Close() + if resp.StatusCode != http.StatusOK { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return nil, fmt.Errorf("failed to do connect handshake, status code: %s", resp.Status) + } + return nil, fmt.Errorf("failed to do connect handshake, response: %q", dump) + } + + return &bufConn{Conn: conn, r: r}, nil +} + +// newProxyDialer returns a dialer that connects to proxy first if necessary. +// The returned dialer checks if a proxy is necessary, dial to the proxy with the +// provided dialer, does HTTP CONNECT handshake and returns the connection. +func newProxyDialer(dialer func(context.Context, string) (net.Conn, error)) func(context.Context, string) (net.Conn, error) { + return func(ctx context.Context, addr string) (conn net.Conn, err error) { + var newAddr string + proxyURL, err := mapAddress(ctx, addr) + if err != nil { + if err != errDisabled { + return nil, err + } + newAddr = addr + } else { + newAddr = proxyURL.Host + } + + conn, err = dialer(ctx, newAddr) + if err != nil { + return + } + if proxyURL != nil { + // proxy is disabled if proxyURL is nil. + conn, err = doHTTPConnectHandshake(ctx, conn, addr, proxyURL) + } + return + } +} + +func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error { + req = req.WithContext(ctx) + if err := req.Write(conn); err != nil { + return fmt.Errorf("failed to write the HTTP request: %v", err) + } + return nil +} diff --git a/vendor/google.golang.org/grpc/regenerate.sh b/vendor/google.golang.org/grpc/regenerate.sh new file mode 100644 index 000000000..987bc2025 --- /dev/null +++ b/vendor/google.golang.org/grpc/regenerate.sh @@ -0,0 +1,79 @@ +#!/bin/bash +# Copyright 2020 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -eu -o pipefail + +WORKDIR=$(mktemp -d) + +function finish { + rm -rf "$WORKDIR" +} +trap finish EXIT + +export GOBIN=${WORKDIR}/bin +export PATH=${GOBIN}:${PATH} +mkdir -p ${GOBIN} + +echo "go install github.com/golang/protobuf/protoc-gen-go" +(cd test/tools && go install github.com/golang/protobuf/protoc-gen-go) + +echo "go install cmd/protoc-gen-go-grpc" +(cd cmd/protoc-gen-go-grpc && go install .) + +echo "git clone https://github.com/grpc/grpc-proto" +git clone --quiet https://github.com/grpc/grpc-proto ${WORKDIR}/grpc-proto + +mkdir -p ${WORKDIR}/googleapis/google/rpc +echo "curl https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto" +curl --silent https://raw.githubusercontent.com/googleapis/googleapis/master/google/rpc/code.proto > ${WORKDIR}/googleapis/google/rpc/code.proto + +mkdir -p ${WORKDIR}/out + +SOURCES=( + ${WORKDIR}/googleapis/google/rpc/code.proto + ${WORKDIR}/grpc-proto/grpc/binlog/v1/binarylog.proto + ${WORKDIR}/grpc-proto/grpc/channelz/v1/channelz.proto + ${WORKDIR}/grpc-proto/grpc/gcp/altscontext.proto + ${WORKDIR}/grpc-proto/grpc/gcp/handshaker.proto + ${WORKDIR}/grpc-proto/grpc/gcp/transport_security_common.proto + ${WORKDIR}/grpc-proto/grpc/health/v1/health.proto + ${WORKDIR}/grpc-proto/grpc/lb/v1/load_balancer.proto + ${WORKDIR}/grpc-proto/grpc/lookup/v1/rls.proto + ${WORKDIR}/grpc-proto/grpc/service_config/service_config.proto + $(git ls-files --exclude-standard --cached --others "*.proto") +) +OPTS=Mgrpc/service_config/service_config.proto=/internal/proto/grpc_service_config +for src in ${SOURCES[@]}; do + echo "protoc ${src}" + protoc --go_out=${OPTS}:${WORKDIR}/out --go-grpc_out=${OPTS},requireUnimplementedServers=false:${WORKDIR}/out \ + -I"." \ + -I${WORKDIR}/grpc-proto \ + -I${WORKDIR}/googleapis \ + ${src} +done + +# The go_package option in grpc/lookup/v1/rls.proto doesn't match the +# current location. Move it into the right place. +mkdir -p ${WORKDIR}/out/google.golang.org/grpc/balancer/rls/internal/proto/grpc_lookup_v1 +mv ${WORKDIR}/out/google.golang.org/grpc/lookup/grpc_lookup_v1/* ${WORKDIR}/out/google.golang.org/grpc/balancer/rls/internal/proto/grpc_lookup_v1 + +# grpc_testingv3/testv3.pb.go is not re-generated because it was +# intentionally generated by an older version of protoc-gen-go. +rm ${WORKDIR}/out/google.golang.org/grpc/reflection/grpc_testingv3/*.pb.go + +# grpc/service_config/service_config.proto does not have a go_package option. +cp ${WORKDIR}/out/grpc/service_config/service_config.pb.go internal/proto/grpc_service_config + +cp -R ${WORKDIR}/out/google.golang.org/grpc/* . diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go new file mode 100644 index 000000000..379275a2d --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -0,0 +1,256 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package resolver defines APIs for name resolution in gRPC. +// All APIs in this package are experimental. +package resolver + +import ( + "context" + "net" + + "google.golang.org/grpc/attributes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/serviceconfig" +) + +var ( + // m is a map from scheme to resolver builder. + m = make(map[string]Builder) + // defaultScheme is the default scheme to use. + defaultScheme = "passthrough" +) + +// TODO(bar) install dns resolver in init(){}. + +// Register registers the resolver builder to the resolver map. b.Scheme will be +// used as the scheme registered with this builder. +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. If multiple Resolvers are +// registered with the same name, the one registered last will take effect. +func Register(b Builder) { + m[b.Scheme()] = b +} + +// Get returns the resolver builder registered with the given scheme. +// +// If no builder is register with the scheme, nil will be returned. +func Get(scheme string) Builder { + if b, ok := m[scheme]; ok { + return b + } + return nil +} + +// SetDefaultScheme sets the default scheme that will be used. The default +// default scheme is "passthrough". +// +// NOTE: this function must only be called during initialization time (i.e. in +// an init() function), and is not thread-safe. The scheme set last overrides +// previously set values. +func SetDefaultScheme(scheme string) { + defaultScheme = scheme +} + +// GetDefaultScheme gets the default scheme that will be used. +func GetDefaultScheme() string { + return defaultScheme +} + +// AddressType indicates the address type returned by name resolution. +// +// Deprecated: use Attributes in Address instead. +type AddressType uint8 + +const ( + // Backend indicates the address is for a backend server. + // + // Deprecated: use Attributes in Address instead. + Backend AddressType = iota + // GRPCLB indicates the address is for a grpclb load balancer. + // + // Deprecated: to select the GRPCLB load balancing policy, use a service + // config with a corresponding loadBalancingConfig. To supply balancer + // addresses to the GRPCLB load balancing policy, set State.Attributes + // using balancer/grpclb/state.Set. + GRPCLB +) + +// Address represents a server the client connects to. +// This is the EXPERIMENTAL API and may be changed or extended in the future. +type Address struct { + // Addr is the server address on which a connection will be established. + Addr string + + // ServerName is the name of this address. + // If non-empty, the ServerName is used as the transport certification authority for + // the address, instead of the hostname from the Dial target string. In most cases, + // this should not be set. + // + // If Type is GRPCLB, ServerName should be the name of the remote load + // balancer, not the name of the backend. + // + // WARNING: ServerName must only be populated with trusted values. It + // is insecure to populate it with data from untrusted inputs since untrusted + // values could be used to bypass the authority checks performed by TLS. + ServerName string + + // Attributes contains arbitrary data about this address intended for + // consumption by the load balancing policy. + Attributes *attributes.Attributes + + // Type is the type of this address. + // + // Deprecated: use Attributes instead. + Type AddressType + + // Metadata is the information associated with Addr, which may be used + // to make load balancing decision. + // + // Deprecated: use Attributes instead. + Metadata interface{} +} + +// BuildOptions includes additional information for the builder to create +// the resolver. +type BuildOptions struct { + // DisableServiceConfig indicates whether a resolver implementation should + // fetch service config data. + DisableServiceConfig bool + // DialCreds is the transport credentials used by the ClientConn for + // communicating with the target gRPC service (set via + // WithTransportCredentials). In cases where a name resolution service + // requires the same credentials, the resolver may use this field. In most + // cases though, it is not appropriate, and this field may be ignored. + DialCreds credentials.TransportCredentials + // CredsBundle is the credentials bundle used by the ClientConn for + // communicating with the target gRPC service (set via + // WithCredentialsBundle). In cases where a name resolution service + // requires the same credentials, the resolver may use this field. In most + // cases though, it is not appropriate, and this field may be ignored. + CredsBundle credentials.Bundle + // Dialer is the custom dialer used by the ClientConn for dialling the + // target gRPC service (set via WithDialer). In cases where a name + // resolution service requires the same dialer, the resolver may use this + // field. In most cases though, it is not appropriate, and this field may + // be ignored. + Dialer func(context.Context, string) (net.Conn, error) +} + +// State contains the current Resolver state relevant to the ClientConn. +type State struct { + // Addresses is the latest set of resolved addresses for the target. + Addresses []Address + + // ServiceConfig contains the result from parsing the latest service + // config. If it is nil, it indicates no service config is present or the + // resolver does not provide service configs. + ServiceConfig *serviceconfig.ParseResult + + // Attributes contains arbitrary data about the resolver intended for + // consumption by the load balancing policy. + Attributes *attributes.Attributes +} + +// ClientConn contains the callbacks for resolver to notify any updates +// to the gRPC ClientConn. +// +// This interface is to be implemented by gRPC. Users should not need a +// brand new implementation of this interface. For the situations like +// testing, the new implementation should embed this interface. This allows +// gRPC to add new methods to this interface. +type ClientConn interface { + // UpdateState updates the state of the ClientConn appropriately. + UpdateState(State) + // ReportError notifies the ClientConn that the Resolver encountered an + // error. The ClientConn will notify the load balancer and begin calling + // ResolveNow on the Resolver with exponential backoff. + ReportError(error) + // NewAddress is called by resolver to notify ClientConn a new list + // of resolved addresses. + // The address list should be the complete list of resolved addresses. + // + // Deprecated: Use UpdateState instead. + NewAddress(addresses []Address) + // NewServiceConfig is called by resolver to notify ClientConn a new + // service config. The service config should be provided as a json string. + // + // Deprecated: Use UpdateState instead. + NewServiceConfig(serviceConfig string) + // ParseServiceConfig parses the provided service config and returns an + // object that provides the parsed config. + ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult +} + +// Target represents a target for gRPC, as specified in: +// https://github.com/grpc/grpc/blob/master/doc/naming.md. +// It is parsed from the target string that gets passed into Dial or DialContext by the user. And +// grpc passes it to the resolver and the balancer. +// +// If the target follows the naming spec, and the parsed scheme is registered with grpc, we will +// parse the target string according to the spec. e.g. "dns://some_authority/foo.bar" will be parsed +// into &Target{Scheme: "dns", Authority: "some_authority", Endpoint: "foo.bar"} +// +// If the target does not contain a scheme, we will apply the default scheme, and set the Target to +// be the full target string. e.g. "foo.bar" will be parsed into +// &Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "foo.bar"}. +// +// If the parsed scheme is not registered (i.e. no corresponding resolver available to resolve the +// endpoint), we set the Scheme to be the default scheme, and set the Endpoint to be the full target +// string. e.g. target string "unknown_scheme://authority/endpoint" will be parsed into +// &Target{Scheme: resolver.GetDefaultScheme(), Endpoint: "unknown_scheme://authority/endpoint"}. +type Target struct { + Scheme string + Authority string + Endpoint string +} + +// Builder creates a resolver that will be used to watch name resolution updates. +type Builder interface { + // Build creates a new resolver for the given target. + // + // gRPC dial calls Build synchronously, and fails if the returned error is + // not nil. + Build(target Target, cc ClientConn, opts BuildOptions) (Resolver, error) + // Scheme returns the scheme supported by this resolver. + // Scheme is defined at https://github.com/grpc/grpc/blob/master/doc/naming.md. + Scheme() string +} + +// ResolveNowOptions includes additional information for ResolveNow. +type ResolveNowOptions struct{} + +// Resolver watches for the updates on the specified target. +// Updates include address updates and service config updates. +type Resolver interface { + // ResolveNow will be called by gRPC to try to resolve the target name + // again. It's just a hint, resolver can ignore this if it's not necessary. + // + // It could be called multiple times concurrently. + ResolveNow(ResolveNowOptions) + // Close closes the resolver. + Close() +} + +// UnregisterForTesting removes the resolver builder with the given scheme from the +// resolver map. +// This function is for testing only. +func UnregisterForTesting(scheme string) { + delete(m, scheme) +} diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go new file mode 100644 index 000000000..265002a75 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go @@ -0,0 +1,222 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "fmt" + "strings" + "sync" + "time" + + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" +) + +// ccResolverWrapper is a wrapper on top of cc for resolvers. +// It implements resolver.ClientConn interface. +type ccResolverWrapper struct { + cc *ClientConn + resolverMu sync.Mutex + resolver resolver.Resolver + done *grpcsync.Event + curState resolver.State + + pollingMu sync.Mutex + polling chan struct{} +} + +// newCCResolverWrapper uses the resolver.Builder to build a Resolver and +// returns a ccResolverWrapper object which wraps the newly built resolver. +func newCCResolverWrapper(cc *ClientConn, rb resolver.Builder) (*ccResolverWrapper, error) { + ccr := &ccResolverWrapper{ + cc: cc, + done: grpcsync.NewEvent(), + } + + var credsClone credentials.TransportCredentials + if creds := cc.dopts.copts.TransportCredentials; creds != nil { + credsClone = creds.Clone() + } + rbo := resolver.BuildOptions{ + DisableServiceConfig: cc.dopts.disableServiceConfig, + DialCreds: credsClone, + CredsBundle: cc.dopts.copts.CredsBundle, + Dialer: cc.dopts.copts.Dialer, + } + + var err error + // We need to hold the lock here while we assign to the ccr.resolver field + // to guard against a data race caused by the following code path, + // rb.Build-->ccr.ReportError-->ccr.poll-->ccr.resolveNow, would end up + // accessing ccr.resolver which is being assigned here. + ccr.resolverMu.Lock() + defer ccr.resolverMu.Unlock() + ccr.resolver, err = rb.Build(cc.parsedTarget, ccr, rbo) + if err != nil { + return nil, err + } + return ccr, nil +} + +func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { + ccr.resolverMu.Lock() + if !ccr.done.HasFired() { + ccr.resolver.ResolveNow(o) + } + ccr.resolverMu.Unlock() +} + +func (ccr *ccResolverWrapper) close() { + ccr.resolverMu.Lock() + ccr.resolver.Close() + ccr.done.Fire() + ccr.resolverMu.Unlock() +} + +// poll begins or ends asynchronous polling of the resolver based on whether +// err is ErrBadResolverState. +func (ccr *ccResolverWrapper) poll(err error) { + ccr.pollingMu.Lock() + defer ccr.pollingMu.Unlock() + if err != balancer.ErrBadResolverState { + // stop polling + if ccr.polling != nil { + close(ccr.polling) + ccr.polling = nil + } + return + } + if ccr.polling != nil { + // already polling + return + } + p := make(chan struct{}) + ccr.polling = p + go func() { + for i := 0; ; i++ { + ccr.resolveNow(resolver.ResolveNowOptions{}) + t := time.NewTimer(ccr.cc.dopts.resolveNowBackoff(i)) + select { + case <-p: + t.Stop() + return + case <-ccr.done.Done(): + // Resolver has been closed. + t.Stop() + return + case <-t.C: + select { + case <-p: + return + default: + } + // Timer expired; re-resolve. + } + } + }() +} + +func (ccr *ccResolverWrapper) UpdateState(s resolver.State) { + if ccr.done.HasFired() { + return + } + channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: sending update to cc: %v", s) + if channelz.IsOn() { + ccr.addChannelzTraceEvent(s) + } + ccr.curState = s + ccr.poll(ccr.cc.updateResolverState(ccr.curState, nil)) +} + +func (ccr *ccResolverWrapper) ReportError(err error) { + if ccr.done.HasFired() { + return + } + channelz.Warningf(logger, ccr.cc.channelzID, "ccResolverWrapper: reporting error to cc: %v", err) + ccr.poll(ccr.cc.updateResolverState(resolver.State{}, err)) +} + +// NewAddress is called by the resolver implementation to send addresses to gRPC. +func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { + if ccr.done.HasFired() { + return + } + channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: sending new addresses to cc: %v", addrs) + if channelz.IsOn() { + ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) + } + ccr.curState.Addresses = addrs + ccr.poll(ccr.cc.updateResolverState(ccr.curState, nil)) +} + +// NewServiceConfig is called by the resolver implementation to send service +// configs to gRPC. +func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { + if ccr.done.HasFired() { + return + } + channelz.Infof(logger, ccr.cc.channelzID, "ccResolverWrapper: got new service config: %v", sc) + if ccr.cc.dopts.disableServiceConfig { + channelz.Info(logger, ccr.cc.channelzID, "Service config lookups disabled; ignoring config") + return + } + scpr := parseServiceConfig(sc) + if scpr.Err != nil { + channelz.Warningf(logger, ccr.cc.channelzID, "ccResolverWrapper: error parsing service config: %v", scpr.Err) + ccr.poll(balancer.ErrBadResolverState) + return + } + if channelz.IsOn() { + ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) + } + ccr.curState.ServiceConfig = scpr + ccr.poll(ccr.cc.updateResolverState(ccr.curState, nil)) +} + +func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { + return parseServiceConfig(scJSON) +} + +func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { + var updates []string + var oldSC, newSC *ServiceConfig + var oldOK, newOK bool + if ccr.curState.ServiceConfig != nil { + oldSC, oldOK = ccr.curState.ServiceConfig.Config.(*ServiceConfig) + } + if s.ServiceConfig != nil { + newSC, newOK = s.ServiceConfig.Config.(*ServiceConfig) + } + if oldOK != newOK || (oldOK && newOK && oldSC.rawJSONString != newSC.rawJSONString) { + updates = append(updates, "service config updated") + } + if len(ccr.curState.Addresses) > 0 && len(s.Addresses) == 0 { + updates = append(updates, "resolver returned an empty address list") + } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 { + updates = append(updates, "resolver returned new addresses") + } + channelz.AddTraceEvent(logger, ccr.cc.channelzID, 0, &channelz.TraceEventDesc{ + Desc: fmt.Sprintf("Resolver state updated: %+v (%v)", s, strings.Join(updates, "; ")), + Severity: channelz.CtINFO, + }) +} diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go new file mode 100644 index 000000000..8644b8a7d --- /dev/null +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -0,0 +1,882 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/binary" + "fmt" + "io" + "io/ioutil" + "math" + "net/url" + "strings" + "sync" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/encoding/proto" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" +) + +// Compressor defines the interface gRPC uses to compress a message. +// +// Deprecated: use package encoding. +type Compressor interface { + // Do compresses p into w. + Do(w io.Writer, p []byte) error + // Type returns the compression algorithm the Compressor uses. + Type() string +} + +type gzipCompressor struct { + pool sync.Pool +} + +// NewGZIPCompressor creates a Compressor based on GZIP. +// +// Deprecated: use package encoding/gzip. +func NewGZIPCompressor() Compressor { + c, _ := NewGZIPCompressorWithLevel(gzip.DefaultCompression) + return c +} + +// NewGZIPCompressorWithLevel is like NewGZIPCompressor but specifies the gzip compression level instead +// of assuming DefaultCompression. +// +// The error returned will be nil if the level is valid. +// +// Deprecated: use package encoding/gzip. +func NewGZIPCompressorWithLevel(level int) (Compressor, error) { + if level < gzip.DefaultCompression || level > gzip.BestCompression { + return nil, fmt.Errorf("grpc: invalid compression level: %d", level) + } + return &gzipCompressor{ + pool: sync.Pool{ + New: func() interface{} { + w, err := gzip.NewWriterLevel(ioutil.Discard, level) + if err != nil { + panic(err) + } + return w + }, + }, + }, nil +} + +func (c *gzipCompressor) Do(w io.Writer, p []byte) error { + z := c.pool.Get().(*gzip.Writer) + defer c.pool.Put(z) + z.Reset(w) + if _, err := z.Write(p); err != nil { + return err + } + return z.Close() +} + +func (c *gzipCompressor) Type() string { + return "gzip" +} + +// Decompressor defines the interface gRPC uses to decompress a message. +// +// Deprecated: use package encoding. +type Decompressor interface { + // Do reads the data from r and uncompress them. + Do(r io.Reader) ([]byte, error) + // Type returns the compression algorithm the Decompressor uses. + Type() string +} + +type gzipDecompressor struct { + pool sync.Pool +} + +// NewGZIPDecompressor creates a Decompressor based on GZIP. +// +// Deprecated: use package encoding/gzip. +func NewGZIPDecompressor() Decompressor { + return &gzipDecompressor{} +} + +func (d *gzipDecompressor) Do(r io.Reader) ([]byte, error) { + var z *gzip.Reader + switch maybeZ := d.pool.Get().(type) { + case nil: + newZ, err := gzip.NewReader(r) + if err != nil { + return nil, err + } + z = newZ + case *gzip.Reader: + z = maybeZ + if err := z.Reset(r); err != nil { + d.pool.Put(z) + return nil, err + } + } + + defer func() { + z.Close() + d.pool.Put(z) + }() + return ioutil.ReadAll(z) +} + +func (d *gzipDecompressor) Type() string { + return "gzip" +} + +// callInfo contains all related configuration and information about an RPC. +type callInfo struct { + compressorType string + failFast bool + maxReceiveMessageSize *int + maxSendMessageSize *int + creds credentials.PerRPCCredentials + contentSubtype string + codec baseCodec + maxRetryRPCBufferSize int +} + +func defaultCallInfo() *callInfo { + return &callInfo{ + failFast: true, + maxRetryRPCBufferSize: 256 * 1024, // 256KB + } +} + +// CallOption configures a Call before it starts or extracts information from +// a Call after it completes. +type CallOption interface { + // before is called before the call is sent to any server. If before + // returns a non-nil error, the RPC fails with that error. + before(*callInfo) error + + // after is called after the call has completed. after cannot return an + // error, so any failures should be reported via output parameters. + after(*callInfo, *csAttempt) +} + +// EmptyCallOption does not alter the Call configuration. +// It can be embedded in another structure to carry satellite data for use +// by interceptors. +type EmptyCallOption struct{} + +func (EmptyCallOption) before(*callInfo) error { return nil } +func (EmptyCallOption) after(*callInfo, *csAttempt) {} + +// Header returns a CallOptions that retrieves the header metadata +// for a unary RPC. +func Header(md *metadata.MD) CallOption { + return HeaderCallOption{HeaderAddr: md} +} + +// HeaderCallOption is a CallOption for collecting response header metadata. +// The metadata field will be populated *after* the RPC completes. +// This is an EXPERIMENTAL API. +type HeaderCallOption struct { + HeaderAddr *metadata.MD +} + +func (o HeaderCallOption) before(c *callInfo) error { return nil } +func (o HeaderCallOption) after(c *callInfo, attempt *csAttempt) { + *o.HeaderAddr, _ = attempt.s.Header() +} + +// Trailer returns a CallOptions that retrieves the trailer metadata +// for a unary RPC. +func Trailer(md *metadata.MD) CallOption { + return TrailerCallOption{TrailerAddr: md} +} + +// TrailerCallOption is a CallOption for collecting response trailer metadata. +// The metadata field will be populated *after* the RPC completes. +// This is an EXPERIMENTAL API. +type TrailerCallOption struct { + TrailerAddr *metadata.MD +} + +func (o TrailerCallOption) before(c *callInfo) error { return nil } +func (o TrailerCallOption) after(c *callInfo, attempt *csAttempt) { + *o.TrailerAddr = attempt.s.Trailer() +} + +// Peer returns a CallOption that retrieves peer information for a unary RPC. +// The peer field will be populated *after* the RPC completes. +func Peer(p *peer.Peer) CallOption { + return PeerCallOption{PeerAddr: p} +} + +// PeerCallOption is a CallOption for collecting the identity of the remote +// peer. The peer field will be populated *after* the RPC completes. +// This is an EXPERIMENTAL API. +type PeerCallOption struct { + PeerAddr *peer.Peer +} + +func (o PeerCallOption) before(c *callInfo) error { return nil } +func (o PeerCallOption) after(c *callInfo, attempt *csAttempt) { + if x, ok := peer.FromContext(attempt.s.Context()); ok { + *o.PeerAddr = *x + } +} + +// WaitForReady configures the action to take when an RPC is attempted on broken +// connections or unreachable servers. If waitForReady is false, the RPC will fail +// immediately. Otherwise, the RPC client will block the call until a +// connection is available (or the call is canceled or times out) and will +// retry the call if it fails due to a transient error. gRPC will not retry if +// data was written to the wire unless the server indicates it did not process +// the data. Please refer to +// https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md. +// +// By default, RPCs don't "wait for ready". +func WaitForReady(waitForReady bool) CallOption { + return FailFastCallOption{FailFast: !waitForReady} +} + +// FailFast is the opposite of WaitForReady. +// +// Deprecated: use WaitForReady. +func FailFast(failFast bool) CallOption { + return FailFastCallOption{FailFast: failFast} +} + +// FailFastCallOption is a CallOption for indicating whether an RPC should fail +// fast or not. +// This is an EXPERIMENTAL API. +type FailFastCallOption struct { + FailFast bool +} + +func (o FailFastCallOption) before(c *callInfo) error { + c.failFast = o.FailFast + return nil +} +func (o FailFastCallOption) after(c *callInfo, attempt *csAttempt) {} + +// MaxCallRecvMsgSize returns a CallOption which sets the maximum message size +// in bytes the client can receive. +func MaxCallRecvMsgSize(bytes int) CallOption { + return MaxRecvMsgSizeCallOption{MaxRecvMsgSize: bytes} +} + +// MaxRecvMsgSizeCallOption is a CallOption that indicates the maximum message +// size in bytes the client can receive. +// This is an EXPERIMENTAL API. +type MaxRecvMsgSizeCallOption struct { + MaxRecvMsgSize int +} + +func (o MaxRecvMsgSizeCallOption) before(c *callInfo) error { + c.maxReceiveMessageSize = &o.MaxRecvMsgSize + return nil +} +func (o MaxRecvMsgSizeCallOption) after(c *callInfo, attempt *csAttempt) {} + +// MaxCallSendMsgSize returns a CallOption which sets the maximum message size +// in bytes the client can send. +func MaxCallSendMsgSize(bytes int) CallOption { + return MaxSendMsgSizeCallOption{MaxSendMsgSize: bytes} +} + +// MaxSendMsgSizeCallOption is a CallOption that indicates the maximum message +// size in bytes the client can send. +// This is an EXPERIMENTAL API. +type MaxSendMsgSizeCallOption struct { + MaxSendMsgSize int +} + +func (o MaxSendMsgSizeCallOption) before(c *callInfo) error { + c.maxSendMessageSize = &o.MaxSendMsgSize + return nil +} +func (o MaxSendMsgSizeCallOption) after(c *callInfo, attempt *csAttempt) {} + +// PerRPCCredentials returns a CallOption that sets credentials.PerRPCCredentials +// for a call. +func PerRPCCredentials(creds credentials.PerRPCCredentials) CallOption { + return PerRPCCredsCallOption{Creds: creds} +} + +// PerRPCCredsCallOption is a CallOption that indicates the per-RPC +// credentials to use for the call. +// This is an EXPERIMENTAL API. +type PerRPCCredsCallOption struct { + Creds credentials.PerRPCCredentials +} + +func (o PerRPCCredsCallOption) before(c *callInfo) error { + c.creds = o.Creds + return nil +} +func (o PerRPCCredsCallOption) after(c *callInfo, attempt *csAttempt) {} + +// UseCompressor returns a CallOption which sets the compressor used when +// sending the request. If WithCompressor is also set, UseCompressor has +// higher priority. +// +// This API is EXPERIMENTAL. +func UseCompressor(name string) CallOption { + return CompressorCallOption{CompressorType: name} +} + +// CompressorCallOption is a CallOption that indicates the compressor to use. +// This is an EXPERIMENTAL API. +type CompressorCallOption struct { + CompressorType string +} + +func (o CompressorCallOption) before(c *callInfo) error { + c.compressorType = o.CompressorType + return nil +} +func (o CompressorCallOption) after(c *callInfo, attempt *csAttempt) {} + +// CallContentSubtype returns a CallOption that will set the content-subtype +// for a call. For example, if content-subtype is "json", the Content-Type over +// the wire will be "application/grpc+json". The content-subtype is converted +// to lowercase before being included in Content-Type. See Content-Type on +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. +// +// If ForceCodec is not also used, the content-subtype will be used to look up +// the Codec to use in the registry controlled by RegisterCodec. See the +// documentation on RegisterCodec for details on registration. The lookup of +// content-subtype is case-insensitive. If no such Codec is found, the call +// will result in an error with code codes.Internal. +// +// If ForceCodec is also used, that Codec will be used for all request and +// response messages, with the content-subtype set to the given contentSubtype +// here for requests. +func CallContentSubtype(contentSubtype string) CallOption { + return ContentSubtypeCallOption{ContentSubtype: strings.ToLower(contentSubtype)} +} + +// ContentSubtypeCallOption is a CallOption that indicates the content-subtype +// used for marshaling messages. +// This is an EXPERIMENTAL API. +type ContentSubtypeCallOption struct { + ContentSubtype string +} + +func (o ContentSubtypeCallOption) before(c *callInfo) error { + c.contentSubtype = o.ContentSubtype + return nil +} +func (o ContentSubtypeCallOption) after(c *callInfo, attempt *csAttempt) {} + +// ForceCodec returns a CallOption that will set the given Codec to be +// used for all request and response messages for a call. The result of calling +// String() will be used as the content-subtype in a case-insensitive manner. +// +// See Content-Type on +// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests for +// more details. Also see the documentation on RegisterCodec and +// CallContentSubtype for more details on the interaction between Codec and +// content-subtype. +// +// This function is provided for advanced users; prefer to use only +// CallContentSubtype to select a registered codec instead. +// +// This is an EXPERIMENTAL API. +func ForceCodec(codec encoding.Codec) CallOption { + return ForceCodecCallOption{Codec: codec} +} + +// ForceCodecCallOption is a CallOption that indicates the codec used for +// marshaling messages. +// +// This is an EXPERIMENTAL API. +type ForceCodecCallOption struct { + Codec encoding.Codec +} + +func (o ForceCodecCallOption) before(c *callInfo) error { + c.codec = o.Codec + return nil +} +func (o ForceCodecCallOption) after(c *callInfo, attempt *csAttempt) {} + +// CallCustomCodec behaves like ForceCodec, but accepts a grpc.Codec instead of +// an encoding.Codec. +// +// Deprecated: use ForceCodec instead. +func CallCustomCodec(codec Codec) CallOption { + return CustomCodecCallOption{Codec: codec} +} + +// CustomCodecCallOption is a CallOption that indicates the codec used for +// marshaling messages. +// +// This is an EXPERIMENTAL API. +type CustomCodecCallOption struct { + Codec Codec +} + +func (o CustomCodecCallOption) before(c *callInfo) error { + c.codec = o.Codec + return nil +} +func (o CustomCodecCallOption) after(c *callInfo, attempt *csAttempt) {} + +// MaxRetryRPCBufferSize returns a CallOption that limits the amount of memory +// used for buffering this RPC's requests for retry purposes. +// +// This API is EXPERIMENTAL. +func MaxRetryRPCBufferSize(bytes int) CallOption { + return MaxRetryRPCBufferSizeCallOption{bytes} +} + +// MaxRetryRPCBufferSizeCallOption is a CallOption indicating the amount of +// memory to be used for caching this RPC for retry purposes. +// This is an EXPERIMENTAL API. +type MaxRetryRPCBufferSizeCallOption struct { + MaxRetryRPCBufferSize int +} + +func (o MaxRetryRPCBufferSizeCallOption) before(c *callInfo) error { + c.maxRetryRPCBufferSize = o.MaxRetryRPCBufferSize + return nil +} +func (o MaxRetryRPCBufferSizeCallOption) after(c *callInfo, attempt *csAttempt) {} + +// The format of the payload: compressed or not? +type payloadFormat uint8 + +const ( + compressionNone payloadFormat = 0 // no compression + compressionMade payloadFormat = 1 // compressed +) + +// parser reads complete gRPC messages from the underlying reader. +type parser struct { + // r is the underlying reader. + // See the comment on recvMsg for the permissible + // error types. + r io.Reader + + // The header of a gRPC message. Find more detail at + // https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md + header [5]byte +} + +// recvMsg reads a complete gRPC message from the stream. +// +// It returns the message and its payload (compression/encoding) +// format. The caller owns the returned msg memory. +// +// If there is an error, possible values are: +// * io.EOF, when no messages remain +// * io.ErrUnexpectedEOF +// * of type transport.ConnectionError +// * an error from the status package +// No other error values or types must be returned, which also means +// that the underlying io.Reader must not return an incompatible +// error. +func (p *parser) recvMsg(maxReceiveMessageSize int) (pf payloadFormat, msg []byte, err error) { + if _, err := p.r.Read(p.header[:]); err != nil { + return 0, nil, err + } + + pf = payloadFormat(p.header[0]) + length := binary.BigEndian.Uint32(p.header[1:]) + + if length == 0 { + return pf, nil, nil + } + if int64(length) > int64(maxInt) { + return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max length allowed on current machine (%d vs. %d)", length, maxInt) + } + if int(length) > maxReceiveMessageSize { + return 0, nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", length, maxReceiveMessageSize) + } + // TODO(bradfitz,zhaoq): garbage. reuse buffer after proto decoding instead + // of making it for each message: + msg = make([]byte, int(length)) + if _, err := p.r.Read(msg); err != nil { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + return 0, nil, err + } + return pf, msg, nil +} + +// encode serializes msg and returns a buffer containing the message, or an +// error if it is too large to be transmitted by grpc. If msg is nil, it +// generates an empty message. +func encode(c baseCodec, msg interface{}) ([]byte, error) { + if msg == nil { // NOTE: typed nils will not be caught by this check + return nil, nil + } + b, err := c.Marshal(msg) + if err != nil { + return nil, status.Errorf(codes.Internal, "grpc: error while marshaling: %v", err.Error()) + } + if uint(len(b)) > math.MaxUint32 { + return nil, status.Errorf(codes.ResourceExhausted, "grpc: message too large (%d bytes)", len(b)) + } + return b, nil +} + +// compress returns the input bytes compressed by compressor or cp. If both +// compressors are nil, returns nil. +// +// TODO(dfawley): eliminate cp parameter by wrapping Compressor in an encoding.Compressor. +func compress(in []byte, cp Compressor, compressor encoding.Compressor) ([]byte, error) { + if compressor == nil && cp == nil { + return nil, nil + } + wrapErr := func(err error) error { + return status.Errorf(codes.Internal, "grpc: error while compressing: %v", err.Error()) + } + cbuf := &bytes.Buffer{} + if compressor != nil { + z, err := compressor.Compress(cbuf) + if err != nil { + return nil, wrapErr(err) + } + if _, err := z.Write(in); err != nil { + return nil, wrapErr(err) + } + if err := z.Close(); err != nil { + return nil, wrapErr(err) + } + } else { + if err := cp.Do(cbuf, in); err != nil { + return nil, wrapErr(err) + } + } + return cbuf.Bytes(), nil +} + +const ( + payloadLen = 1 + sizeLen = 4 + headerLen = payloadLen + sizeLen +) + +// msgHeader returns a 5-byte header for the message being transmitted and the +// payload, which is compData if non-nil or data otherwise. +func msgHeader(data, compData []byte) (hdr []byte, payload []byte) { + hdr = make([]byte, headerLen) + if compData != nil { + hdr[0] = byte(compressionMade) + data = compData + } else { + hdr[0] = byte(compressionNone) + } + + // Write length of payload into buf + binary.BigEndian.PutUint32(hdr[payloadLen:], uint32(len(data))) + return hdr, data +} + +func outPayload(client bool, msg interface{}, data, payload []byte, t time.Time) *stats.OutPayload { + return &stats.OutPayload{ + Client: client, + Payload: msg, + Data: data, + Length: len(data), + WireLength: len(payload) + headerLen, + SentTime: t, + } +} + +func checkRecvPayload(pf payloadFormat, recvCompress string, haveCompressor bool) *status.Status { + switch pf { + case compressionNone: + case compressionMade: + if recvCompress == "" || recvCompress == encoding.Identity { + return status.New(codes.Internal, "grpc: compressed flag set with identity or empty encoding") + } + if !haveCompressor { + return status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", recvCompress) + } + default: + return status.Newf(codes.Internal, "grpc: received unexpected payload format %d", pf) + } + return nil +} + +type payloadInfo struct { + wireLength int // The compressed length got from wire. + uncompressedBytes []byte +} + +func recvAndDecompress(p *parser, s *transport.Stream, dc Decompressor, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor) ([]byte, error) { + pf, d, err := p.recvMsg(maxReceiveMessageSize) + if err != nil { + return nil, err + } + if payInfo != nil { + payInfo.wireLength = len(d) + } + + if st := checkRecvPayload(pf, s.RecvCompress(), compressor != nil || dc != nil); st != nil { + return nil, st.Err() + } + + var size int + if pf == compressionMade { + // To match legacy behavior, if the decompressor is set by WithDecompressor or RPCDecompressor, + // use this decompressor as the default. + if dc != nil { + d, err = dc.Do(bytes.NewReader(d)) + size = len(d) + } else { + d, size, err = decompress(compressor, d, maxReceiveMessageSize) + } + if err != nil { + return nil, status.Errorf(codes.Internal, "grpc: failed to decompress the received message %v", err) + } + } else { + size = len(d) + } + if size > maxReceiveMessageSize { + // TODO: Revisit the error code. Currently keep it consistent with java + // implementation. + return nil, status.Errorf(codes.ResourceExhausted, "grpc: received message larger than max (%d vs. %d)", size, maxReceiveMessageSize) + } + return d, nil +} + +// Using compressor, decompress d, returning data and size. +// Optionally, if data will be over maxReceiveMessageSize, just return the size. +func decompress(compressor encoding.Compressor, d []byte, maxReceiveMessageSize int) ([]byte, int, error) { + dcReader, err := compressor.Decompress(bytes.NewReader(d)) + if err != nil { + return nil, 0, err + } + if sizer, ok := compressor.(interface { + DecompressedSize(compressedBytes []byte) int + }); ok { + if size := sizer.DecompressedSize(d); size >= 0 { + if size > maxReceiveMessageSize { + return nil, size, nil + } + // size is used as an estimate to size the buffer, but we + // will read more data if available. + // +MinRead so ReadFrom will not reallocate if size is correct. + buf := bytes.NewBuffer(make([]byte, 0, size+bytes.MinRead)) + bytesRead, err := buf.ReadFrom(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + return buf.Bytes(), int(bytesRead), err + } + } + // Read from LimitReader with limit max+1. So if the underlying + // reader is over limit, the result will be bigger than max. + d, err = ioutil.ReadAll(io.LimitReader(dcReader, int64(maxReceiveMessageSize)+1)) + return d, len(d), err +} + +// For the two compressor parameters, both should not be set, but if they are, +// dc takes precedence over compressor. +// TODO(dfawley): wrap the old compressor/decompressor using the new API? +func recv(p *parser, c baseCodec, s *transport.Stream, dc Decompressor, m interface{}, maxReceiveMessageSize int, payInfo *payloadInfo, compressor encoding.Compressor) error { + d, err := recvAndDecompress(p, s, dc, maxReceiveMessageSize, payInfo, compressor) + if err != nil { + return err + } + if err := c.Unmarshal(d, m); err != nil { + return status.Errorf(codes.Internal, "grpc: failed to unmarshal the received message %v", err) + } + if payInfo != nil { + payInfo.uncompressedBytes = d + } + return nil +} + +// Information about RPC +type rpcInfo struct { + failfast bool + preloaderInfo *compressorInfo +} + +// Information about Preloader +// Responsible for storing codec, and compressors +// If stream (s) has context s.Context which stores rpcInfo that has non nil +// pointers to codec, and compressors, then we can use preparedMsg for Async message prep +// and reuse marshalled bytes +type compressorInfo struct { + codec baseCodec + cp Compressor + comp encoding.Compressor +} + +type rpcInfoContextKey struct{} + +func newContextWithRPCInfo(ctx context.Context, failfast bool, codec baseCodec, cp Compressor, comp encoding.Compressor) context.Context { + return context.WithValue(ctx, rpcInfoContextKey{}, &rpcInfo{ + failfast: failfast, + preloaderInfo: &compressorInfo{ + codec: codec, + cp: cp, + comp: comp, + }, + }) +} + +func rpcInfoFromContext(ctx context.Context) (s *rpcInfo, ok bool) { + s, ok = ctx.Value(rpcInfoContextKey{}).(*rpcInfo) + return +} + +// Code returns the error code for err if it was produced by the rpc system. +// Otherwise, it returns codes.Unknown. +// +// Deprecated: use status.Code instead. +func Code(err error) codes.Code { + return status.Code(err) +} + +// ErrorDesc returns the error description of err if it was produced by the rpc system. +// Otherwise, it returns err.Error() or empty string when err is nil. +// +// Deprecated: use status.Convert and Message method instead. +func ErrorDesc(err error) string { + return status.Convert(err).Message() +} + +// Errorf returns an error containing an error code and a description; +// Errorf returns nil if c is OK. +// +// Deprecated: use status.Errorf instead. +func Errorf(c codes.Code, format string, a ...interface{}) error { + return status.Errorf(c, format, a...) +} + +// toRPCErr converts an error into an error from the status package. +func toRPCErr(err error) error { + if err == nil || err == io.EOF { + return err + } + if err == io.ErrUnexpectedEOF { + return status.Error(codes.Internal, err.Error()) + } + if _, ok := status.FromError(err); ok { + return err + } + switch e := err.(type) { + case transport.ConnectionError: + return status.Error(codes.Unavailable, e.Desc) + default: + switch err { + case context.DeadlineExceeded: + return status.Error(codes.DeadlineExceeded, err.Error()) + case context.Canceled: + return status.Error(codes.Canceled, err.Error()) + } + } + return status.Error(codes.Unknown, err.Error()) +} + +// setCallInfoCodec should only be called after CallOptions have been applied. +func setCallInfoCodec(c *callInfo) error { + if c.codec != nil { + // codec was already set by a CallOption; use it. + return nil + } + + if c.contentSubtype == "" { + // No codec specified in CallOptions; use proto by default. + c.codec = encoding.GetCodec(proto.Name) + return nil + } + + // c.contentSubtype is already lowercased in CallContentSubtype + c.codec = encoding.GetCodec(c.contentSubtype) + if c.codec == nil { + return status.Errorf(codes.Internal, "no codec registered for content-subtype %s", c.contentSubtype) + } + return nil +} + +// parseDialTarget returns the network and address to pass to dialer +func parseDialTarget(target string) (net string, addr string) { + net = "tcp" + + m1 := strings.Index(target, ":") + m2 := strings.Index(target, ":/") + + // handle unix:addr which will fail with url.Parse + if m1 >= 0 && m2 < 0 { + if n := target[0:m1]; n == "unix" { + net = n + addr = target[m1+1:] + return net, addr + } + } + if m2 >= 0 { + t, err := url.Parse(target) + if err != nil { + return net, target + } + scheme := t.Scheme + addr = t.Path + if scheme == "unix" { + net = scheme + if addr == "" { + addr = t.Host + } + return net, addr + } + } + + return net, target +} + +// channelzData is used to store channelz related data for ClientConn, addrConn and Server. +// These fields cannot be embedded in the original structs (e.g. ClientConn), since to do atomic +// operation on int64 variable on 32-bit machine, user is responsible to enforce memory alignment. +// Here, by grouping those int64 fields inside a struct, we are enforcing the alignment. +type channelzData struct { + callsStarted int64 + callsFailed int64 + callsSucceeded int64 + // lastCallStartedTime stores the timestamp that last call starts. It is of int64 type instead of + // time.Time since it's more costly to atomically update time.Time variable than int64 variable. + lastCallStartedTime int64 +} + +// The SupportPackageIsVersion variables are referenced from generated protocol +// buffer files to ensure compatibility with the gRPC version used. The latest +// support package version is 6. +// +// Older versions are kept for compatibility. They may be removed if +// compatibility cannot be maintained. +// +// These constants should not be referenced from any other code. +const ( + SupportPackageIsVersion3 = true + SupportPackageIsVersion4 = true + SupportPackageIsVersion5 = true + SupportPackageIsVersion6 = true +) + +const grpcUA = "grpc-go/" + Version diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go new file mode 100644 index 000000000..1b56cc2d1 --- /dev/null +++ b/vendor/google.golang.org/grpc/server.go @@ -0,0 +1,1741 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "errors" + "fmt" + "io" + "math" + "net" + "net/http" + "reflect" + "runtime" + "strings" + "sync" + "sync/atomic" + "time" + + "golang.org/x/net/trace" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/encoding/proto" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal/binarylog" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcrand" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/keepalive" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" + "google.golang.org/grpc/tap" +) + +const ( + defaultServerMaxReceiveMessageSize = 1024 * 1024 * 4 + defaultServerMaxSendMessageSize = math.MaxInt32 +) + +var statusOK = status.New(codes.OK, "") +var logger = grpclog.Component("core") + +type methodHandler func(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor UnaryServerInterceptor) (interface{}, error) + +// MethodDesc represents an RPC service's method specification. +type MethodDesc struct { + MethodName string + Handler methodHandler +} + +// ServiceDesc represents an RPC service's specification. +type ServiceDesc struct { + ServiceName string + // The pointer to the service interface. Used to check whether the user + // provided implementation satisfies the interface requirements. + HandlerType interface{} + Methods []MethodDesc + Streams []StreamDesc + Metadata interface{} +} + +// service consists of the information of the server serving this service and +// the methods in this service. +type service struct { + server interface{} // the server for service methods + md map[string]*MethodDesc + sd map[string]*StreamDesc + mdata interface{} +} + +type serverWorkerData struct { + st transport.ServerTransport + wg *sync.WaitGroup + stream *transport.Stream +} + +// Server is a gRPC server to serve RPC requests. +type Server struct { + opts serverOptions + + mu sync.Mutex // guards following + lis map[net.Listener]bool + conns map[transport.ServerTransport]bool + serve bool + drain bool + cv *sync.Cond // signaled when connections close for GracefulStop + m map[string]*service // service name -> service info + events trace.EventLog + + quit *grpcsync.Event + done *grpcsync.Event + channelzRemoveOnce sync.Once + serveWG sync.WaitGroup // counts active Serve goroutines for GracefulStop + + channelzID int64 // channelz unique identification number + czData *channelzData + + serverWorkerChannels []chan *serverWorkerData +} + +type serverOptions struct { + creds credentials.TransportCredentials + codec baseCodec + cp Compressor + dc Decompressor + unaryInt UnaryServerInterceptor + streamInt StreamServerInterceptor + chainUnaryInts []UnaryServerInterceptor + chainStreamInts []StreamServerInterceptor + inTapHandle tap.ServerInHandle + statsHandler stats.Handler + maxConcurrentStreams uint32 + maxReceiveMessageSize int + maxSendMessageSize int + unknownStreamDesc *StreamDesc + keepaliveParams keepalive.ServerParameters + keepalivePolicy keepalive.EnforcementPolicy + initialWindowSize int32 + initialConnWindowSize int32 + writeBufferSize int + readBufferSize int + connectionTimeout time.Duration + maxHeaderListSize *uint32 + headerTableSize *uint32 + numServerWorkers uint32 +} + +var defaultServerOptions = serverOptions{ + maxReceiveMessageSize: defaultServerMaxReceiveMessageSize, + maxSendMessageSize: defaultServerMaxSendMessageSize, + connectionTimeout: 120 * time.Second, + writeBufferSize: defaultWriteBufSize, + readBufferSize: defaultReadBufSize, +} + +// A ServerOption sets options such as credentials, codec and keepalive parameters, etc. +type ServerOption interface { + apply(*serverOptions) +} + +// EmptyServerOption does not alter the server configuration. It can be embedded +// in another structure to build custom server options. +// +// This API is EXPERIMENTAL. +type EmptyServerOption struct{} + +func (EmptyServerOption) apply(*serverOptions) {} + +// funcServerOption wraps a function that modifies serverOptions into an +// implementation of the ServerOption interface. +type funcServerOption struct { + f func(*serverOptions) +} + +func (fdo *funcServerOption) apply(do *serverOptions) { + fdo.f(do) +} + +func newFuncServerOption(f func(*serverOptions)) *funcServerOption { + return &funcServerOption{ + f: f, + } +} + +// WriteBufferSize determines how much data can be batched before doing a write on the wire. +// The corresponding memory allocation for this buffer will be twice the size to keep syscalls low. +// The default value for this buffer is 32KB. +// Zero will disable the write buffer such that each write will be on underlying connection. +// Note: A Send call may not directly translate to a write. +func WriteBufferSize(s int) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.writeBufferSize = s + }) +} + +// ReadBufferSize lets you set the size of read buffer, this determines how much data can be read at most +// for one read syscall. +// The default value for this buffer is 32KB. +// Zero will disable read buffer for a connection so data framer can access the underlying +// conn directly. +func ReadBufferSize(s int) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.readBufferSize = s + }) +} + +// InitialWindowSize returns a ServerOption that sets window size for stream. +// The lower bound for window size is 64K and any value smaller than that will be ignored. +func InitialWindowSize(s int32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.initialWindowSize = s + }) +} + +// InitialConnWindowSize returns a ServerOption that sets window size for a connection. +// The lower bound for window size is 64K and any value smaller than that will be ignored. +func InitialConnWindowSize(s int32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.initialConnWindowSize = s + }) +} + +// KeepaliveParams returns a ServerOption that sets keepalive and max-age parameters for the server. +func KeepaliveParams(kp keepalive.ServerParameters) ServerOption { + if kp.Time > 0 && kp.Time < time.Second { + logger.Warning("Adjusting keepalive ping interval to minimum period of 1s") + kp.Time = time.Second + } + + return newFuncServerOption(func(o *serverOptions) { + o.keepaliveParams = kp + }) +} + +// KeepaliveEnforcementPolicy returns a ServerOption that sets keepalive enforcement policy for the server. +func KeepaliveEnforcementPolicy(kep keepalive.EnforcementPolicy) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.keepalivePolicy = kep + }) +} + +// CustomCodec returns a ServerOption that sets a codec for message marshaling and unmarshaling. +// +// This will override any lookups by content-subtype for Codecs registered with RegisterCodec. +// +// Deprecated: register codecs using encoding.RegisterCodec. The server will +// automatically use registered codecs based on the incoming requests' headers. +// See also +// https://github.com/grpc/grpc-go/blob/master/Documentation/encoding.md#using-a-codec. +// Will be supported throughout 1.x. +func CustomCodec(codec Codec) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.codec = codec + }) +} + +// RPCCompressor returns a ServerOption that sets a compressor for outbound +// messages. For backward compatibility, all outbound messages will be sent +// using this compressor, regardless of incoming message compression. By +// default, server messages will be sent using the same compressor with which +// request messages were sent. +// +// Deprecated: use encoding.RegisterCompressor instead. Will be supported +// throughout 1.x. +func RPCCompressor(cp Compressor) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.cp = cp + }) +} + +// RPCDecompressor returns a ServerOption that sets a decompressor for inbound +// messages. It has higher priority than decompressors registered via +// encoding.RegisterCompressor. +// +// Deprecated: use encoding.RegisterCompressor instead. Will be supported +// throughout 1.x. +func RPCDecompressor(dc Decompressor) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.dc = dc + }) +} + +// MaxMsgSize returns a ServerOption to set the max message size in bytes the server can receive. +// If this is not set, gRPC uses the default limit. +// +// Deprecated: use MaxRecvMsgSize instead. Will be supported throughout 1.x. +func MaxMsgSize(m int) ServerOption { + return MaxRecvMsgSize(m) +} + +// MaxRecvMsgSize returns a ServerOption to set the max message size in bytes the server can receive. +// If this is not set, gRPC uses the default 4MB. +func MaxRecvMsgSize(m int) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.maxReceiveMessageSize = m + }) +} + +// MaxSendMsgSize returns a ServerOption to set the max message size in bytes the server can send. +// If this is not set, gRPC uses the default `math.MaxInt32`. +func MaxSendMsgSize(m int) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.maxSendMessageSize = m + }) +} + +// MaxConcurrentStreams returns a ServerOption that will apply a limit on the number +// of concurrent streams to each ServerTransport. +func MaxConcurrentStreams(n uint32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.maxConcurrentStreams = n + }) +} + +// Creds returns a ServerOption that sets credentials for server connections. +func Creds(c credentials.TransportCredentials) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.creds = c + }) +} + +// UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the +// server. Only one unary interceptor can be installed. The construction of multiple +// interceptors (e.g., chaining) can be implemented at the caller. +func UnaryInterceptor(i UnaryServerInterceptor) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + if o.unaryInt != nil { + panic("The unary server interceptor was already set and may not be reset.") + } + o.unaryInt = i + }) +} + +// ChainUnaryInterceptor returns a ServerOption that specifies the chained interceptor +// for unary RPCs. The first interceptor will be the outer most, +// while the last interceptor will be the inner most wrapper around the real call. +// All unary interceptors added by this method will be chained. +func ChainUnaryInterceptor(interceptors ...UnaryServerInterceptor) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.chainUnaryInts = append(o.chainUnaryInts, interceptors...) + }) +} + +// StreamInterceptor returns a ServerOption that sets the StreamServerInterceptor for the +// server. Only one stream interceptor can be installed. +func StreamInterceptor(i StreamServerInterceptor) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + if o.streamInt != nil { + panic("The stream server interceptor was already set and may not be reset.") + } + o.streamInt = i + }) +} + +// ChainStreamInterceptor returns a ServerOption that specifies the chained interceptor +// for streaming RPCs. The first interceptor will be the outer most, +// while the last interceptor will be the inner most wrapper around the real call. +// All stream interceptors added by this method will be chained. +func ChainStreamInterceptor(interceptors ...StreamServerInterceptor) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.chainStreamInts = append(o.chainStreamInts, interceptors...) + }) +} + +// InTapHandle returns a ServerOption that sets the tap handle for all the server +// transport to be created. Only one can be installed. +func InTapHandle(h tap.ServerInHandle) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + if o.inTapHandle != nil { + panic("The tap handle was already set and may not be reset.") + } + o.inTapHandle = h + }) +} + +// StatsHandler returns a ServerOption that sets the stats handler for the server. +func StatsHandler(h stats.Handler) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.statsHandler = h + }) +} + +// UnknownServiceHandler returns a ServerOption that allows for adding a custom +// unknown service handler. The provided method is a bidi-streaming RPC service +// handler that will be invoked instead of returning the "unimplemented" gRPC +// error whenever a request is received for an unregistered service or method. +// The handling function and stream interceptor (if set) have full access to +// the ServerStream, including its Context. +func UnknownServiceHandler(streamHandler StreamHandler) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.unknownStreamDesc = &StreamDesc{ + StreamName: "unknown_service_handler", + Handler: streamHandler, + // We need to assume that the users of the streamHandler will want to use both. + ClientStreams: true, + ServerStreams: true, + } + }) +} + +// ConnectionTimeout returns a ServerOption that sets the timeout for +// connection establishment (up to and including HTTP/2 handshaking) for all +// new connections. If this is not set, the default is 120 seconds. A zero or +// negative value will result in an immediate timeout. +// +// This API is EXPERIMENTAL. +func ConnectionTimeout(d time.Duration) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.connectionTimeout = d + }) +} + +// MaxHeaderListSize returns a ServerOption that sets the max (uncompressed) size +// of header list that the server is prepared to accept. +func MaxHeaderListSize(s uint32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.maxHeaderListSize = &s + }) +} + +// HeaderTableSize returns a ServerOption that sets the size of dynamic +// header table for stream. +// +// This API is EXPERIMENTAL. +func HeaderTableSize(s uint32) ServerOption { + return newFuncServerOption(func(o *serverOptions) { + o.headerTableSize = &s + }) +} + +// NumStreamWorkers returns a ServerOption that sets the number of worker +// goroutines that should be used to process incoming streams. Setting this to +// zero (default) will disable workers and spawn a new goroutine for each +// stream. +// +// This API is EXPERIMENTAL. +func NumStreamWorkers(numServerWorkers uint32) ServerOption { + // TODO: If/when this API gets stabilized (i.e. stream workers become the + // only way streams are processed), change the behavior of the zero value to + // a sane default. Preliminary experiments suggest that a value equal to the + // number of CPUs available is most performant; requires thorough testing. + return newFuncServerOption(func(o *serverOptions) { + o.numServerWorkers = numServerWorkers + }) +} + +// serverWorkerResetThreshold defines how often the stack must be reset. Every +// N requests, by spawning a new goroutine in its place, a worker can reset its +// stack so that large stacks don't live in memory forever. 2^16 should allow +// each goroutine stack to live for at least a few seconds in a typical +// workload (assuming a QPS of a few thousand requests/sec). +const serverWorkerResetThreshold = 1 << 16 + +// serverWorkers blocks on a *transport.Stream channel forever and waits for +// data to be fed by serveStreams. This allows different requests to be +// processed by the same goroutine, removing the need for expensive stack +// re-allocations (see the runtime.morestack problem [1]). +// +// [1] https://github.com/golang/go/issues/18138 +func (s *Server) serverWorker(ch chan *serverWorkerData) { + // To make sure all server workers don't reset at the same time, choose a + // random number of iterations before resetting. + threshold := serverWorkerResetThreshold + grpcrand.Intn(serverWorkerResetThreshold) + for completed := 0; completed < threshold; completed++ { + data, ok := <-ch + if !ok { + return + } + s.handleStream(data.st, data.stream, s.traceInfo(data.st, data.stream)) + data.wg.Done() + } + go s.serverWorker(ch) +} + +// initServerWorkers creates worker goroutines and channels to process incoming +// connections to reduce the time spent overall on runtime.morestack. +func (s *Server) initServerWorkers() { + s.serverWorkerChannels = make([]chan *serverWorkerData, s.opts.numServerWorkers) + for i := uint32(0); i < s.opts.numServerWorkers; i++ { + s.serverWorkerChannels[i] = make(chan *serverWorkerData) + go s.serverWorker(s.serverWorkerChannels[i]) + } +} + +func (s *Server) stopServerWorkers() { + for i := uint32(0); i < s.opts.numServerWorkers; i++ { + close(s.serverWorkerChannels[i]) + } +} + +// NewServer creates a gRPC server which has no service registered and has not +// started to accept requests yet. +func NewServer(opt ...ServerOption) *Server { + opts := defaultServerOptions + for _, o := range opt { + o.apply(&opts) + } + s := &Server{ + lis: make(map[net.Listener]bool), + opts: opts, + conns: make(map[transport.ServerTransport]bool), + m: make(map[string]*service), + quit: grpcsync.NewEvent(), + done: grpcsync.NewEvent(), + czData: new(channelzData), + } + chainUnaryServerInterceptors(s) + chainStreamServerInterceptors(s) + s.cv = sync.NewCond(&s.mu) + if EnableTracing { + _, file, line, _ := runtime.Caller(1) + s.events = trace.NewEventLog("grpc.Server", fmt.Sprintf("%s:%d", file, line)) + } + + if s.opts.numServerWorkers > 0 { + s.initServerWorkers() + } + + if channelz.IsOn() { + s.channelzID = channelz.RegisterServer(&channelzServer{s}, "") + } + return s +} + +// printf records an event in s's event log, unless s has been stopped. +// REQUIRES s.mu is held. +func (s *Server) printf(format string, a ...interface{}) { + if s.events != nil { + s.events.Printf(format, a...) + } +} + +// errorf records an error in s's event log, unless s has been stopped. +// REQUIRES s.mu is held. +func (s *Server) errorf(format string, a ...interface{}) { + if s.events != nil { + s.events.Errorf(format, a...) + } +} + +// RegisterService registers a service and its implementation to the gRPC +// server. It is called from the IDL generated code. This must be called before +// invoking Serve. +func (s *Server) RegisterService(sd *ServiceDesc, ss interface{}) { + ht := reflect.TypeOf(sd.HandlerType).Elem() + st := reflect.TypeOf(ss) + if !st.Implements(ht) { + logger.Fatalf("grpc: Server.RegisterService found the handler of type %v that does not satisfy %v", st, ht) + } + s.register(sd, ss) +} + +func (s *Server) register(sd *ServiceDesc, ss interface{}) { + s.mu.Lock() + defer s.mu.Unlock() + s.printf("RegisterService(%q)", sd.ServiceName) + if s.serve { + logger.Fatalf("grpc: Server.RegisterService after Server.Serve for %q", sd.ServiceName) + } + if _, ok := s.m[sd.ServiceName]; ok { + logger.Fatalf("grpc: Server.RegisterService found duplicate service registration for %q", sd.ServiceName) + } + srv := &service{ + server: ss, + md: make(map[string]*MethodDesc), + sd: make(map[string]*StreamDesc), + mdata: sd.Metadata, + } + for i := range sd.Methods { + d := &sd.Methods[i] + srv.md[d.MethodName] = d + } + for i := range sd.Streams { + d := &sd.Streams[i] + srv.sd[d.StreamName] = d + } + s.m[sd.ServiceName] = srv +} + +// MethodInfo contains the information of an RPC including its method name and type. +type MethodInfo struct { + // Name is the method name only, without the service name or package name. + Name string + // IsClientStream indicates whether the RPC is a client streaming RPC. + IsClientStream bool + // IsServerStream indicates whether the RPC is a server streaming RPC. + IsServerStream bool +} + +// ServiceInfo contains unary RPC method info, streaming RPC method info and metadata for a service. +type ServiceInfo struct { + Methods []MethodInfo + // Metadata is the metadata specified in ServiceDesc when registering service. + Metadata interface{} +} + +// GetServiceInfo returns a map from service names to ServiceInfo. +// Service names include the package names, in the form of .. +func (s *Server) GetServiceInfo() map[string]ServiceInfo { + ret := make(map[string]ServiceInfo) + for n, srv := range s.m { + methods := make([]MethodInfo, 0, len(srv.md)+len(srv.sd)) + for m := range srv.md { + methods = append(methods, MethodInfo{ + Name: m, + IsClientStream: false, + IsServerStream: false, + }) + } + for m, d := range srv.sd { + methods = append(methods, MethodInfo{ + Name: m, + IsClientStream: d.ClientStreams, + IsServerStream: d.ServerStreams, + }) + } + + ret[n] = ServiceInfo{ + Methods: methods, + Metadata: srv.mdata, + } + } + return ret +} + +// ErrServerStopped indicates that the operation is now illegal because of +// the server being stopped. +var ErrServerStopped = errors.New("grpc: the server has been stopped") + +func (s *Server) useTransportAuthenticator(rawConn net.Conn) (net.Conn, credentials.AuthInfo, error) { + if s.opts.creds == nil { + return rawConn, nil, nil + } + return s.opts.creds.ServerHandshake(rawConn) +} + +type listenSocket struct { + net.Listener + channelzID int64 +} + +func (l *listenSocket) ChannelzMetric() *channelz.SocketInternalMetric { + return &channelz.SocketInternalMetric{ + SocketOptions: channelz.GetSocketOption(l.Listener), + LocalAddr: l.Listener.Addr(), + } +} + +func (l *listenSocket) Close() error { + err := l.Listener.Close() + if channelz.IsOn() { + channelz.RemoveEntry(l.channelzID) + } + return err +} + +// Serve accepts incoming connections on the listener lis, creating a new +// ServerTransport and service goroutine for each. The service goroutines +// read gRPC requests and then call the registered handlers to reply to them. +// Serve returns when lis.Accept fails with fatal errors. lis will be closed when +// this method returns. +// Serve will return a non-nil error unless Stop or GracefulStop is called. +func (s *Server) Serve(lis net.Listener) error { + s.mu.Lock() + s.printf("serving") + s.serve = true + if s.lis == nil { + // Serve called after Stop or GracefulStop. + s.mu.Unlock() + lis.Close() + return ErrServerStopped + } + + s.serveWG.Add(1) + defer func() { + s.serveWG.Done() + if s.quit.HasFired() { + // Stop or GracefulStop called; block until done and return nil. + <-s.done.Done() + } + }() + + ls := &listenSocket{Listener: lis} + s.lis[ls] = true + + if channelz.IsOn() { + ls.channelzID = channelz.RegisterListenSocket(ls, s.channelzID, lis.Addr().String()) + } + s.mu.Unlock() + + defer func() { + s.mu.Lock() + if s.lis != nil && s.lis[ls] { + ls.Close() + delete(s.lis, ls) + } + s.mu.Unlock() + }() + + var tempDelay time.Duration // how long to sleep on accept failure + + for { + rawConn, err := lis.Accept() + if err != nil { + if ne, ok := err.(interface { + Temporary() bool + }); ok && ne.Temporary() { + if tempDelay == 0 { + tempDelay = 5 * time.Millisecond + } else { + tempDelay *= 2 + } + if max := 1 * time.Second; tempDelay > max { + tempDelay = max + } + s.mu.Lock() + s.printf("Accept error: %v; retrying in %v", err, tempDelay) + s.mu.Unlock() + timer := time.NewTimer(tempDelay) + select { + case <-timer.C: + case <-s.quit.Done(): + timer.Stop() + return nil + } + continue + } + s.mu.Lock() + s.printf("done serving; Accept = %v", err) + s.mu.Unlock() + + if s.quit.HasFired() { + return nil + } + return err + } + tempDelay = 0 + // Start a new goroutine to deal with rawConn so we don't stall this Accept + // loop goroutine. + // + // Make sure we account for the goroutine so GracefulStop doesn't nil out + // s.conns before this conn can be added. + s.serveWG.Add(1) + go func() { + s.handleRawConn(rawConn) + s.serveWG.Done() + }() + } +} + +// handleRawConn forks a goroutine to handle a just-accepted connection that +// has not had any I/O performed on it yet. +func (s *Server) handleRawConn(rawConn net.Conn) { + if s.quit.HasFired() { + rawConn.Close() + return + } + rawConn.SetDeadline(time.Now().Add(s.opts.connectionTimeout)) + conn, authInfo, err := s.useTransportAuthenticator(rawConn) + if err != nil { + // ErrConnDispatched means that the connection was dispatched away from + // gRPC; those connections should be left open. + if err != credentials.ErrConnDispatched { + s.mu.Lock() + s.errorf("ServerHandshake(%q) failed: %v", rawConn.RemoteAddr(), err) + s.mu.Unlock() + channelz.Warningf(logger, s.channelzID, "grpc: Server.Serve failed to complete security handshake from %q: %v", rawConn.RemoteAddr(), err) + rawConn.Close() + } + rawConn.SetDeadline(time.Time{}) + return + } + + // Finish handshaking (HTTP2) + st := s.newHTTP2Transport(conn, authInfo) + if st == nil { + return + } + + rawConn.SetDeadline(time.Time{}) + if !s.addConn(st) { + return + } + go func() { + s.serveStreams(st) + s.removeConn(st) + }() +} + +// newHTTP2Transport sets up a http/2 transport (using the +// gRPC http2 server transport in transport/http2_server.go). +func (s *Server) newHTTP2Transport(c net.Conn, authInfo credentials.AuthInfo) transport.ServerTransport { + config := &transport.ServerConfig{ + MaxStreams: s.opts.maxConcurrentStreams, + AuthInfo: authInfo, + InTapHandle: s.opts.inTapHandle, + StatsHandler: s.opts.statsHandler, + KeepaliveParams: s.opts.keepaliveParams, + KeepalivePolicy: s.opts.keepalivePolicy, + InitialWindowSize: s.opts.initialWindowSize, + InitialConnWindowSize: s.opts.initialConnWindowSize, + WriteBufferSize: s.opts.writeBufferSize, + ReadBufferSize: s.opts.readBufferSize, + ChannelzParentID: s.channelzID, + MaxHeaderListSize: s.opts.maxHeaderListSize, + HeaderTableSize: s.opts.headerTableSize, + } + st, err := transport.NewServerTransport("http2", c, config) + if err != nil { + s.mu.Lock() + s.errorf("NewServerTransport(%q) failed: %v", c.RemoteAddr(), err) + s.mu.Unlock() + c.Close() + channelz.Warning(logger, s.channelzID, "grpc: Server.Serve failed to create ServerTransport: ", err) + return nil + } + + return st +} + +func (s *Server) serveStreams(st transport.ServerTransport) { + defer st.Close() + var wg sync.WaitGroup + + var roundRobinCounter uint32 + st.HandleStreams(func(stream *transport.Stream) { + wg.Add(1) + if s.opts.numServerWorkers > 0 { + data := &serverWorkerData{st: st, wg: &wg, stream: stream} + select { + case s.serverWorkerChannels[atomic.AddUint32(&roundRobinCounter, 1)%s.opts.numServerWorkers] <- data: + default: + // If all stream workers are busy, fallback to the default code path. + go func() { + s.handleStream(st, stream, s.traceInfo(st, stream)) + wg.Done() + }() + } + } else { + go func() { + defer wg.Done() + s.handleStream(st, stream, s.traceInfo(st, stream)) + }() + } + }, func(ctx context.Context, method string) context.Context { + if !EnableTracing { + return ctx + } + tr := trace.New("grpc.Recv."+methodFamily(method), method) + return trace.NewContext(ctx, tr) + }) + wg.Wait() +} + +var _ http.Handler = (*Server)(nil) + +// ServeHTTP implements the Go standard library's http.Handler +// interface by responding to the gRPC request r, by looking up +// the requested gRPC method in the gRPC server s. +// +// The provided HTTP request must have arrived on an HTTP/2 +// connection. When using the Go standard library's server, +// practically this means that the Request must also have arrived +// over TLS. +// +// To share one port (such as 443 for https) between gRPC and an +// existing http.Handler, use a root http.Handler such as: +// +// if r.ProtoMajor == 2 && strings.HasPrefix( +// r.Header.Get("Content-Type"), "application/grpc") { +// grpcServer.ServeHTTP(w, r) +// } else { +// yourMux.ServeHTTP(w, r) +// } +// +// Note that ServeHTTP uses Go's HTTP/2 server implementation which is totally +// separate from grpc-go's HTTP/2 server. Performance and features may vary +// between the two paths. ServeHTTP does not support some gRPC features +// available through grpc-go's HTTP/2 server, and it is currently EXPERIMENTAL +// and subject to change. +func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { + st, err := transport.NewServerHandlerTransport(w, r, s.opts.statsHandler) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + if !s.addConn(st) { + return + } + defer s.removeConn(st) + s.serveStreams(st) +} + +// traceInfo returns a traceInfo and associates it with stream, if tracing is enabled. +// If tracing is not enabled, it returns nil. +func (s *Server) traceInfo(st transport.ServerTransport, stream *transport.Stream) (trInfo *traceInfo) { + if !EnableTracing { + return nil + } + tr, ok := trace.FromContext(stream.Context()) + if !ok { + return nil + } + + trInfo = &traceInfo{ + tr: tr, + firstLine: firstLine{ + client: false, + remoteAddr: st.RemoteAddr(), + }, + } + if dl, ok := stream.Context().Deadline(); ok { + trInfo.firstLine.deadline = time.Until(dl) + } + return trInfo +} + +func (s *Server) addConn(st transport.ServerTransport) bool { + s.mu.Lock() + defer s.mu.Unlock() + if s.conns == nil { + st.Close() + return false + } + if s.drain { + // Transport added after we drained our existing conns: drain it + // immediately. + st.Drain() + } + s.conns[st] = true + return true +} + +func (s *Server) removeConn(st transport.ServerTransport) { + s.mu.Lock() + defer s.mu.Unlock() + if s.conns != nil { + delete(s.conns, st) + s.cv.Broadcast() + } +} + +func (s *Server) channelzMetric() *channelz.ServerInternalMetric { + return &channelz.ServerInternalMetric{ + CallsStarted: atomic.LoadInt64(&s.czData.callsStarted), + CallsSucceeded: atomic.LoadInt64(&s.czData.callsSucceeded), + CallsFailed: atomic.LoadInt64(&s.czData.callsFailed), + LastCallStartedTimestamp: time.Unix(0, atomic.LoadInt64(&s.czData.lastCallStartedTime)), + } +} + +func (s *Server) incrCallsStarted() { + atomic.AddInt64(&s.czData.callsStarted, 1) + atomic.StoreInt64(&s.czData.lastCallStartedTime, time.Now().UnixNano()) +} + +func (s *Server) incrCallsSucceeded() { + atomic.AddInt64(&s.czData.callsSucceeded, 1) +} + +func (s *Server) incrCallsFailed() { + atomic.AddInt64(&s.czData.callsFailed, 1) +} + +func (s *Server) sendResponse(t transport.ServerTransport, stream *transport.Stream, msg interface{}, cp Compressor, opts *transport.Options, comp encoding.Compressor) error { + data, err := encode(s.getCodec(stream.ContentSubtype()), msg) + if err != nil { + channelz.Error(logger, s.channelzID, "grpc: server failed to encode response: ", err) + return err + } + compData, err := compress(data, cp, comp) + if err != nil { + channelz.Error(logger, s.channelzID, "grpc: server failed to compress response: ", err) + return err + } + hdr, payload := msgHeader(data, compData) + // TODO(dfawley): should we be checking len(data) instead? + if len(payload) > s.opts.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "grpc: trying to send message larger than max (%d vs. %d)", len(payload), s.opts.maxSendMessageSize) + } + err = t.Write(stream, hdr, payload, opts) + if err == nil && s.opts.statsHandler != nil { + s.opts.statsHandler.HandleRPC(stream.Context(), outPayload(false, msg, data, payload, time.Now())) + } + return err +} + +// chainUnaryServerInterceptors chains all unary server interceptors into one. +func chainUnaryServerInterceptors(s *Server) { + // Prepend opts.unaryInt to the chaining interceptors if it exists, since unaryInt will + // be executed before any other chained interceptors. + interceptors := s.opts.chainUnaryInts + if s.opts.unaryInt != nil { + interceptors = append([]UnaryServerInterceptor{s.opts.unaryInt}, s.opts.chainUnaryInts...) + } + + var chainedInt UnaryServerInterceptor + if len(interceptors) == 0 { + chainedInt = nil + } else if len(interceptors) == 1 { + chainedInt = interceptors[0] + } else { + chainedInt = func(ctx context.Context, req interface{}, info *UnaryServerInfo, handler UnaryHandler) (interface{}, error) { + return interceptors[0](ctx, req, info, getChainUnaryHandler(interceptors, 0, info, handler)) + } + } + + s.opts.unaryInt = chainedInt +} + +// getChainUnaryHandler recursively generate the chained UnaryHandler +func getChainUnaryHandler(interceptors []UnaryServerInterceptor, curr int, info *UnaryServerInfo, finalHandler UnaryHandler) UnaryHandler { + if curr == len(interceptors)-1 { + return finalHandler + } + + return func(ctx context.Context, req interface{}) (interface{}, error) { + return interceptors[curr+1](ctx, req, info, getChainUnaryHandler(interceptors, curr+1, info, finalHandler)) + } +} + +func (s *Server) processUnaryRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, md *MethodDesc, trInfo *traceInfo) (err error) { + sh := s.opts.statsHandler + if sh != nil || trInfo != nil || channelz.IsOn() { + if channelz.IsOn() { + s.incrCallsStarted() + } + var statsBegin *stats.Begin + if sh != nil { + beginTime := time.Now() + statsBegin = &stats.Begin{ + BeginTime: beginTime, + } + sh.HandleRPC(stream.Context(), statsBegin) + } + if trInfo != nil { + trInfo.tr.LazyLog(&trInfo.firstLine, false) + } + // The deferred error handling for tracing, stats handler and channelz are + // combined into one function to reduce stack usage -- a defer takes ~56-64 + // bytes on the stack, so overflowing the stack will require a stack + // re-allocation, which is expensive. + // + // To maintain behavior similar to separate deferred statements, statements + // should be executed in the reverse order. That is, tracing first, stats + // handler second, and channelz last. Note that panics *within* defers will + // lead to different behavior, but that's an acceptable compromise; that + // would be undefined behavior territory anyway. + defer func() { + if trInfo != nil { + if err != nil && err != io.EOF { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + trInfo.tr.Finish() + } + + if sh != nil { + end := &stats.End{ + BeginTime: statsBegin.BeginTime, + EndTime: time.Now(), + } + if err != nil && err != io.EOF { + end.Error = toRPCErr(err) + } + sh.HandleRPC(stream.Context(), end) + } + + if channelz.IsOn() { + if err != nil && err != io.EOF { + s.incrCallsFailed() + } else { + s.incrCallsSucceeded() + } + } + }() + } + + binlog := binarylog.GetMethodLogger(stream.Method()) + if binlog != nil { + ctx := stream.Context() + md, _ := metadata.FromIncomingContext(ctx) + logEntry := &binarylog.ClientHeader{ + Header: md, + MethodName: stream.Method(), + PeerAddr: nil, + } + if deadline, ok := ctx.Deadline(); ok { + logEntry.Timeout = time.Until(deadline) + if logEntry.Timeout < 0 { + logEntry.Timeout = 0 + } + } + if a := md[":authority"]; len(a) > 0 { + logEntry.Authority = a[0] + } + if peer, ok := peer.FromContext(ctx); ok { + logEntry.PeerAddr = peer.Addr + } + binlog.Log(logEntry) + } + + // comp and cp are used for compression. decomp and dc are used for + // decompression. If comp and decomp are both set, they are the same; + // however they are kept separate to ensure that at most one of the + // compressor/decompressor variable pairs are set for use later. + var comp, decomp encoding.Compressor + var cp Compressor + var dc Decompressor + + // If dc is set and matches the stream's compression, use it. Otherwise, try + // to find a matching registered compressor for decomp. + if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { + dc = s.opts.dc + } else if rc != "" && rc != encoding.Identity { + decomp = encoding.GetCompressor(rc) + if decomp == nil { + st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) + t.WriteStatus(stream, st) + return st.Err() + } + } + + // If cp is set, use it. Otherwise, attempt to compress the response using + // the incoming message compression method. + // + // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. + if s.opts.cp != nil { + cp = s.opts.cp + stream.SetSendCompress(cp.Type()) + } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { + // Legacy compressor not specified; attempt to respond with same encoding. + comp = encoding.GetCompressor(rc) + if comp != nil { + stream.SetSendCompress(rc) + } + } + + var payInfo *payloadInfo + if sh != nil || binlog != nil { + payInfo = &payloadInfo{} + } + d, err := recvAndDecompress(&parser{r: stream}, stream, dc, s.opts.maxReceiveMessageSize, payInfo, decomp) + if err != nil { + if st, ok := status.FromError(err); ok { + if e := t.WriteStatus(stream, st); e != nil { + channelz.Warningf(logger, s.channelzID, "grpc: Server.processUnaryRPC failed to write status %v", e) + } + } + return err + } + if channelz.IsOn() { + t.IncrMsgRecv() + } + df := func(v interface{}) error { + if err := s.getCodec(stream.ContentSubtype()).Unmarshal(d, v); err != nil { + return status.Errorf(codes.Internal, "grpc: error unmarshalling request: %v", err) + } + if sh != nil { + sh.HandleRPC(stream.Context(), &stats.InPayload{ + RecvTime: time.Now(), + Payload: v, + WireLength: payInfo.wireLength, + Data: d, + Length: len(d), + }) + } + if binlog != nil { + binlog.Log(&binarylog.ClientMessage{ + Message: d, + }) + } + if trInfo != nil { + trInfo.tr.LazyLog(&payload{sent: false, msg: v}, true) + } + return nil + } + ctx := NewContextWithServerTransportStream(stream.Context(), stream) + reply, appErr := md.Handler(srv.server, ctx, df, s.opts.unaryInt) + if appErr != nil { + appStatus, ok := status.FromError(appErr) + if !ok { + // Convert appErr if it is not a grpc status error. + appErr = status.Error(codes.Unknown, appErr.Error()) + appStatus, _ = status.FromError(appErr) + } + if trInfo != nil { + trInfo.tr.LazyLog(stringer(appStatus.Message()), true) + trInfo.tr.SetError() + } + if e := t.WriteStatus(stream, appStatus); e != nil { + channelz.Warningf(logger, s.channelzID, "grpc: Server.processUnaryRPC failed to write status: %v", e) + } + if binlog != nil { + if h, _ := stream.Header(); h.Len() > 0 { + // Only log serverHeader if there was header. Otherwise it can + // be trailer only. + binlog.Log(&binarylog.ServerHeader{ + Header: h, + }) + } + binlog.Log(&binarylog.ServerTrailer{ + Trailer: stream.Trailer(), + Err: appErr, + }) + } + return appErr + } + if trInfo != nil { + trInfo.tr.LazyLog(stringer("OK"), false) + } + opts := &transport.Options{Last: true} + + if err := s.sendResponse(t, stream, reply, cp, opts, comp); err != nil { + if err == io.EOF { + // The entire stream is done (for unary RPC only). + return err + } + if sts, ok := status.FromError(err); ok { + if e := t.WriteStatus(stream, sts); e != nil { + channelz.Warningf(logger, s.channelzID, "grpc: Server.processUnaryRPC failed to write status: %v", e) + } + } else { + switch st := err.(type) { + case transport.ConnectionError: + // Nothing to do here. + default: + panic(fmt.Sprintf("grpc: Unexpected error (%T) from sendResponse: %v", st, st)) + } + } + if binlog != nil { + h, _ := stream.Header() + binlog.Log(&binarylog.ServerHeader{ + Header: h, + }) + binlog.Log(&binarylog.ServerTrailer{ + Trailer: stream.Trailer(), + Err: appErr, + }) + } + return err + } + if binlog != nil { + h, _ := stream.Header() + binlog.Log(&binarylog.ServerHeader{ + Header: h, + }) + binlog.Log(&binarylog.ServerMessage{ + Message: reply, + }) + } + if channelz.IsOn() { + t.IncrMsgSent() + } + if trInfo != nil { + trInfo.tr.LazyLog(&payload{sent: true, msg: reply}, true) + } + // TODO: Should we be logging if writing status failed here, like above? + // Should the logging be in WriteStatus? Should we ignore the WriteStatus + // error or allow the stats handler to see it? + err = t.WriteStatus(stream, statusOK) + if binlog != nil { + binlog.Log(&binarylog.ServerTrailer{ + Trailer: stream.Trailer(), + Err: appErr, + }) + } + return err +} + +// chainStreamServerInterceptors chains all stream server interceptors into one. +func chainStreamServerInterceptors(s *Server) { + // Prepend opts.streamInt to the chaining interceptors if it exists, since streamInt will + // be executed before any other chained interceptors. + interceptors := s.opts.chainStreamInts + if s.opts.streamInt != nil { + interceptors = append([]StreamServerInterceptor{s.opts.streamInt}, s.opts.chainStreamInts...) + } + + var chainedInt StreamServerInterceptor + if len(interceptors) == 0 { + chainedInt = nil + } else if len(interceptors) == 1 { + chainedInt = interceptors[0] + } else { + chainedInt = func(srv interface{}, ss ServerStream, info *StreamServerInfo, handler StreamHandler) error { + return interceptors[0](srv, ss, info, getChainStreamHandler(interceptors, 0, info, handler)) + } + } + + s.opts.streamInt = chainedInt +} + +// getChainStreamHandler recursively generate the chained StreamHandler +func getChainStreamHandler(interceptors []StreamServerInterceptor, curr int, info *StreamServerInfo, finalHandler StreamHandler) StreamHandler { + if curr == len(interceptors)-1 { + return finalHandler + } + + return func(srv interface{}, ss ServerStream) error { + return interceptors[curr+1](srv, ss, info, getChainStreamHandler(interceptors, curr+1, info, finalHandler)) + } +} + +func (s *Server) processStreamingRPC(t transport.ServerTransport, stream *transport.Stream, srv *service, sd *StreamDesc, trInfo *traceInfo) (err error) { + if channelz.IsOn() { + s.incrCallsStarted() + } + sh := s.opts.statsHandler + var statsBegin *stats.Begin + if sh != nil { + beginTime := time.Now() + statsBegin = &stats.Begin{ + BeginTime: beginTime, + } + sh.HandleRPC(stream.Context(), statsBegin) + } + ctx := NewContextWithServerTransportStream(stream.Context(), stream) + ss := &serverStream{ + ctx: ctx, + t: t, + s: stream, + p: &parser{r: stream}, + codec: s.getCodec(stream.ContentSubtype()), + maxReceiveMessageSize: s.opts.maxReceiveMessageSize, + maxSendMessageSize: s.opts.maxSendMessageSize, + trInfo: trInfo, + statsHandler: sh, + } + + if sh != nil || trInfo != nil || channelz.IsOn() { + // See comment in processUnaryRPC on defers. + defer func() { + if trInfo != nil { + ss.mu.Lock() + if err != nil && err != io.EOF { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + ss.trInfo.tr.Finish() + ss.trInfo.tr = nil + ss.mu.Unlock() + } + + if sh != nil { + end := &stats.End{ + BeginTime: statsBegin.BeginTime, + EndTime: time.Now(), + } + if err != nil && err != io.EOF { + end.Error = toRPCErr(err) + } + sh.HandleRPC(stream.Context(), end) + } + + if channelz.IsOn() { + if err != nil && err != io.EOF { + s.incrCallsFailed() + } else { + s.incrCallsSucceeded() + } + } + }() + } + + ss.binlog = binarylog.GetMethodLogger(stream.Method()) + if ss.binlog != nil { + md, _ := metadata.FromIncomingContext(ctx) + logEntry := &binarylog.ClientHeader{ + Header: md, + MethodName: stream.Method(), + PeerAddr: nil, + } + if deadline, ok := ctx.Deadline(); ok { + logEntry.Timeout = time.Until(deadline) + if logEntry.Timeout < 0 { + logEntry.Timeout = 0 + } + } + if a := md[":authority"]; len(a) > 0 { + logEntry.Authority = a[0] + } + if peer, ok := peer.FromContext(ss.Context()); ok { + logEntry.PeerAddr = peer.Addr + } + ss.binlog.Log(logEntry) + } + + // If dc is set and matches the stream's compression, use it. Otherwise, try + // to find a matching registered compressor for decomp. + if rc := stream.RecvCompress(); s.opts.dc != nil && s.opts.dc.Type() == rc { + ss.dc = s.opts.dc + } else if rc != "" && rc != encoding.Identity { + ss.decomp = encoding.GetCompressor(rc) + if ss.decomp == nil { + st := status.Newf(codes.Unimplemented, "grpc: Decompressor is not installed for grpc-encoding %q", rc) + t.WriteStatus(ss.s, st) + return st.Err() + } + } + + // If cp is set, use it. Otherwise, attempt to compress the response using + // the incoming message compression method. + // + // NOTE: this needs to be ahead of all handling, https://github.com/grpc/grpc-go/issues/686. + if s.opts.cp != nil { + ss.cp = s.opts.cp + stream.SetSendCompress(s.opts.cp.Type()) + } else if rc := stream.RecvCompress(); rc != "" && rc != encoding.Identity { + // Legacy compressor not specified; attempt to respond with same encoding. + ss.comp = encoding.GetCompressor(rc) + if ss.comp != nil { + stream.SetSendCompress(rc) + } + } + + if trInfo != nil { + trInfo.tr.LazyLog(&trInfo.firstLine, false) + } + var appErr error + var server interface{} + if srv != nil { + server = srv.server + } + if s.opts.streamInt == nil { + appErr = sd.Handler(server, ss) + } else { + info := &StreamServerInfo{ + FullMethod: stream.Method(), + IsClientStream: sd.ClientStreams, + IsServerStream: sd.ServerStreams, + } + appErr = s.opts.streamInt(server, ss, info, sd.Handler) + } + if appErr != nil { + appStatus, ok := status.FromError(appErr) + if !ok { + appStatus = status.New(codes.Unknown, appErr.Error()) + appErr = appStatus.Err() + } + if trInfo != nil { + ss.mu.Lock() + ss.trInfo.tr.LazyLog(stringer(appStatus.Message()), true) + ss.trInfo.tr.SetError() + ss.mu.Unlock() + } + t.WriteStatus(ss.s, appStatus) + if ss.binlog != nil { + ss.binlog.Log(&binarylog.ServerTrailer{ + Trailer: ss.s.Trailer(), + Err: appErr, + }) + } + // TODO: Should we log an error from WriteStatus here and below? + return appErr + } + if trInfo != nil { + ss.mu.Lock() + ss.trInfo.tr.LazyLog(stringer("OK"), false) + ss.mu.Unlock() + } + err = t.WriteStatus(ss.s, statusOK) + if ss.binlog != nil { + ss.binlog.Log(&binarylog.ServerTrailer{ + Trailer: ss.s.Trailer(), + Err: appErr, + }) + } + return err +} + +func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream, trInfo *traceInfo) { + sm := stream.Method() + if sm != "" && sm[0] == '/' { + sm = sm[1:] + } + pos := strings.LastIndex(sm, "/") + if pos == -1 { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"Malformed method name %q", []interface{}{sm}}, true) + trInfo.tr.SetError() + } + errDesc := fmt.Sprintf("malformed method name: %q", stream.Method()) + if err := t.WriteStatus(stream, status.New(codes.ResourceExhausted, errDesc)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + channelz.Warningf(logger, s.channelzID, "grpc: Server.handleStream failed to write status: %v", err) + } + if trInfo != nil { + trInfo.tr.Finish() + } + return + } + service := sm[:pos] + method := sm[pos+1:] + + srv, knownService := s.m[service] + if knownService { + if md, ok := srv.md[method]; ok { + s.processUnaryRPC(t, stream, srv, md, trInfo) + return + } + if sd, ok := srv.sd[method]; ok { + s.processStreamingRPC(t, stream, srv, sd, trInfo) + return + } + } + // Unknown service, or known server unknown method. + if unknownDesc := s.opts.unknownStreamDesc; unknownDesc != nil { + s.processStreamingRPC(t, stream, nil, unknownDesc, trInfo) + return + } + var errDesc string + if !knownService { + errDesc = fmt.Sprintf("unknown service %v", service) + } else { + errDesc = fmt.Sprintf("unknown method %v for service %v", method, service) + } + if trInfo != nil { + trInfo.tr.LazyPrintf("%s", errDesc) + trInfo.tr.SetError() + } + if err := t.WriteStatus(stream, status.New(codes.Unimplemented, errDesc)); err != nil { + if trInfo != nil { + trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + trInfo.tr.SetError() + } + channelz.Warningf(logger, s.channelzID, "grpc: Server.handleStream failed to write status: %v", err) + } + if trInfo != nil { + trInfo.tr.Finish() + } +} + +// The key to save ServerTransportStream in the context. +type streamKey struct{} + +// NewContextWithServerTransportStream creates a new context from ctx and +// attaches stream to it. +// +// This API is EXPERIMENTAL. +func NewContextWithServerTransportStream(ctx context.Context, stream ServerTransportStream) context.Context { + return context.WithValue(ctx, streamKey{}, stream) +} + +// ServerTransportStream is a minimal interface that a transport stream must +// implement. This can be used to mock an actual transport stream for tests of +// handler code that use, for example, grpc.SetHeader (which requires some +// stream to be in context). +// +// See also NewContextWithServerTransportStream. +// +// This API is EXPERIMENTAL. +type ServerTransportStream interface { + Method() string + SetHeader(md metadata.MD) error + SendHeader(md metadata.MD) error + SetTrailer(md metadata.MD) error +} + +// ServerTransportStreamFromContext returns the ServerTransportStream saved in +// ctx. Returns nil if the given context has no stream associated with it +// (which implies it is not an RPC invocation context). +// +// This API is EXPERIMENTAL. +func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream { + s, _ := ctx.Value(streamKey{}).(ServerTransportStream) + return s +} + +// Stop stops the gRPC server. It immediately closes all open +// connections and listeners. +// It cancels all active RPCs on the server side and the corresponding +// pending RPCs on the client side will get notified by connection +// errors. +func (s *Server) Stop() { + s.quit.Fire() + + defer func() { + s.serveWG.Wait() + s.done.Fire() + }() + + s.channelzRemoveOnce.Do(func() { + if channelz.IsOn() { + channelz.RemoveEntry(s.channelzID) + } + }) + + s.mu.Lock() + listeners := s.lis + s.lis = nil + st := s.conns + s.conns = nil + // interrupt GracefulStop if Stop and GracefulStop are called concurrently. + s.cv.Broadcast() + s.mu.Unlock() + + for lis := range listeners { + lis.Close() + } + for c := range st { + c.Close() + } + if s.opts.numServerWorkers > 0 { + s.stopServerWorkers() + } + + s.mu.Lock() + if s.events != nil { + s.events.Finish() + s.events = nil + } + s.mu.Unlock() +} + +// GracefulStop stops the gRPC server gracefully. It stops the server from +// accepting new connections and RPCs and blocks until all the pending RPCs are +// finished. +func (s *Server) GracefulStop() { + s.quit.Fire() + defer s.done.Fire() + + s.channelzRemoveOnce.Do(func() { + if channelz.IsOn() { + channelz.RemoveEntry(s.channelzID) + } + }) + s.mu.Lock() + if s.conns == nil { + s.mu.Unlock() + return + } + + for lis := range s.lis { + lis.Close() + } + s.lis = nil + if !s.drain { + for st := range s.conns { + st.Drain() + } + s.drain = true + } + + // Wait for serving threads to be ready to exit. Only then can we be sure no + // new conns will be created. + s.mu.Unlock() + s.serveWG.Wait() + s.mu.Lock() + + for len(s.conns) != 0 { + s.cv.Wait() + } + s.conns = nil + if s.events != nil { + s.events.Finish() + s.events = nil + } + s.mu.Unlock() +} + +// contentSubtype must be lowercase +// cannot return nil +func (s *Server) getCodec(contentSubtype string) baseCodec { + if s.opts.codec != nil { + return s.opts.codec + } + if contentSubtype == "" { + return encoding.GetCodec(proto.Name) + } + codec := encoding.GetCodec(contentSubtype) + if codec == nil { + return encoding.GetCodec(proto.Name) + } + return codec +} + +// SetHeader sets the header metadata. +// When called multiple times, all the provided metadata will be merged. +// All the metadata will be sent out when one of the following happens: +// - grpc.SendHeader() is called; +// - The first response is sent out; +// - An RPC status is sent out (error or success). +func SetHeader(ctx context.Context, md metadata.MD) error { + if md.Len() == 0 { + return nil + } + stream := ServerTransportStreamFromContext(ctx) + if stream == nil { + return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) + } + return stream.SetHeader(md) +} + +// SendHeader sends header metadata. It may be called at most once. +// The provided md and headers set by SetHeader() will be sent. +func SendHeader(ctx context.Context, md metadata.MD) error { + stream := ServerTransportStreamFromContext(ctx) + if stream == nil { + return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) + } + if err := stream.SendHeader(md); err != nil { + return toRPCErr(err) + } + return nil +} + +// SetTrailer sets the trailer metadata that will be sent when an RPC returns. +// When called more than once, all the provided metadata will be merged. +func SetTrailer(ctx context.Context, md metadata.MD) error { + if md.Len() == 0 { + return nil + } + stream := ServerTransportStreamFromContext(ctx) + if stream == nil { + return status.Errorf(codes.Internal, "grpc: failed to fetch the stream from the context %v", ctx) + } + return stream.SetTrailer(md) +} + +// Method returns the method string for the server context. The returned +// string is in the format of "/service/method". +func Method(ctx context.Context) (string, bool) { + s := ServerTransportStreamFromContext(ctx) + if s == nil { + return "", false + } + return s.Method(), true +} + +type channelzServer struct { + s *Server +} + +func (c *channelzServer) ChannelzMetric() *channelz.ServerInternalMetric { + return c.s.channelzMetric() +} diff --git a/vendor/google.golang.org/grpc/service_config.go b/vendor/google.golang.org/grpc/service_config.go new file mode 100644 index 000000000..5e434ca7f --- /dev/null +++ b/vendor/google.golang.org/grpc/service_config.go @@ -0,0 +1,454 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "encoding/json" + "errors" + "fmt" + "reflect" + "strconv" + "strings" + "time" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal" + internalserviceconfig "google.golang.org/grpc/internal/serviceconfig" + "google.golang.org/grpc/serviceconfig" +) + +const maxInt = int(^uint(0) >> 1) + +// MethodConfig defines the configuration recommended by the service providers for a +// particular method. +// +// Deprecated: Users should not use this struct. Service config should be received +// through name resolver, as specified here +// https://github.com/grpc/grpc/blob/master/doc/service_config.md +type MethodConfig struct { + // WaitForReady indicates whether RPCs sent to this method should wait until + // the connection is ready by default (!failfast). The value specified via the + // gRPC client API will override the value set here. + WaitForReady *bool + // Timeout is the default timeout for RPCs sent to this method. The actual + // deadline used will be the minimum of the value specified here and the value + // set by the application via the gRPC client API. If either one is not set, + // then the other will be used. If neither is set, then the RPC has no deadline. + Timeout *time.Duration + // MaxReqSize is the maximum allowed payload size for an individual request in a + // stream (client->server) in bytes. The size which is measured is the serialized + // payload after per-message compression (but before stream compression) in bytes. + // The actual value used is the minimum of the value specified here and the value set + // by the application via the gRPC client API. If either one is not set, then the other + // will be used. If neither is set, then the built-in default is used. + MaxReqSize *int + // MaxRespSize is the maximum allowed payload size for an individual response in a + // stream (server->client) in bytes. + MaxRespSize *int + // RetryPolicy configures retry options for the method. + retryPolicy *retryPolicy +} + +type lbConfig struct { + name string + cfg serviceconfig.LoadBalancingConfig +} + +// ServiceConfig is provided by the service provider and contains parameters for how +// clients that connect to the service should behave. +// +// Deprecated: Users should not use this struct. Service config should be received +// through name resolver, as specified here +// https://github.com/grpc/grpc/blob/master/doc/service_config.md +type ServiceConfig struct { + serviceconfig.Config + + // LB is the load balancer the service providers recommends. The balancer + // specified via grpc.WithBalancerName will override this. This is deprecated; + // lbConfigs is preferred. If lbConfig and LB are both present, lbConfig + // will be used. + LB *string + + // lbConfig is the service config's load balancing configuration. If + // lbConfig and LB are both present, lbConfig will be used. + lbConfig *lbConfig + + // Methods contains a map for the methods in this service. If there is an + // exact match for a method (i.e. /service/method) in the map, use the + // corresponding MethodConfig. If there's no exact match, look for the + // default config for the service (/service/) and use the corresponding + // MethodConfig if it exists. Otherwise, the method has no MethodConfig to + // use. + Methods map[string]MethodConfig + + // If a retryThrottlingPolicy is provided, gRPC will automatically throttle + // retry attempts and hedged RPCs when the client’s ratio of failures to + // successes exceeds a threshold. + // + // For each server name, the gRPC client will maintain a token_count which is + // initially set to maxTokens, and can take values between 0 and maxTokens. + // + // Every outgoing RPC (regardless of service or method invoked) will change + // token_count as follows: + // + // - Every failed RPC will decrement the token_count by 1. + // - Every successful RPC will increment the token_count by tokenRatio. + // + // If token_count is less than or equal to maxTokens / 2, then RPCs will not + // be retried and hedged RPCs will not be sent. + retryThrottling *retryThrottlingPolicy + // healthCheckConfig must be set as one of the requirement to enable LB channel + // health check. + healthCheckConfig *healthCheckConfig + // rawJSONString stores service config json string that get parsed into + // this service config struct. + rawJSONString string +} + +// healthCheckConfig defines the go-native version of the LB channel health check config. +type healthCheckConfig struct { + // serviceName is the service name to use in the health-checking request. + ServiceName string +} + +// retryPolicy defines the go-native version of the retry policy defined by the +// service config here: +// https://github.com/grpc/proposal/blob/master/A6-client-retries.md#integration-with-service-config +type retryPolicy struct { + // MaxAttempts is the maximum number of attempts, including the original RPC. + // + // This field is required and must be two or greater. + maxAttempts int + + // Exponential backoff parameters. The initial retry attempt will occur at + // random(0, initialBackoff). In general, the nth attempt will occur at + // random(0, + // min(initialBackoff*backoffMultiplier**(n-1), maxBackoff)). + // + // These fields are required and must be greater than zero. + initialBackoff time.Duration + maxBackoff time.Duration + backoffMultiplier float64 + + // The set of status codes which may be retried. + // + // Status codes are specified as strings, e.g., "UNAVAILABLE". + // + // This field is required and must be non-empty. + // Note: a set is used to store this for easy lookup. + retryableStatusCodes map[codes.Code]bool +} + +type jsonRetryPolicy struct { + MaxAttempts int + InitialBackoff string + MaxBackoff string + BackoffMultiplier float64 + RetryableStatusCodes []codes.Code +} + +// retryThrottlingPolicy defines the go-native version of the retry throttling +// policy defined by the service config here: +// https://github.com/grpc/proposal/blob/master/A6-client-retries.md#integration-with-service-config +type retryThrottlingPolicy struct { + // The number of tokens starts at maxTokens. The token_count will always be + // between 0 and maxTokens. + // + // This field is required and must be greater than zero. + MaxTokens float64 + // The amount of tokens to add on each successful RPC. Typically this will + // be some number between 0 and 1, e.g., 0.1. + // + // This field is required and must be greater than zero. Up to 3 decimal + // places are supported. + TokenRatio float64 +} + +func parseDuration(s *string) (*time.Duration, error) { + if s == nil { + return nil, nil + } + if !strings.HasSuffix(*s, "s") { + return nil, fmt.Errorf("malformed duration %q", *s) + } + ss := strings.SplitN((*s)[:len(*s)-1], ".", 3) + if len(ss) > 2 { + return nil, fmt.Errorf("malformed duration %q", *s) + } + // hasDigits is set if either the whole or fractional part of the number is + // present, since both are optional but one is required. + hasDigits := false + var d time.Duration + if len(ss[0]) > 0 { + i, err := strconv.ParseInt(ss[0], 10, 32) + if err != nil { + return nil, fmt.Errorf("malformed duration %q: %v", *s, err) + } + d = time.Duration(i) * time.Second + hasDigits = true + } + if len(ss) == 2 && len(ss[1]) > 0 { + if len(ss[1]) > 9 { + return nil, fmt.Errorf("malformed duration %q", *s) + } + f, err := strconv.ParseInt(ss[1], 10, 64) + if err != nil { + return nil, fmt.Errorf("malformed duration %q: %v", *s, err) + } + for i := 9; i > len(ss[1]); i-- { + f *= 10 + } + d += time.Duration(f) + hasDigits = true + } + if !hasDigits { + return nil, fmt.Errorf("malformed duration %q", *s) + } + + return &d, nil +} + +type jsonName struct { + Service string + Method string +} + +var ( + errDuplicatedName = errors.New("duplicated name") + errEmptyServiceNonEmptyMethod = errors.New("cannot combine empty 'service' and non-empty 'method'") +) + +func (j jsonName) generatePath() (string, error) { + if j.Service == "" { + if j.Method != "" { + return "", errEmptyServiceNonEmptyMethod + } + return "", nil + } + res := "/" + j.Service + "/" + if j.Method != "" { + res += j.Method + } + return res, nil +} + +// TODO(lyuxuan): delete this struct after cleaning up old service config implementation. +type jsonMC struct { + Name *[]jsonName + WaitForReady *bool + Timeout *string + MaxRequestMessageBytes *int64 + MaxResponseMessageBytes *int64 + RetryPolicy *jsonRetryPolicy +} + +// TODO(lyuxuan): delete this struct after cleaning up old service config implementation. +type jsonSC struct { + LoadBalancingPolicy *string + LoadBalancingConfig *internalserviceconfig.BalancerConfig + MethodConfig *[]jsonMC + RetryThrottling *retryThrottlingPolicy + HealthCheckConfig *healthCheckConfig +} + +func init() { + internal.ParseServiceConfigForTesting = parseServiceConfig +} +func parseServiceConfig(js string) *serviceconfig.ParseResult { + if len(js) == 0 { + return &serviceconfig.ParseResult{Err: fmt.Errorf("no JSON service config provided")} + } + var rsc jsonSC + err := json.Unmarshal([]byte(js), &rsc) + if err != nil { + logger.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) + return &serviceconfig.ParseResult{Err: err} + } + sc := ServiceConfig{ + LB: rsc.LoadBalancingPolicy, + Methods: make(map[string]MethodConfig), + retryThrottling: rsc.RetryThrottling, + healthCheckConfig: rsc.HealthCheckConfig, + rawJSONString: js, + } + if c := rsc.LoadBalancingConfig; c != nil { + sc.lbConfig = &lbConfig{ + name: c.Name, + cfg: c.Config, + } + } + + if rsc.MethodConfig == nil { + return &serviceconfig.ParseResult{Config: &sc} + } + + paths := map[string]struct{}{} + for _, m := range *rsc.MethodConfig { + if m.Name == nil { + continue + } + d, err := parseDuration(m.Timeout) + if err != nil { + logger.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) + return &serviceconfig.ParseResult{Err: err} + } + + mc := MethodConfig{ + WaitForReady: m.WaitForReady, + Timeout: d, + } + if mc.retryPolicy, err = convertRetryPolicy(m.RetryPolicy); err != nil { + logger.Warningf("grpc: parseServiceConfig error unmarshaling %s due to %v", js, err) + return &serviceconfig.ParseResult{Err: err} + } + if m.MaxRequestMessageBytes != nil { + if *m.MaxRequestMessageBytes > int64(maxInt) { + mc.MaxReqSize = newInt(maxInt) + } else { + mc.MaxReqSize = newInt(int(*m.MaxRequestMessageBytes)) + } + } + if m.MaxResponseMessageBytes != nil { + if *m.MaxResponseMessageBytes > int64(maxInt) { + mc.MaxRespSize = newInt(maxInt) + } else { + mc.MaxRespSize = newInt(int(*m.MaxResponseMessageBytes)) + } + } + for i, n := range *m.Name { + path, err := n.generatePath() + if err != nil { + logger.Warningf("grpc: parseServiceConfig error unmarshaling %s due to methodConfig[%d]: %v", js, i, err) + return &serviceconfig.ParseResult{Err: err} + } + + if _, ok := paths[path]; ok { + err = errDuplicatedName + logger.Warningf("grpc: parseServiceConfig error unmarshaling %s due to methodConfig[%d]: %v", js, i, err) + return &serviceconfig.ParseResult{Err: err} + } + paths[path] = struct{}{} + sc.Methods[path] = mc + } + } + + if sc.retryThrottling != nil { + if mt := sc.retryThrottling.MaxTokens; mt <= 0 || mt > 1000 { + return &serviceconfig.ParseResult{Err: fmt.Errorf("invalid retry throttling config: maxTokens (%v) out of range (0, 1000]", mt)} + } + if tr := sc.retryThrottling.TokenRatio; tr <= 0 { + return &serviceconfig.ParseResult{Err: fmt.Errorf("invalid retry throttling config: tokenRatio (%v) may not be negative", tr)} + } + } + return &serviceconfig.ParseResult{Config: &sc} +} + +func convertRetryPolicy(jrp *jsonRetryPolicy) (p *retryPolicy, err error) { + if jrp == nil { + return nil, nil + } + ib, err := parseDuration(&jrp.InitialBackoff) + if err != nil { + return nil, err + } + mb, err := parseDuration(&jrp.MaxBackoff) + if err != nil { + return nil, err + } + + if jrp.MaxAttempts <= 1 || + *ib <= 0 || + *mb <= 0 || + jrp.BackoffMultiplier <= 0 || + len(jrp.RetryableStatusCodes) == 0 { + logger.Warningf("grpc: ignoring retry policy %v due to illegal configuration", jrp) + return nil, nil + } + + rp := &retryPolicy{ + maxAttempts: jrp.MaxAttempts, + initialBackoff: *ib, + maxBackoff: *mb, + backoffMultiplier: jrp.BackoffMultiplier, + retryableStatusCodes: make(map[codes.Code]bool), + } + if rp.maxAttempts > 5 { + // TODO(retry): Make the max maxAttempts configurable. + rp.maxAttempts = 5 + } + for _, code := range jrp.RetryableStatusCodes { + rp.retryableStatusCodes[code] = true + } + return rp, nil +} + +func min(a, b *int) *int { + if *a < *b { + return a + } + return b +} + +func getMaxSize(mcMax, doptMax *int, defaultVal int) *int { + if mcMax == nil && doptMax == nil { + return &defaultVal + } + if mcMax != nil && doptMax != nil { + return min(mcMax, doptMax) + } + if mcMax != nil { + return mcMax + } + return doptMax +} + +func newInt(b int) *int { + return &b +} + +func init() { + internal.EqualServiceConfigForTesting = equalServiceConfig +} + +// equalServiceConfig compares two configs. The rawJSONString field is ignored, +// because they may diff in white spaces. +// +// If any of them is NOT *ServiceConfig, return false. +func equalServiceConfig(a, b serviceconfig.Config) bool { + aa, ok := a.(*ServiceConfig) + if !ok { + return false + } + bb, ok := b.(*ServiceConfig) + if !ok { + return false + } + aaRaw := aa.rawJSONString + aa.rawJSONString = "" + bbRaw := bb.rawJSONString + bb.rawJSONString = "" + defer func() { + aa.rawJSONString = aaRaw + bb.rawJSONString = bbRaw + }() + // Using reflect.DeepEqual instead of cmp.Equal because many balancer + // configs are unexported, and cmp.Equal cannot compare unexported fields + // from unexported structs. + return reflect.DeepEqual(aa, bb) +} diff --git a/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go b/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go new file mode 100644 index 000000000..187c30442 --- /dev/null +++ b/vendor/google.golang.org/grpc/serviceconfig/serviceconfig.go @@ -0,0 +1,41 @@ +/* + * + * Copyright 2019 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package serviceconfig defines types and methods for operating on gRPC +// service configs. +// +// This package is EXPERIMENTAL. +package serviceconfig + +// Config represents an opaque data structure holding a service config. +type Config interface { + isServiceConfig() +} + +// LoadBalancingConfig represents an opaque data structure holding a load +// balancing config. +type LoadBalancingConfig interface { + isLoadBalancingConfig() +} + +// ParseResult contains a service config or an error. Exactly one must be +// non-nil. +type ParseResult struct { + Config Config + Err error +} diff --git a/vendor/google.golang.org/grpc/stats/handlers.go b/vendor/google.golang.org/grpc/stats/handlers.go new file mode 100644 index 000000000..dc03731e4 --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/handlers.go @@ -0,0 +1,63 @@ +/* + * + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package stats + +import ( + "context" + "net" +) + +// ConnTagInfo defines the relevant information needed by connection context tagger. +type ConnTagInfo struct { + // RemoteAddr is the remote address of the corresponding connection. + RemoteAddr net.Addr + // LocalAddr is the local address of the corresponding connection. + LocalAddr net.Addr +} + +// RPCTagInfo defines the relevant information needed by RPC context tagger. +type RPCTagInfo struct { + // FullMethodName is the RPC method in the format of /package.service/method. + FullMethodName string + // FailFast indicates if this RPC is failfast. + // This field is only valid on client side, it's always false on server side. + FailFast bool +} + +// Handler defines the interface for the related stats handling (e.g., RPCs, connections). +type Handler interface { + // TagRPC can attach some information to the given context. + // The context used for the rest lifetime of the RPC will be derived from + // the returned context. + TagRPC(context.Context, *RPCTagInfo) context.Context + // HandleRPC processes the RPC stats. + HandleRPC(context.Context, RPCStats) + + // TagConn can attach some information to the given context. + // The returned context will be used for stats handling. + // For conn stats handling, the context used in HandleConn for this + // connection will be derived from the context returned. + // For RPC stats handling, + // - On server side, the context used in HandleRPC for all RPCs on this + // connection will be derived from the context returned. + // - On client side, the context is not derived from the context returned. + TagConn(context.Context, *ConnTagInfo) context.Context + // HandleConn processes the Conn stats. + HandleConn(context.Context, ConnStats) +} diff --git a/vendor/google.golang.org/grpc/stats/stats.go b/vendor/google.golang.org/grpc/stats/stats.go new file mode 100644 index 000000000..63e476ee7 --- /dev/null +++ b/vendor/google.golang.org/grpc/stats/stats.go @@ -0,0 +1,312 @@ +/* + * + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package stats is for collecting and reporting various network and RPC stats. +// This package is for monitoring purpose only. All fields are read-only. +// All APIs are experimental. +package stats // import "google.golang.org/grpc/stats" + +import ( + "context" + "net" + "time" + + "google.golang.org/grpc/metadata" +) + +// RPCStats contains stats information about RPCs. +type RPCStats interface { + isRPCStats() + // IsClient returns true if this RPCStats is from client side. + IsClient() bool +} + +// Begin contains stats when an RPC begins. +// FailFast is only valid if this Begin is from client side. +type Begin struct { + // Client is true if this Begin is from client side. + Client bool + // BeginTime is the time when the RPC begins. + BeginTime time.Time + // FailFast indicates if this RPC is failfast. + FailFast bool +} + +// IsClient indicates if the stats information is from client side. +func (s *Begin) IsClient() bool { return s.Client } + +func (s *Begin) isRPCStats() {} + +// InPayload contains the information for an incoming payload. +type InPayload struct { + // Client is true if this InPayload is from client side. + Client bool + // Payload is the payload with original type. + Payload interface{} + // Data is the serialized message payload. + Data []byte + // Length is the length of uncompressed data. + Length int + // WireLength is the length of data on wire (compressed, signed, encrypted). + WireLength int + // RecvTime is the time when the payload is received. + RecvTime time.Time +} + +// IsClient indicates if the stats information is from client side. +func (s *InPayload) IsClient() bool { return s.Client } + +func (s *InPayload) isRPCStats() {} + +// InHeader contains stats when a header is received. +type InHeader struct { + // Client is true if this InHeader is from client side. + Client bool + // WireLength is the wire length of header. + WireLength int + // Compression is the compression algorithm used for the RPC. + Compression string + // Header contains the header metadata received. + Header metadata.MD + + // The following fields are valid only if Client is false. + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string + // RemoteAddr is the remote address of the corresponding connection. + RemoteAddr net.Addr + // LocalAddr is the local address of the corresponding connection. + LocalAddr net.Addr +} + +// IsClient indicates if the stats information is from client side. +func (s *InHeader) IsClient() bool { return s.Client } + +func (s *InHeader) isRPCStats() {} + +// InTrailer contains stats when a trailer is received. +type InTrailer struct { + // Client is true if this InTrailer is from client side. + Client bool + // WireLength is the wire length of trailer. + WireLength int + // Trailer contains the trailer metadata received from the server. This + // field is only valid if this InTrailer is from the client side. + Trailer metadata.MD +} + +// IsClient indicates if the stats information is from client side. +func (s *InTrailer) IsClient() bool { return s.Client } + +func (s *InTrailer) isRPCStats() {} + +// OutPayload contains the information for an outgoing payload. +type OutPayload struct { + // Client is true if this OutPayload is from client side. + Client bool + // Payload is the payload with original type. + Payload interface{} + // Data is the serialized message payload. + Data []byte + // Length is the length of uncompressed data. + Length int + // WireLength is the length of data on wire (compressed, signed, encrypted). + WireLength int + // SentTime is the time when the payload is sent. + SentTime time.Time +} + +// IsClient indicates if this stats information is from client side. +func (s *OutPayload) IsClient() bool { return s.Client } + +func (s *OutPayload) isRPCStats() {} + +// OutHeader contains stats when a header is sent. +type OutHeader struct { + // Client is true if this OutHeader is from client side. + Client bool + // Compression is the compression algorithm used for the RPC. + Compression string + // Header contains the header metadata sent. + Header metadata.MD + + // The following fields are valid only if Client is true. + // FullMethod is the full RPC method string, i.e., /package.service/method. + FullMethod string + // RemoteAddr is the remote address of the corresponding connection. + RemoteAddr net.Addr + // LocalAddr is the local address of the corresponding connection. + LocalAddr net.Addr +} + +// IsClient indicates if this stats information is from client side. +func (s *OutHeader) IsClient() bool { return s.Client } + +func (s *OutHeader) isRPCStats() {} + +// OutTrailer contains stats when a trailer is sent. +type OutTrailer struct { + // Client is true if this OutTrailer is from client side. + Client bool + // WireLength is the wire length of trailer. + // + // Deprecated: This field is never set. The length is not known when this message is + // emitted because the trailer fields are compressed with hpack after that. + WireLength int + // Trailer contains the trailer metadata sent to the client. This + // field is only valid if this OutTrailer is from the server side. + Trailer metadata.MD +} + +// IsClient indicates if this stats information is from client side. +func (s *OutTrailer) IsClient() bool { return s.Client } + +func (s *OutTrailer) isRPCStats() {} + +// End contains stats when an RPC ends. +type End struct { + // Client is true if this End is from client side. + Client bool + // BeginTime is the time when the RPC began. + BeginTime time.Time + // EndTime is the time when the RPC ends. + EndTime time.Time + // Trailer contains the trailer metadata received from the server. This + // field is only valid if this End is from the client side. + // Deprecated: use Trailer in InTrailer instead. + Trailer metadata.MD + // Error is the error the RPC ended with. It is an error generated from + // status.Status and can be converted back to status.Status using + // status.FromError if non-nil. + Error error +} + +// IsClient indicates if this is from client side. +func (s *End) IsClient() bool { return s.Client } + +func (s *End) isRPCStats() {} + +// ConnStats contains stats information about connections. +type ConnStats interface { + isConnStats() + // IsClient returns true if this ConnStats is from client side. + IsClient() bool +} + +// ConnBegin contains the stats of a connection when it is established. +type ConnBegin struct { + // Client is true if this ConnBegin is from client side. + Client bool +} + +// IsClient indicates if this is from client side. +func (s *ConnBegin) IsClient() bool { return s.Client } + +func (s *ConnBegin) isConnStats() {} + +// ConnEnd contains the stats of a connection when it ends. +type ConnEnd struct { + // Client is true if this ConnEnd is from client side. + Client bool +} + +// IsClient indicates if this is from client side. +func (s *ConnEnd) IsClient() bool { return s.Client } + +func (s *ConnEnd) isConnStats() {} + +type incomingTagsKey struct{} +type outgoingTagsKey struct{} + +// SetTags attaches stats tagging data to the context, which will be sent in +// the outgoing RPC with the header grpc-tags-bin. Subsequent calls to +// SetTags will overwrite the values from earlier calls. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func SetTags(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, outgoingTagsKey{}, b) +} + +// Tags returns the tags from the context for the inbound RPC. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func Tags(ctx context.Context) []byte { + b, _ := ctx.Value(incomingTagsKey{}).([]byte) + return b +} + +// SetIncomingTags attaches stats tagging data to the context, to be read by +// the application (not sent in outgoing RPCs). +// +// This is intended for gRPC-internal use ONLY. +func SetIncomingTags(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, incomingTagsKey{}, b) +} + +// OutgoingTags returns the tags from the context for the outbound RPC. +// +// This is intended for gRPC-internal use ONLY. +func OutgoingTags(ctx context.Context) []byte { + b, _ := ctx.Value(outgoingTagsKey{}).([]byte) + return b +} + +type incomingTraceKey struct{} +type outgoingTraceKey struct{} + +// SetTrace attaches stats tagging data to the context, which will be sent in +// the outgoing RPC with the header grpc-trace-bin. Subsequent calls to +// SetTrace will overwrite the values from earlier calls. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func SetTrace(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, outgoingTraceKey{}, b) +} + +// Trace returns the trace from the context for the inbound RPC. +// +// NOTE: this is provided only for backward compatibility with existing clients +// and will likely be removed in an upcoming release. New uses should transmit +// this type of data using metadata with a different, non-reserved (i.e. does +// not begin with "grpc-") header name. +func Trace(ctx context.Context) []byte { + b, _ := ctx.Value(incomingTraceKey{}).([]byte) + return b +} + +// SetIncomingTrace attaches stats tagging data to the context, to be read by +// the application (not sent in outgoing RPCs). It is intended for +// gRPC-internal use. +func SetIncomingTrace(ctx context.Context, b []byte) context.Context { + return context.WithValue(ctx, incomingTraceKey{}, b) +} + +// OutgoingTrace returns the trace from the context for the outbound RPC. It is +// intended for gRPC-internal use. +func OutgoingTrace(ctx context.Context) []byte { + b, _ := ctx.Value(outgoingTraceKey{}).([]byte) + return b +} diff --git a/vendor/google.golang.org/grpc/status/status.go b/vendor/google.golang.org/grpc/status/status.go new file mode 100644 index 000000000..01e182c30 --- /dev/null +++ b/vendor/google.golang.org/grpc/status/status.go @@ -0,0 +1,127 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package status implements errors returned by gRPC. These errors are +// serialized and transmitted on the wire between server and client, and allow +// for additional data to be transmitted via the Details field in the status +// proto. gRPC service handlers should return an error created by this +// package, and gRPC clients should expect a corresponding error to be +// returned from the RPC call. +// +// This package upholds the invariants that a non-nil error may not +// contain an OK code, and an OK code must result in a nil error. +package status + +import ( + "context" + "fmt" + + spb "google.golang.org/genproto/googleapis/rpc/status" + + "google.golang.org/grpc/codes" + "google.golang.org/grpc/internal/status" +) + +// Status references google.golang.org/grpc/internal/status. It represents an +// RPC status code, message, and details. It is immutable and should be +// created with New, Newf, or FromProto. +// https://godoc.org/google.golang.org/grpc/internal/status +type Status = status.Status + +// New returns a Status representing c and msg. +func New(c codes.Code, msg string) *Status { + return status.New(c, msg) +} + +// Newf returns New(c, fmt.Sprintf(format, a...)). +func Newf(c codes.Code, format string, a ...interface{}) *Status { + return New(c, fmt.Sprintf(format, a...)) +} + +// Error returns an error representing c and msg. If c is OK, returns nil. +func Error(c codes.Code, msg string) error { + return New(c, msg).Err() +} + +// Errorf returns Error(c, fmt.Sprintf(format, a...)). +func Errorf(c codes.Code, format string, a ...interface{}) error { + return Error(c, fmt.Sprintf(format, a...)) +} + +// ErrorProto returns an error representing s. If s.Code is OK, returns nil. +func ErrorProto(s *spb.Status) error { + return FromProto(s).Err() +} + +// FromProto returns a Status representing s. +func FromProto(s *spb.Status) *Status { + return status.FromProto(s) +} + +// FromError returns a Status representing err if it was produced from this +// package or has a method `GRPCStatus() *Status`. Otherwise, ok is false and a +// Status is returned with codes.Unknown and the original error message. +func FromError(err error) (s *Status, ok bool) { + if err == nil { + return nil, true + } + if se, ok := err.(interface { + GRPCStatus() *Status + }); ok { + return se.GRPCStatus(), true + } + return New(codes.Unknown, err.Error()), false +} + +// Convert is a convenience function which removes the need to handle the +// boolean return value from FromError. +func Convert(err error) *Status { + s, _ := FromError(err) + return s +} + +// Code returns the Code of the error if it is a Status error, codes.OK if err +// is nil, or codes.Unknown otherwise. +func Code(err error) codes.Code { + // Don't use FromError to avoid allocation of OK status. + if err == nil { + return codes.OK + } + if se, ok := err.(interface { + GRPCStatus() *Status + }); ok { + return se.GRPCStatus().Code() + } + return codes.Unknown +} + +// FromContextError converts a context error into a Status. It returns a +// Status with codes.OK if err is nil, or a Status with codes.Unknown if err is +// non-nil and not a context error. +func FromContextError(err error) *Status { + switch err { + case nil: + return nil + case context.DeadlineExceeded: + return New(codes.DeadlineExceeded, err.Error()) + case context.Canceled: + return New(codes.Canceled, err.Error()) + default: + return New(codes.Unknown, err.Error()) + } +} diff --git a/vendor/google.golang.org/grpc/stream.go b/vendor/google.golang.org/grpc/stream.go new file mode 100644 index 000000000..fbc3fb11c --- /dev/null +++ b/vendor/google.golang.org/grpc/stream.go @@ -0,0 +1,1551 @@ +/* + * + * Copyright 2014 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "errors" + "io" + "math" + "strconv" + "sync" + "time" + + "golang.org/x/net/trace" + "google.golang.org/grpc/balancer" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/encoding" + "google.golang.org/grpc/internal/balancerload" + "google.golang.org/grpc/internal/binarylog" + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcrand" + "google.golang.org/grpc/internal/grpcutil" + "google.golang.org/grpc/internal/transport" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" + "google.golang.org/grpc/stats" + "google.golang.org/grpc/status" +) + +// StreamHandler defines the handler called by gRPC server to complete the +// execution of a streaming RPC. If a StreamHandler returns an error, it +// should be produced by the status package, or else gRPC will use +// codes.Unknown as the status code and err.Error() as the status message +// of the RPC. +type StreamHandler func(srv interface{}, stream ServerStream) error + +// StreamDesc represents a streaming RPC service's method specification. +type StreamDesc struct { + StreamName string + Handler StreamHandler + + // At least one of these is true. + ServerStreams bool + ClientStreams bool +} + +// Stream defines the common interface a client or server stream has to satisfy. +// +// Deprecated: See ClientStream and ServerStream documentation instead. +type Stream interface { + // Deprecated: See ClientStream and ServerStream documentation instead. + Context() context.Context + // Deprecated: See ClientStream and ServerStream documentation instead. + SendMsg(m interface{}) error + // Deprecated: See ClientStream and ServerStream documentation instead. + RecvMsg(m interface{}) error +} + +// ClientStream defines the client-side behavior of a streaming RPC. +// +// All errors returned from ClientStream methods are compatible with the +// status package. +type ClientStream interface { + // Header returns the header metadata received from the server if there + // is any. It blocks if the metadata is not ready to read. + Header() (metadata.MD, error) + // Trailer returns the trailer metadata from the server, if there is any. + // It must only be called after stream.CloseAndRecv has returned, or + // stream.Recv has returned a non-nil error (including io.EOF). + Trailer() metadata.MD + // CloseSend closes the send direction of the stream. It closes the stream + // when non-nil error is met. It is also not safe to call CloseSend + // concurrently with SendMsg. + CloseSend() error + // Context returns the context for this stream. + // + // It should not be called until after Header or RecvMsg has returned. Once + // called, subsequent client-side retries are disabled. + Context() context.Context + // SendMsg is generally called by generated code. On error, SendMsg aborts + // the stream. If the error was generated by the client, the status is + // returned directly; otherwise, io.EOF is returned and the status of + // the stream may be discovered using RecvMsg. + // + // SendMsg blocks until: + // - There is sufficient flow control to schedule m with the transport, or + // - The stream is done, or + // - The stream breaks. + // + // SendMsg does not wait until the message is received by the server. An + // untimely stream closure may result in lost messages. To ensure delivery, + // users should ensure the RPC completed successfully using RecvMsg. + // + // It is safe to have a goroutine calling SendMsg and another goroutine + // calling RecvMsg on the same stream at the same time, but it is not safe + // to call SendMsg on the same stream in different goroutines. It is also + // not safe to call CloseSend concurrently with SendMsg. + SendMsg(m interface{}) error + // RecvMsg blocks until it receives a message into m or the stream is + // done. It returns io.EOF when the stream completes successfully. On + // any other error, the stream is aborted and the error contains the RPC + // status. + // + // It is safe to have a goroutine calling SendMsg and another goroutine + // calling RecvMsg on the same stream at the same time, but it is not + // safe to call RecvMsg on the same stream in different goroutines. + RecvMsg(m interface{}) error +} + +// NewStream creates a new Stream for the client side. This is typically +// called by generated code. ctx is used for the lifetime of the stream. +// +// To ensure resources are not leaked due to the stream returned, one of the following +// actions must be performed: +// +// 1. Call Close on the ClientConn. +// 2. Cancel the context provided. +// 3. Call RecvMsg until a non-nil error is returned. A protobuf-generated +// client-streaming RPC, for instance, might use the helper function +// CloseAndRecv (note that CloseSend does not Recv, therefore is not +// guaranteed to release all resources). +// 4. Receive a non-nil, non-io.EOF error from Header or SendMsg. +// +// If none of the above happen, a goroutine and a context will be leaked, and grpc +// will not call the optionally-configured stats handler with a stats.End message. +func (cc *ClientConn) NewStream(ctx context.Context, desc *StreamDesc, method string, opts ...CallOption) (ClientStream, error) { + // allow interceptor to see all applicable call options, which means those + // configured as defaults from dial option as well as per-call options + opts = combine(cc.dopts.callOptions, opts) + + if cc.dopts.streamInt != nil { + return cc.dopts.streamInt(ctx, desc, cc, method, newClientStream, opts...) + } + return newClientStream(ctx, desc, cc, method, opts...) +} + +// NewClientStream is a wrapper for ClientConn.NewStream. +func NewClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (ClientStream, error) { + return cc.NewStream(ctx, desc, method, opts...) +} + +func newClientStream(ctx context.Context, desc *StreamDesc, cc *ClientConn, method string, opts ...CallOption) (_ ClientStream, err error) { + if channelz.IsOn() { + cc.incrCallsStarted() + defer func() { + if err != nil { + cc.incrCallsFailed() + } + }() + } + c := defaultCallInfo() + // Provide an opportunity for the first RPC to see the first service config + // provided by the resolver. + if err := cc.waitForResolvedAddrs(ctx); err != nil { + return nil, err + } + mc := cc.GetMethodConfig(method) + if mc.WaitForReady != nil { + c.failFast = !*mc.WaitForReady + } + + // Possible context leak: + // The cancel function for the child context we create will only be called + // when RecvMsg returns a non-nil error, if the ClientConn is closed, or if + // an error is generated by SendMsg. + // https://github.com/grpc/grpc-go/issues/1818. + var cancel context.CancelFunc + if mc.Timeout != nil && *mc.Timeout >= 0 { + ctx, cancel = context.WithTimeout(ctx, *mc.Timeout) + } else { + ctx, cancel = context.WithCancel(ctx) + } + defer func() { + if err != nil { + cancel() + } + }() + + for _, o := range opts { + if err := o.before(c); err != nil { + return nil, toRPCErr(err) + } + } + c.maxSendMessageSize = getMaxSize(mc.MaxReqSize, c.maxSendMessageSize, defaultClientMaxSendMessageSize) + c.maxReceiveMessageSize = getMaxSize(mc.MaxRespSize, c.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize) + if err := setCallInfoCodec(c); err != nil { + return nil, err + } + + callHdr := &transport.CallHdr{ + Host: cc.authority, + Method: method, + ContentSubtype: c.contentSubtype, + } + + // Set our outgoing compression according to the UseCompressor CallOption, if + // set. In that case, also find the compressor from the encoding package. + // Otherwise, use the compressor configured by the WithCompressor DialOption, + // if set. + var cp Compressor + var comp encoding.Compressor + if ct := c.compressorType; ct != "" { + callHdr.SendCompress = ct + if ct != encoding.Identity { + comp = encoding.GetCompressor(ct) + if comp == nil { + return nil, status.Errorf(codes.Internal, "grpc: Compressor is not installed for requested grpc-encoding %q", ct) + } + } + } else if cc.dopts.cp != nil { + callHdr.SendCompress = cc.dopts.cp.Type() + cp = cc.dopts.cp + } + if c.creds != nil { + callHdr.Creds = c.creds + } + var trInfo *traceInfo + if EnableTracing { + trInfo = &traceInfo{ + tr: trace.New("grpc.Sent."+methodFamily(method), method), + firstLine: firstLine{ + client: true, + }, + } + if deadline, ok := ctx.Deadline(); ok { + trInfo.firstLine.deadline = time.Until(deadline) + } + trInfo.tr.LazyLog(&trInfo.firstLine, false) + ctx = trace.NewContext(ctx, trInfo.tr) + } + ctx = newContextWithRPCInfo(ctx, c.failFast, c.codec, cp, comp) + sh := cc.dopts.copts.StatsHandler + var beginTime time.Time + if sh != nil { + ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: method, FailFast: c.failFast}) + beginTime = time.Now() + begin := &stats.Begin{ + Client: true, + BeginTime: beginTime, + FailFast: c.failFast, + } + sh.HandleRPC(ctx, begin) + } + + cs := &clientStream{ + callHdr: callHdr, + ctx: ctx, + methodConfig: &mc, + opts: opts, + callInfo: c, + cc: cc, + desc: desc, + codec: c.codec, + cp: cp, + comp: comp, + cancel: cancel, + beginTime: beginTime, + firstAttempt: true, + } + if !cc.dopts.disableRetry { + cs.retryThrottler = cc.retryThrottler.Load().(*retryThrottler) + } + cs.binlog = binarylog.GetMethodLogger(method) + + // Only this initial attempt has stats/tracing. + // TODO(dfawley): move to newAttempt when per-attempt stats are implemented. + if err := cs.newAttemptLocked(sh, trInfo); err != nil { + cs.finish(err) + return nil, err + } + + op := func(a *csAttempt) error { return a.newStream() } + if err := cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }); err != nil { + cs.finish(err) + return nil, err + } + + if cs.binlog != nil { + md, _ := metadata.FromOutgoingContext(ctx) + logEntry := &binarylog.ClientHeader{ + OnClientSide: true, + Header: md, + MethodName: method, + Authority: cs.cc.authority, + } + if deadline, ok := ctx.Deadline(); ok { + logEntry.Timeout = time.Until(deadline) + if logEntry.Timeout < 0 { + logEntry.Timeout = 0 + } + } + cs.binlog.Log(logEntry) + } + + if desc != unaryStreamDesc { + // Listen on cc and stream contexts to cleanup when the user closes the + // ClientConn or cancels the stream context. In all other cases, an error + // should already be injected into the recv buffer by the transport, which + // the client will eventually receive, and then we will cancel the stream's + // context in clientStream.finish. + go func() { + select { + case <-cc.ctx.Done(): + cs.finish(ErrClientConnClosing) + case <-ctx.Done(): + cs.finish(toRPCErr(ctx.Err())) + } + }() + } + return cs, nil +} + +// newAttemptLocked creates a new attempt with a transport. +// If it succeeds, then it replaces clientStream's attempt with this new attempt. +func (cs *clientStream) newAttemptLocked(sh stats.Handler, trInfo *traceInfo) (retErr error) { + newAttempt := &csAttempt{ + cs: cs, + dc: cs.cc.dopts.dc, + statsHandler: sh, + trInfo: trInfo, + } + defer func() { + if retErr != nil { + // This attempt is not set in the clientStream, so it's finish won't + // be called. Call it here for stats and trace in case they are not + // nil. + newAttempt.finish(retErr) + } + }() + + if err := cs.ctx.Err(); err != nil { + return toRPCErr(err) + } + + ctx := cs.ctx + if cs.cc.parsedTarget.Scheme == "xds" { + // Add extra metadata (metadata that will be added by transport) to context + // so the balancer can see them. + ctx = grpcutil.WithExtraMetadata(cs.ctx, metadata.Pairs( + "content-type", grpcutil.ContentType(cs.callHdr.ContentSubtype), + )) + } + t, done, err := cs.cc.getTransport(ctx, cs.callInfo.failFast, cs.callHdr.Method) + if err != nil { + return err + } + if trInfo != nil { + trInfo.firstLine.SetRemoteAddr(t.RemoteAddr()) + } + newAttempt.t = t + newAttempt.done = done + cs.attempt = newAttempt + return nil +} + +func (a *csAttempt) newStream() error { + cs := a.cs + cs.callHdr.PreviousAttempts = cs.numRetries + s, err := a.t.NewStream(cs.ctx, cs.callHdr) + if err != nil { + if _, ok := err.(transport.PerformedIOError); ok { + // Return without converting to an RPC error so retry code can + // inspect. + return err + } + return toRPCErr(err) + } + cs.attempt.s = s + cs.attempt.p = &parser{r: s} + return nil +} + +// clientStream implements a client side Stream. +type clientStream struct { + callHdr *transport.CallHdr + opts []CallOption + callInfo *callInfo + cc *ClientConn + desc *StreamDesc + + codec baseCodec + cp Compressor + comp encoding.Compressor + + cancel context.CancelFunc // cancels all attempts + + sentLast bool // sent an end stream + beginTime time.Time + + methodConfig *MethodConfig + + ctx context.Context // the application's context, wrapped by stats/tracing + + retryThrottler *retryThrottler // The throttler active when the RPC began. + + binlog *binarylog.MethodLogger // Binary logger, can be nil. + // serverHeaderBinlogged is a boolean for whether server header has been + // logged. Server header will be logged when the first time one of those + // happens: stream.Header(), stream.Recv(). + // + // It's only read and used by Recv() and Header(), so it doesn't need to be + // synchronized. + serverHeaderBinlogged bool + + mu sync.Mutex + firstAttempt bool // if true, transparent retry is valid + numRetries int // exclusive of transparent retry attempt(s) + numRetriesSincePushback int // retries since pushback; to reset backoff + finished bool // TODO: replace with atomic cmpxchg or sync.Once? + // attempt is the active client stream attempt. + // The only place where it is written is the newAttemptLocked method and this method never writes nil. + // So, attempt can be nil only inside newClientStream function when clientStream is first created. + // One of the first things done after clientStream's creation, is to call newAttemptLocked which either + // assigns a non nil value to the attempt or returns an error. If an error is returned from newAttemptLocked, + // then newClientStream calls finish on the clientStream and returns. So, finish method is the only + // place where we need to check if the attempt is nil. + attempt *csAttempt + // TODO(hedging): hedging will have multiple attempts simultaneously. + committed bool // active attempt committed for retry? + buffer []func(a *csAttempt) error // operations to replay on retry + bufferSize int // current size of buffer +} + +// csAttempt implements a single transport stream attempt within a +// clientStream. +type csAttempt struct { + cs *clientStream + t transport.ClientTransport + s *transport.Stream + p *parser + done func(balancer.DoneInfo) + + finished bool + dc Decompressor + decomp encoding.Compressor + decompSet bool + + mu sync.Mutex // guards trInfo.tr + // trInfo may be nil (if EnableTracing is false). + // trInfo.tr is set when created (if EnableTracing is true), + // and cleared when the finish method is called. + trInfo *traceInfo + + statsHandler stats.Handler +} + +func (cs *clientStream) commitAttemptLocked() { + cs.committed = true + cs.buffer = nil +} + +func (cs *clientStream) commitAttempt() { + cs.mu.Lock() + cs.commitAttemptLocked() + cs.mu.Unlock() +} + +// shouldRetry returns nil if the RPC should be retried; otherwise it returns +// the error that should be returned by the operation. +func (cs *clientStream) shouldRetry(err error) error { + unprocessed := false + if cs.attempt.s == nil { + pioErr, ok := err.(transport.PerformedIOError) + if ok { + // Unwrap error. + err = toRPCErr(pioErr.Err) + } else { + unprocessed = true + } + if !ok && !cs.callInfo.failFast { + // In the event of a non-IO operation error from NewStream, we + // never attempted to write anything to the wire, so we can retry + // indefinitely for non-fail-fast RPCs. + return nil + } + } + if cs.finished || cs.committed { + // RPC is finished or committed; cannot retry. + return err + } + // Wait for the trailers. + if cs.attempt.s != nil { + <-cs.attempt.s.Done() + unprocessed = cs.attempt.s.Unprocessed() + } + if cs.firstAttempt && unprocessed { + // First attempt, stream unprocessed: transparently retry. + return nil + } + if cs.cc.dopts.disableRetry { + return err + } + + pushback := 0 + hasPushback := false + if cs.attempt.s != nil { + if !cs.attempt.s.TrailersOnly() { + return err + } + + // TODO(retry): Move down if the spec changes to not check server pushback + // before considering this a failure for throttling. + sps := cs.attempt.s.Trailer()["grpc-retry-pushback-ms"] + if len(sps) == 1 { + var e error + if pushback, e = strconv.Atoi(sps[0]); e != nil || pushback < 0 { + channelz.Infof(logger, cs.cc.channelzID, "Server retry pushback specified to abort (%q).", sps[0]) + cs.retryThrottler.throttle() // This counts as a failure for throttling. + return err + } + hasPushback = true + } else if len(sps) > 1 { + channelz.Warningf(logger, cs.cc.channelzID, "Server retry pushback specified multiple values (%q); not retrying.", sps) + cs.retryThrottler.throttle() // This counts as a failure for throttling. + return err + } + } + + var code codes.Code + if cs.attempt.s != nil { + code = cs.attempt.s.Status().Code() + } else { + code = status.Convert(err).Code() + } + + rp := cs.methodConfig.retryPolicy + if rp == nil || !rp.retryableStatusCodes[code] { + return err + } + + // Note: the ordering here is important; we count this as a failure + // only if the code matched a retryable code. + if cs.retryThrottler.throttle() { + return err + } + if cs.numRetries+1 >= rp.maxAttempts { + return err + } + + var dur time.Duration + if hasPushback { + dur = time.Millisecond * time.Duration(pushback) + cs.numRetriesSincePushback = 0 + } else { + fact := math.Pow(rp.backoffMultiplier, float64(cs.numRetriesSincePushback)) + cur := float64(rp.initialBackoff) * fact + if max := float64(rp.maxBackoff); cur > max { + cur = max + } + dur = time.Duration(grpcrand.Int63n(int64(cur))) + cs.numRetriesSincePushback++ + } + + // TODO(dfawley): we could eagerly fail here if dur puts us past the + // deadline, but unsure if it is worth doing. + t := time.NewTimer(dur) + select { + case <-t.C: + cs.numRetries++ + return nil + case <-cs.ctx.Done(): + t.Stop() + return status.FromContextError(cs.ctx.Err()).Err() + } +} + +// Returns nil if a retry was performed and succeeded; error otherwise. +func (cs *clientStream) retryLocked(lastErr error) error { + for { + cs.attempt.finish(lastErr) + if err := cs.shouldRetry(lastErr); err != nil { + cs.commitAttemptLocked() + return err + } + cs.firstAttempt = false + if err := cs.newAttemptLocked(nil, nil); err != nil { + return err + } + if lastErr = cs.replayBufferLocked(); lastErr == nil { + return nil + } + } +} + +func (cs *clientStream) Context() context.Context { + cs.commitAttempt() + // No need to lock before using attempt, since we know it is committed and + // cannot change. + return cs.attempt.s.Context() +} + +func (cs *clientStream) withRetry(op func(a *csAttempt) error, onSuccess func()) error { + cs.mu.Lock() + for { + if cs.committed { + cs.mu.Unlock() + return op(cs.attempt) + } + a := cs.attempt + cs.mu.Unlock() + err := op(a) + cs.mu.Lock() + if a != cs.attempt { + // We started another attempt already. + continue + } + if err == io.EOF { + <-a.s.Done() + } + if err == nil || (err == io.EOF && a.s.Status().Code() == codes.OK) { + onSuccess() + cs.mu.Unlock() + return err + } + if err := cs.retryLocked(err); err != nil { + cs.mu.Unlock() + return err + } + } +} + +func (cs *clientStream) Header() (metadata.MD, error) { + var m metadata.MD + err := cs.withRetry(func(a *csAttempt) error { + var err error + m, err = a.s.Header() + return toRPCErr(err) + }, cs.commitAttemptLocked) + if err != nil { + cs.finish(err) + return nil, err + } + if cs.binlog != nil && !cs.serverHeaderBinlogged { + // Only log if binary log is on and header has not been logged. + logEntry := &binarylog.ServerHeader{ + OnClientSide: true, + Header: m, + PeerAddr: nil, + } + if peer, ok := peer.FromContext(cs.Context()); ok { + logEntry.PeerAddr = peer.Addr + } + cs.binlog.Log(logEntry) + cs.serverHeaderBinlogged = true + } + return m, err +} + +func (cs *clientStream) Trailer() metadata.MD { + // On RPC failure, we never need to retry, because usage requires that + // RecvMsg() returned a non-nil error before calling this function is valid. + // We would have retried earlier if necessary. + // + // Commit the attempt anyway, just in case users are not following those + // directions -- it will prevent races and should not meaningfully impact + // performance. + cs.commitAttempt() + if cs.attempt.s == nil { + return nil + } + return cs.attempt.s.Trailer() +} + +func (cs *clientStream) replayBufferLocked() error { + a := cs.attempt + for _, f := range cs.buffer { + if err := f(a); err != nil { + return err + } + } + return nil +} + +func (cs *clientStream) bufferForRetryLocked(sz int, op func(a *csAttempt) error) { + // Note: we still will buffer if retry is disabled (for transparent retries). + if cs.committed { + return + } + cs.bufferSize += sz + if cs.bufferSize > cs.callInfo.maxRetryRPCBufferSize { + cs.commitAttemptLocked() + return + } + cs.buffer = append(cs.buffer, op) +} + +func (cs *clientStream) SendMsg(m interface{}) (err error) { + defer func() { + if err != nil && err != io.EOF { + // Call finish on the client stream for errors generated by this SendMsg + // call, as these indicate problems created by this client. (Transport + // errors are converted to an io.EOF error in csAttempt.sendMsg; the real + // error will be returned from RecvMsg eventually in that case, or be + // retried.) + cs.finish(err) + } + }() + if cs.sentLast { + return status.Errorf(codes.Internal, "SendMsg called after CloseSend") + } + if !cs.desc.ClientStreams { + cs.sentLast = true + } + + // load hdr, payload, data + hdr, payload, data, err := prepareMsg(m, cs.codec, cs.cp, cs.comp) + if err != nil { + return err + } + + // TODO(dfawley): should we be checking len(data) instead? + if len(payload) > *cs.callInfo.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), *cs.callInfo.maxSendMessageSize) + } + msgBytes := data // Store the pointer before setting to nil. For binary logging. + op := func(a *csAttempt) error { + err := a.sendMsg(m, hdr, payload, data) + // nil out the message and uncomp when replaying; they are only needed for + // stats which is disabled for subsequent attempts. + m, data = nil, nil + return err + } + err = cs.withRetry(op, func() { cs.bufferForRetryLocked(len(hdr)+len(payload), op) }) + if cs.binlog != nil && err == nil { + cs.binlog.Log(&binarylog.ClientMessage{ + OnClientSide: true, + Message: msgBytes, + }) + } + return +} + +func (cs *clientStream) RecvMsg(m interface{}) error { + if cs.binlog != nil && !cs.serverHeaderBinlogged { + // Call Header() to binary log header if it's not already logged. + cs.Header() + } + var recvInfo *payloadInfo + if cs.binlog != nil { + recvInfo = &payloadInfo{} + } + err := cs.withRetry(func(a *csAttempt) error { + return a.recvMsg(m, recvInfo) + }, cs.commitAttemptLocked) + if cs.binlog != nil && err == nil { + cs.binlog.Log(&binarylog.ServerMessage{ + OnClientSide: true, + Message: recvInfo.uncompressedBytes, + }) + } + if err != nil || !cs.desc.ServerStreams { + // err != nil or non-server-streaming indicates end of stream. + cs.finish(err) + + if cs.binlog != nil { + // finish will not log Trailer. Log Trailer here. + logEntry := &binarylog.ServerTrailer{ + OnClientSide: true, + Trailer: cs.Trailer(), + Err: err, + } + if logEntry.Err == io.EOF { + logEntry.Err = nil + } + if peer, ok := peer.FromContext(cs.Context()); ok { + logEntry.PeerAddr = peer.Addr + } + cs.binlog.Log(logEntry) + } + } + return err +} + +func (cs *clientStream) CloseSend() error { + if cs.sentLast { + // TODO: return an error and finish the stream instead, due to API misuse? + return nil + } + cs.sentLast = true + op := func(a *csAttempt) error { + a.t.Write(a.s, nil, nil, &transport.Options{Last: true}) + // Always return nil; io.EOF is the only error that might make sense + // instead, but there is no need to signal the client to call RecvMsg + // as the only use left for the stream after CloseSend is to call + // RecvMsg. This also matches historical behavior. + return nil + } + cs.withRetry(op, func() { cs.bufferForRetryLocked(0, op) }) + if cs.binlog != nil { + cs.binlog.Log(&binarylog.ClientHalfClose{ + OnClientSide: true, + }) + } + // We never returned an error here for reasons. + return nil +} + +func (cs *clientStream) finish(err error) { + if err == io.EOF { + // Ending a stream with EOF indicates a success. + err = nil + } + cs.mu.Lock() + if cs.finished { + cs.mu.Unlock() + return + } + cs.finished = true + cs.commitAttemptLocked() + if cs.attempt != nil { + cs.attempt.finish(err) + // after functions all rely upon having a stream. + if cs.attempt.s != nil { + for _, o := range cs.opts { + o.after(cs.callInfo, cs.attempt) + } + } + } + cs.mu.Unlock() + // For binary logging. only log cancel in finish (could be caused by RPC ctx + // canceled or ClientConn closed). Trailer will be logged in RecvMsg. + // + // Only one of cancel or trailer needs to be logged. In the cases where + // users don't call RecvMsg, users must have already canceled the RPC. + if cs.binlog != nil && status.Code(err) == codes.Canceled { + cs.binlog.Log(&binarylog.Cancel{ + OnClientSide: true, + }) + } + if err == nil { + cs.retryThrottler.successfulRPC() + } + if channelz.IsOn() { + if err != nil { + cs.cc.incrCallsFailed() + } else { + cs.cc.incrCallsSucceeded() + } + } + cs.cancel() +} + +func (a *csAttempt) sendMsg(m interface{}, hdr, payld, data []byte) error { + cs := a.cs + if a.trInfo != nil { + a.mu.Lock() + if a.trInfo.tr != nil { + a.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) + } + a.mu.Unlock() + } + if err := a.t.Write(a.s, hdr, payld, &transport.Options{Last: !cs.desc.ClientStreams}); err != nil { + if !cs.desc.ClientStreams { + // For non-client-streaming RPCs, we return nil instead of EOF on error + // because the generated code requires it. finish is not called; RecvMsg() + // will call it with the stream's status independently. + return nil + } + return io.EOF + } + if a.statsHandler != nil { + a.statsHandler.HandleRPC(cs.ctx, outPayload(true, m, data, payld, time.Now())) + } + if channelz.IsOn() { + a.t.IncrMsgSent() + } + return nil +} + +func (a *csAttempt) recvMsg(m interface{}, payInfo *payloadInfo) (err error) { + cs := a.cs + if a.statsHandler != nil && payInfo == nil { + payInfo = &payloadInfo{} + } + + if !a.decompSet { + // Block until we receive headers containing received message encoding. + if ct := a.s.RecvCompress(); ct != "" && ct != encoding.Identity { + if a.dc == nil || a.dc.Type() != ct { + // No configured decompressor, or it does not match the incoming + // message encoding; attempt to find a registered compressor that does. + a.dc = nil + a.decomp = encoding.GetCompressor(ct) + } + } else { + // No compression is used; disable our decompressor. + a.dc = nil + } + // Only initialize this state once per stream. + a.decompSet = true + } + err = recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, payInfo, a.decomp) + if err != nil { + if err == io.EOF { + if statusErr := a.s.Status().Err(); statusErr != nil { + return statusErr + } + return io.EOF // indicates successful end of stream. + } + return toRPCErr(err) + } + if a.trInfo != nil { + a.mu.Lock() + if a.trInfo.tr != nil { + a.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) + } + a.mu.Unlock() + } + if a.statsHandler != nil { + a.statsHandler.HandleRPC(cs.ctx, &stats.InPayload{ + Client: true, + RecvTime: time.Now(), + Payload: m, + // TODO truncate large payload. + Data: payInfo.uncompressedBytes, + WireLength: payInfo.wireLength, + Length: len(payInfo.uncompressedBytes), + }) + } + if channelz.IsOn() { + a.t.IncrMsgRecv() + } + if cs.desc.ServerStreams { + // Subsequent messages should be received by subsequent RecvMsg calls. + return nil + } + // Special handling for non-server-stream rpcs. + // This recv expects EOF or errors, so we don't collect inPayload. + err = recv(a.p, cs.codec, a.s, a.dc, m, *cs.callInfo.maxReceiveMessageSize, nil, a.decomp) + if err == nil { + return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) + } + if err == io.EOF { + return a.s.Status().Err() // non-server streaming Recv returns nil on success + } + return toRPCErr(err) +} + +func (a *csAttempt) finish(err error) { + a.mu.Lock() + if a.finished { + a.mu.Unlock() + return + } + a.finished = true + if err == io.EOF { + // Ending a stream with EOF indicates a success. + err = nil + } + var tr metadata.MD + if a.s != nil { + a.t.CloseStream(a.s, err) + tr = a.s.Trailer() + } + + if a.done != nil { + br := false + if a.s != nil { + br = a.s.BytesReceived() + } + a.done(balancer.DoneInfo{ + Err: err, + Trailer: tr, + BytesSent: a.s != nil, + BytesReceived: br, + ServerLoad: balancerload.Parse(tr), + }) + } + if a.statsHandler != nil { + end := &stats.End{ + Client: true, + BeginTime: a.cs.beginTime, + EndTime: time.Now(), + Trailer: tr, + Error: err, + } + a.statsHandler.HandleRPC(a.cs.ctx, end) + } + if a.trInfo != nil && a.trInfo.tr != nil { + if err == nil { + a.trInfo.tr.LazyPrintf("RPC: [OK]") + } else { + a.trInfo.tr.LazyPrintf("RPC: [%v]", err) + a.trInfo.tr.SetError() + } + a.trInfo.tr.Finish() + a.trInfo.tr = nil + } + a.mu.Unlock() +} + +// newClientStream creates a ClientStream with the specified transport, on the +// given addrConn. +// +// It's expected that the given transport is either the same one in addrConn, or +// is already closed. To avoid race, transport is specified separately, instead +// of using ac.transpot. +// +// Main difference between this and ClientConn.NewStream: +// - no retry +// - no service config (or wait for service config) +// - no tracing or stats +func newNonRetryClientStream(ctx context.Context, desc *StreamDesc, method string, t transport.ClientTransport, ac *addrConn, opts ...CallOption) (_ ClientStream, err error) { + if t == nil { + // TODO: return RPC error here? + return nil, errors.New("transport provided is nil") + } + // defaultCallInfo contains unnecessary info(i.e. failfast, maxRetryRPCBufferSize), so we just initialize an empty struct. + c := &callInfo{} + + // Possible context leak: + // The cancel function for the child context we create will only be called + // when RecvMsg returns a non-nil error, if the ClientConn is closed, or if + // an error is generated by SendMsg. + // https://github.com/grpc/grpc-go/issues/1818. + ctx, cancel := context.WithCancel(ctx) + defer func() { + if err != nil { + cancel() + } + }() + + for _, o := range opts { + if err := o.before(c); err != nil { + return nil, toRPCErr(err) + } + } + c.maxReceiveMessageSize = getMaxSize(nil, c.maxReceiveMessageSize, defaultClientMaxReceiveMessageSize) + c.maxSendMessageSize = getMaxSize(nil, c.maxSendMessageSize, defaultServerMaxSendMessageSize) + if err := setCallInfoCodec(c); err != nil { + return nil, err + } + + callHdr := &transport.CallHdr{ + Host: ac.cc.authority, + Method: method, + ContentSubtype: c.contentSubtype, + } + + // Set our outgoing compression according to the UseCompressor CallOption, if + // set. In that case, also find the compressor from the encoding package. + // Otherwise, use the compressor configured by the WithCompressor DialOption, + // if set. + var cp Compressor + var comp encoding.Compressor + if ct := c.compressorType; ct != "" { + callHdr.SendCompress = ct + if ct != encoding.Identity { + comp = encoding.GetCompressor(ct) + if comp == nil { + return nil, status.Errorf(codes.Internal, "grpc: Compressor is not installed for requested grpc-encoding %q", ct) + } + } + } else if ac.cc.dopts.cp != nil { + callHdr.SendCompress = ac.cc.dopts.cp.Type() + cp = ac.cc.dopts.cp + } + if c.creds != nil { + callHdr.Creds = c.creds + } + + // Use a special addrConnStream to avoid retry. + as := &addrConnStream{ + callHdr: callHdr, + ac: ac, + ctx: ctx, + cancel: cancel, + opts: opts, + callInfo: c, + desc: desc, + codec: c.codec, + cp: cp, + comp: comp, + t: t, + } + + s, err := as.t.NewStream(as.ctx, as.callHdr) + if err != nil { + err = toRPCErr(err) + return nil, err + } + as.s = s + as.p = &parser{r: s} + ac.incrCallsStarted() + if desc != unaryStreamDesc { + // Listen on cc and stream contexts to cleanup when the user closes the + // ClientConn or cancels the stream context. In all other cases, an error + // should already be injected into the recv buffer by the transport, which + // the client will eventually receive, and then we will cancel the stream's + // context in clientStream.finish. + go func() { + select { + case <-ac.ctx.Done(): + as.finish(status.Error(codes.Canceled, "grpc: the SubConn is closing")) + case <-ctx.Done(): + as.finish(toRPCErr(ctx.Err())) + } + }() + } + return as, nil +} + +type addrConnStream struct { + s *transport.Stream + ac *addrConn + callHdr *transport.CallHdr + cancel context.CancelFunc + opts []CallOption + callInfo *callInfo + t transport.ClientTransport + ctx context.Context + sentLast bool + desc *StreamDesc + codec baseCodec + cp Compressor + comp encoding.Compressor + decompSet bool + dc Decompressor + decomp encoding.Compressor + p *parser + mu sync.Mutex + finished bool +} + +func (as *addrConnStream) Header() (metadata.MD, error) { + m, err := as.s.Header() + if err != nil { + as.finish(toRPCErr(err)) + } + return m, err +} + +func (as *addrConnStream) Trailer() metadata.MD { + return as.s.Trailer() +} + +func (as *addrConnStream) CloseSend() error { + if as.sentLast { + // TODO: return an error and finish the stream instead, due to API misuse? + return nil + } + as.sentLast = true + + as.t.Write(as.s, nil, nil, &transport.Options{Last: true}) + // Always return nil; io.EOF is the only error that might make sense + // instead, but there is no need to signal the client to call RecvMsg + // as the only use left for the stream after CloseSend is to call + // RecvMsg. This also matches historical behavior. + return nil +} + +func (as *addrConnStream) Context() context.Context { + return as.s.Context() +} + +func (as *addrConnStream) SendMsg(m interface{}) (err error) { + defer func() { + if err != nil && err != io.EOF { + // Call finish on the client stream for errors generated by this SendMsg + // call, as these indicate problems created by this client. (Transport + // errors are converted to an io.EOF error in csAttempt.sendMsg; the real + // error will be returned from RecvMsg eventually in that case, or be + // retried.) + as.finish(err) + } + }() + if as.sentLast { + return status.Errorf(codes.Internal, "SendMsg called after CloseSend") + } + if !as.desc.ClientStreams { + as.sentLast = true + } + + // load hdr, payload, data + hdr, payld, _, err := prepareMsg(m, as.codec, as.cp, as.comp) + if err != nil { + return err + } + + // TODO(dfawley): should we be checking len(data) instead? + if len(payld) > *as.callInfo.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payld), *as.callInfo.maxSendMessageSize) + } + + if err := as.t.Write(as.s, hdr, payld, &transport.Options{Last: !as.desc.ClientStreams}); err != nil { + if !as.desc.ClientStreams { + // For non-client-streaming RPCs, we return nil instead of EOF on error + // because the generated code requires it. finish is not called; RecvMsg() + // will call it with the stream's status independently. + return nil + } + return io.EOF + } + + if channelz.IsOn() { + as.t.IncrMsgSent() + } + return nil +} + +func (as *addrConnStream) RecvMsg(m interface{}) (err error) { + defer func() { + if err != nil || !as.desc.ServerStreams { + // err != nil or non-server-streaming indicates end of stream. + as.finish(err) + } + }() + + if !as.decompSet { + // Block until we receive headers containing received message encoding. + if ct := as.s.RecvCompress(); ct != "" && ct != encoding.Identity { + if as.dc == nil || as.dc.Type() != ct { + // No configured decompressor, or it does not match the incoming + // message encoding; attempt to find a registered compressor that does. + as.dc = nil + as.decomp = encoding.GetCompressor(ct) + } + } else { + // No compression is used; disable our decompressor. + as.dc = nil + } + // Only initialize this state once per stream. + as.decompSet = true + } + err = recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp) + if err != nil { + if err == io.EOF { + if statusErr := as.s.Status().Err(); statusErr != nil { + return statusErr + } + return io.EOF // indicates successful end of stream. + } + return toRPCErr(err) + } + + if channelz.IsOn() { + as.t.IncrMsgRecv() + } + if as.desc.ServerStreams { + // Subsequent messages should be received by subsequent RecvMsg calls. + return nil + } + + // Special handling for non-server-stream rpcs. + // This recv expects EOF or errors, so we don't collect inPayload. + err = recv(as.p, as.codec, as.s, as.dc, m, *as.callInfo.maxReceiveMessageSize, nil, as.decomp) + if err == nil { + return toRPCErr(errors.New("grpc: client streaming protocol violation: get , want ")) + } + if err == io.EOF { + return as.s.Status().Err() // non-server streaming Recv returns nil on success + } + return toRPCErr(err) +} + +func (as *addrConnStream) finish(err error) { + as.mu.Lock() + if as.finished { + as.mu.Unlock() + return + } + as.finished = true + if err == io.EOF { + // Ending a stream with EOF indicates a success. + err = nil + } + if as.s != nil { + as.t.CloseStream(as.s, err) + } + + if err != nil { + as.ac.incrCallsFailed() + } else { + as.ac.incrCallsSucceeded() + } + as.cancel() + as.mu.Unlock() +} + +// ServerStream defines the server-side behavior of a streaming RPC. +// +// All errors returned from ServerStream methods are compatible with the +// status package. +type ServerStream interface { + // SetHeader sets the header metadata. It may be called multiple times. + // When call multiple times, all the provided metadata will be merged. + // All the metadata will be sent out when one of the following happens: + // - ServerStream.SendHeader() is called; + // - The first response is sent out; + // - An RPC status is sent out (error or success). + SetHeader(metadata.MD) error + // SendHeader sends the header metadata. + // The provided md and headers set by SetHeader() will be sent. + // It fails if called multiple times. + SendHeader(metadata.MD) error + // SetTrailer sets the trailer metadata which will be sent with the RPC status. + // When called more than once, all the provided metadata will be merged. + SetTrailer(metadata.MD) + // Context returns the context for this stream. + Context() context.Context + // SendMsg sends a message. On error, SendMsg aborts the stream and the + // error is returned directly. + // + // SendMsg blocks until: + // - There is sufficient flow control to schedule m with the transport, or + // - The stream is done, or + // - The stream breaks. + // + // SendMsg does not wait until the message is received by the client. An + // untimely stream closure may result in lost messages. + // + // It is safe to have a goroutine calling SendMsg and another goroutine + // calling RecvMsg on the same stream at the same time, but it is not safe + // to call SendMsg on the same stream in different goroutines. + SendMsg(m interface{}) error + // RecvMsg blocks until it receives a message into m or the stream is + // done. It returns io.EOF when the client has performed a CloseSend. On + // any non-EOF error, the stream is aborted and the error contains the + // RPC status. + // + // It is safe to have a goroutine calling SendMsg and another goroutine + // calling RecvMsg on the same stream at the same time, but it is not + // safe to call RecvMsg on the same stream in different goroutines. + RecvMsg(m interface{}) error +} + +// serverStream implements a server side Stream. +type serverStream struct { + ctx context.Context + t transport.ServerTransport + s *transport.Stream + p *parser + codec baseCodec + + cp Compressor + dc Decompressor + comp encoding.Compressor + decomp encoding.Compressor + + maxReceiveMessageSize int + maxSendMessageSize int + trInfo *traceInfo + + statsHandler stats.Handler + + binlog *binarylog.MethodLogger + // serverHeaderBinlogged indicates whether server header has been logged. It + // will happen when one of the following two happens: stream.SendHeader(), + // stream.Send(). + // + // It's only checked in send and sendHeader, doesn't need to be + // synchronized. + serverHeaderBinlogged bool + + mu sync.Mutex // protects trInfo.tr after the service handler runs. +} + +func (ss *serverStream) Context() context.Context { + return ss.ctx +} + +func (ss *serverStream) SetHeader(md metadata.MD) error { + if md.Len() == 0 { + return nil + } + return ss.s.SetHeader(md) +} + +func (ss *serverStream) SendHeader(md metadata.MD) error { + err := ss.t.WriteHeader(ss.s, md) + if ss.binlog != nil && !ss.serverHeaderBinlogged { + h, _ := ss.s.Header() + ss.binlog.Log(&binarylog.ServerHeader{ + Header: h, + }) + ss.serverHeaderBinlogged = true + } + return err +} + +func (ss *serverStream) SetTrailer(md metadata.MD) { + if md.Len() == 0 { + return + } + ss.s.SetTrailer(md) +} + +func (ss *serverStream) SendMsg(m interface{}) (err error) { + defer func() { + if ss.trInfo != nil { + ss.mu.Lock() + if ss.trInfo.tr != nil { + if err == nil { + ss.trInfo.tr.LazyLog(&payload{sent: true, msg: m}, true) + } else { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + } + ss.mu.Unlock() + } + if err != nil && err != io.EOF { + st, _ := status.FromError(toRPCErr(err)) + ss.t.WriteStatus(ss.s, st) + // Non-user specified status was sent out. This should be an error + // case (as a server side Cancel maybe). + // + // This is not handled specifically now. User will return a final + // status from the service handler, we will log that error instead. + // This behavior is similar to an interceptor. + } + if channelz.IsOn() && err == nil { + ss.t.IncrMsgSent() + } + }() + + // load hdr, payload, data + hdr, payload, data, err := prepareMsg(m, ss.codec, ss.cp, ss.comp) + if err != nil { + return err + } + + // TODO(dfawley): should we be checking len(data) instead? + if len(payload) > ss.maxSendMessageSize { + return status.Errorf(codes.ResourceExhausted, "trying to send message larger than max (%d vs. %d)", len(payload), ss.maxSendMessageSize) + } + if err := ss.t.Write(ss.s, hdr, payload, &transport.Options{Last: false}); err != nil { + return toRPCErr(err) + } + if ss.binlog != nil { + if !ss.serverHeaderBinlogged { + h, _ := ss.s.Header() + ss.binlog.Log(&binarylog.ServerHeader{ + Header: h, + }) + ss.serverHeaderBinlogged = true + } + ss.binlog.Log(&binarylog.ServerMessage{ + Message: data, + }) + } + if ss.statsHandler != nil { + ss.statsHandler.HandleRPC(ss.s.Context(), outPayload(false, m, data, payload, time.Now())) + } + return nil +} + +func (ss *serverStream) RecvMsg(m interface{}) (err error) { + defer func() { + if ss.trInfo != nil { + ss.mu.Lock() + if ss.trInfo.tr != nil { + if err == nil { + ss.trInfo.tr.LazyLog(&payload{sent: false, msg: m}, true) + } else if err != io.EOF { + ss.trInfo.tr.LazyLog(&fmtStringer{"%v", []interface{}{err}}, true) + ss.trInfo.tr.SetError() + } + } + ss.mu.Unlock() + } + if err != nil && err != io.EOF { + st, _ := status.FromError(toRPCErr(err)) + ss.t.WriteStatus(ss.s, st) + // Non-user specified status was sent out. This should be an error + // case (as a server side Cancel maybe). + // + // This is not handled specifically now. User will return a final + // status from the service handler, we will log that error instead. + // This behavior is similar to an interceptor. + } + if channelz.IsOn() && err == nil { + ss.t.IncrMsgRecv() + } + }() + var payInfo *payloadInfo + if ss.statsHandler != nil || ss.binlog != nil { + payInfo = &payloadInfo{} + } + if err := recv(ss.p, ss.codec, ss.s, ss.dc, m, ss.maxReceiveMessageSize, payInfo, ss.decomp); err != nil { + if err == io.EOF { + if ss.binlog != nil { + ss.binlog.Log(&binarylog.ClientHalfClose{}) + } + return err + } + if err == io.ErrUnexpectedEOF { + err = status.Errorf(codes.Internal, io.ErrUnexpectedEOF.Error()) + } + return toRPCErr(err) + } + if ss.statsHandler != nil { + ss.statsHandler.HandleRPC(ss.s.Context(), &stats.InPayload{ + RecvTime: time.Now(), + Payload: m, + // TODO truncate large payload. + Data: payInfo.uncompressedBytes, + WireLength: payInfo.wireLength, + Length: len(payInfo.uncompressedBytes), + }) + } + if ss.binlog != nil { + ss.binlog.Log(&binarylog.ClientMessage{ + Message: payInfo.uncompressedBytes, + }) + } + return nil +} + +// MethodFromServerStream returns the method string for the input stream. +// The returned string is in the format of "/service/method". +func MethodFromServerStream(stream ServerStream) (string, bool) { + return Method(stream.Context()) +} + +// prepareMsg returns the hdr, payload and data +// using the compressors passed or using the +// passed preparedmsg +func prepareMsg(m interface{}, codec baseCodec, cp Compressor, comp encoding.Compressor) (hdr, payload, data []byte, err error) { + if preparedMsg, ok := m.(*PreparedMsg); ok { + return preparedMsg.hdr, preparedMsg.payload, preparedMsg.encodedData, nil + } + // The input interface is not a prepared msg. + // Marshal and Compress the data at this point + data, err = encode(codec, m) + if err != nil { + return nil, nil, nil, err + } + compData, err := compress(data, cp, comp) + if err != nil { + return nil, nil, nil, err + } + hdr, payload = msgHeader(data, compData) + return hdr, payload, data, nil +} diff --git a/vendor/google.golang.org/grpc/tap/tap.go b/vendor/google.golang.org/grpc/tap/tap.go new file mode 100644 index 000000000..584360f68 --- /dev/null +++ b/vendor/google.golang.org/grpc/tap/tap.go @@ -0,0 +1,51 @@ +/* + * + * Copyright 2016 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package tap defines the function handles which are executed on the transport +// layer of gRPC-Go and related information. Everything here is EXPERIMENTAL. +package tap + +import ( + "context" +) + +// Info defines the relevant information needed by the handles. +type Info struct { + // FullMethodName is the string of grpc method (in the format of + // /package.service/method). + FullMethodName string + // TODO: More to be added. +} + +// ServerInHandle defines the function which runs before a new stream is created +// on the server side. If it returns a non-nil error, the stream will not be +// created and a RST_STREAM will be sent back to the client with REFUSED_STREAM. +// The client will receive an RPC error "code = Unavailable, desc = stream +// terminated by RST_STREAM with error code: REFUSED_STREAM". +// +// It's intended to be used in situations where you don't want to waste the +// resources to accept the new stream (e.g. rate-limiting). And the content of +// the error will be ignored and won't be sent back to the client. For other +// general usages, please use interceptors. +// +// Note that it is executed in the per-connection I/O goroutine(s) instead of +// per-RPC goroutine. Therefore, users should NOT have any +// blocking/time-consuming work in this handle. Otherwise all the RPCs would +// slow down. Also, for the same reason, this handle won't be called +// concurrently by gRPC. +type ServerInHandle func(ctx context.Context, info *Info) (context.Context, error) diff --git a/vendor/google.golang.org/grpc/trace.go b/vendor/google.golang.org/grpc/trace.go new file mode 100644 index 000000000..07a2d26b3 --- /dev/null +++ b/vendor/google.golang.org/grpc/trace.go @@ -0,0 +1,123 @@ +/* + * + * Copyright 2015 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "bytes" + "fmt" + "io" + "net" + "strings" + "sync" + "time" + + "golang.org/x/net/trace" +) + +// EnableTracing controls whether to trace RPCs using the golang.org/x/net/trace package. +// This should only be set before any RPCs are sent or received by this program. +var EnableTracing bool + +// methodFamily returns the trace family for the given method. +// It turns "/pkg.Service/GetFoo" into "pkg.Service". +func methodFamily(m string) string { + m = strings.TrimPrefix(m, "/") // remove leading slash + if i := strings.Index(m, "/"); i >= 0 { + m = m[:i] // remove everything from second slash + } + return m +} + +// traceInfo contains tracing information for an RPC. +type traceInfo struct { + tr trace.Trace + firstLine firstLine +} + +// firstLine is the first line of an RPC trace. +// It may be mutated after construction; remoteAddr specifically may change +// during client-side use. +type firstLine struct { + mu sync.Mutex + client bool // whether this is a client (outgoing) RPC + remoteAddr net.Addr + deadline time.Duration // may be zero +} + +func (f *firstLine) SetRemoteAddr(addr net.Addr) { + f.mu.Lock() + f.remoteAddr = addr + f.mu.Unlock() +} + +func (f *firstLine) String() string { + f.mu.Lock() + defer f.mu.Unlock() + + var line bytes.Buffer + io.WriteString(&line, "RPC: ") + if f.client { + io.WriteString(&line, "to") + } else { + io.WriteString(&line, "from") + } + fmt.Fprintf(&line, " %v deadline:", f.remoteAddr) + if f.deadline != 0 { + fmt.Fprint(&line, f.deadline) + } else { + io.WriteString(&line, "none") + } + return line.String() +} + +const truncateSize = 100 + +func truncate(x string, l int) string { + if l > len(x) { + return x + } + return x[:l] +} + +// payload represents an RPC request or response payload. +type payload struct { + sent bool // whether this is an outgoing payload + msg interface{} // e.g. a proto.Message + // TODO(dsymonds): add stringifying info to codec, and limit how much we hold here? +} + +func (p payload) String() string { + if p.sent { + return truncate(fmt.Sprintf("sent: %v", p.msg), truncateSize) + } + return truncate(fmt.Sprintf("recv: %v", p.msg), truncateSize) +} + +type fmtStringer struct { + format string + a []interface{} +} + +func (f *fmtStringer) String() string { + return fmt.Sprintf(f.format, f.a...) +} + +type stringer string + +func (s stringer) String() string { return string(s) } diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go new file mode 100644 index 000000000..de387f7b8 --- /dev/null +++ b/vendor/google.golang.org/grpc/version.go @@ -0,0 +1,22 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +// Version is the current grpc version. +const Version = "1.31.1" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh new file mode 100644 index 000000000..8b7dff19a --- /dev/null +++ b/vendor/google.golang.org/grpc/vet.sh @@ -0,0 +1,190 @@ +#!/bin/bash + +set -ex # Exit on error; debugging enabled. +set -o pipefail # Fail a pipe if any sub-command fails. + +# not makes sure the command passed to it does not exit with a return code of 0. +not() { + # This is required instead of the earlier (! $COMMAND) because subshells and + # pipefail don't work the same on Darwin as in Linux. + ! "$@" +} + +die() { + echo "$@" >&2 + exit 1 +} + +fail_on_output() { + tee /dev/stderr | not read +} + +# Check to make sure it's safe to modify the user's git repo. +git status --porcelain | fail_on_output + +# Undo any edits made by this script. +cleanup() { + git reset --hard HEAD +} +trap cleanup EXIT + +PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}" + +if [[ "$1" = "-install" ]]; then + # Check for module support + if go help mod >& /dev/null; then + # Install the pinned versions as defined in module tools. + pushd ./test/tools + go install \ + golang.org/x/lint/golint \ + golang.org/x/tools/cmd/goimports \ + honnef.co/go/tools/cmd/staticcheck \ + github.com/client9/misspell/cmd/misspell + popd + else + # Ye olde `go get` incantation. + # Note: this gets the latest version of all tools (vs. the pinned versions + # with Go modules). + go get -u \ + golang.org/x/lint/golint \ + golang.org/x/tools/cmd/goimports \ + honnef.co/go/tools/cmd/staticcheck \ + github.com/client9/misspell/cmd/misspell + fi + if [[ -z "${VET_SKIP_PROTO}" ]]; then + if [[ "${TRAVIS}" = "true" ]]; then + PROTOBUF_VERSION=3.3.0 + PROTOC_FILENAME=protoc-${PROTOBUF_VERSION}-linux-x86_64.zip + pushd /home/travis + wget https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/${PROTOC_FILENAME} + unzip ${PROTOC_FILENAME} + bin/protoc --version + popd + elif not which protoc > /dev/null; then + die "Please install protoc into your path" + fi + fi + exit 0 +elif [[ "$#" -ne 0 ]]; then + die "Unknown argument(s): $*" +fi + +# - Ensure all source files contain a copyright message. +not git grep -L "\(Copyright [0-9]\{4,\} gRPC authors\)\|DO NOT EDIT" -- '*.go' + +# - Make sure all tests in grpc and grpc/test use leakcheck via Teardown. +not grep 'func Test[^(]' *_test.go +not grep 'func Test[^(]' test/*.go + +# - Do not import x/net/context. +not git grep -l 'x/net/context' -- "*.go" + +# - Do not import math/rand for real library code. Use internal/grpcrand for +# thread safety. +git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^stress\|grpcrand\|^benchmark\|wrr_test' + +# - Ensure all ptypes proto packages are renamed when importing. +not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go" + +# - Ensure all xds proto imports are renamed to *pb or *grpc. +git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' | not grep -v 'pb "\|grpc "' + +# - Check imports that are illegal in appengine (until Go 1.11). +# TODO: Remove when we drop Go 1.10 support +go list -f {{.Dir}} ./... | xargs go run test/go_vet/vet.go + +# - gofmt, goimports, golint (with exceptions for generated code), go vet. +gofmt -s -d -l . 2>&1 | fail_on_output +goimports -l . 2>&1 | not grep -vE "(_mock|\.pb)\.go" +golint ./... 2>&1 | not grep -vE "(_mock|\.pb)\.go:" +go vet -all ./... + +misspell -error . + +# - Check that generated proto files are up to date. +if [[ -z "${VET_SKIP_PROTO}" ]]; then + PATH="/home/travis/bin:${PATH}" make proto && \ + git status --porcelain 2>&1 | fail_on_output || \ + (git status; git --no-pager diff; exit 1) +fi + +# - Check that our modules are tidy. +if go help mod >& /dev/null; then + find . -name 'go.mod' | xargs -IXXX bash -c 'cd $(dirname XXX); go mod tidy' + git status --porcelain 2>&1 | fail_on_output || \ + (git status; git --no-pager diff; exit 1) +fi + +# - Collection of static analysis checks +# +# TODO(dfawley): don't use deprecated functions in examples or first-party +# plugins. +SC_OUT="$(mktemp)" +staticcheck -go 1.9 -checks 'inherit,-ST1015' ./... > "${SC_OUT}" || true +# Error if anything other than deprecation warnings are printed. +not grep -v "is deprecated:.*SA1019" "${SC_OUT}" +# Only ignore the following deprecated types/fields/functions. +not grep -Fv '.CredsBundle +.HeaderMap +.Metadata is deprecated: use Attributes +.NewAddress +.NewServiceConfig +.Type is deprecated: use Attributes +balancer.ErrTransientFailure +balancer.Picker +grpc.CallCustomCodec +grpc.Code +grpc.Compressor +grpc.CustomCodec +grpc.Decompressor +grpc.MaxMsgSize +grpc.MethodConfig +grpc.NewGZIPCompressor +grpc.NewGZIPDecompressor +grpc.RPCCompressor +grpc.RPCDecompressor +grpc.ServiceConfig +grpc.WithBalancerName +grpc.WithCompressor +grpc.WithDecompressor +grpc.WithDialer +grpc.WithMaxMsgSize +grpc.WithServiceConfig +grpc.WithTimeout +http.CloseNotifier +info.SecurityVersion +resolver.Backend +resolver.GRPCLB' "${SC_OUT}" + +# - special golint on package comments. +lint_package_comment_per_package() { + # Number of files in this go package. + fileCount=$(go list -f '{{len .GoFiles}}' $1) + if [ ${fileCount} -eq 0 ]; then + return 0 + fi + # Number of package errors generated by golint. + lintPackageCommentErrorsCount=$(golint --min_confidence 0 $1 | grep -c "should have a package comment") + # golint complains about every file that's missing the package comment. If the + # number of files for this package is greater than the number of errors, there's + # at least one file with package comment, good. Otherwise, fail. + if [ ${fileCount} -le ${lintPackageCommentErrorsCount} ]; then + echo "Package $1 (with ${fileCount} files) is missing package comment" + return 1 + fi +} +lint_package_comment() { + set +ex + + count=0 + for i in $(go list ./...); do + lint_package_comment_per_package "$i" + ((count += $?)) + done + + set -ex + return $count +} +lint_package_comment + +echo SUCCESS diff --git a/vendor/gopkg.in/fsnotify.v1/.editorconfig b/vendor/gopkg.in/fsnotify.v1/.editorconfig deleted file mode 100644 index ba49e3c23..000000000 --- a/vendor/gopkg.in/fsnotify.v1/.editorconfig +++ /dev/null @@ -1,5 +0,0 @@ -root = true - -[*] -indent_style = tab -indent_size = 4 diff --git a/vendor/gopkg.in/fsnotify.v1/.gitignore b/vendor/gopkg.in/fsnotify.v1/.gitignore deleted file mode 100644 index 4cd0cbaf4..000000000 --- a/vendor/gopkg.in/fsnotify.v1/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -# Setup a Global .gitignore for OS and editor generated files: -# https://help.github.com/articles/ignoring-files -# git config --global core.excludesfile ~/.gitignore_global - -.vagrant -*.sublime-project diff --git a/vendor/gopkg.in/fsnotify.v1/.travis.yml b/vendor/gopkg.in/fsnotify.v1/.travis.yml deleted file mode 100644 index 981d1bb81..000000000 --- a/vendor/gopkg.in/fsnotify.v1/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: false -language: go - -go: - - 1.8.x - - 1.9.x - - tip - -matrix: - allow_failures: - - go: tip - fast_finish: true - -before_script: - - go get -u github.com/golang/lint/golint - -script: - - go test -v --race ./... - -after_script: - - test -z "$(gofmt -s -l -w . | tee /dev/stderr)" - - test -z "$(golint ./... | tee /dev/stderr)" - - go vet ./... - -os: - - linux - - osx - -notifications: - email: false diff --git a/vendor/gopkg.in/fsnotify.v1/AUTHORS b/vendor/gopkg.in/fsnotify.v1/AUTHORS deleted file mode 100644 index 5ab5d41c5..000000000 --- a/vendor/gopkg.in/fsnotify.v1/AUTHORS +++ /dev/null @@ -1,52 +0,0 @@ -# Names should be added to this file as -# Name or Organization -# The email address is not required for organizations. - -# You can update this list using the following command: -# -# $ git shortlog -se | awk '{print $2 " " $3 " " $4}' - -# Please keep the list sorted. - -Aaron L -Adrien Bustany -Amit Krishnan -Anmol Sethi -Bjørn Erik Pedersen -Bruno Bigras -Caleb Spare -Case Nelson -Chris Howey -Christoffer Buchholz -Daniel Wagner-Hall -Dave Cheney -Evan Phoenix -Francisco Souza -Hari haran -John C Barstow -Kelvin Fo -Ken-ichirou MATSUZAWA -Matt Layher -Nathan Youngman -Nickolai Zeldovich -Patrick -Paul Hammond -Pawel Knap -Pieter Droogendijk -Pursuit92 -Riku Voipio -Rob Figueiredo -Rodrigo Chiossi -Slawek Ligus -Soge Zhang -Tiffany Jernigan -Tilak Sharma -Tom Payne -Travis Cline -Tudor Golubenco -Vahe Khachikyan -Yukang -bronze1man -debrando -henrikedwards -铁哥 diff --git a/vendor/gopkg.in/fsnotify.v1/CHANGELOG.md b/vendor/gopkg.in/fsnotify.v1/CHANGELOG.md deleted file mode 100644 index be4d7ea2c..000000000 --- a/vendor/gopkg.in/fsnotify.v1/CHANGELOG.md +++ /dev/null @@ -1,317 +0,0 @@ -# Changelog - -## v1.4.7 / 2018-01-09 - -* BSD/macOS: Fix possible deadlock on closing the watcher on kqueue (thanks @nhooyr and @glycerine) -* Tests: Fix missing verb on format string (thanks @rchiossi) -* Linux: Fix deadlock in Remove (thanks @aarondl) -* Linux: Watch.Add improvements (avoid race, fix consistency, reduce garbage) (thanks @twpayne) -* Docs: Moved FAQ into the README (thanks @vahe) -* Linux: Properly handle inotify's IN_Q_OVERFLOW event (thanks @zeldovich) -* Docs: replace references to OS X with macOS - -## v1.4.2 / 2016-10-10 - -* Linux: use InotifyInit1 with IN_CLOEXEC to stop leaking a file descriptor to a child process when using fork/exec [#178](https://github.com/fsnotify/fsnotify/pull/178) (thanks @pattyshack) - -## v1.4.1 / 2016-10-04 - -* Fix flaky inotify stress test on Linux [#177](https://github.com/fsnotify/fsnotify/pull/177) (thanks @pattyshack) - -## v1.4.0 / 2016-10-01 - -* add a String() method to Event.Op [#165](https://github.com/fsnotify/fsnotify/pull/165) (thanks @oozie) - -## v1.3.1 / 2016-06-28 - -* Windows: fix for double backslash when watching the root of a drive [#151](https://github.com/fsnotify/fsnotify/issues/151) (thanks @brunoqc) - -## v1.3.0 / 2016-04-19 - -* Support linux/arm64 by [patching](https://go-review.googlesource.com/#/c/21971/) x/sys/unix and switching to to it from syscall (thanks @suihkulokki) [#135](https://github.com/fsnotify/fsnotify/pull/135) - -## v1.2.10 / 2016-03-02 - -* Fix golint errors in windows.go [#121](https://github.com/fsnotify/fsnotify/pull/121) (thanks @tiffanyfj) - -## v1.2.9 / 2016-01-13 - -kqueue: Fix logic for CREATE after REMOVE [#111](https://github.com/fsnotify/fsnotify/pull/111) (thanks @bep) - -## v1.2.8 / 2015-12-17 - -* kqueue: fix race condition in Close [#105](https://github.com/fsnotify/fsnotify/pull/105) (thanks @djui for reporting the issue and @ppknap for writing a failing test) -* inotify: fix race in test -* enable race detection for continuous integration (Linux, Mac, Windows) - -## v1.2.5 / 2015-10-17 - -* inotify: use epoll_create1 for arm64 support (requires Linux 2.6.27 or later) [#100](https://github.com/fsnotify/fsnotify/pull/100) (thanks @suihkulokki) -* inotify: fix path leaks [#73](https://github.com/fsnotify/fsnotify/pull/73) (thanks @chamaken) -* kqueue: watch for rename events on subdirectories [#83](https://github.com/fsnotify/fsnotify/pull/83) (thanks @guotie) -* kqueue: avoid infinite loops from symlinks cycles [#101](https://github.com/fsnotify/fsnotify/pull/101) (thanks @illicitonion) - -## v1.2.1 / 2015-10-14 - -* kqueue: don't watch named pipes [#98](https://github.com/fsnotify/fsnotify/pull/98) (thanks @evanphx) - -## v1.2.0 / 2015-02-08 - -* inotify: use epoll to wake up readEvents [#66](https://github.com/fsnotify/fsnotify/pull/66) (thanks @PieterD) -* inotify: closing watcher should now always shut down goroutine [#63](https://github.com/fsnotify/fsnotify/pull/63) (thanks @PieterD) -* kqueue: close kqueue after removing watches, fixes [#59](https://github.com/fsnotify/fsnotify/issues/59) - -## v1.1.1 / 2015-02-05 - -* inotify: Retry read on EINTR [#61](https://github.com/fsnotify/fsnotify/issues/61) (thanks @PieterD) - -## v1.1.0 / 2014-12-12 - -* kqueue: rework internals [#43](https://github.com/fsnotify/fsnotify/pull/43) - * add low-level functions - * only need to store flags on directories - * less mutexes [#13](https://github.com/fsnotify/fsnotify/issues/13) - * done can be an unbuffered channel - * remove calls to os.NewSyscallError -* More efficient string concatenation for Event.String() [#52](https://github.com/fsnotify/fsnotify/pull/52) (thanks @mdlayher) -* kqueue: fix regression in rework causing subdirectories to be watched [#48](https://github.com/fsnotify/fsnotify/issues/48) -* kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) - -## v1.0.4 / 2014-09-07 - -* kqueue: add dragonfly to the build tags. -* Rename source code files, rearrange code so exported APIs are at the top. -* Add done channel to example code. [#37](https://github.com/fsnotify/fsnotify/pull/37) (thanks @chenyukang) - -## v1.0.3 / 2014-08-19 - -* [Fix] Windows MOVED_TO now translates to Create like on BSD and Linux. [#36](https://github.com/fsnotify/fsnotify/issues/36) - -## v1.0.2 / 2014-08-17 - -* [Fix] Missing create events on macOS. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) -* [Fix] Make ./path and path equivalent. (thanks @zhsso) - -## v1.0.0 / 2014-08-15 - -* [API] Remove AddWatch on Windows, use Add. -* Improve documentation for exported identifiers. [#30](https://github.com/fsnotify/fsnotify/issues/30) -* Minor updates based on feedback from golint. - -## dev / 2014-07-09 - -* Moved to [github.com/fsnotify/fsnotify](https://github.com/fsnotify/fsnotify). -* Use os.NewSyscallError instead of returning errno (thanks @hariharan-uno) - -## dev / 2014-07-04 - -* kqueue: fix incorrect mutex used in Close() -* Update example to demonstrate usage of Op. - -## dev / 2014-06-28 - -* [API] Don't set the Write Op for attribute notifications [#4](https://github.com/fsnotify/fsnotify/issues/4) -* Fix for String() method on Event (thanks Alex Brainman) -* Don't build on Plan 9 or Solaris (thanks @4ad) - -## dev / 2014-06-21 - -* Events channel of type Event rather than *Event. -* [internal] use syscall constants directly for inotify and kqueue. -* [internal] kqueue: rename events to kevents and fileEvent to event. - -## dev / 2014-06-19 - -* Go 1.3+ required on Windows (uses syscall.ERROR_MORE_DATA internally). -* [internal] remove cookie from Event struct (unused). -* [internal] Event struct has the same definition across every OS. -* [internal] remove internal watch and removeWatch methods. - -## dev / 2014-06-12 - -* [API] Renamed Watch() to Add() and RemoveWatch() to Remove(). -* [API] Pluralized channel names: Events and Errors. -* [API] Renamed FileEvent struct to Event. -* [API] Op constants replace methods like IsCreate(). - -## dev / 2014-06-12 - -* Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) - -## dev / 2014-05-23 - -* [API] Remove current implementation of WatchFlags. - * current implementation doesn't take advantage of OS for efficiency - * provides little benefit over filtering events as they are received, but has extra bookkeeping and mutexes - * no tests for the current implementation - * not fully implemented on Windows [#93](https://github.com/howeyc/fsnotify/issues/93#issuecomment-39285195) - -## v0.9.3 / 2014-12-31 - -* kqueue: cleanup internal watch before sending remove event [#51](https://github.com/fsnotify/fsnotify/issues/51) - -## v0.9.2 / 2014-08-17 - -* [Backport] Fix missing create events on macOS. [#14](https://github.com/fsnotify/fsnotify/issues/14) (thanks @zhsso) - -## v0.9.1 / 2014-06-12 - -* Fix data race on kevent buffer (thanks @tilaks) [#98](https://github.com/howeyc/fsnotify/pull/98) - -## v0.9.0 / 2014-01-17 - -* IsAttrib() for events that only concern a file's metadata [#79][] (thanks @abustany) -* [Fix] kqueue: fix deadlock [#77][] (thanks @cespare) -* [NOTICE] Development has moved to `code.google.com/p/go.exp/fsnotify` in preparation for inclusion in the Go standard library. - -## v0.8.12 / 2013-11-13 - -* [API] Remove FD_SET and friends from Linux adapter - -## v0.8.11 / 2013-11-02 - -* [Doc] Add Changelog [#72][] (thanks @nathany) -* [Doc] Spotlight and double modify events on macOS [#62][] (reported by @paulhammond) - -## v0.8.10 / 2013-10-19 - -* [Fix] kqueue: remove file watches when parent directory is removed [#71][] (reported by @mdwhatcott) -* [Fix] kqueue: race between Close and readEvents [#70][] (reported by @bernerdschaefer) -* [Doc] specify OS-specific limits in README (thanks @debrando) - -## v0.8.9 / 2013-09-08 - -* [Doc] Contributing (thanks @nathany) -* [Doc] update package path in example code [#63][] (thanks @paulhammond) -* [Doc] GoCI badge in README (Linux only) [#60][] -* [Doc] Cross-platform testing with Vagrant [#59][] (thanks @nathany) - -## v0.8.8 / 2013-06-17 - -* [Fix] Windows: handle `ERROR_MORE_DATA` on Windows [#49][] (thanks @jbowtie) - -## v0.8.7 / 2013-06-03 - -* [API] Make syscall flags internal -* [Fix] inotify: ignore event changes -* [Fix] race in symlink test [#45][] (reported by @srid) -* [Fix] tests on Windows -* lower case error messages - -## v0.8.6 / 2013-05-23 - -* kqueue: Use EVT_ONLY flag on Darwin -* [Doc] Update README with full example - -## v0.8.5 / 2013-05-09 - -* [Fix] inotify: allow monitoring of "broken" symlinks (thanks @tsg) - -## v0.8.4 / 2013-04-07 - -* [Fix] kqueue: watch all file events [#40][] (thanks @ChrisBuchholz) - -## v0.8.3 / 2013-03-13 - -* [Fix] inoitfy/kqueue memory leak [#36][] (reported by @nbkolchin) -* [Fix] kqueue: use fsnFlags for watching a directory [#33][] (reported by @nbkolchin) - -## v0.8.2 / 2013-02-07 - -* [Doc] add Authors -* [Fix] fix data races for map access [#29][] (thanks @fsouza) - -## v0.8.1 / 2013-01-09 - -* [Fix] Windows path separators -* [Doc] BSD License - -## v0.8.0 / 2012-11-09 - -* kqueue: directory watching improvements (thanks @vmirage) -* inotify: add `IN_MOVED_TO` [#25][] (requested by @cpisto) -* [Fix] kqueue: deleting watched directory [#24][] (reported by @jakerr) - -## v0.7.4 / 2012-10-09 - -* [Fix] inotify: fixes from https://codereview.appspot.com/5418045/ (ugorji) -* [Fix] kqueue: preserve watch flags when watching for delete [#21][] (reported by @robfig) -* [Fix] kqueue: watch the directory even if it isn't a new watch (thanks @robfig) -* [Fix] kqueue: modify after recreation of file - -## v0.7.3 / 2012-09-27 - -* [Fix] kqueue: watch with an existing folder inside the watched folder (thanks @vmirage) -* [Fix] kqueue: no longer get duplicate CREATE events - -## v0.7.2 / 2012-09-01 - -* kqueue: events for created directories - -## v0.7.1 / 2012-07-14 - -* [Fix] for renaming files - -## v0.7.0 / 2012-07-02 - -* [Feature] FSNotify flags -* [Fix] inotify: Added file name back to event path - -## v0.6.0 / 2012-06-06 - -* kqueue: watch files after directory created (thanks @tmc) - -## v0.5.1 / 2012-05-22 - -* [Fix] inotify: remove all watches before Close() - -## v0.5.0 / 2012-05-03 - -* [API] kqueue: return errors during watch instead of sending over channel -* kqueue: match symlink behavior on Linux -* inotify: add `DELETE_SELF` (requested by @taralx) -* [Fix] kqueue: handle EINTR (reported by @robfig) -* [Doc] Godoc example [#1][] (thanks @davecheney) - -## v0.4.0 / 2012-03-30 - -* Go 1 released: build with go tool -* [Feature] Windows support using winfsnotify -* Windows does not have attribute change notifications -* Roll attribute notifications into IsModify - -## v0.3.0 / 2012-02-19 - -* kqueue: add files when watch directory - -## v0.2.0 / 2011-12-30 - -* update to latest Go weekly code - -## v0.1.0 / 2011-10-19 - -* kqueue: add watch on file creation to match inotify -* kqueue: create file event -* inotify: ignore `IN_IGNORED` events -* event String() -* linux: common FileEvent functions -* initial commit - -[#79]: https://github.com/howeyc/fsnotify/pull/79 -[#77]: https://github.com/howeyc/fsnotify/pull/77 -[#72]: https://github.com/howeyc/fsnotify/issues/72 -[#71]: https://github.com/howeyc/fsnotify/issues/71 -[#70]: https://github.com/howeyc/fsnotify/issues/70 -[#63]: https://github.com/howeyc/fsnotify/issues/63 -[#62]: https://github.com/howeyc/fsnotify/issues/62 -[#60]: https://github.com/howeyc/fsnotify/issues/60 -[#59]: https://github.com/howeyc/fsnotify/issues/59 -[#49]: https://github.com/howeyc/fsnotify/issues/49 -[#45]: https://github.com/howeyc/fsnotify/issues/45 -[#40]: https://github.com/howeyc/fsnotify/issues/40 -[#36]: https://github.com/howeyc/fsnotify/issues/36 -[#33]: https://github.com/howeyc/fsnotify/issues/33 -[#29]: https://github.com/howeyc/fsnotify/issues/29 -[#25]: https://github.com/howeyc/fsnotify/issues/25 -[#24]: https://github.com/howeyc/fsnotify/issues/24 -[#21]: https://github.com/howeyc/fsnotify/issues/21 diff --git a/vendor/gopkg.in/fsnotify.v1/CONTRIBUTING.md b/vendor/gopkg.in/fsnotify.v1/CONTRIBUTING.md deleted file mode 100644 index 828a60b24..000000000 --- a/vendor/gopkg.in/fsnotify.v1/CONTRIBUTING.md +++ /dev/null @@ -1,77 +0,0 @@ -# Contributing - -## Issues - -* Request features and report bugs using the [GitHub Issue Tracker](https://github.com/fsnotify/fsnotify/issues). -* Please indicate the platform you are using fsnotify on. -* A code example to reproduce the problem is appreciated. - -## Pull Requests - -### Contributor License Agreement - -fsnotify is derived from code in the [golang.org/x/exp](https://godoc.org/golang.org/x/exp) package and it may be included [in the standard library](https://github.com/fsnotify/fsnotify/issues/1) in the future. Therefore fsnotify carries the same [LICENSE](https://github.com/fsnotify/fsnotify/blob/master/LICENSE) as Go. Contributors retain their copyright, so you need to fill out a short form before we can accept your contribution: [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual). - -Please indicate that you have signed the CLA in your pull request. - -### How fsnotify is Developed - -* Development is done on feature branches. -* Tests are run on BSD, Linux, macOS and Windows. -* Pull requests are reviewed and [applied to master][am] using [hub][]. - * Maintainers may modify or squash commits rather than asking contributors to. -* To issue a new release, the maintainers will: - * Update the CHANGELOG - * Tag a version, which will become available through gopkg.in. - -### How to Fork - -For smooth sailing, always use the original import path. Installing with `go get` makes this easy. - -1. Install from GitHub (`go get -u github.com/fsnotify/fsnotify`) -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Ensure everything works and the tests pass (see below) -4. Commit your changes (`git commit -am 'Add some feature'`) - -Contribute upstream: - -1. Fork fsnotify on GitHub -2. Add your remote (`git remote add fork git@github.com:mycompany/repo.git`) -3. Push to the branch (`git push fork my-new-feature`) -4. Create a new Pull Request on GitHub - -This workflow is [thoroughly explained by Katrina Owen](https://splice.com/blog/contributing-open-source-git-repositories-go/). - -### Testing - -fsnotify uses build tags to compile different code on Linux, BSD, macOS, and Windows. - -Before doing a pull request, please do your best to test your changes on multiple platforms, and list which platforms you were able/unable to test on. - -To aid in cross-platform testing there is a Vagrantfile for Linux and BSD. - -* Install [Vagrant](http://www.vagrantup.com/) and [VirtualBox](https://www.virtualbox.org/) -* Setup [Vagrant Gopher](https://github.com/nathany/vagrant-gopher) in your `src` folder. -* Run `vagrant up` from the project folder. You can also setup just one box with `vagrant up linux` or `vagrant up bsd` (note: the BSD box doesn't support Windows hosts at this time, and NFS may prompt for your host OS password) -* Once setup, you can run the test suite on a given OS with a single command `vagrant ssh linux -c 'cd fsnotify/fsnotify; go test'`. -* When you're done, you will want to halt or destroy the Vagrant boxes. - -Notice: fsnotify file system events won't trigger in shared folders. The tests get around this limitation by using the /tmp directory. - -Right now there is no equivalent solution for Windows and macOS, but there are Windows VMs [freely available from Microsoft](http://www.modern.ie/en-us/virtualization-tools#downloads). - -### Maintainers - -Help maintaining fsnotify is welcome. To be a maintainer: - -* Submit a pull request and sign the CLA as above. -* You must be able to run the test suite on Mac, Windows, Linux and BSD. - -To keep master clean, the fsnotify project uses the "apply mail" workflow outlined in Nathaniel Talbott's post ["Merge pull request" Considered Harmful][am]. This requires installing [hub][]. - -All code changes should be internal pull requests. - -Releases are tagged using [Semantic Versioning](http://semver.org/). - -[hub]: https://github.com/github/hub -[am]: http://blog.spreedly.com/2014/06/24/merge-pull-request-considered-harmful/#.VGa5yZPF_Zs diff --git a/vendor/gopkg.in/fsnotify.v1/LICENSE b/vendor/gopkg.in/fsnotify.v1/LICENSE deleted file mode 100644 index f21e54080..000000000 --- a/vendor/gopkg.in/fsnotify.v1/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. -Copyright (c) 2012 fsnotify Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following disclaimer -in the documentation and/or other materials provided with the -distribution. - * Neither the name of Google Inc. nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/gopkg.in/fsnotify.v1/README.md b/vendor/gopkg.in/fsnotify.v1/README.md deleted file mode 100644 index 399320741..000000000 --- a/vendor/gopkg.in/fsnotify.v1/README.md +++ /dev/null @@ -1,79 +0,0 @@ -# File system notifications for Go - -[![GoDoc](https://godoc.org/github.com/fsnotify/fsnotify?status.svg)](https://godoc.org/github.com/fsnotify/fsnotify) [![Go Report Card](https://goreportcard.com/badge/github.com/fsnotify/fsnotify)](https://goreportcard.com/report/github.com/fsnotify/fsnotify) - -fsnotify utilizes [golang.org/x/sys](https://godoc.org/golang.org/x/sys) rather than `syscall` from the standard library. Ensure you have the latest version installed by running: - -```console -go get -u golang.org/x/sys/... -``` - -Cross platform: Windows, Linux, BSD and macOS. - -|Adapter |OS |Status | -|----------|----------|----------| -|inotify |Linux 2.6.27 or later, Android\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| -|kqueue |BSD, macOS, iOS\*|Supported [![Build Status](https://travis-ci.org/fsnotify/fsnotify.svg?branch=master)](https://travis-ci.org/fsnotify/fsnotify)| -|ReadDirectoryChangesW|Windows|Supported [![Build status](https://ci.appveyor.com/api/projects/status/ivwjubaih4r0udeh/branch/master?svg=true)](https://ci.appveyor.com/project/NathanYoungman/fsnotify/branch/master)| -|FSEvents |macOS |[Planned](https://github.com/fsnotify/fsnotify/issues/11)| -|FEN |Solaris 11 |[In Progress](https://github.com/fsnotify/fsnotify/issues/12)| -|fanotify |Linux 2.6.37+ | | -|USN Journals |Windows |[Maybe](https://github.com/fsnotify/fsnotify/issues/53)| -|Polling |*All* |[Maybe](https://github.com/fsnotify/fsnotify/issues/9)| - -\* Android and iOS are untested. - -Please see [the documentation](https://godoc.org/github.com/fsnotify/fsnotify) and consult the [FAQ](#faq) for usage information. - -## API stability - -fsnotify is a fork of [howeyc/fsnotify](https://godoc.org/github.com/howeyc/fsnotify) with a new API as of v1.0. The API is based on [this design document](http://goo.gl/MrYxyA). - -All [releases](https://github.com/fsnotify/fsnotify/releases) are tagged based on [Semantic Versioning](http://semver.org/). Further API changes are [planned](https://github.com/fsnotify/fsnotify/milestones), and will be tagged with a new major revision number. - -Go 1.6 supports dependencies located in the `vendor/` folder. Unless you are creating a library, it is recommended that you copy fsnotify into `vendor/github.com/fsnotify/fsnotify` within your project, and likewise for `golang.org/x/sys`. - -## Contributing - -Please refer to [CONTRIBUTING][] before opening an issue or pull request. - -## Example - -See [example_test.go](https://github.com/fsnotify/fsnotify/blob/master/example_test.go). - -## FAQ - -**When a file is moved to another directory is it still being watched?** - -No (it shouldn't be, unless you are watching where it was moved to). - -**When I watch a directory, are all subdirectories watched as well?** - -No, you must add watches for any directory you want to watch (a recursive watcher is on the roadmap [#18][]). - -**Do I have to watch the Error and Event channels in a separate goroutine?** - -As of now, yes. Looking into making this single-thread friendly (see [howeyc #7][#7]) - -**Why am I receiving multiple events for the same file on OS X?** - -Spotlight indexing on OS X can result in multiple events (see [howeyc #62][#62]). A temporary workaround is to add your folder(s) to the *Spotlight Privacy settings* until we have a native FSEvents implementation (see [#11][]). - -**How many files can be watched at once?** - -There are OS-specific limits as to how many watches can be created: -* Linux: /proc/sys/fs/inotify/max_user_watches contains the limit, reaching this limit results in a "no space left on device" error. -* BSD / OSX: sysctl variables "kern.maxfiles" and "kern.maxfilesperproc", reaching these limits results in a "too many open files" error. - -[#62]: https://github.com/howeyc/fsnotify/issues/62 -[#18]: https://github.com/fsnotify/fsnotify/issues/18 -[#11]: https://github.com/fsnotify/fsnotify/issues/11 -[#7]: https://github.com/howeyc/fsnotify/issues/7 - -[contributing]: https://github.com/fsnotify/fsnotify/blob/master/CONTRIBUTING.md - -## Related Projects - -* [notify](https://github.com/rjeczalik/notify) -* [fsevents](https://github.com/fsnotify/fsevents) - diff --git a/vendor/gopkg.in/fsnotify.v1/fen.go b/vendor/gopkg.in/fsnotify.v1/fen.go deleted file mode 100644 index ced39cb88..000000000 --- a/vendor/gopkg.in/fsnotify.v1/fen.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build solaris - -package fsnotify - -import ( - "errors" -) - -// Watcher watches a set of files, delivering events to a channel. -type Watcher struct { - Events chan Event - Errors chan error -} - -// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. -func NewWatcher() (*Watcher, error) { - return nil, errors.New("FEN based watcher not yet supported for fsnotify\n") -} - -// Close removes all watches and closes the events channel. -func (w *Watcher) Close() error { - return nil -} - -// Add starts watching the named file or directory (non-recursively). -func (w *Watcher) Add(name string) error { - return nil -} - -// Remove stops watching the the named file or directory (non-recursively). -func (w *Watcher) Remove(name string) error { - return nil -} diff --git a/vendor/gopkg.in/fsnotify.v1/fsnotify.go b/vendor/gopkg.in/fsnotify.v1/fsnotify.go deleted file mode 100644 index 190bf0de5..000000000 --- a/vendor/gopkg.in/fsnotify.v1/fsnotify.go +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2012 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build !plan9 - -// Package fsnotify provides a platform-independent interface for file system notifications. -package fsnotify - -import ( - "bytes" - "errors" - "fmt" -) - -// Event represents a single file system notification. -type Event struct { - Name string // Relative path to the file or directory. - Op Op // File operation that triggered the event. -} - -// Op describes a set of file operations. -type Op uint32 - -// These are the generalized file operations that can trigger a notification. -const ( - Create Op = 1 << iota - Write - Remove - Rename - Chmod -) - -func (op Op) String() string { - // Use a buffer for efficient string concatenation - var buffer bytes.Buffer - - if op&Create == Create { - buffer.WriteString("|CREATE") - } - if op&Remove == Remove { - buffer.WriteString("|REMOVE") - } - if op&Write == Write { - buffer.WriteString("|WRITE") - } - if op&Rename == Rename { - buffer.WriteString("|RENAME") - } - if op&Chmod == Chmod { - buffer.WriteString("|CHMOD") - } - if buffer.Len() == 0 { - return "" - } - return buffer.String()[1:] // Strip leading pipe -} - -// String returns a string representation of the event in the form -// "file: REMOVE|WRITE|..." -func (e Event) String() string { - return fmt.Sprintf("%q: %s", e.Name, e.Op.String()) -} - -// Common errors that can be reported by a watcher -var ErrEventOverflow = errors.New("fsnotify queue overflow") diff --git a/vendor/gopkg.in/fsnotify.v1/inotify.go b/vendor/gopkg.in/fsnotify.v1/inotify.go deleted file mode 100644 index d9fd1b88a..000000000 --- a/vendor/gopkg.in/fsnotify.v1/inotify.go +++ /dev/null @@ -1,337 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux - -package fsnotify - -import ( - "errors" - "fmt" - "io" - "os" - "path/filepath" - "strings" - "sync" - "unsafe" - - "golang.org/x/sys/unix" -) - -// Watcher watches a set of files, delivering events to a channel. -type Watcher struct { - Events chan Event - Errors chan error - mu sync.Mutex // Map access - fd int - poller *fdPoller - watches map[string]*watch // Map of inotify watches (key: path) - paths map[int]string // Map of watched paths (key: watch descriptor) - done chan struct{} // Channel for sending a "quit message" to the reader goroutine - doneResp chan struct{} // Channel to respond to Close -} - -// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. -func NewWatcher() (*Watcher, error) { - // Create inotify fd - fd, errno := unix.InotifyInit1(unix.IN_CLOEXEC) - if fd == -1 { - return nil, errno - } - // Create epoll - poller, err := newFdPoller(fd) - if err != nil { - unix.Close(fd) - return nil, err - } - w := &Watcher{ - fd: fd, - poller: poller, - watches: make(map[string]*watch), - paths: make(map[int]string), - Events: make(chan Event), - Errors: make(chan error), - done: make(chan struct{}), - doneResp: make(chan struct{}), - } - - go w.readEvents() - return w, nil -} - -func (w *Watcher) isClosed() bool { - select { - case <-w.done: - return true - default: - return false - } -} - -// Close removes all watches and closes the events channel. -func (w *Watcher) Close() error { - if w.isClosed() { - return nil - } - - // Send 'close' signal to goroutine, and set the Watcher to closed. - close(w.done) - - // Wake up goroutine - w.poller.wake() - - // Wait for goroutine to close - <-w.doneResp - - return nil -} - -// Add starts watching the named file or directory (non-recursively). -func (w *Watcher) Add(name string) error { - name = filepath.Clean(name) - if w.isClosed() { - return errors.New("inotify instance already closed") - } - - const agnosticEvents = unix.IN_MOVED_TO | unix.IN_MOVED_FROM | - unix.IN_CREATE | unix.IN_ATTRIB | unix.IN_MODIFY | - unix.IN_MOVE_SELF | unix.IN_DELETE | unix.IN_DELETE_SELF - - var flags uint32 = agnosticEvents - - w.mu.Lock() - defer w.mu.Unlock() - watchEntry := w.watches[name] - if watchEntry != nil { - flags |= watchEntry.flags | unix.IN_MASK_ADD - } - wd, errno := unix.InotifyAddWatch(w.fd, name, flags) - if wd == -1 { - return errno - } - - if watchEntry == nil { - w.watches[name] = &watch{wd: uint32(wd), flags: flags} - w.paths[wd] = name - } else { - watchEntry.wd = uint32(wd) - watchEntry.flags = flags - } - - return nil -} - -// Remove stops watching the named file or directory (non-recursively). -func (w *Watcher) Remove(name string) error { - name = filepath.Clean(name) - - // Fetch the watch. - w.mu.Lock() - defer w.mu.Unlock() - watch, ok := w.watches[name] - - // Remove it from inotify. - if !ok { - return fmt.Errorf("can't remove non-existent inotify watch for: %s", name) - } - - // We successfully removed the watch if InotifyRmWatch doesn't return an - // error, we need to clean up our internal state to ensure it matches - // inotify's kernel state. - delete(w.paths, int(watch.wd)) - delete(w.watches, name) - - // inotify_rm_watch will return EINVAL if the file has been deleted; - // the inotify will already have been removed. - // watches and pathes are deleted in ignoreLinux() implicitly and asynchronously - // by calling inotify_rm_watch() below. e.g. readEvents() goroutine receives IN_IGNORE - // so that EINVAL means that the wd is being rm_watch()ed or its file removed - // by another thread and we have not received IN_IGNORE event. - success, errno := unix.InotifyRmWatch(w.fd, watch.wd) - if success == -1 { - // TODO: Perhaps it's not helpful to return an error here in every case. - // the only two possible errors are: - // EBADF, which happens when w.fd is not a valid file descriptor of any kind. - // EINVAL, which is when fd is not an inotify descriptor or wd is not a valid watch descriptor. - // Watch descriptors are invalidated when they are removed explicitly or implicitly; - // explicitly by inotify_rm_watch, implicitly when the file they are watching is deleted. - return errno - } - - return nil -} - -type watch struct { - wd uint32 // Watch descriptor (as returned by the inotify_add_watch() syscall) - flags uint32 // inotify flags of this watch (see inotify(7) for the list of valid flags) -} - -// readEvents reads from the inotify file descriptor, converts the -// received events into Event objects and sends them via the Events channel -func (w *Watcher) readEvents() { - var ( - buf [unix.SizeofInotifyEvent * 4096]byte // Buffer for a maximum of 4096 raw events - n int // Number of bytes read with read() - errno error // Syscall errno - ok bool // For poller.wait - ) - - defer close(w.doneResp) - defer close(w.Errors) - defer close(w.Events) - defer unix.Close(w.fd) - defer w.poller.close() - - for { - // See if we have been closed. - if w.isClosed() { - return - } - - ok, errno = w.poller.wait() - if errno != nil { - select { - case w.Errors <- errno: - case <-w.done: - return - } - continue - } - - if !ok { - continue - } - - n, errno = unix.Read(w.fd, buf[:]) - // If a signal interrupted execution, see if we've been asked to close, and try again. - // http://man7.org/linux/man-pages/man7/signal.7.html : - // "Before Linux 3.8, reads from an inotify(7) file descriptor were not restartable" - if errno == unix.EINTR { - continue - } - - // unix.Read might have been woken up by Close. If so, we're done. - if w.isClosed() { - return - } - - if n < unix.SizeofInotifyEvent { - var err error - if n == 0 { - // If EOF is received. This should really never happen. - err = io.EOF - } else if n < 0 { - // If an error occurred while reading. - err = errno - } else { - // Read was too short. - err = errors.New("notify: short read in readEvents()") - } - select { - case w.Errors <- err: - case <-w.done: - return - } - continue - } - - var offset uint32 - // We don't know how many events we just read into the buffer - // While the offset points to at least one whole event... - for offset <= uint32(n-unix.SizeofInotifyEvent) { - // Point "raw" to the event in the buffer - raw := (*unix.InotifyEvent)(unsafe.Pointer(&buf[offset])) - - mask := uint32(raw.Mask) - nameLen := uint32(raw.Len) - - if mask&unix.IN_Q_OVERFLOW != 0 { - select { - case w.Errors <- ErrEventOverflow: - case <-w.done: - return - } - } - - // If the event happened to the watched directory or the watched file, the kernel - // doesn't append the filename to the event, but we would like to always fill the - // the "Name" field with a valid filename. We retrieve the path of the watch from - // the "paths" map. - w.mu.Lock() - name, ok := w.paths[int(raw.Wd)] - // IN_DELETE_SELF occurs when the file/directory being watched is removed. - // This is a sign to clean up the maps, otherwise we are no longer in sync - // with the inotify kernel state which has already deleted the watch - // automatically. - if ok && mask&unix.IN_DELETE_SELF == unix.IN_DELETE_SELF { - delete(w.paths, int(raw.Wd)) - delete(w.watches, name) - } - w.mu.Unlock() - - if nameLen > 0 { - // Point "bytes" at the first byte of the filename - bytes := (*[unix.PathMax]byte)(unsafe.Pointer(&buf[offset+unix.SizeofInotifyEvent])) - // The filename is padded with NULL bytes. TrimRight() gets rid of those. - name += "/" + strings.TrimRight(string(bytes[0:nameLen]), "\000") - } - - event := newEvent(name, mask) - - // Send the events that are not ignored on the events channel - if !event.ignoreLinux(mask) { - select { - case w.Events <- event: - case <-w.done: - return - } - } - - // Move to the next event in the buffer - offset += unix.SizeofInotifyEvent + nameLen - } - } -} - -// Certain types of events can be "ignored" and not sent over the Events -// channel. Such as events marked ignore by the kernel, or MODIFY events -// against files that do not exist. -func (e *Event) ignoreLinux(mask uint32) bool { - // Ignore anything the inotify API says to ignore - if mask&unix.IN_IGNORED == unix.IN_IGNORED { - return true - } - - // If the event is not a DELETE or RENAME, the file must exist. - // Otherwise the event is ignored. - // *Note*: this was put in place because it was seen that a MODIFY - // event was sent after the DELETE. This ignores that MODIFY and - // assumes a DELETE will come or has come if the file doesn't exist. - if !(e.Op&Remove == Remove || e.Op&Rename == Rename) { - _, statErr := os.Lstat(e.Name) - return os.IsNotExist(statErr) - } - return false -} - -// newEvent returns an platform-independent Event based on an inotify mask. -func newEvent(name string, mask uint32) Event { - e := Event{Name: name} - if mask&unix.IN_CREATE == unix.IN_CREATE || mask&unix.IN_MOVED_TO == unix.IN_MOVED_TO { - e.Op |= Create - } - if mask&unix.IN_DELETE_SELF == unix.IN_DELETE_SELF || mask&unix.IN_DELETE == unix.IN_DELETE { - e.Op |= Remove - } - if mask&unix.IN_MODIFY == unix.IN_MODIFY { - e.Op |= Write - } - if mask&unix.IN_MOVE_SELF == unix.IN_MOVE_SELF || mask&unix.IN_MOVED_FROM == unix.IN_MOVED_FROM { - e.Op |= Rename - } - if mask&unix.IN_ATTRIB == unix.IN_ATTRIB { - e.Op |= Chmod - } - return e -} diff --git a/vendor/gopkg.in/fsnotify.v1/inotify_poller.go b/vendor/gopkg.in/fsnotify.v1/inotify_poller.go deleted file mode 100644 index cc7db4b22..000000000 --- a/vendor/gopkg.in/fsnotify.v1/inotify_poller.go +++ /dev/null @@ -1,187 +0,0 @@ -// Copyright 2015 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build linux - -package fsnotify - -import ( - "errors" - - "golang.org/x/sys/unix" -) - -type fdPoller struct { - fd int // File descriptor (as returned by the inotify_init() syscall) - epfd int // Epoll file descriptor - pipe [2]int // Pipe for waking up -} - -func emptyPoller(fd int) *fdPoller { - poller := new(fdPoller) - poller.fd = fd - poller.epfd = -1 - poller.pipe[0] = -1 - poller.pipe[1] = -1 - return poller -} - -// Create a new inotify poller. -// This creates an inotify handler, and an epoll handler. -func newFdPoller(fd int) (*fdPoller, error) { - var errno error - poller := emptyPoller(fd) - defer func() { - if errno != nil { - poller.close() - } - }() - poller.fd = fd - - // Create epoll fd - poller.epfd, errno = unix.EpollCreate1(0) - if poller.epfd == -1 { - return nil, errno - } - // Create pipe; pipe[0] is the read end, pipe[1] the write end. - errno = unix.Pipe2(poller.pipe[:], unix.O_NONBLOCK) - if errno != nil { - return nil, errno - } - - // Register inotify fd with epoll - event := unix.EpollEvent{ - Fd: int32(poller.fd), - Events: unix.EPOLLIN, - } - errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.fd, &event) - if errno != nil { - return nil, errno - } - - // Register pipe fd with epoll - event = unix.EpollEvent{ - Fd: int32(poller.pipe[0]), - Events: unix.EPOLLIN, - } - errno = unix.EpollCtl(poller.epfd, unix.EPOLL_CTL_ADD, poller.pipe[0], &event) - if errno != nil { - return nil, errno - } - - return poller, nil -} - -// Wait using epoll. -// Returns true if something is ready to be read, -// false if there is not. -func (poller *fdPoller) wait() (bool, error) { - // 3 possible events per fd, and 2 fds, makes a maximum of 6 events. - // I don't know whether epoll_wait returns the number of events returned, - // or the total number of events ready. - // I decided to catch both by making the buffer one larger than the maximum. - events := make([]unix.EpollEvent, 7) - for { - n, errno := unix.EpollWait(poller.epfd, events, -1) - if n == -1 { - if errno == unix.EINTR { - continue - } - return false, errno - } - if n == 0 { - // If there are no events, try again. - continue - } - if n > 6 { - // This should never happen. More events were returned than should be possible. - return false, errors.New("epoll_wait returned more events than I know what to do with") - } - ready := events[:n] - epollhup := false - epollerr := false - epollin := false - for _, event := range ready { - if event.Fd == int32(poller.fd) { - if event.Events&unix.EPOLLHUP != 0 { - // This should not happen, but if it does, treat it as a wakeup. - epollhup = true - } - if event.Events&unix.EPOLLERR != 0 { - // If an error is waiting on the file descriptor, we should pretend - // something is ready to read, and let unix.Read pick up the error. - epollerr = true - } - if event.Events&unix.EPOLLIN != 0 { - // There is data to read. - epollin = true - } - } - if event.Fd == int32(poller.pipe[0]) { - if event.Events&unix.EPOLLHUP != 0 { - // Write pipe descriptor was closed, by us. This means we're closing down the - // watcher, and we should wake up. - } - if event.Events&unix.EPOLLERR != 0 { - // If an error is waiting on the pipe file descriptor. - // This is an absolute mystery, and should never ever happen. - return false, errors.New("Error on the pipe descriptor.") - } - if event.Events&unix.EPOLLIN != 0 { - // This is a regular wakeup, so we have to clear the buffer. - err := poller.clearWake() - if err != nil { - return false, err - } - } - } - } - - if epollhup || epollerr || epollin { - return true, nil - } - return false, nil - } -} - -// Close the write end of the poller. -func (poller *fdPoller) wake() error { - buf := make([]byte, 1) - n, errno := unix.Write(poller.pipe[1], buf) - if n == -1 { - if errno == unix.EAGAIN { - // Buffer is full, poller will wake. - return nil - } - return errno - } - return nil -} - -func (poller *fdPoller) clearWake() error { - // You have to be woken up a LOT in order to get to 100! - buf := make([]byte, 100) - n, errno := unix.Read(poller.pipe[0], buf) - if n == -1 { - if errno == unix.EAGAIN { - // Buffer is empty, someone else cleared our wake. - return nil - } - return errno - } - return nil -} - -// Close all poller file descriptors, but not the one passed to it. -func (poller *fdPoller) close() { - if poller.pipe[1] != -1 { - unix.Close(poller.pipe[1]) - } - if poller.pipe[0] != -1 { - unix.Close(poller.pipe[0]) - } - if poller.epfd != -1 { - unix.Close(poller.epfd) - } -} diff --git a/vendor/gopkg.in/fsnotify.v1/kqueue.go b/vendor/gopkg.in/fsnotify.v1/kqueue.go deleted file mode 100644 index 86e76a3d6..000000000 --- a/vendor/gopkg.in/fsnotify.v1/kqueue.go +++ /dev/null @@ -1,521 +0,0 @@ -// Copyright 2010 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build freebsd openbsd netbsd dragonfly darwin - -package fsnotify - -import ( - "errors" - "fmt" - "io/ioutil" - "os" - "path/filepath" - "sync" - "time" - - "golang.org/x/sys/unix" -) - -// Watcher watches a set of files, delivering events to a channel. -type Watcher struct { - Events chan Event - Errors chan error - done chan struct{} // Channel for sending a "quit message" to the reader goroutine - - kq int // File descriptor (as returned by the kqueue() syscall). - - mu sync.Mutex // Protects access to watcher data - watches map[string]int // Map of watched file descriptors (key: path). - externalWatches map[string]bool // Map of watches added by user of the library. - dirFlags map[string]uint32 // Map of watched directories to fflags used in kqueue. - paths map[int]pathInfo // Map file descriptors to path names for processing kqueue events. - fileExists map[string]bool // Keep track of if we know this file exists (to stop duplicate create events). - isClosed bool // Set to true when Close() is first called -} - -type pathInfo struct { - name string - isDir bool -} - -// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. -func NewWatcher() (*Watcher, error) { - kq, err := kqueue() - if err != nil { - return nil, err - } - - w := &Watcher{ - kq: kq, - watches: make(map[string]int), - dirFlags: make(map[string]uint32), - paths: make(map[int]pathInfo), - fileExists: make(map[string]bool), - externalWatches: make(map[string]bool), - Events: make(chan Event), - Errors: make(chan error), - done: make(chan struct{}), - } - - go w.readEvents() - return w, nil -} - -// Close removes all watches and closes the events channel. -func (w *Watcher) Close() error { - w.mu.Lock() - if w.isClosed { - w.mu.Unlock() - return nil - } - w.isClosed = true - - // copy paths to remove while locked - var pathsToRemove = make([]string, 0, len(w.watches)) - for name := range w.watches { - pathsToRemove = append(pathsToRemove, name) - } - w.mu.Unlock() - // unlock before calling Remove, which also locks - - for _, name := range pathsToRemove { - w.Remove(name) - } - - // send a "quit" message to the reader goroutine - close(w.done) - - return nil -} - -// Add starts watching the named file or directory (non-recursively). -func (w *Watcher) Add(name string) error { - w.mu.Lock() - w.externalWatches[name] = true - w.mu.Unlock() - _, err := w.addWatch(name, noteAllEvents) - return err -} - -// Remove stops watching the the named file or directory (non-recursively). -func (w *Watcher) Remove(name string) error { - name = filepath.Clean(name) - w.mu.Lock() - watchfd, ok := w.watches[name] - w.mu.Unlock() - if !ok { - return fmt.Errorf("can't remove non-existent kevent watch for: %s", name) - } - - const registerRemove = unix.EV_DELETE - if err := register(w.kq, []int{watchfd}, registerRemove, 0); err != nil { - return err - } - - unix.Close(watchfd) - - w.mu.Lock() - isDir := w.paths[watchfd].isDir - delete(w.watches, name) - delete(w.paths, watchfd) - delete(w.dirFlags, name) - w.mu.Unlock() - - // Find all watched paths that are in this directory that are not external. - if isDir { - var pathsToRemove []string - w.mu.Lock() - for _, path := range w.paths { - wdir, _ := filepath.Split(path.name) - if filepath.Clean(wdir) == name { - if !w.externalWatches[path.name] { - pathsToRemove = append(pathsToRemove, path.name) - } - } - } - w.mu.Unlock() - for _, name := range pathsToRemove { - // Since these are internal, not much sense in propagating error - // to the user, as that will just confuse them with an error about - // a path they did not explicitly watch themselves. - w.Remove(name) - } - } - - return nil -} - -// Watch all events (except NOTE_EXTEND, NOTE_LINK, NOTE_REVOKE) -const noteAllEvents = unix.NOTE_DELETE | unix.NOTE_WRITE | unix.NOTE_ATTRIB | unix.NOTE_RENAME - -// keventWaitTime to block on each read from kevent -var keventWaitTime = durationToTimespec(100 * time.Millisecond) - -// addWatch adds name to the watched file set. -// The flags are interpreted as described in kevent(2). -// Returns the real path to the file which was added, if any, which may be different from the one passed in the case of symlinks. -func (w *Watcher) addWatch(name string, flags uint32) (string, error) { - var isDir bool - // Make ./name and name equivalent - name = filepath.Clean(name) - - w.mu.Lock() - if w.isClosed { - w.mu.Unlock() - return "", errors.New("kevent instance already closed") - } - watchfd, alreadyWatching := w.watches[name] - // We already have a watch, but we can still override flags. - if alreadyWatching { - isDir = w.paths[watchfd].isDir - } - w.mu.Unlock() - - if !alreadyWatching { - fi, err := os.Lstat(name) - if err != nil { - return "", err - } - - // Don't watch sockets. - if fi.Mode()&os.ModeSocket == os.ModeSocket { - return "", nil - } - - // Don't watch named pipes. - if fi.Mode()&os.ModeNamedPipe == os.ModeNamedPipe { - return "", nil - } - - // Follow Symlinks - // Unfortunately, Linux can add bogus symlinks to watch list without - // issue, and Windows can't do symlinks period (AFAIK). To maintain - // consistency, we will act like everything is fine. There will simply - // be no file events for broken symlinks. - // Hence the returns of nil on errors. - if fi.Mode()&os.ModeSymlink == os.ModeSymlink { - name, err = filepath.EvalSymlinks(name) - if err != nil { - return "", nil - } - - w.mu.Lock() - _, alreadyWatching = w.watches[name] - w.mu.Unlock() - - if alreadyWatching { - return name, nil - } - - fi, err = os.Lstat(name) - if err != nil { - return "", nil - } - } - - watchfd, err = unix.Open(name, openMode, 0700) - if watchfd == -1 { - return "", err - } - - isDir = fi.IsDir() - } - - const registerAdd = unix.EV_ADD | unix.EV_CLEAR | unix.EV_ENABLE - if err := register(w.kq, []int{watchfd}, registerAdd, flags); err != nil { - unix.Close(watchfd) - return "", err - } - - if !alreadyWatching { - w.mu.Lock() - w.watches[name] = watchfd - w.paths[watchfd] = pathInfo{name: name, isDir: isDir} - w.mu.Unlock() - } - - if isDir { - // Watch the directory if it has not been watched before, - // or if it was watched before, but perhaps only a NOTE_DELETE (watchDirectoryFiles) - w.mu.Lock() - - watchDir := (flags&unix.NOTE_WRITE) == unix.NOTE_WRITE && - (!alreadyWatching || (w.dirFlags[name]&unix.NOTE_WRITE) != unix.NOTE_WRITE) - // Store flags so this watch can be updated later - w.dirFlags[name] = flags - w.mu.Unlock() - - if watchDir { - if err := w.watchDirectoryFiles(name); err != nil { - return "", err - } - } - } - return name, nil -} - -// readEvents reads from kqueue and converts the received kevents into -// Event values that it sends down the Events channel. -func (w *Watcher) readEvents() { - eventBuffer := make([]unix.Kevent_t, 10) - -loop: - for { - // See if there is a message on the "done" channel - select { - case <-w.done: - break loop - default: - } - - // Get new events - kevents, err := read(w.kq, eventBuffer, &keventWaitTime) - // EINTR is okay, the syscall was interrupted before timeout expired. - if err != nil && err != unix.EINTR { - select { - case w.Errors <- err: - case <-w.done: - break loop - } - continue - } - - // Flush the events we received to the Events channel - for len(kevents) > 0 { - kevent := &kevents[0] - watchfd := int(kevent.Ident) - mask := uint32(kevent.Fflags) - w.mu.Lock() - path := w.paths[watchfd] - w.mu.Unlock() - event := newEvent(path.name, mask) - - if path.isDir && !(event.Op&Remove == Remove) { - // Double check to make sure the directory exists. This can happen when - // we do a rm -fr on a recursively watched folders and we receive a - // modification event first but the folder has been deleted and later - // receive the delete event - if _, err := os.Lstat(event.Name); os.IsNotExist(err) { - // mark is as delete event - event.Op |= Remove - } - } - - if event.Op&Rename == Rename || event.Op&Remove == Remove { - w.Remove(event.Name) - w.mu.Lock() - delete(w.fileExists, event.Name) - w.mu.Unlock() - } - - if path.isDir && event.Op&Write == Write && !(event.Op&Remove == Remove) { - w.sendDirectoryChangeEvents(event.Name) - } else { - // Send the event on the Events channel. - select { - case w.Events <- event: - case <-w.done: - break loop - } - } - - if event.Op&Remove == Remove { - // Look for a file that may have overwritten this. - // For example, mv f1 f2 will delete f2, then create f2. - if path.isDir { - fileDir := filepath.Clean(event.Name) - w.mu.Lock() - _, found := w.watches[fileDir] - w.mu.Unlock() - if found { - // make sure the directory exists before we watch for changes. When we - // do a recursive watch and perform rm -fr, the parent directory might - // have gone missing, ignore the missing directory and let the - // upcoming delete event remove the watch from the parent directory. - if _, err := os.Lstat(fileDir); err == nil { - w.sendDirectoryChangeEvents(fileDir) - } - } - } else { - filePath := filepath.Clean(event.Name) - if fileInfo, err := os.Lstat(filePath); err == nil { - w.sendFileCreatedEventIfNew(filePath, fileInfo) - } - } - } - - // Move to next event - kevents = kevents[1:] - } - } - - // cleanup - err := unix.Close(w.kq) - if err != nil { - // only way the previous loop breaks is if w.done was closed so we need to async send to w.Errors. - select { - case w.Errors <- err: - default: - } - } - close(w.Events) - close(w.Errors) -} - -// newEvent returns an platform-independent Event based on kqueue Fflags. -func newEvent(name string, mask uint32) Event { - e := Event{Name: name} - if mask&unix.NOTE_DELETE == unix.NOTE_DELETE { - e.Op |= Remove - } - if mask&unix.NOTE_WRITE == unix.NOTE_WRITE { - e.Op |= Write - } - if mask&unix.NOTE_RENAME == unix.NOTE_RENAME { - e.Op |= Rename - } - if mask&unix.NOTE_ATTRIB == unix.NOTE_ATTRIB { - e.Op |= Chmod - } - return e -} - -func newCreateEvent(name string) Event { - return Event{Name: name, Op: Create} -} - -// watchDirectoryFiles to mimic inotify when adding a watch on a directory -func (w *Watcher) watchDirectoryFiles(dirPath string) error { - // Get all files - files, err := ioutil.ReadDir(dirPath) - if err != nil { - return err - } - - for _, fileInfo := range files { - filePath := filepath.Join(dirPath, fileInfo.Name()) - filePath, err = w.internalWatch(filePath, fileInfo) - if err != nil { - return err - } - - w.mu.Lock() - w.fileExists[filePath] = true - w.mu.Unlock() - } - - return nil -} - -// sendDirectoryEvents searches the directory for newly created files -// and sends them over the event channel. This functionality is to have -// the BSD version of fsnotify match Linux inotify which provides a -// create event for files created in a watched directory. -func (w *Watcher) sendDirectoryChangeEvents(dirPath string) { - // Get all files - files, err := ioutil.ReadDir(dirPath) - if err != nil { - select { - case w.Errors <- err: - case <-w.done: - return - } - } - - // Search for new files - for _, fileInfo := range files { - filePath := filepath.Join(dirPath, fileInfo.Name()) - err := w.sendFileCreatedEventIfNew(filePath, fileInfo) - - if err != nil { - return - } - } -} - -// sendFileCreatedEvent sends a create event if the file isn't already being tracked. -func (w *Watcher) sendFileCreatedEventIfNew(filePath string, fileInfo os.FileInfo) (err error) { - w.mu.Lock() - _, doesExist := w.fileExists[filePath] - w.mu.Unlock() - if !doesExist { - // Send create event - select { - case w.Events <- newCreateEvent(filePath): - case <-w.done: - return - } - } - - // like watchDirectoryFiles (but without doing another ReadDir) - filePath, err = w.internalWatch(filePath, fileInfo) - if err != nil { - return err - } - - w.mu.Lock() - w.fileExists[filePath] = true - w.mu.Unlock() - - return nil -} - -func (w *Watcher) internalWatch(name string, fileInfo os.FileInfo) (string, error) { - if fileInfo.IsDir() { - // mimic Linux providing delete events for subdirectories - // but preserve the flags used if currently watching subdirectory - w.mu.Lock() - flags := w.dirFlags[name] - w.mu.Unlock() - - flags |= unix.NOTE_DELETE | unix.NOTE_RENAME - return w.addWatch(name, flags) - } - - // watch file to mimic Linux inotify - return w.addWatch(name, noteAllEvents) -} - -// kqueue creates a new kernel event queue and returns a descriptor. -func kqueue() (kq int, err error) { - kq, err = unix.Kqueue() - if kq == -1 { - return kq, err - } - return kq, nil -} - -// register events with the queue -func register(kq int, fds []int, flags int, fflags uint32) error { - changes := make([]unix.Kevent_t, len(fds)) - - for i, fd := range fds { - // SetKevent converts int to the platform-specific types: - unix.SetKevent(&changes[i], fd, unix.EVFILT_VNODE, flags) - changes[i].Fflags = fflags - } - - // register the events - success, err := unix.Kevent(kq, changes, nil, nil) - if success == -1 { - return err - } - return nil -} - -// read retrieves pending events, or waits until an event occurs. -// A timeout of nil blocks indefinitely, while 0 polls the queue. -func read(kq int, events []unix.Kevent_t, timeout *unix.Timespec) ([]unix.Kevent_t, error) { - n, err := unix.Kevent(kq, nil, events, timeout) - if err != nil { - return nil, err - } - return events[0:n], nil -} - -// durationToTimespec prepares a timeout value -func durationToTimespec(d time.Duration) unix.Timespec { - return unix.NsecToTimespec(d.Nanoseconds()) -} diff --git a/vendor/gopkg.in/fsnotify.v1/open_mode_bsd.go b/vendor/gopkg.in/fsnotify.v1/open_mode_bsd.go deleted file mode 100644 index 7d8de1451..000000000 --- a/vendor/gopkg.in/fsnotify.v1/open_mode_bsd.go +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build freebsd openbsd netbsd dragonfly - -package fsnotify - -import "golang.org/x/sys/unix" - -const openMode = unix.O_NONBLOCK | unix.O_RDONLY diff --git a/vendor/gopkg.in/fsnotify.v1/open_mode_darwin.go b/vendor/gopkg.in/fsnotify.v1/open_mode_darwin.go deleted file mode 100644 index 9139e1716..000000000 --- a/vendor/gopkg.in/fsnotify.v1/open_mode_darwin.go +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin - -package fsnotify - -import "golang.org/x/sys/unix" - -// note: this constant is not defined on BSD -const openMode = unix.O_EVTONLY diff --git a/vendor/gopkg.in/fsnotify.v1/windows.go b/vendor/gopkg.in/fsnotify.v1/windows.go deleted file mode 100644 index 09436f31d..000000000 --- a/vendor/gopkg.in/fsnotify.v1/windows.go +++ /dev/null @@ -1,561 +0,0 @@ -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build windows - -package fsnotify - -import ( - "errors" - "fmt" - "os" - "path/filepath" - "runtime" - "sync" - "syscall" - "unsafe" -) - -// Watcher watches a set of files, delivering events to a channel. -type Watcher struct { - Events chan Event - Errors chan error - isClosed bool // Set to true when Close() is first called - mu sync.Mutex // Map access - port syscall.Handle // Handle to completion port - watches watchMap // Map of watches (key: i-number) - input chan *input // Inputs to the reader are sent on this channel - quit chan chan<- error -} - -// NewWatcher establishes a new watcher with the underlying OS and begins waiting for events. -func NewWatcher() (*Watcher, error) { - port, e := syscall.CreateIoCompletionPort(syscall.InvalidHandle, 0, 0, 0) - if e != nil { - return nil, os.NewSyscallError("CreateIoCompletionPort", e) - } - w := &Watcher{ - port: port, - watches: make(watchMap), - input: make(chan *input, 1), - Events: make(chan Event, 50), - Errors: make(chan error), - quit: make(chan chan<- error, 1), - } - go w.readEvents() - return w, nil -} - -// Close removes all watches and closes the events channel. -func (w *Watcher) Close() error { - if w.isClosed { - return nil - } - w.isClosed = true - - // Send "quit" message to the reader goroutine - ch := make(chan error) - w.quit <- ch - if err := w.wakeupReader(); err != nil { - return err - } - return <-ch -} - -// Add starts watching the named file or directory (non-recursively). -func (w *Watcher) Add(name string) error { - if w.isClosed { - return errors.New("watcher already closed") - } - in := &input{ - op: opAddWatch, - path: filepath.Clean(name), - flags: sysFSALLEVENTS, - reply: make(chan error), - } - w.input <- in - if err := w.wakeupReader(); err != nil { - return err - } - return <-in.reply -} - -// Remove stops watching the the named file or directory (non-recursively). -func (w *Watcher) Remove(name string) error { - in := &input{ - op: opRemoveWatch, - path: filepath.Clean(name), - reply: make(chan error), - } - w.input <- in - if err := w.wakeupReader(); err != nil { - return err - } - return <-in.reply -} - -const ( - // Options for AddWatch - sysFSONESHOT = 0x80000000 - sysFSONLYDIR = 0x1000000 - - // Events - sysFSACCESS = 0x1 - sysFSALLEVENTS = 0xfff - sysFSATTRIB = 0x4 - sysFSCLOSE = 0x18 - sysFSCREATE = 0x100 - sysFSDELETE = 0x200 - sysFSDELETESELF = 0x400 - sysFSMODIFY = 0x2 - sysFSMOVE = 0xc0 - sysFSMOVEDFROM = 0x40 - sysFSMOVEDTO = 0x80 - sysFSMOVESELF = 0x800 - - // Special events - sysFSIGNORED = 0x8000 - sysFSQOVERFLOW = 0x4000 -) - -func newEvent(name string, mask uint32) Event { - e := Event{Name: name} - if mask&sysFSCREATE == sysFSCREATE || mask&sysFSMOVEDTO == sysFSMOVEDTO { - e.Op |= Create - } - if mask&sysFSDELETE == sysFSDELETE || mask&sysFSDELETESELF == sysFSDELETESELF { - e.Op |= Remove - } - if mask&sysFSMODIFY == sysFSMODIFY { - e.Op |= Write - } - if mask&sysFSMOVE == sysFSMOVE || mask&sysFSMOVESELF == sysFSMOVESELF || mask&sysFSMOVEDFROM == sysFSMOVEDFROM { - e.Op |= Rename - } - if mask&sysFSATTRIB == sysFSATTRIB { - e.Op |= Chmod - } - return e -} - -const ( - opAddWatch = iota - opRemoveWatch -) - -const ( - provisional uint64 = 1 << (32 + iota) -) - -type input struct { - op int - path string - flags uint32 - reply chan error -} - -type inode struct { - handle syscall.Handle - volume uint32 - index uint64 -} - -type watch struct { - ov syscall.Overlapped - ino *inode // i-number - path string // Directory path - mask uint64 // Directory itself is being watched with these notify flags - names map[string]uint64 // Map of names being watched and their notify flags - rename string // Remembers the old name while renaming a file - buf [4096]byte -} - -type indexMap map[uint64]*watch -type watchMap map[uint32]indexMap - -func (w *Watcher) wakeupReader() error { - e := syscall.PostQueuedCompletionStatus(w.port, 0, 0, nil) - if e != nil { - return os.NewSyscallError("PostQueuedCompletionStatus", e) - } - return nil -} - -func getDir(pathname string) (dir string, err error) { - attr, e := syscall.GetFileAttributes(syscall.StringToUTF16Ptr(pathname)) - if e != nil { - return "", os.NewSyscallError("GetFileAttributes", e) - } - if attr&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 { - dir = pathname - } else { - dir, _ = filepath.Split(pathname) - dir = filepath.Clean(dir) - } - return -} - -func getIno(path string) (ino *inode, err error) { - h, e := syscall.CreateFile(syscall.StringToUTF16Ptr(path), - syscall.FILE_LIST_DIRECTORY, - syscall.FILE_SHARE_READ|syscall.FILE_SHARE_WRITE|syscall.FILE_SHARE_DELETE, - nil, syscall.OPEN_EXISTING, - syscall.FILE_FLAG_BACKUP_SEMANTICS|syscall.FILE_FLAG_OVERLAPPED, 0) - if e != nil { - return nil, os.NewSyscallError("CreateFile", e) - } - var fi syscall.ByHandleFileInformation - if e = syscall.GetFileInformationByHandle(h, &fi); e != nil { - syscall.CloseHandle(h) - return nil, os.NewSyscallError("GetFileInformationByHandle", e) - } - ino = &inode{ - handle: h, - volume: fi.VolumeSerialNumber, - index: uint64(fi.FileIndexHigh)<<32 | uint64(fi.FileIndexLow), - } - return ino, nil -} - -// Must run within the I/O thread. -func (m watchMap) get(ino *inode) *watch { - if i := m[ino.volume]; i != nil { - return i[ino.index] - } - return nil -} - -// Must run within the I/O thread. -func (m watchMap) set(ino *inode, watch *watch) { - i := m[ino.volume] - if i == nil { - i = make(indexMap) - m[ino.volume] = i - } - i[ino.index] = watch -} - -// Must run within the I/O thread. -func (w *Watcher) addWatch(pathname string, flags uint64) error { - dir, err := getDir(pathname) - if err != nil { - return err - } - if flags&sysFSONLYDIR != 0 && pathname != dir { - return nil - } - ino, err := getIno(dir) - if err != nil { - return err - } - w.mu.Lock() - watchEntry := w.watches.get(ino) - w.mu.Unlock() - if watchEntry == nil { - if _, e := syscall.CreateIoCompletionPort(ino.handle, w.port, 0, 0); e != nil { - syscall.CloseHandle(ino.handle) - return os.NewSyscallError("CreateIoCompletionPort", e) - } - watchEntry = &watch{ - ino: ino, - path: dir, - names: make(map[string]uint64), - } - w.mu.Lock() - w.watches.set(ino, watchEntry) - w.mu.Unlock() - flags |= provisional - } else { - syscall.CloseHandle(ino.handle) - } - if pathname == dir { - watchEntry.mask |= flags - } else { - watchEntry.names[filepath.Base(pathname)] |= flags - } - if err = w.startRead(watchEntry); err != nil { - return err - } - if pathname == dir { - watchEntry.mask &= ^provisional - } else { - watchEntry.names[filepath.Base(pathname)] &= ^provisional - } - return nil -} - -// Must run within the I/O thread. -func (w *Watcher) remWatch(pathname string) error { - dir, err := getDir(pathname) - if err != nil { - return err - } - ino, err := getIno(dir) - if err != nil { - return err - } - w.mu.Lock() - watch := w.watches.get(ino) - w.mu.Unlock() - if watch == nil { - return fmt.Errorf("can't remove non-existent watch for: %s", pathname) - } - if pathname == dir { - w.sendEvent(watch.path, watch.mask&sysFSIGNORED) - watch.mask = 0 - } else { - name := filepath.Base(pathname) - w.sendEvent(filepath.Join(watch.path, name), watch.names[name]&sysFSIGNORED) - delete(watch.names, name) - } - return w.startRead(watch) -} - -// Must run within the I/O thread. -func (w *Watcher) deleteWatch(watch *watch) { - for name, mask := range watch.names { - if mask&provisional == 0 { - w.sendEvent(filepath.Join(watch.path, name), mask&sysFSIGNORED) - } - delete(watch.names, name) - } - if watch.mask != 0 { - if watch.mask&provisional == 0 { - w.sendEvent(watch.path, watch.mask&sysFSIGNORED) - } - watch.mask = 0 - } -} - -// Must run within the I/O thread. -func (w *Watcher) startRead(watch *watch) error { - if e := syscall.CancelIo(watch.ino.handle); e != nil { - w.Errors <- os.NewSyscallError("CancelIo", e) - w.deleteWatch(watch) - } - mask := toWindowsFlags(watch.mask) - for _, m := range watch.names { - mask |= toWindowsFlags(m) - } - if mask == 0 { - if e := syscall.CloseHandle(watch.ino.handle); e != nil { - w.Errors <- os.NewSyscallError("CloseHandle", e) - } - w.mu.Lock() - delete(w.watches[watch.ino.volume], watch.ino.index) - w.mu.Unlock() - return nil - } - e := syscall.ReadDirectoryChanges(watch.ino.handle, &watch.buf[0], - uint32(unsafe.Sizeof(watch.buf)), false, mask, nil, &watch.ov, 0) - if e != nil { - err := os.NewSyscallError("ReadDirectoryChanges", e) - if e == syscall.ERROR_ACCESS_DENIED && watch.mask&provisional == 0 { - // Watched directory was probably removed - if w.sendEvent(watch.path, watch.mask&sysFSDELETESELF) { - if watch.mask&sysFSONESHOT != 0 { - watch.mask = 0 - } - } - err = nil - } - w.deleteWatch(watch) - w.startRead(watch) - return err - } - return nil -} - -// readEvents reads from the I/O completion port, converts the -// received events into Event objects and sends them via the Events channel. -// Entry point to the I/O thread. -func (w *Watcher) readEvents() { - var ( - n, key uint32 - ov *syscall.Overlapped - ) - runtime.LockOSThread() - - for { - e := syscall.GetQueuedCompletionStatus(w.port, &n, &key, &ov, syscall.INFINITE) - watch := (*watch)(unsafe.Pointer(ov)) - - if watch == nil { - select { - case ch := <-w.quit: - w.mu.Lock() - var indexes []indexMap - for _, index := range w.watches { - indexes = append(indexes, index) - } - w.mu.Unlock() - for _, index := range indexes { - for _, watch := range index { - w.deleteWatch(watch) - w.startRead(watch) - } - } - var err error - if e := syscall.CloseHandle(w.port); e != nil { - err = os.NewSyscallError("CloseHandle", e) - } - close(w.Events) - close(w.Errors) - ch <- err - return - case in := <-w.input: - switch in.op { - case opAddWatch: - in.reply <- w.addWatch(in.path, uint64(in.flags)) - case opRemoveWatch: - in.reply <- w.remWatch(in.path) - } - default: - } - continue - } - - switch e { - case syscall.ERROR_MORE_DATA: - if watch == nil { - w.Errors <- errors.New("ERROR_MORE_DATA has unexpectedly null lpOverlapped buffer") - } else { - // The i/o succeeded but the buffer is full. - // In theory we should be building up a full packet. - // In practice we can get away with just carrying on. - n = uint32(unsafe.Sizeof(watch.buf)) - } - case syscall.ERROR_ACCESS_DENIED: - // Watched directory was probably removed - w.sendEvent(watch.path, watch.mask&sysFSDELETESELF) - w.deleteWatch(watch) - w.startRead(watch) - continue - case syscall.ERROR_OPERATION_ABORTED: - // CancelIo was called on this handle - continue - default: - w.Errors <- os.NewSyscallError("GetQueuedCompletionPort", e) - continue - case nil: - } - - var offset uint32 - for { - if n == 0 { - w.Events <- newEvent("", sysFSQOVERFLOW) - w.Errors <- errors.New("short read in readEvents()") - break - } - - // Point "raw" to the event in the buffer - raw := (*syscall.FileNotifyInformation)(unsafe.Pointer(&watch.buf[offset])) - buf := (*[syscall.MAX_PATH]uint16)(unsafe.Pointer(&raw.FileName)) - name := syscall.UTF16ToString(buf[:raw.FileNameLength/2]) - fullname := filepath.Join(watch.path, name) - - var mask uint64 - switch raw.Action { - case syscall.FILE_ACTION_REMOVED: - mask = sysFSDELETESELF - case syscall.FILE_ACTION_MODIFIED: - mask = sysFSMODIFY - case syscall.FILE_ACTION_RENAMED_OLD_NAME: - watch.rename = name - case syscall.FILE_ACTION_RENAMED_NEW_NAME: - if watch.names[watch.rename] != 0 { - watch.names[name] |= watch.names[watch.rename] - delete(watch.names, watch.rename) - mask = sysFSMOVESELF - } - } - - sendNameEvent := func() { - if w.sendEvent(fullname, watch.names[name]&mask) { - if watch.names[name]&sysFSONESHOT != 0 { - delete(watch.names, name) - } - } - } - if raw.Action != syscall.FILE_ACTION_RENAMED_NEW_NAME { - sendNameEvent() - } - if raw.Action == syscall.FILE_ACTION_REMOVED { - w.sendEvent(fullname, watch.names[name]&sysFSIGNORED) - delete(watch.names, name) - } - if w.sendEvent(fullname, watch.mask&toFSnotifyFlags(raw.Action)) { - if watch.mask&sysFSONESHOT != 0 { - watch.mask = 0 - } - } - if raw.Action == syscall.FILE_ACTION_RENAMED_NEW_NAME { - fullname = filepath.Join(watch.path, watch.rename) - sendNameEvent() - } - - // Move to the next event in the buffer - if raw.NextEntryOffset == 0 { - break - } - offset += raw.NextEntryOffset - - // Error! - if offset >= n { - w.Errors <- errors.New("Windows system assumed buffer larger than it is, events have likely been missed.") - break - } - } - - if err := w.startRead(watch); err != nil { - w.Errors <- err - } - } -} - -func (w *Watcher) sendEvent(name string, mask uint64) bool { - if mask == 0 { - return false - } - event := newEvent(name, uint32(mask)) - select { - case ch := <-w.quit: - w.quit <- ch - case w.Events <- event: - } - return true -} - -func toWindowsFlags(mask uint64) uint32 { - var m uint32 - if mask&sysFSACCESS != 0 { - m |= syscall.FILE_NOTIFY_CHANGE_LAST_ACCESS - } - if mask&sysFSMODIFY != 0 { - m |= syscall.FILE_NOTIFY_CHANGE_LAST_WRITE - } - if mask&sysFSATTRIB != 0 { - m |= syscall.FILE_NOTIFY_CHANGE_ATTRIBUTES - } - if mask&(sysFSMOVE|sysFSCREATE|sysFSDELETE) != 0 { - m |= syscall.FILE_NOTIFY_CHANGE_FILE_NAME | syscall.FILE_NOTIFY_CHANGE_DIR_NAME - } - return m -} - -func toFSnotifyFlags(action uint32) uint64 { - switch action { - case syscall.FILE_ACTION_ADDED: - return sysFSCREATE - case syscall.FILE_ACTION_REMOVED: - return sysFSDELETE - case syscall.FILE_ACTION_MODIFIED: - return sysFSMODIFY - case syscall.FILE_ACTION_RENAMED_OLD_NAME: - return sysFSMOVEDFROM - case syscall.FILE_ACTION_RENAMED_NEW_NAME: - return sysFSMOVEDTO - } - return 0 -} diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go index 9fca2e165..2e09f4fac 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/api/resource/generated.pb.go @@ -36,7 +36,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *Quantity) Reset() { *m = Quantity{} } func (*Quantity) ProtoMessage() {} diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/math.go b/vendor/k8s.io/apimachinery/pkg/api/resource/math.go index 7f63175d3..8ffcb9f09 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/math.go +++ b/vendor/k8s.io/apimachinery/pkg/api/resource/math.go @@ -37,12 +37,8 @@ var ( big1024 = big.NewInt(1024) // Commonly needed inf.Dec values-- treat as read only! - decZero = inf.NewDec(0, 0) - decOne = inf.NewDec(1, 0) - decMinusOne = inf.NewDec(-1, 0) - decThousand = inf.NewDec(1000, 0) - dec1024 = inf.NewDec(1024, 0) - decMinus1024 = inf.NewDec(-1024, 0) + decZero = inf.NewDec(0, 0) + decOne = inf.NewDec(1, 0) // Largest (in magnitude) number allowed. maxAllowed = infDecAmount{inf.NewDec((1<<63)-1, 0)} // == max int64 diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go index 516d041da..d95e03aa9 100644 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go +++ b/vendor/k8s.io/apimachinery/pkg/api/resource/quantity.go @@ -634,6 +634,11 @@ func (q Quantity) MarshalJSON() ([]byte, error) { return result, nil } +// ToUnstructured implements the value.UnstructuredConverter interface. +func (q Quantity) ToUnstructured() interface{} { + return q.String() +} + // UnmarshalJSON implements the json.Unmarshaller interface. // TODO: Remove support for leading/trailing whitespace func (q *Quantity) UnmarshalJSON(value []byte) error { diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go index b56140de5..ceb645278 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/internalversion/register.go @@ -47,19 +47,6 @@ func addToGroupVersion(scheme *runtime.Scheme) error { if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil { return err } - err := scheme.AddConversionFuncs( - metav1.Convert_string_To_labels_Selector, - metav1.Convert_labels_Selector_To_string, - - metav1.Convert_string_To_fields_Selector, - metav1.Convert_fields_Selector_To_string, - - metav1.Convert_Map_string_To_string_To_v1_LabelSelector, - metav1.Convert_v1_LabelSelector_To_Map_string_To_string, - ) - if err != nil { - return err - } // ListOptions is the only options struct which needs conversion (it exposes labels and fields // as selectors for convenience). The other types have only a single representation today. scheme.AddKnownTypes(SchemeGroupVersion, @@ -71,8 +58,8 @@ func addToGroupVersion(scheme *runtime.Scheme) error { &metav1.UpdateOptions{}, ) scheme.AddKnownTypes(SchemeGroupVersion, - &metav1beta1.Table{}, - &metav1beta1.TableOptions{}, + &metav1.Table{}, + &metav1.TableOptions{}, &metav1beta1.PartialObjectMetadata{}, &metav1beta1.PartialObjectMetadataList{}, ) @@ -87,6 +74,7 @@ func addToGroupVersion(scheme *runtime.Scheme) error { &metav1.DeleteOptions{}, &metav1.CreateOptions{}, &metav1.UpdateOptions{}) + metav1.AddToGroupVersion(scheme, metav1.SchemeGroupVersion) return nil } @@ -95,5 +83,4 @@ func addToGroupVersion(scheme *runtime.Scheme) error { // the logic for conversion private. func init() { localSchemeBuilder.Register(addToGroupVersion) - localSchemeBuilder.Register(metav1.RegisterConversions) } diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go index 285a41a42..b937398cd 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/conversion.go @@ -26,69 +26,10 @@ import ( "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" ) -func AddConversionFuncs(scheme *runtime.Scheme) error { - return scheme.AddConversionFuncs( - Convert_v1_TypeMeta_To_v1_TypeMeta, - - Convert_v1_ListMeta_To_v1_ListMeta, - - Convert_v1_DeleteOptions_To_v1_DeleteOptions, - - Convert_intstr_IntOrString_To_intstr_IntOrString, - Convert_Pointer_intstr_IntOrString_To_intstr_IntOrString, - Convert_intstr_IntOrString_To_Pointer_intstr_IntOrString, - - Convert_Pointer_v1_Duration_To_v1_Duration, - Convert_v1_Duration_To_Pointer_v1_Duration, - - Convert_Slice_string_To_v1_Time, - Convert_Slice_string_To_Pointer_v1_Time, - - Convert_v1_Time_To_v1_Time, - Convert_v1_MicroTime_To_v1_MicroTime, - - Convert_resource_Quantity_To_resource_Quantity, - - Convert_string_To_labels_Selector, - Convert_labels_Selector_To_string, - - Convert_string_To_fields_Selector, - Convert_fields_Selector_To_string, - - Convert_Pointer_bool_To_bool, - Convert_bool_To_Pointer_bool, - - Convert_Pointer_string_To_string, - Convert_string_To_Pointer_string, - - Convert_Pointer_int64_To_int, - Convert_int_To_Pointer_int64, - - Convert_Pointer_int32_To_int32, - Convert_int32_To_Pointer_int32, - - Convert_Pointer_int64_To_int64, - Convert_int64_To_Pointer_int64, - - Convert_Pointer_float64_To_float64, - Convert_float64_To_Pointer_float64, - - Convert_Map_string_To_string_To_v1_LabelSelector, - Convert_v1_LabelSelector_To_Map_string_To_string, - - Convert_Slice_string_To_Slice_int32, - - Convert_Slice_string_To_Pointer_v1_DeletionPropagation, - - Convert_Slice_string_To_v1_IncludeObjectPolicy, - ) -} - func Convert_Pointer_float64_To_float64(in **float64, out *float64, s conversion.Scope) error { if *in == nil { *out = 0 diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration.go index babe8a8b5..a22b07878 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/duration.go @@ -49,6 +49,11 @@ func (d Duration) MarshalJSON() ([]byte, error) { return json.Marshal(d.Duration.String()) } +// ToUnstructured implements the value.UnstructuredConverter interface. +func (d Duration) ToUnstructured() interface{} { + return d.Duration.String() +} + // OpenAPISchemaType is used by the kube-openapi generator when constructing // the OpenAPI spec of this type. // diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go index 31b1d955e..3288c5649 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/generated.pb.go @@ -47,7 +47,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *APIGroup) Reset() { *m = APIGroup{} } func (*APIGroup) ProtoMessage() {} @@ -11004,6 +11004,7 @@ func (m *WatchEvent) Unmarshal(dAtA []byte) error { func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -11035,10 +11036,8 @@ func skipGenerated(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -11059,55 +11058,30 @@ func skipGenerated(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthGenerated } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGenerated(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/register.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/register.go index a7b8aa34f..c1a077178 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/register.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/register.go @@ -53,15 +53,6 @@ var scheme = runtime.NewScheme() // ParameterCodec knows about query parameters used with the meta v1 API spec. var ParameterCodec = runtime.NewParameterCodec(scheme) -func addEventConversionFuncs(scheme *runtime.Scheme) error { - return scheme.AddConversionFuncs( - Convert_v1_WatchEvent_To_watch_Event, - Convert_v1_InternalEvent_To_v1_WatchEvent, - Convert_watch_Event_To_v1_WatchEvent, - Convert_v1_WatchEvent_To_v1_InternalEvent, - ) -} - var optionsTypes = []runtime.Object{ &ListOptions{}, &ExportOptions{}, @@ -90,10 +81,8 @@ func AddToGroupVersion(scheme *runtime.Scheme, groupVersion schema.GroupVersion) &APIResourceList{}, ) - utilruntime.Must(addEventConversionFuncs(scheme)) - // register manually. This usually goes through the SchemeBuilder, which we cannot use here. - utilruntime.Must(AddConversionFuncs(scheme)) + utilruntime.Must(RegisterConversions(scheme)) utilruntime.Must(RegisterDefaults(scheme)) } @@ -106,9 +95,7 @@ func AddMetaToScheme(scheme *runtime.Scheme) error { &PartialObjectMetadataList{}, ) - return scheme.AddConversionFuncs( - Convert_Slice_string_To_v1_IncludeObjectPolicy, - ) + return nil } func init() { diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go index fe510ed9e..4a1d89cfc 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/time.go @@ -153,6 +153,16 @@ func (t Time) MarshalJSON() ([]byte, error) { return buf, nil } +// ToUnstructured implements the value.UnstructuredConverter interface. +func (t Time) ToUnstructured() interface{} { + if t.IsZero() { + return nil + } + buf := make([]byte, 0, len(time.RFC3339)) + buf = t.UTC().AppendFormat(buf, time.RFC3339) + return string(buf) +} + // OpenAPISchemaType is used by the kube-openapi generator when constructing // the OpenAPI spec of this type. // diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go index bf125b62a..e7aaead8c 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go @@ -873,6 +873,9 @@ const ( // FieldManagerConflict is used to report when another client claims to manage this field, // It should only be returned for a request using server-side apply. CauseTypeFieldManagerConflict CauseType = "FieldManagerConflict" + // CauseTypeResourceVersionTooLarge is used to report that the requested resource version + // is newer than the data observed by the API server, so the request cannot be served. + CauseTypeResourceVersionTooLarge CauseType = "ResourceVersionTooLarge" ) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go index 2743793dd..fcd491f4c 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/validation/validation.go @@ -178,7 +178,7 @@ func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *fiel default: allErrs = append(allErrs, field.Invalid(fldPath.Child("operation"), fields.Operation, "must be `Apply` or `Update`")) } - if fields.FieldsType != "FieldsV1" { + if len(fields.FieldsType) > 0 && fields.FieldsType != "FieldsV1" { allErrs = append(allErrs, field.Invalid(fldPath.Child("fieldsType"), fields.FieldsType, "must be `FieldsV1`")) } } diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.pb.go index 5fae30ae8..cd5fc9026 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.pb.go @@ -42,7 +42,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *PartialObjectMetadataList) Reset() { *m = PartialObjectMetadataList{} } func (*PartialObjectMetadataList) ProtoMessage() {} @@ -81,28 +81,27 @@ func init() { } var fileDescriptor_90ec10f86b91f9a8 = []byte{ - // 321 bytes of a gzipped FileDescriptorProto + // 317 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x91, 0x41, 0x4b, 0xf3, 0x30, - 0x18, 0xc7, 0x9b, 0xf7, 0x65, 0x38, 0x3a, 0x04, 0xd9, 0x69, 0xee, 0x90, 0x0d, 0x4f, 0xf3, 0xb0, - 0x84, 0x0d, 0x11, 0xc1, 0xdb, 0x6e, 0x82, 0xa2, 0xec, 0x28, 0x1e, 0x4c, 0xbb, 0xc7, 0x2e, 0xd6, - 0x34, 0x25, 0x79, 0x3a, 0xf0, 0xe6, 0x47, 0xf0, 0x63, 0xed, 0xb8, 0xe3, 0x40, 0x18, 0xae, 0x7e, - 0x11, 0x49, 0x57, 0x45, 0xa6, 0x62, 0x6f, 0x79, 0xfe, 0xe1, 0xf7, 0xcb, 0x3f, 0x89, 0x3f, 0x8e, - 0x4f, 0x2c, 0x93, 0x9a, 0xc7, 0x59, 0x00, 0x26, 0x01, 0x04, 0xcb, 0x67, 0x90, 0x4c, 0xb4, 0xe1, - 0xe5, 0x86, 0x48, 0xa5, 0x12, 0xe1, 0x54, 0x26, 0x60, 0x1e, 0x79, 0x1a, 0x47, 0x2e, 0xb0, 0x5c, - 0x01, 0x0a, 0x3e, 0x1b, 0x04, 0x80, 0x62, 0xc0, 0x23, 0x48, 0xc0, 0x08, 0x84, 0x09, 0x4b, 0x8d, - 0x46, 0xdd, 0x3c, 0xdc, 0xa0, 0xec, 0x2b, 0xca, 0xd2, 0x38, 0x72, 0x81, 0x65, 0x0e, 0x65, 0x25, - 0xda, 0xee, 0x47, 0x12, 0xa7, 0x59, 0xc0, 0x42, 0xad, 0x78, 0xa4, 0x23, 0xcd, 0x0b, 0x43, 0x90, - 0xdd, 0x15, 0x53, 0x31, 0x14, 0xab, 0x8d, 0xb9, 0x7d, 0x54, 0xa5, 0xd4, 0x76, 0x9f, 0xf6, 0xaf, - 0x57, 0x31, 0x59, 0x82, 0x52, 0xc1, 0x37, 0xe0, 0xf8, 0x2f, 0xc0, 0x86, 0x53, 0x50, 0x62, 0x9b, - 0x3b, 0x78, 0x21, 0xfe, 0xfe, 0x95, 0x30, 0x28, 0xc5, 0xc3, 0x65, 0x70, 0x0f, 0x21, 0x5e, 0x00, - 0x8a, 0x89, 0x40, 0x71, 0x2e, 0x2d, 0x36, 0x6f, 0xfc, 0xba, 0x2a, 0xe7, 0xd6, 0xbf, 0x2e, 0xe9, - 0x35, 0x86, 0x8c, 0x55, 0x79, 0x29, 0xe6, 0x68, 0x67, 0x1a, 0xed, 0xcd, 0x57, 0x1d, 0x2f, 0x5f, - 0x75, 0xea, 0x1f, 0xc9, 0xf8, 0xd3, 0xd8, 0xbc, 0xf5, 0x6b, 0x12, 0x41, 0xd9, 0x16, 0xe9, 0xfe, - 0xef, 0x35, 0x86, 0xa7, 0xd5, 0xd4, 0x3f, 0xb6, 0x1d, 0xed, 0x96, 0xe7, 0xd4, 0xce, 0x9c, 0x71, - 0xbc, 0x11, 0x8f, 0xfa, 0xf3, 0x35, 0xf5, 0x16, 0x6b, 0xea, 0x2d, 0xd7, 0xd4, 0x7b, 0xca, 0x29, - 0x99, 0xe7, 0x94, 0x2c, 0x72, 0x4a, 0x96, 0x39, 0x25, 0xaf, 0x39, 0x25, 0xcf, 0x6f, 0xd4, 0xbb, - 0xde, 0x29, 0xbf, 0xf6, 0x3d, 0x00, 0x00, 0xff, 0xff, 0xc6, 0x7e, 0x00, 0x08, 0x5a, 0x02, 0x00, - 0x00, + 0x1c, 0xc6, 0x9b, 0xf7, 0x65, 0x38, 0x3a, 0x04, 0xd9, 0x69, 0xee, 0x90, 0x0d, 0x4f, 0xf3, 0xb0, + 0x84, 0x0d, 0x11, 0xc1, 0xdb, 0x6e, 0x82, 0xa2, 0xec, 0x28, 0x1e, 0x4c, 0xbb, 0xbf, 0x5d, 0xac, + 0x69, 0x4a, 0xf2, 0xef, 0xc0, 0x9b, 0x1f, 0xc1, 0x8f, 0xb5, 0xe3, 0x8e, 0x03, 0x61, 0xb8, 0xf8, + 0x45, 0x24, 0x5d, 0x15, 0x19, 0x0a, 0xbb, 0xf5, 0x79, 0xca, 0xef, 0x97, 0x27, 0x24, 0x1c, 0xa7, + 0x67, 0x96, 0x49, 0xcd, 0xd3, 0x22, 0x02, 0x93, 0x01, 0x82, 0xe5, 0x33, 0xc8, 0x26, 0xda, 0xf0, + 0xea, 0x87, 0xc8, 0xa5, 0x12, 0xf1, 0x54, 0x66, 0x60, 0x9e, 0x79, 0x9e, 0x26, 0xbe, 0xb0, 0x5c, + 0x01, 0x0a, 0x3e, 0x1b, 0x44, 0x80, 0x62, 0xc0, 0x13, 0xc8, 0xc0, 0x08, 0x84, 0x09, 0xcb, 0x8d, + 0x46, 0xdd, 0x3c, 0xde, 0xa0, 0xec, 0x27, 0xca, 0xf2, 0x34, 0xf1, 0x85, 0x65, 0x1e, 0x65, 0x15, + 0xda, 0xee, 0x27, 0x12, 0xa7, 0x45, 0xc4, 0x62, 0xad, 0x78, 0xa2, 0x13, 0xcd, 0x4b, 0x43, 0x54, + 0x3c, 0x94, 0xa9, 0x0c, 0xe5, 0xd7, 0xc6, 0xdc, 0x3e, 0xd9, 0x65, 0xd4, 0xf6, 0x9e, 0xf6, 0xe9, + 0x5f, 0x94, 0x29, 0x32, 0x94, 0x0a, 0xb8, 0x8d, 0xa7, 0xa0, 0xc4, 0x36, 0x77, 0xf4, 0x46, 0xc2, + 0xc3, 0x1b, 0x61, 0x50, 0x8a, 0xa7, 0xeb, 0xe8, 0x11, 0x62, 0xbc, 0x02, 0x14, 0x13, 0x81, 0xe2, + 0x52, 0x5a, 0x6c, 0xde, 0x85, 0x75, 0x55, 0xe5, 0xd6, 0xbf, 0x2e, 0xe9, 0x35, 0x86, 0x8c, 0xed, + 0x72, 0x71, 0xe6, 0x69, 0x6f, 0x1a, 0x1d, 0xcc, 0x57, 0x9d, 0xc0, 0xad, 0x3a, 0xf5, 0xaf, 0x66, + 0xfc, 0x6d, 0x6c, 0xde, 0x87, 0x35, 0x89, 0xa0, 0x6c, 0x8b, 0x74, 0xff, 0xf7, 0x1a, 0xc3, 0xf3, + 0xdd, 0xd4, 0xbf, 0xae, 0x1d, 0xed, 0x57, 0xe7, 0xd4, 0x2e, 0xbc, 0x71, 0xbc, 0x11, 0x8f, 0xfa, + 0xf3, 0x35, 0x0d, 0x16, 0x6b, 0x1a, 0x2c, 0xd7, 0x34, 0x78, 0x71, 0x94, 0xcc, 0x1d, 0x25, 0x0b, + 0x47, 0xc9, 0xd2, 0x51, 0xf2, 0xee, 0x28, 0x79, 0xfd, 0xa0, 0xc1, 0xed, 0x5e, 0xf5, 0x52, 0x9f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x82, 0x5b, 0x80, 0x29, 0x02, 0x00, 0x00, } func (m *PartialObjectMetadataList) Marshal() (dAtA []byte, err error) { @@ -333,6 +332,7 @@ func (m *PartialObjectMetadataList) Unmarshal(dAtA []byte) error { func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -364,10 +364,8 @@ func skipGenerated(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -388,55 +386,30 @@ func skipGenerated(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthGenerated } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGenerated(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto index 19606666f..59ce74376 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/generated.proto @@ -22,7 +22,6 @@ syntax = 'proto2'; package k8s.io.apimachinery.pkg.apis.meta.v1beta1; import "k8s.io/apimachinery/pkg/apis/meta/v1/generated.proto"; -import "k8s.io/apimachinery/pkg/runtime/generated.proto"; import "k8s.io/apimachinery/pkg/runtime/schema/generated.proto"; // Package-wide variables from generator "generated". diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/register.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/register.go index 4b4acd72f..8d11399fb 100644 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/register.go +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1beta1/register.go @@ -19,7 +19,6 @@ package v1beta1 import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - utilruntime "k8s.io/apimachinery/pkg/util/runtime" ) // GroupName is the group name for this API. @@ -33,12 +32,6 @@ func Kind(kind string) schema.GroupKind { return SchemeGroupVersion.WithKind(kind).GroupKind() } -// scheme is the registry for the common types that adhere to the meta v1beta1 API spec. -var scheme = runtime.NewScheme() - -// ParameterCodec knows about query parameters used with the meta v1beta1 API spec. -var ParameterCodec = runtime.NewParameterCodec(scheme) - // AddMetaToScheme registers base meta types into schemas. func AddMetaToScheme(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, @@ -48,14 +41,5 @@ func AddMetaToScheme(scheme *runtime.Scheme) error { &PartialObjectMetadataList{}, ) - return scheme.AddConversionFuncs( - Convert_Slice_string_To_v1beta1_IncludeObjectPolicy, - ) -} - -func init() { - utilruntime.Must(AddMetaToScheme(scheme)) - - // register manually. This usually goes through the SchemeBuilder, which we cannot use here. - utilruntime.Must(RegisterDefaults(scheme)) + return nil } diff --git a/vendor/k8s.io/apimachinery/pkg/conversion/converter.go b/vendor/k8s.io/apimachinery/pkg/conversion/converter.go index bc615dc3a..2d7c8bd1e 100644 --- a/vendor/k8s.io/apimachinery/pkg/conversion/converter.go +++ b/vendor/k8s.io/apimachinery/pkg/conversion/converter.go @@ -54,7 +54,8 @@ type Converter struct { generatedConversionFuncs ConversionFuncs // Set of conversions that should be treated as a no-op - ignoredConversions map[typePair]struct{} + ignoredConversions map[typePair]struct{} + ignoredUntypedConversions map[typePair]struct{} // This is a map from a source field type and name, to a list of destination // field type and name. @@ -83,17 +84,23 @@ type Converter struct { // NewConverter creates a new Converter object. func NewConverter(nameFn NameFunc) *Converter { c := &Converter{ - conversionFuncs: NewConversionFuncs(), - generatedConversionFuncs: NewConversionFuncs(), - ignoredConversions: make(map[typePair]struct{}), - nameFunc: nameFn, - structFieldDests: make(map[typeNamePair][]typeNamePair), - structFieldSources: make(map[typeNamePair][]typeNamePair), + conversionFuncs: NewConversionFuncs(), + generatedConversionFuncs: NewConversionFuncs(), + ignoredConversions: make(map[typePair]struct{}), + ignoredUntypedConversions: make(map[typePair]struct{}), + nameFunc: nameFn, + structFieldDests: make(map[typeNamePair][]typeNamePair), + structFieldSources: make(map[typeNamePair][]typeNamePair), inputFieldMappingFuncs: make(map[reflect.Type]FieldMappingFunc), inputDefaultFlags: make(map[reflect.Type]FieldMatchingFlags), } - c.RegisterConversionFunc(Convert_Slice_byte_To_Slice_byte) + c.RegisterUntypedConversionFunc( + (*[]byte)(nil), (*[]byte)(nil), + func(a, b interface{}, s Scope) error { + return Convert_Slice_byte_To_Slice_byte(a.(*[]byte), b.(*[]byte), s) + }, + ) return c } @@ -131,10 +138,6 @@ type Scope interface { // parameters, you'll run out of stack space before anything useful happens. Convert(src, dest interface{}, flags FieldMatchingFlags) error - // DefaultConvert performs the default conversion, without calling a conversion func - // on the current stack frame. This makes it safe to call from a conversion func. - DefaultConvert(src, dest interface{}, flags FieldMatchingFlags) error - // SrcTags and DestTags contain the struct tags that src and dest had, respectively. // If the enclosing object was not a struct, then these will contain no tags, of course. SrcTag() reflect.StructTag @@ -153,31 +156,14 @@ type FieldMappingFunc func(key string, sourceTag, destTag reflect.StructTag) (so func NewConversionFuncs() ConversionFuncs { return ConversionFuncs{ - fns: make(map[typePair]reflect.Value), untyped: make(map[typePair]ConversionFunc), } } type ConversionFuncs struct { - fns map[typePair]reflect.Value untyped map[typePair]ConversionFunc } -// Add adds the provided conversion functions to the lookup table - they must have the signature -// `func(type1, type2, Scope) error`. Functions are added in the order passed and will override -// previously registered pairs. -func (c ConversionFuncs) Add(fns ...interface{}) error { - for _, fn := range fns { - fv := reflect.ValueOf(fn) - ft := fv.Type() - if err := verifyConversionFunctionSignature(ft); err != nil { - return err - } - c.fns[typePair{ft.In(0).Elem(), ft.In(1).Elem()}] = fv - } - return nil -} - // AddUntyped adds the provided conversion function to the lookup table for the types that are // supplied as a and b. a and b must be pointers or an error is returned. This method overwrites // previously defined functions. @@ -197,12 +183,6 @@ func (c ConversionFuncs) AddUntyped(a, b interface{}, fn ConversionFunc) error { // both other and c, with other conversions taking precedence. func (c ConversionFuncs) Merge(other ConversionFuncs) ConversionFuncs { merged := NewConversionFuncs() - for k, v := range c.fns { - merged.fns[k] = v - } - for k, v := range other.fns { - merged.fns[k] = v - } for k, v := range c.untyped { merged.untyped[k] = v } @@ -290,12 +270,6 @@ func (s *scope) Convert(src, dest interface{}, flags FieldMatchingFlags) error { return s.converter.Convert(src, dest, flags, s.meta) } -// DefaultConvert continues a conversion, performing a default conversion (no conversion func) -// for the current stack frame. -func (s *scope) DefaultConvert(src, dest interface{}, flags FieldMatchingFlags) error { - return s.converter.DefaultConvert(src, dest, flags, s.meta) -} - // SrcTag returns the tag of the struct containing the current source item, if any. func (s *scope) SrcTag() reflect.StructTag { return s.srcStack.top().tag @@ -360,29 +334,6 @@ func verifyConversionFunctionSignature(ft reflect.Type) error { return nil } -// RegisterConversionFunc registers a conversion func with the -// Converter. conversionFunc must take three parameters: a pointer to the input -// type, a pointer to the output type, and a conversion.Scope (which should be -// used if recursive conversion calls are desired). It must return an error. -// -// Example: -// c.RegisterConversionFunc( -// func(in *Pod, out *v1.Pod, s Scope) error { -// // conversion logic... -// return nil -// }) -// DEPRECATED: Will be removed in favor of RegisterUntypedConversionFunc -func (c *Converter) RegisterConversionFunc(conversionFunc interface{}) error { - return c.conversionFuncs.Add(conversionFunc) -} - -// Similar to RegisterConversionFunc, but registers conversion function that were -// automatically generated. -// DEPRECATED: Will be removed in favor of RegisterGeneratedUntypedConversionFunc -func (c *Converter) RegisterGeneratedConversionFunc(conversionFunc interface{}) error { - return c.generatedConversionFuncs.Add(conversionFunc) -} - // RegisterUntypedConversionFunc registers a function that converts between a and b by passing objects of those // types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce // any other guarantee. @@ -409,6 +360,7 @@ func (c *Converter) RegisterIgnoredConversion(from, to interface{}) error { return fmt.Errorf("expected pointer arg for 'to' param 1, got: %v", typeTo) } c.ignoredConversions[typePair{typeFrom.Elem(), typeTo.Elem()}] = struct{}{} + c.ignoredUntypedConversions[typePair{typeFrom, typeTo}] = struct{}{} return nil } @@ -470,18 +422,6 @@ func (c *Converter) Convert(src, dest interface{}, flags FieldMatchingFlags, met return c.doConversion(src, dest, flags, meta, c.convert) } -// DefaultConvert will translate src to dest if it knows how. Both must be pointers. -// No conversion func is used. If the default copying mechanism -// doesn't work on this type pair, an error will be returned. -// Read the comments on the various FieldMatchingFlags constants to understand -// what the 'flags' parameter does. -// 'meta' is given to allow you to pass information to conversion functions, -// it is not used by DefaultConvert() other than storing it in the scope. -// Not safe for objects with cyclic references! -func (c *Converter) DefaultConvert(src, dest interface{}, flags FieldMatchingFlags, meta *Meta) error { - return c.doConversion(src, dest, flags, meta, c.defaultConvert) -} - type conversionFunc func(sv, dv reflect.Value, scope *scope) error func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags, meta *Meta, f conversionFunc) error { @@ -491,6 +431,11 @@ func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags flags: flags, meta: meta, } + + // ignore conversions of this type + if _, ok := c.ignoredUntypedConversions[pair]; ok { + return nil + } if fn, ok := c.conversionFuncs.untyped[pair]; ok { return fn(src, dest, scope) } @@ -517,33 +462,20 @@ func (c *Converter) doConversion(src, dest interface{}, flags FieldMatchingFlags return f(sv, dv, scope) } -// callCustom calls 'custom' with sv & dv. custom must be a conversion function. -func (c *Converter) callCustom(sv, dv, custom reflect.Value, scope *scope) error { - if !sv.CanAddr() { - sv2 := reflect.New(sv.Type()) - sv2.Elem().Set(sv) - sv = sv2 - } else { - sv = sv.Addr() - } +// callUntyped calls predefined conversion func. +func (c *Converter) callUntyped(sv, dv reflect.Value, f ConversionFunc, scope *scope) error { if !dv.CanAddr() { - if !dv.CanSet() { - return scope.errorf("can't addr or set dest.") - } - dvOrig := dv - dv := reflect.New(dvOrig.Type()) - defer func() { dvOrig.Set(dv) }() - } else { - dv = dv.Addr() + return scope.errorf("cant addr dest") } - args := []reflect.Value{sv, dv, reflect.ValueOf(scope)} - ret := custom.Call(args)[0].Interface() - // This convolution is necessary because nil interfaces won't convert - // to errors. - if ret == nil { - return nil + var svPointer reflect.Value + if sv.CanAddr() { + svPointer = sv.Addr() + } else { + svPointer = reflect.New(sv.Type()) + svPointer.Elem().Set(sv) } - return ret.(error) + dvPointer := dv.Addr() + return f(svPointer.Interface(), dvPointer.Interface(), scope) } // convert recursively copies sv into dv, calling an appropriate conversion function if @@ -561,27 +493,14 @@ func (c *Converter) convert(sv, dv reflect.Value, scope *scope) error { } // Convert sv to dv. - if fv, ok := c.conversionFuncs.fns[pair]; ok { - if c.Debug != nil { - c.Debug.Logf("Calling custom conversion of '%v' to '%v'", st, dt) - } - return c.callCustom(sv, dv, fv, scope) + pair = typePair{reflect.PtrTo(sv.Type()), reflect.PtrTo(dv.Type())} + if f, ok := c.conversionFuncs.untyped[pair]; ok { + return c.callUntyped(sv, dv, f, scope) } - if fv, ok := c.generatedConversionFuncs.fns[pair]; ok { - if c.Debug != nil { - c.Debug.Logf("Calling generated conversion of '%v' to '%v'", st, dt) - } - return c.callCustom(sv, dv, fv, scope) + if f, ok := c.generatedConversionFuncs.untyped[pair]; ok { + return c.callUntyped(sv, dv, f, scope) } - return c.defaultConvert(sv, dv, scope) -} - -// defaultConvert recursively copies sv into dv. no conversion function is called -// for the current stack frame (but conversion functions may be called for nested objects) -func (c *Converter) defaultConvert(sv, dv reflect.Value, scope *scope) error { - dt, st := dv.Type(), sv.Type() - if !dv.CanSet() { return scope.errorf("Cannot set dest. (Tried to deep copy something with unexported fields?)") } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go b/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go index 0947dce73..d04d701f3 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/conversion.go @@ -53,14 +53,6 @@ func JSONKeyMapper(key string, sourceTag, destTag reflect.StructTag) (string, st return key, key } -// DefaultStringConversions are helpers for converting []string and string to real values. -var DefaultStringConversions = []interface{}{ - Convert_Slice_string_To_string, - Convert_Slice_string_To_int, - Convert_Slice_string_To_bool, - Convert_Slice_string_To_int64, -} - func Convert_Slice_string_To_string(in *[]string, out *string, s conversion.Scope) error { if len(*in) == 0 { *out = "" @@ -178,3 +170,27 @@ func Convert_Slice_string_To_Pointer_int64(in *[]string, out **int64, s conversi *out = &i return nil } + +func RegisterStringConversions(s *Scheme) error { + if err := s.AddConversionFunc((*[]string)(nil), (*string)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_string_To_string(a.(*[]string), b.(*string), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]string)(nil), (*int)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_string_To_int(a.(*[]string), b.(*int), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]string)(nil), (*bool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_string_To_bool(a.(*[]string), b.(*bool), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*[]string)(nil), (*int64)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_Slice_string_To_int64(a.(*[]string), b.(*int64), scope) + }); err != nil { + return err + } + return nil +} diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/converter.go b/vendor/k8s.io/apimachinery/pkg/runtime/converter.go index b3e8a53b3..918d0831d 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/converter.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/converter.go @@ -17,7 +17,6 @@ limitations under the License. package runtime import ( - "bytes" encodingjson "encoding/json" "fmt" "math" @@ -32,6 +31,7 @@ import ( "k8s.io/apimachinery/pkg/conversion" "k8s.io/apimachinery/pkg/util/json" utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "sigs.k8s.io/structured-merge-diff/v3/value" "k8s.io/klog" ) @@ -68,13 +68,8 @@ func newFieldsCache() *fieldsCache { } var ( - marshalerType = reflect.TypeOf(new(encodingjson.Marshaler)).Elem() - unmarshalerType = reflect.TypeOf(new(encodingjson.Unmarshaler)).Elem() mapStringInterfaceType = reflect.TypeOf(map[string]interface{}{}) stringType = reflect.TypeOf(string("")) - int64Type = reflect.TypeOf(int64(0)) - float64Type = reflect.TypeOf(float64(0)) - boolType = reflect.TypeOf(bool(false)) fieldCache = newFieldsCache() // DefaultUnstructuredConverter performs unstructured to Go typed object conversions. @@ -208,13 +203,9 @@ func fromUnstructured(sv, dv reflect.Value) error { } // Check if the object has a custom JSON marshaller/unmarshaller. - if reflect.PtrTo(dt).Implements(unmarshalerType) { - data, err := json.Marshal(sv.Interface()) - if err != nil { - return fmt.Errorf("error encoding %s to json: %v", st.String(), err) - } - unmarshaler := dv.Addr().Interface().(encodingjson.Unmarshaler) - return unmarshaler.UnmarshalJSON(data) + entry := value.TypeReflectEntryOf(dv.Type()) + if entry.CanConvertFromUnstructured() { + return entry.FromUnstructured(sv, dv) } switch dt.Kind() { @@ -256,6 +247,7 @@ func fieldInfoFromField(structType reflect.Type, field int) *fieldInfo { for i := range items { if items[i] == "omitempty" { info.omitempty = true + break } } } @@ -483,112 +475,28 @@ func toUnstructuredViaJSON(obj interface{}, u *map[string]interface{}) error { return json.Unmarshal(data, u) } -var ( - nullBytes = []byte("null") - trueBytes = []byte("true") - falseBytes = []byte("false") -) - -func getMarshaler(v reflect.Value) (encodingjson.Marshaler, bool) { - // Check value receivers if v is not a pointer and pointer receivers if v is a pointer - if v.Type().Implements(marshalerType) { - return v.Interface().(encodingjson.Marshaler), true - } - // Check pointer receivers if v is not a pointer - if v.Kind() != reflect.Ptr && v.CanAddr() { - v = v.Addr() - if v.Type().Implements(marshalerType) { - return v.Interface().(encodingjson.Marshaler), true - } - } - return nil, false -} - func toUnstructured(sv, dv reflect.Value) error { - // Check if the object has a custom JSON marshaller/unmarshaller. - if marshaler, ok := getMarshaler(sv); ok { - if sv.Kind() == reflect.Ptr && sv.IsNil() { - // We're done - we don't need to store anything. - return nil - } - - data, err := marshaler.MarshalJSON() + // Check if the object has a custom string converter. + entry := value.TypeReflectEntryOf(sv.Type()) + if entry.CanConvertToUnstructured() { + v, err := entry.ToUnstructured(sv) if err != nil { return err } - switch { - case len(data) == 0: - return fmt.Errorf("error decoding from json: empty value") - - case bytes.Equal(data, nullBytes): - // We're done - we don't need to store anything. - - case bytes.Equal(data, trueBytes): - dv.Set(reflect.ValueOf(true)) - - case bytes.Equal(data, falseBytes): - dv.Set(reflect.ValueOf(false)) - - case data[0] == '"': - var result string - err := json.Unmarshal(data, &result) - if err != nil { - return fmt.Errorf("error decoding string from json: %v", err) - } - dv.Set(reflect.ValueOf(result)) - - case data[0] == '{': - result := make(map[string]interface{}) - err := json.Unmarshal(data, &result) - if err != nil { - return fmt.Errorf("error decoding object from json: %v", err) - } - dv.Set(reflect.ValueOf(result)) - - case data[0] == '[': - result := make([]interface{}, 0) - err := json.Unmarshal(data, &result) - if err != nil { - return fmt.Errorf("error decoding array from json: %v", err) - } - dv.Set(reflect.ValueOf(result)) - - default: - var ( - resultInt int64 - resultFloat float64 - err error - ) - if err = json.Unmarshal(data, &resultInt); err == nil { - dv.Set(reflect.ValueOf(resultInt)) - } else if err = json.Unmarshal(data, &resultFloat); err == nil { - dv.Set(reflect.ValueOf(resultFloat)) - } else { - return fmt.Errorf("error decoding number from json: %v", err) - } + if v != nil { + dv.Set(reflect.ValueOf(v)) } - return nil } - - st, dt := sv.Type(), dv.Type() + st := sv.Type() switch st.Kind() { case reflect.String: - if dt.Kind() == reflect.Interface && dv.NumMethod() == 0 { - dv.Set(reflect.New(stringType)) - } dv.Set(reflect.ValueOf(sv.String())) return nil case reflect.Bool: - if dt.Kind() == reflect.Interface && dv.NumMethod() == 0 { - dv.Set(reflect.New(boolType)) - } dv.Set(reflect.ValueOf(sv.Bool())) return nil case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if dt.Kind() == reflect.Interface && dv.NumMethod() == 0 { - dv.Set(reflect.New(int64Type)) - } dv.Set(reflect.ValueOf(sv.Int())) return nil case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: @@ -596,15 +504,9 @@ func toUnstructured(sv, dv reflect.Value) error { if uVal > math.MaxInt64 { return fmt.Errorf("unsigned value %d does not fit into int64 (overflow)", uVal) } - if dt.Kind() == reflect.Interface && dv.NumMethod() == 0 { - dv.Set(reflect.New(int64Type)) - } dv.Set(reflect.ValueOf(int64(uVal))) return nil case reflect.Float32, reflect.Float64: - if dt.Kind() == reflect.Interface && dv.NumMethod() == 0 { - dv.Set(reflect.New(float64Type)) - } dv.Set(reflect.ValueOf(sv.Float())) return nil case reflect.Map: diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/embedded.go b/vendor/k8s.io/apimachinery/pkg/runtime/embedded.go index db11eb8bc..7251e65f6 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/embedded.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/embedded.go @@ -134,9 +134,16 @@ func Convert_runtime_RawExtension_To_runtime_Object(in *RawExtension, out *Objec return nil } -func DefaultEmbeddedConversions() []interface{} { - return []interface{}{ - Convert_runtime_Object_To_runtime_RawExtension, - Convert_runtime_RawExtension_To_runtime_Object, +func RegisterEmbeddedConversions(s *Scheme) error { + if err := s.AddConversionFunc((*Object)(nil), (*RawExtension)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_runtime_Object_To_runtime_RawExtension(a.(*Object), b.(*RawExtension), scope) + }); err != nil { + return err } + if err := s.AddConversionFunc((*RawExtension)(nil), (*Object)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_runtime_RawExtension_To_runtime_Object(a.(*RawExtension), b.(*Object), scope) + }); err != nil { + return err + } + return nil } diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go index af2f076b8..071971817 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/generated.pb.go @@ -40,7 +40,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *RawExtension) Reset() { *m = RawExtension{} } func (*RawExtension) ProtoMessage() {} @@ -772,6 +772,7 @@ func (m *Unknown) Unmarshal(dAtA []byte) error { func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -803,10 +804,8 @@ func skipGenerated(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -827,55 +826,30 @@ func skipGenerated(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthGenerated } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGenerated(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go index a7276649f..29d3ac45b 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.pb.go @@ -36,7 +36,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func init() { proto.RegisterFile("k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/runtime/schema/generated.proto", fileDescriptor_0462724132518e0d) diff --git a/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go b/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go index fd37e293a..4b739ec38 100644 --- a/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go +++ b/vendor/k8s.io/apimachinery/pkg/runtime/scheme.go @@ -102,10 +102,10 @@ func NewScheme() *Scheme { } s.converter = conversion.NewConverter(s.nameFunc) - utilruntime.Must(s.AddConversionFuncs(DefaultEmbeddedConversions()...)) + // Enable couple default conversions by default. + utilruntime.Must(RegisterEmbeddedConversions(s)) + utilruntime.Must(RegisterStringConversions(s)) - // Enable map[string][]string conversions by default - utilruntime.Must(s.AddConversionFuncs(DefaultStringConversions...)) utilruntime.Must(s.RegisterInputDefaults(&map[string][]string{}, JSONKeyMapper, conversion.AllowDifferentFieldTypeNames|conversion.IgnoreMissingFields)) utilruntime.Must(s.RegisterInputDefaults(&url.Values{}, JSONKeyMapper, conversion.AllowDifferentFieldTypeNames|conversion.IgnoreMissingFields)) return s @@ -308,45 +308,6 @@ func (s *Scheme) AddIgnoredConversionType(from, to interface{}) error { return s.converter.RegisterIgnoredConversion(from, to) } -// AddConversionFuncs adds functions to the list of conversion functions. The given -// functions should know how to convert between two of your API objects, or their -// sub-objects. We deduce how to call these functions from the types of their two -// parameters; see the comment for Converter.Register. -// -// Note that, if you need to copy sub-objects that didn't change, you can use the -// conversion.Scope object that will be passed to your conversion function. -// Additionally, all conversions started by Scheme will set the SrcVersion and -// DestVersion fields on the Meta object. Example: -// -// s.AddConversionFuncs( -// func(in *InternalObject, out *ExternalObject, scope conversion.Scope) error { -// // You can depend on Meta() being non-nil, and this being set to -// // the source version, e.g., "" -// s.Meta().SrcVersion -// // You can depend on this being set to the destination version, -// // e.g., "v1". -// s.Meta().DestVersion -// // Call scope.Convert to copy sub-fields. -// s.Convert(&in.SubFieldThatMoved, &out.NewLocation.NewName, 0) -// return nil -// }, -// ) -// -// (For more detail about conversion functions, see Converter.Register's comment.) -// -// Also note that the default behavior, if you don't add a conversion function, is to -// sanely copy fields that have the same names and same type names. It's OK if the -// destination type has extra fields, but it must not remove any. So you only need to -// add conversion functions for things with changed/removed fields. -func (s *Scheme) AddConversionFuncs(conversionFuncs ...interface{}) error { - for _, f := range conversionFuncs { - if err := s.converter.RegisterConversionFunc(f); err != nil { - return err - } - } - return nil -} - // AddConversionFunc registers a function that converts between a and b by passing objects of those // types to the provided function. The function *must* accept objects of a and b - this machinery will not enforce // any other guarantee. diff --git a/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go b/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go index 1689e62e8..6cf13d83d 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go +++ b/vendor/k8s.io/apimachinery/pkg/util/clock/clock.go @@ -52,23 +52,26 @@ func (RealClock) Since(ts time.Time) time.Duration { return time.Since(ts) } -// Same as time.After(d). +// After is the same as time.After(d). func (RealClock) After(d time.Duration) <-chan time.Time { return time.After(d) } +// NewTimer returns a new Timer. func (RealClock) NewTimer(d time.Duration) Timer { return &realTimer{ timer: time.NewTimer(d), } } +// NewTicker returns a new Ticker. func (RealClock) NewTicker(d time.Duration) Ticker { return &realTicker{ ticker: time.NewTicker(d), } } +// Sleep pauses the RealClock for duration d. func (RealClock) Sleep(d time.Duration) { time.Sleep(d) } @@ -94,12 +97,14 @@ type fakeClockWaiter struct { destChan chan time.Time } +// NewFakePassiveClock returns a new FakePassiveClock. func NewFakePassiveClock(t time.Time) *FakePassiveClock { return &FakePassiveClock{ time: t, } } +// NewFakeClock returns a new FakeClock func NewFakeClock(t time.Time) *FakeClock { return &FakeClock{ FakePassiveClock: *NewFakePassiveClock(t), @@ -120,14 +125,14 @@ func (f *FakePassiveClock) Since(ts time.Time) time.Duration { return f.time.Sub(ts) } -// Sets the time. +// SetTime sets the time on the FakePassiveClock. func (f *FakePassiveClock) SetTime(t time.Time) { f.lock.Lock() defer f.lock.Unlock() f.time = t } -// Fake version of time.After(d). +// After is the Fake version of time.After(d). func (f *FakeClock) After(d time.Duration) <-chan time.Time { f.lock.Lock() defer f.lock.Unlock() @@ -140,7 +145,7 @@ func (f *FakeClock) After(d time.Duration) <-chan time.Time { return ch } -// Fake version of time.NewTimer(d). +// NewTimer is the Fake version of time.NewTimer(d). func (f *FakeClock) NewTimer(d time.Duration) Timer { f.lock.Lock() defer f.lock.Unlock() @@ -157,6 +162,7 @@ func (f *FakeClock) NewTimer(d time.Duration) Timer { return timer } +// NewTicker returns a new Ticker. func (f *FakeClock) NewTicker(d time.Duration) Ticker { f.lock.Lock() defer f.lock.Unlock() @@ -174,14 +180,14 @@ func (f *FakeClock) NewTicker(d time.Duration) Ticker { } } -// Move clock by Duration, notify anyone that's called After, Tick, or NewTimer +// Step moves clock by Duration, notifies anyone that's called After, Tick, or NewTimer func (f *FakeClock) Step(d time.Duration) { f.lock.Lock() defer f.lock.Unlock() f.setTimeLocked(f.time.Add(d)) } -// Sets the time. +// SetTime sets the time on a FakeClock. func (f *FakeClock) SetTime(t time.Time) { f.lock.Lock() defer f.lock.Unlock() @@ -219,7 +225,7 @@ func (f *FakeClock) setTimeLocked(t time.Time) { f.waiters = newWaiters } -// Returns true if After has been called on f but not yet satisfied (so you can +// HasWaiters returns true if After has been called on f but not yet satisfied (so you can // write race-free tests). func (f *FakeClock) HasWaiters() bool { f.lock.RLock() @@ -227,6 +233,7 @@ func (f *FakeClock) HasWaiters() bool { return len(f.waiters) > 0 } +// Sleep pauses the FakeClock for duration d. func (f *FakeClock) Sleep(d time.Duration) { f.Step(d) } @@ -248,24 +255,25 @@ func (i *IntervalClock) Since(ts time.Time) time.Duration { return i.Time.Sub(ts) } -// Unimplemented, will panic. +// After is currently unimplemented, will panic. // TODO: make interval clock use FakeClock so this can be implemented. func (*IntervalClock) After(d time.Duration) <-chan time.Time { panic("IntervalClock doesn't implement After") } -// Unimplemented, will panic. +// NewTimer is currently unimplemented, will panic. // TODO: make interval clock use FakeClock so this can be implemented. func (*IntervalClock) NewTimer(d time.Duration) Timer { panic("IntervalClock doesn't implement NewTimer") } -// Unimplemented, will panic. +// NewTicker is currently unimplemented, will panic. // TODO: make interval clock use FakeClock so this can be implemented. func (*IntervalClock) NewTicker(d time.Duration) Ticker { panic("IntervalClock doesn't implement NewTicker") } +// Sleep is currently unimplemented; will panic. func (*IntervalClock) Sleep(d time.Duration) { panic("IntervalClock doesn't implement Sleep") } @@ -355,6 +363,7 @@ func (f *fakeTimer) Reset(d time.Duration) bool { return false } +// Ticker defines the Ticker interface type Ticker interface { C() <-chan time.Time Stop() diff --git a/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go b/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go index 62a73f34e..5bafc218e 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go +++ b/vendor/k8s.io/apimachinery/pkg/util/errors/errors.go @@ -28,9 +28,14 @@ type MessageCountMap map[string]int // Aggregate represents an object that contains multiple errors, but does not // necessarily have singular semantic meaning. +// The aggregate can be used with `errors.Is()` to check for the occurrence of +// a specific error type. +// Errors.As() is not supported, because the caller presumably cares about a +// specific error of potentially multiple that match the given type. type Aggregate interface { error Errors() []error + Is(error) bool } // NewAggregate converts a slice of errors into an Aggregate interface, which @@ -71,16 +76,17 @@ func (agg aggregate) Error() string { } seenerrs := sets.NewString() result := "" - agg.visit(func(err error) { + agg.visit(func(err error) bool { msg := err.Error() if seenerrs.Has(msg) { - return + return false } seenerrs.Insert(msg) if len(seenerrs) > 1 { result += ", " } result += msg + return false }) if len(seenerrs) == 1 { return result @@ -88,19 +94,33 @@ func (agg aggregate) Error() string { return "[" + result + "]" } -func (agg aggregate) visit(f func(err error)) { +func (agg aggregate) Is(target error) bool { + return agg.visit(func(err error) bool { + return errors.Is(err, target) + }) +} + +func (agg aggregate) visit(f func(err error) bool) bool { for _, err := range agg { switch err := err.(type) { case aggregate: - err.visit(f) + if match := err.visit(f); match { + return match + } case Aggregate: for _, nestedErr := range err.Errors() { - f(nestedErr) + if match := f(nestedErr); match { + return match + } } default: - f(err) + if match := f(err); match { + return match + } } } + + return false } // Errors is part of the Aggregate interface. diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go b/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go index 64cbc7703..ec1cb70f2 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go +++ b/vendor/k8s.io/apimachinery/pkg/util/intstr/generated.pb.go @@ -38,7 +38,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package func (m *IntOrString) Reset() { *m = IntOrString{} } func (*IntOrString) ProtoMessage() {} @@ -289,6 +289,7 @@ func (m *IntOrString) Unmarshal(dAtA []byte) error { func skipGenerated(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -320,10 +321,8 @@ func skipGenerated(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -344,55 +343,30 @@ func skipGenerated(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthGenerated } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenerated - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipGenerated(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthGenerated - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenerated + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenerated + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthGenerated = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenerated = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group") ) diff --git a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go index 2df629555..cb974dcf7 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go +++ b/vendor/k8s.io/apimachinery/pkg/util/intstr/intstr.go @@ -97,7 +97,8 @@ func (intstr *IntOrString) String() string { } // IntValue returns the IntVal if type Int, or if -// it is a String, will attempt a conversion to int. +// it is a String, will attempt a conversion to int, +// returning 0 if a parsing error occurs. func (intstr *IntOrString) IntValue() int { if intstr.Type == String { i, _ := strconv.Atoi(intstr.StrVal) diff --git a/vendor/k8s.io/apimachinery/pkg/util/net/http.go b/vendor/k8s.io/apimachinery/pkg/util/net/http.go index bd79d6c4a..7b64e6815 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/net/http.go +++ b/vendor/k8s.io/apimachinery/pkg/util/net/http.go @@ -212,13 +212,17 @@ func GetHTTPClient(req *http.Request) string { return "unknown" } -// SourceIPs splits the comma separated X-Forwarded-For header or returns the X-Real-Ip header or req.RemoteAddr, -// in that order, ignoring invalid IPs. It returns nil if all of these are empty or invalid. +// SourceIPs splits the comma separated X-Forwarded-For header and joins it with +// the X-Real-Ip header and/or req.RemoteAddr, ignoring invalid IPs. +// The X-Real-Ip is omitted if it's already present in the X-Forwarded-For chain. +// The req.RemoteAddr is always the last IP in the returned list. +// It returns nil if all of these are empty or invalid. func SourceIPs(req *http.Request) []net.IP { + var srcIPs []net.IP + hdr := req.Header // First check the X-Forwarded-For header for requests via proxy. hdrForwardedFor := hdr.Get("X-Forwarded-For") - forwardedForIPs := []net.IP{} if hdrForwardedFor != "" { // X-Forwarded-For can be a csv of IPs in case of multiple proxies. // Use the first valid one. @@ -226,38 +230,49 @@ func SourceIPs(req *http.Request) []net.IP { for _, part := range parts { ip := net.ParseIP(strings.TrimSpace(part)) if ip != nil { - forwardedForIPs = append(forwardedForIPs, ip) + srcIPs = append(srcIPs, ip) } } } - if len(forwardedForIPs) > 0 { - return forwardedForIPs - } // Try the X-Real-Ip header. hdrRealIp := hdr.Get("X-Real-Ip") if hdrRealIp != "" { ip := net.ParseIP(hdrRealIp) - if ip != nil { - return []net.IP{ip} + // Only append the X-Real-Ip if it's not already contained in the X-Forwarded-For chain. + if ip != nil && !containsIP(srcIPs, ip) { + srcIPs = append(srcIPs, ip) } } - // Fallback to Remote Address in request, which will give the correct client IP when there is no proxy. + // Always include the request Remote Address as it cannot be easily spoofed. + var remoteIP net.IP // Remote Address in Go's HTTP server is in the form host:port so we need to split that first. host, _, err := net.SplitHostPort(req.RemoteAddr) if err == nil { - if remoteIP := net.ParseIP(host); remoteIP != nil { - return []net.IP{remoteIP} - } + remoteIP = net.ParseIP(host) } - // Fallback if Remote Address was just IP. - if remoteIP := net.ParseIP(req.RemoteAddr); remoteIP != nil { - return []net.IP{remoteIP} + if remoteIP == nil { + remoteIP = net.ParseIP(req.RemoteAddr) } - return nil + // Don't duplicate remote IP if it's already the last address in the chain. + if remoteIP != nil && (len(srcIPs) == 0 || !remoteIP.Equal(srcIPs[len(srcIPs)-1])) { + srcIPs = append(srcIPs, remoteIP) + } + + return srcIPs +} + +// Checks whether the given IP address is contained in the list of IPs. +func containsIP(ips []net.IP, ip net.IP) bool { + for _, v := range ips { + if v.Equal(ip) { + return true + } + } + return false } // Extracts and returns the clients IP from the given request. @@ -431,7 +446,7 @@ redirectLoop: // Only follow redirects to the same host. Otherwise, propagate the redirect response back. if requireSameHostRedirects && location.Hostname() != originalLocation.Hostname() { - break redirectLoop + return nil, nil, fmt.Errorf("hostname mismatch: expected %s, found %s", originalLocation.Hostname(), location.Hostname()) } // Reset the connection. diff --git a/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go b/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go index 8e1907c2a..915231f2e 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go +++ b/vendor/k8s.io/apimachinery/pkg/util/validation/validation.go @@ -109,6 +109,44 @@ func IsFullyQualifiedDomainName(fldPath *field.Path, name string) field.ErrorLis return allErrors } +// Allowed characters in an HTTP Path as defined by RFC 3986. A HTTP path may +// contain: +// * unreserved characters (alphanumeric, '-', '.', '_', '~') +// * percent-encoded octets +// * sub-delims ("!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=") +// * a colon character (":") +const httpPathFmt string = `[A-Za-z0-9/\-._~%!$&'()*+,;=:]+` + +var httpPathRegexp = regexp.MustCompile("^" + httpPathFmt + "$") + +// IsDomainPrefixedPath checks if the given string is a domain-prefixed path +// (e.g. acme.io/foo). All characters before the first "/" must be a valid +// subdomain as defined by RFC 1123. All characters trailing the first "/" must +// be valid HTTP Path characters as defined by RFC 3986. +func IsDomainPrefixedPath(fldPath *field.Path, dpPath string) field.ErrorList { + var allErrs field.ErrorList + if len(dpPath) == 0 { + return append(allErrs, field.Required(fldPath, "")) + } + + segments := strings.SplitN(dpPath, "/", 2) + if len(segments) != 2 || len(segments[0]) == 0 || len(segments[1]) == 0 { + return append(allErrs, field.Invalid(fldPath, dpPath, "must be a domain-prefixed path (such as \"acme.io/foo\")")) + } + + host := segments[0] + for _, err := range IsDNS1123Subdomain(host) { + allErrs = append(allErrs, field.Invalid(fldPath, host, err)) + } + + path := segments[1] + if !httpPathRegexp.MatchString(path) { + return append(allErrs, field.Invalid(fldPath, path, RegexError("Invalid path", httpPathFmt))) + } + + return allErrs +} + const labelValueFmt string = "(" + qualifiedNameFmt + ")?" const labelValueErrMsg string = "a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character" diff --git a/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go b/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go index 386c3e7ea..d759d912b 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go +++ b/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go @@ -19,10 +19,12 @@ package wait import ( "context" "errors" + "math" "math/rand" "sync" "time" + "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/runtime" ) @@ -128,9 +130,15 @@ func NonSlidingUntilWithContext(ctx context.Context, f func(context.Context), pe // Close stopCh to stop. f may not be invoked if stop channel is already // closed. Pass NeverStop to if you don't want it stop. func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding bool, stopCh <-chan struct{}) { - var t *time.Timer - var sawTimeout bool + BackoffUntil(f, NewJitteredBackoffManager(period, jitterFactor, &clock.RealClock{}), sliding, stopCh) +} +// BackoffUntil loops until stop channel is closed, run f every duration given by BackoffManager. +// +// If sliding is true, the period is computed after f runs. If it is false then +// period includes the runtime for f. +func BackoffUntil(f func(), backoff BackoffManager, sliding bool, stopCh <-chan struct{}) { + var t clock.Timer for { select { case <-stopCh: @@ -138,13 +146,8 @@ func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding b default: } - jitteredPeriod := period - if jitterFactor > 0.0 { - jitteredPeriod = Jitter(period, jitterFactor) - } - if !sliding { - t = resetOrReuseTimer(t, jitteredPeriod, sawTimeout) + t = backoff.Backoff() } func() { @@ -153,7 +156,7 @@ func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding b }() if sliding { - t = resetOrReuseTimer(t, jitteredPeriod, sawTimeout) + t = backoff.Backoff() } // NOTE: b/c there is no priority selection in golang @@ -164,8 +167,7 @@ func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding b select { case <-stopCh: return - case <-t.C: - sawTimeout = true + case <-t.C(): } } } @@ -203,6 +205,12 @@ var ErrWaitTimeout = errors.New("timed out waiting for the condition") // if the loop should be aborted. type ConditionFunc func() (done bool, err error) +// runConditionWithCrashProtection runs a ConditionFunc with crash protection +func runConditionWithCrashProtection(condition ConditionFunc) (bool, error) { + defer runtime.HandleCrash() + return condition() +} + // Backoff holds parameters applied to a Backoff function. type Backoff struct { // The initial duration. @@ -277,6 +285,105 @@ func contextForChannel(parentCh <-chan struct{}) (context.Context, context.Cance return ctx, cancel } +// BackoffManager manages backoff with a particular scheme based on its underlying implementation. It provides +// an interface to return a timer for backoff, and caller shall backoff until Timer.C() drains. If the second Backoff() +// is called before the timer from the first Backoff() call finishes, the first timer will NOT be drained and result in +// undetermined behavior. +// The BackoffManager is supposed to be called in a single-threaded environment. +type BackoffManager interface { + Backoff() clock.Timer +} + +type exponentialBackoffManagerImpl struct { + backoff *Backoff + backoffTimer clock.Timer + lastBackoffStart time.Time + initialBackoff time.Duration + backoffResetDuration time.Duration + clock clock.Clock +} + +// NewExponentialBackoffManager returns a manager for managing exponential backoff. Each backoff is jittered and +// backoff will not exceed the given max. If the backoff is not called within resetDuration, the backoff is reset. +// This backoff manager is used to reduce load during upstream unhealthiness. +func NewExponentialBackoffManager(initBackoff, maxBackoff, resetDuration time.Duration, backoffFactor, jitter float64, c clock.Clock) BackoffManager { + return &exponentialBackoffManagerImpl{ + backoff: &Backoff{ + Duration: initBackoff, + Factor: backoffFactor, + Jitter: jitter, + + // the current impl of wait.Backoff returns Backoff.Duration once steps are used up, which is not + // what we ideally need here, we set it to max int and assume we will never use up the steps + Steps: math.MaxInt32, + Cap: maxBackoff, + }, + backoffTimer: nil, + initialBackoff: initBackoff, + lastBackoffStart: c.Now(), + backoffResetDuration: resetDuration, + clock: c, + } +} + +func (b *exponentialBackoffManagerImpl) getNextBackoff() time.Duration { + if b.clock.Now().Sub(b.lastBackoffStart) > b.backoffResetDuration { + b.backoff.Steps = math.MaxInt32 + b.backoff.Duration = b.initialBackoff + } + b.lastBackoffStart = b.clock.Now() + return b.backoff.Step() +} + +// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer for exponential backoff. +// The returned timer must be drained before calling Backoff() the second time +func (b *exponentialBackoffManagerImpl) Backoff() clock.Timer { + if b.backoffTimer == nil { + b.backoffTimer = b.clock.NewTimer(b.getNextBackoff()) + } else { + b.backoffTimer.Reset(b.getNextBackoff()) + } + return b.backoffTimer +} + +type jitteredBackoffManagerImpl struct { + clock clock.Clock + duration time.Duration + jitter float64 + backoffTimer clock.Timer +} + +// NewJitteredBackoffManager returns a BackoffManager that backoffs with given duration plus given jitter. If the jitter +// is negative, backoff will not be jittered. +func NewJitteredBackoffManager(duration time.Duration, jitter float64, c clock.Clock) BackoffManager { + return &jitteredBackoffManagerImpl{ + clock: c, + duration: duration, + jitter: jitter, + backoffTimer: nil, + } +} + +func (j *jitteredBackoffManagerImpl) getNextBackoff() time.Duration { + jitteredPeriod := j.duration + if j.jitter > 0.0 { + jitteredPeriod = Jitter(j.duration, j.jitter) + } + return jitteredPeriod +} + +// Backoff implements BackoffManager.Backoff, it returns a timer so caller can block on the timer for jittered backoff. +// The returned timer must be drained before calling Backoff() the second time +func (j *jitteredBackoffManagerImpl) Backoff() clock.Timer { + backoff := j.getNextBackoff() + if j.backoffTimer == nil { + j.backoffTimer = j.clock.NewTimer(backoff) + } else { + j.backoffTimer.Reset(backoff) + } + return j.backoffTimer +} + // ExponentialBackoff repeats a condition check with exponential backoff. // // It repeatedly checks the condition and then sleeps, using `backoff.Step()` @@ -289,7 +396,7 @@ func contextForChannel(parentCh <-chan struct{}) (context.Context, context.Cance // In all other cases, ErrWaitTimeout is returned. func ExponentialBackoff(backoff Backoff, condition ConditionFunc) error { for backoff.Steps > 0 { - if ok, err := condition(); err != nil || ok { + if ok, err := runConditionWithCrashProtection(condition); err != nil || ok { return err } if backoff.Steps == 1 { @@ -335,7 +442,7 @@ func PollImmediate(interval, timeout time.Duration, condition ConditionFunc) err } func pollImmediateInternal(wait WaitFunc, condition ConditionFunc) error { - done, err := condition() + done, err := runConditionWithCrashProtection(condition) if err != nil { return err } @@ -364,7 +471,7 @@ func PollInfinite(interval time.Duration, condition ConditionFunc) error { // Some intervals may be missed if the condition takes too long or the time // window is too short. func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error { - done, err := condition() + done, err := runConditionWithCrashProtection(condition) if err != nil { return err } @@ -431,7 +538,7 @@ func WaitFor(wait WaitFunc, fn ConditionFunc, done <-chan struct{}) error { for { select { case _, open := <-c: - ok, err := fn() + ok, err := runConditionWithCrashProtection(fn) if err != nil { return err } @@ -497,16 +604,3 @@ func poller(interval, timeout time.Duration) WaitFunc { return ch }) } - -// resetOrReuseTimer avoids allocating a new timer if one is already in use. -// Not safe for multiple threads. -func resetOrReuseTimer(t *time.Timer, d time.Duration, sawTimeout bool) *time.Timer { - if t == nil { - return time.NewTimer(d) - } - if !t.Stop() && !sawTimeout { - <-t.C - } - t.Reset(d) - return t -} diff --git a/vendor/k8s.io/apimachinery/pkg/watch/watch.go b/vendor/k8s.io/apimachinery/pkg/watch/watch.go index 3945be3ae..988aba3ed 100644 --- a/vendor/k8s.io/apimachinery/pkg/watch/watch.go +++ b/vendor/k8s.io/apimachinery/pkg/watch/watch.go @@ -90,7 +90,7 @@ func (w emptyWatch) ResultChan() <-chan Event { // FakeWatcher lets you test anything that consumes a watch.Interface; threadsafe. type FakeWatcher struct { result chan Event - Stopped bool + stopped bool sync.Mutex } @@ -110,24 +110,24 @@ func NewFakeWithChanSize(size int, blocking bool) *FakeWatcher { func (f *FakeWatcher) Stop() { f.Lock() defer f.Unlock() - if !f.Stopped { + if !f.stopped { klog.V(4).Infof("Stopping fake watcher.") close(f.result) - f.Stopped = true + f.stopped = true } } func (f *FakeWatcher) IsStopped() bool { f.Lock() defer f.Unlock() - return f.Stopped + return f.stopped } // Reset prepares the watcher to be reused. func (f *FakeWatcher) Reset() { f.Lock() defer f.Unlock() - f.Stopped = false + f.stopped = false f.result = make(chan Event) } diff --git a/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go b/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go index 31e421566..82a7cc470 100644 --- a/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go +++ b/vendor/k8s.io/client-go/discovery/cached/memory/memcache.go @@ -190,16 +190,29 @@ func (d *memCacheClient) refreshLocked() error { return err } + wg := &sync.WaitGroup{} + resultLock := &sync.Mutex{} rl := map[string]*cacheEntry{} for _, g := range gl.Groups { for _, v := range g.Versions { - r, err := d.serverResourcesForGroupVersion(v.GroupVersion) - rl[v.GroupVersion] = &cacheEntry{r, err} - if err != nil { - utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", v.GroupVersion, err)) - } + gv := v.GroupVersion + wg.Add(1) + go func() { + defer wg.Done() + defer utilruntime.HandleCrash() + + r, err := d.serverResourcesForGroupVersion(gv) + if err != nil { + utilruntime.HandleError(fmt.Errorf("couldn't get resource list for %v: %v", gv, err)) + } + + resultLock.Lock() + defer resultLock.Unlock() + rl[gv] = &cacheEntry{r, err} + }() } } + wg.Wait() d.groupToServerResources, d.groupList = rl, gl d.cacheValid = true diff --git a/vendor/k8s.io/client-go/discovery/discovery_client.go b/vendor/k8s.io/client-go/discovery/discovery_client.go index 5d89457cc..dc12f9a29 100644 --- a/vendor/k8s.io/client-go/discovery/discovery_client.go +++ b/vendor/k8s.io/client-go/discovery/discovery_client.go @@ -17,6 +17,7 @@ limitations under the License. package discovery import ( + "context" "encoding/json" "fmt" "net/url" @@ -155,7 +156,7 @@ func apiVersionsToAPIGroup(apiVersions *metav1.APIVersions) (apiGroup metav1.API func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err error) { // Get the groupVersions exposed at /api v := &metav1.APIVersions{} - err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do().Into(v) + err = d.restClient.Get().AbsPath(d.LegacyPrefix).Do(context.TODO()).Into(v) apiGroup := metav1.APIGroup{} if err == nil && len(v.Versions) != 0 { apiGroup = apiVersionsToAPIGroup(v) @@ -166,7 +167,7 @@ func (d *DiscoveryClient) ServerGroups() (apiGroupList *metav1.APIGroupList, err // Get the groupVersions exposed at /apis apiGroupList = &metav1.APIGroupList{} - err = d.restClient.Get().AbsPath("/apis").Do().Into(apiGroupList) + err = d.restClient.Get().AbsPath("/apis").Do(context.TODO()).Into(apiGroupList) if err != nil && !errors.IsNotFound(err) && !errors.IsForbidden(err) { return nil, err } @@ -196,7 +197,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r resources = &metav1.APIResourceList{ GroupVersion: groupVersion, } - err = d.restClient.Get().AbsPath(url.String()).Do().Into(resources) + err = d.restClient.Get().AbsPath(url.String()).Do(context.TODO()).Into(resources) if err != nil { // ignore 403 or 404 error to be compatible with an v1.0 server. if groupVersion == "v1" && (errors.IsNotFound(err) || errors.IsForbidden(err)) { @@ -405,7 +406,7 @@ func ServerPreferredNamespacedResources(d DiscoveryInterface) ([]*metav1.APIReso // ServerVersion retrieves and parses the server's version (git version). func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { - body, err := d.restClient.Get().AbsPath("/version").Do().Raw() + body, err := d.restClient.Get().AbsPath("/version").Do(context.TODO()).Raw() if err != nil { return nil, err } @@ -419,12 +420,12 @@ func (d *DiscoveryClient) ServerVersion() (*version.Info, error) { // OpenAPISchema fetches the open api schema using a rest client and parses the proto. func (d *DiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error) { - data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do().Raw() + data, err := d.restClient.Get().AbsPath("/openapi/v2").SetHeader("Accept", mimePb).Do(context.TODO()).Raw() if err != nil { if errors.IsForbidden(err) || errors.IsNotFound(err) || errors.IsNotAcceptable(err) { // single endpoint not found/registered in old server, try to fetch old endpoint // TODO: remove this when kubectl/client-go don't work with 1.9 server - data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do().Raw() + data, err = d.restClient.Get().AbsPath("/swagger-2.0.0.pb-v1").Do(context.TODO()).Raw() if err != nil { return nil, err } diff --git a/vendor/k8s.io/client-go/dynamic/interface.go b/vendor/k8s.io/client-go/dynamic/interface.go index 70756a4f5..b08067c34 100644 --- a/vendor/k8s.io/client-go/dynamic/interface.go +++ b/vendor/k8s.io/client-go/dynamic/interface.go @@ -17,6 +17,8 @@ limitations under the License. package dynamic import ( + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" @@ -29,15 +31,15 @@ type Interface interface { } type ResourceInterface interface { - Create(obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) - Update(obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) - UpdateStatus(obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error) - Delete(name string, options *metav1.DeleteOptions, subresources ...string) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) - List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) + Create(ctx context.Context, obj *unstructured.Unstructured, options metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) + Update(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) + UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, options metav1.UpdateOptions) (*unstructured.Unstructured, error) + Delete(ctx context.Context, name string, options metav1.DeleteOptions, subresources ...string) error + DeleteCollection(ctx context.Context, options metav1.DeleteOptions, listOptions metav1.ListOptions) error + Get(ctx context.Context, name string, options metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) + List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, options metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) } type NamespaceableResourceInterface interface { diff --git a/vendor/k8s.io/client-go/dynamic/simple.go b/vendor/k8s.io/client-go/dynamic/simple.go index 8a026788a..9ae320d30 100644 --- a/vendor/k8s.io/client-go/dynamic/simple.go +++ b/vendor/k8s.io/client-go/dynamic/simple.go @@ -17,6 +17,7 @@ limitations under the License. package dynamic import ( + "context" "fmt" "k8s.io/apimachinery/pkg/api/meta" @@ -89,7 +90,7 @@ func (c *dynamicResourceClient) Namespace(ns string) ResourceInterface { return &ret } -func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Unstructured, opts metav1.CreateOptions, subresources ...string) (*unstructured.Unstructured, error) { outBytes, err := runtime.Encode(unstructured.UnstructuredJSONScheme, obj) if err != nil { return nil, err @@ -111,7 +112,7 @@ func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts meta AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(outBytes). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). - Do() + Do(ctx) if err := result.Error(); err != nil { return nil, err } @@ -127,7 +128,7 @@ func (c *dynamicResourceClient) Create(obj *unstructured.Unstructured, opts meta return uncastObj.(*unstructured.Unstructured), nil } -func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions, subresources ...string) (*unstructured.Unstructured, error) { accessor, err := meta.Accessor(obj) if err != nil { return nil, err @@ -146,7 +147,7 @@ func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts meta AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(outBytes). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). - Do() + Do(ctx) if err := result.Error(); err != nil { return nil, err } @@ -162,7 +163,7 @@ func (c *dynamicResourceClient) Update(obj *unstructured.Unstructured, opts meta return uncastObj.(*unstructured.Unstructured), nil } -func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructured.Unstructured, opts metav1.UpdateOptions) (*unstructured.Unstructured, error) { accessor, err := meta.Accessor(obj) if err != nil { return nil, err @@ -182,7 +183,7 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opt AbsPath(append(c.makeURLSegments(name), "status")...). Body(outBytes). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). - Do() + Do(ctx) if err := result.Error(); err != nil { return nil, err } @@ -198,14 +199,11 @@ func (c *dynamicResourceClient) UpdateStatus(obj *unstructured.Unstructured, opt return uncastObj.(*unstructured.Unstructured), nil } -func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, subresources ...string) error { +func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions, subresources ...string) error { if len(name) == 0 { return fmt.Errorf("name is required") } - if opts == nil { - opts = &metav1.DeleteOptions{} - } - deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), opts) + deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts) if err != nil { return err } @@ -214,15 +212,12 @@ func (c *dynamicResourceClient) Delete(name string, opts *metav1.DeleteOptions, Delete(). AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(deleteOptionsByte). - Do() + Do(ctx) return result.Error() } -func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, listOptions metav1.ListOptions) error { - if opts == nil { - opts = &metav1.DeleteOptions{} - } - deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), opts) +func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOptions metav1.ListOptions) error { + deleteOptionsByte, err := runtime.Encode(deleteOptionsCodec.LegacyCodec(schema.GroupVersion{Version: "v1"}), &opts) if err != nil { return err } @@ -232,15 +227,15 @@ func (c *dynamicResourceClient) DeleteCollection(opts *metav1.DeleteOptions, lis AbsPath(c.makeURLSegments("")...). Body(deleteOptionsByte). SpecificallyVersionedParams(&listOptions, dynamicParameterCodec, versionV1). - Do() + Do(ctx) return result.Error() } -func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav1.GetOptions, subresources ...string) (*unstructured.Unstructured, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } - result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do() + result := c.client.client.Get().AbsPath(append(c.makeURLSegments(name), subresources...)...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx) if err := result.Error(); err != nil { return nil, err } @@ -255,8 +250,8 @@ func (c *dynamicResourceClient) Get(name string, opts metav1.GetOptions, subreso return uncastObj.(*unstructured.Unstructured), nil } -func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { - result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do() +func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) { + result := c.client.client.Get().AbsPath(c.makeURLSegments("")...).SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1).Do(ctx) if err := result.Error(); err != nil { return nil, err } @@ -279,14 +274,14 @@ func (c *dynamicResourceClient) List(opts metav1.ListOptions) (*unstructured.Uns return list, nil } -func (c *dynamicResourceClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { opts.Watch = true return c.client.client.Get().AbsPath(c.makeURLSegments("")...). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). - Watch() + Watch(ctx) } -func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { +func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*unstructured.Unstructured, error) { if len(name) == 0 { return nil, fmt.Errorf("name is required") } @@ -295,7 +290,7 @@ func (c *dynamicResourceClient) Patch(name string, pt types.PatchType, data []by AbsPath(append(c.makeURLSegments(name), subresources...)...). Body(data). SpecificallyVersionedParams(&opts, dynamicParameterCodec, versionV1). - Do() + Do(ctx) if err := result.Error(); err != nil { return nil, err } diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go index 4fadd9a21..b768f6f7f 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" @@ -60,13 +61,13 @@ func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(options) + return client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(options) + return client.AdmissionregistrationV1().MutatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1.MutatingWebhookConfiguration{}, diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go index 1c648e608..8ddcdf2d9 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1/validatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" @@ -60,13 +61,13 @@ func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(options) + return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(options) + return client.AdmissionregistrationV1().ValidatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1.ValidatingWebhookConfiguration{}, diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index a06c406c2..12c8ec1fb 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(options) + return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(options) + return client.AdmissionregistrationV1beta1().MutatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1beta1.MutatingWebhookConfiguration{}, diff --git a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 3b7fafd29..05eb05097 100644 --- a/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interfa if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(options) + return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(options) + return client.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations().Watch(context.TODO(), options) }, }, &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go index 2f69e0df0..31e2b74d0 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/controllerrevision.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" appsv1 "k8s.io/api/apps/v1" @@ -61,13 +62,13 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ControllerRevisions(namespace).List(options) + return client.AppsV1().ControllerRevisions(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ControllerRevisions(namespace).Watch(options) + return client.AppsV1().ControllerRevisions(namespace).Watch(context.TODO(), options) }, }, &appsv1.ControllerRevision{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go index db649ccbf..da7fe9509 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/daemonset.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" appsv1 "k8s.io/api/apps/v1" @@ -61,13 +62,13 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().DaemonSets(namespace).List(options) + return client.AppsV1().DaemonSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().DaemonSets(namespace).Watch(options) + return client.AppsV1().DaemonSets(namespace).Watch(context.TODO(), options) }, }, &appsv1.DaemonSet{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go index 71cd00273..bd639bb3d 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" appsv1 "k8s.io/api/apps/v1" @@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().Deployments(namespace).List(options) + return client.AppsV1().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().Deployments(namespace).Watch(options) + return client.AppsV1().Deployments(namespace).Watch(context.TODO(), options) }, }, &appsv1.Deployment{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go index 6ee7a0537..6d81a471a 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/replicaset.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" appsv1 "k8s.io/api/apps/v1" @@ -61,13 +62,13 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ReplicaSets(namespace).List(options) + return client.AppsV1().ReplicaSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().ReplicaSets(namespace).Watch(options) + return client.AppsV1().ReplicaSets(namespace).Watch(context.TODO(), options) }, }, &appsv1.ReplicaSet{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go index 385e65366..c99bbb73e 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1/statefulset.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" appsv1 "k8s.io/api/apps/v1" @@ -61,13 +62,13 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().StatefulSets(namespace).List(options) + return client.AppsV1().StatefulSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1().StatefulSets(namespace).Watch(options) + return client.AppsV1().StatefulSets(namespace).Watch(context.TODO(), options) }, }, &appsv1.StatefulSet{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go index c7d3e30e0..cb36bd7fd 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/controllerrevision.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" appsv1beta1 "k8s.io/api/apps/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().ControllerRevisions(namespace).List(options) + return client.AppsV1beta1().ControllerRevisions(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().ControllerRevisions(namespace).Watch(options) + return client.AppsV1beta1().ControllerRevisions(namespace).Watch(context.TODO(), options) }, }, &appsv1beta1.ControllerRevision{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go index 03bafca6b..e02a13c2f 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" appsv1beta1 "k8s.io/api/apps/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().Deployments(namespace).List(options) + return client.AppsV1beta1().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().Deployments(namespace).Watch(options) + return client.AppsV1beta1().Deployments(namespace).Watch(context.TODO(), options) }, }, &appsv1beta1.Deployment{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go index e4d1b46fa..b845cc99c 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta1/statefulset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" appsv1beta1 "k8s.io/api/apps/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().StatefulSets(namespace).List(options) + return client.AppsV1beta1().StatefulSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta1().StatefulSets(namespace).Watch(options) + return client.AppsV1beta1().StatefulSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta1.StatefulSet{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go index 975e81077..4d0e91320 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/controllerrevision.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" @@ -61,13 +62,13 @@ func NewFilteredControllerRevisionInformer(client kubernetes.Interface, namespac if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ControllerRevisions(namespace).List(options) + return client.AppsV1beta2().ControllerRevisions(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ControllerRevisions(namespace).Watch(options) + return client.AppsV1beta2().ControllerRevisions(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.ControllerRevision{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go index 99f17fa6c..280e2fe46 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/daemonset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" @@ -61,13 +62,13 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().DaemonSets(namespace).List(options) + return client.AppsV1beta2().DaemonSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().DaemonSets(namespace).Watch(options) + return client.AppsV1beta2().DaemonSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.DaemonSet{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go index b25da82bd..67bdb7972 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" @@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().Deployments(namespace).List(options) + return client.AppsV1beta2().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().Deployments(namespace).Watch(options) + return client.AppsV1beta2().Deployments(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.Deployment{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go index 6ce7fcfd0..85d12bb65 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/replicaset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" @@ -61,13 +62,13 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ReplicaSets(namespace).List(options) + return client.AppsV1beta2().ReplicaSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().ReplicaSets(namespace).Watch(options) + return client.AppsV1beta2().ReplicaSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.ReplicaSet{}, diff --git a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go index e77bb2f8f..2fab6f7b2 100644 --- a/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/informers/apps/v1beta2/statefulset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" time "time" appsv1beta2 "k8s.io/api/apps/v1beta2" @@ -61,13 +62,13 @@ func NewFilteredStatefulSetInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().StatefulSets(namespace).List(options) + return client.AppsV1beta2().StatefulSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AppsV1beta2().StatefulSets(namespace).Watch(options) + return client.AppsV1beta2().StatefulSets(namespace).Watch(context.TODO(), options) }, }, &appsv1beta2.StatefulSet{}, diff --git a/vendor/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go b/vendor/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go index 69778ad2c..ef178c3aa 100644 --- a/vendor/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go +++ b/vendor/k8s.io/client-go/informers/auditregistration/v1alpha1/auditsink.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" auditregistrationv1alpha1 "k8s.io/api/auditregistration/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredAuditSinkInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuditregistrationV1alpha1().AuditSinks().List(options) + return client.AuditregistrationV1alpha1().AuditSinks().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AuditregistrationV1alpha1().AuditSinks().Watch(options) + return client.AuditregistrationV1alpha1().AuditSinks().Watch(context.TODO(), options) }, }, &auditregistrationv1alpha1.AuditSink{}, diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go index 205e4ecd7..44f041e90 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v1/horizontalpodautoscaler.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -61,13 +62,13 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(options) + return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(options) + return client.AutoscalingV1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv1.HorizontalPodAutoscaler{}, diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go index 4627c5a0b..6385a2a19 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -19,6 +19,7 @@ limitations under the License. package v2beta1 import ( + "context" time "time" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" @@ -61,13 +62,13 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(options) + return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(options) + return client.AutoscalingV2beta1().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv2beta1.HorizontalPodAutoscaler{}, diff --git a/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go index b4863f9b7..f1ac3f073 100644 --- a/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/informers/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -19,6 +19,7 @@ limitations under the License. package v2beta2 import ( + "context" time "time" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" @@ -61,13 +62,13 @@ func NewFilteredHorizontalPodAutoscalerInformer(client kubernetes.Interface, nam if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(options) + return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(options) + return client.AutoscalingV2beta2().HorizontalPodAutoscalers(namespace).Watch(context.TODO(), options) }, }, &autoscalingv2beta2.HorizontalPodAutoscaler{}, diff --git a/vendor/k8s.io/client-go/informers/batch/v1/job.go b/vendor/k8s.io/client-go/informers/batch/v1/job.go index 30d41104a..4992f5228 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1/job.go +++ b/vendor/k8s.io/client-go/informers/batch/v1/job.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" batchv1 "k8s.io/api/batch/v1" @@ -61,13 +62,13 @@ func NewFilteredJobInformer(client kubernetes.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1().Jobs(namespace).List(options) + return client.BatchV1().Jobs(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1().Jobs(namespace).Watch(options) + return client.BatchV1().Jobs(namespace).Watch(context.TODO(), options) }, }, &batchv1.Job{}, diff --git a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go index 0b7598e0f..820c93eaa 100644 --- a/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v1beta1/cronjob.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" batchv1beta1 "k8s.io/api/batch/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1beta1().CronJobs(namespace).List(options) + return client.BatchV1beta1().CronJobs(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV1beta1().CronJobs(namespace).Watch(options) + return client.BatchV1beta1().CronJobs(namespace).Watch(context.TODO(), options) }, }, &batchv1beta1.CronJob{}, diff --git a/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go index 20cf7d498..5f5b870d4 100644 --- a/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/informers/batch/v2alpha1/cronjob.go @@ -19,6 +19,7 @@ limitations under the License. package v2alpha1 import ( + "context" time "time" batchv2alpha1 "k8s.io/api/batch/v2alpha1" @@ -61,13 +62,13 @@ func NewFilteredCronJobInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV2alpha1().CronJobs(namespace).List(options) + return client.BatchV2alpha1().CronJobs(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.BatchV2alpha1().CronJobs(namespace).Watch(options) + return client.BatchV2alpha1().CronJobs(namespace).Watch(context.TODO(), options) }, }, &batchv2alpha1.CronJob{}, diff --git a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go index 6472d20e2..4e167ab8b 100644 --- a/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/informers/certificates/v1beta1/certificatesigningrequest.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredCertificateSigningRequestInformer(client kubernetes.Interface, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1beta1().CertificateSigningRequests().List(options) + return client.CertificatesV1beta1().CertificateSigningRequests().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CertificatesV1beta1().CertificateSigningRequests().Watch(options) + return client.CertificatesV1beta1().CertificateSigningRequests().Watch(context.TODO(), options) }, }, &certificatesv1beta1.CertificateSigningRequest{}, diff --git a/vendor/k8s.io/client-go/informers/coordination/v1/lease.go b/vendor/k8s.io/client-go/informers/coordination/v1/lease.go index b8a3de471..e538923a8 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1/lease.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1/lease.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" coordinationv1 "k8s.io/api/coordination/v1" @@ -61,13 +62,13 @@ func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1().Leases(namespace).List(options) + return client.CoordinationV1().Leases(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1().Leases(namespace).Watch(options) + return client.CoordinationV1().Leases(namespace).Watch(context.TODO(), options) }, }, &coordinationv1.Lease{}, diff --git a/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go b/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go index bb59be13e..5a6959c0b 100644 --- a/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go +++ b/vendor/k8s.io/client-go/informers/coordination/v1beta1/lease.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredLeaseInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1beta1().Leases(namespace).List(options) + return client.CoordinationV1beta1().Leases(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoordinationV1beta1().Leases(namespace).Watch(options) + return client.CoordinationV1beta1().Leases(namespace).Watch(context.TODO(), options) }, }, &coordinationv1beta1.Lease{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go index a5ae6fc49..ccdee535b 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/informers/core/v1/componentstatus.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -60,13 +61,13 @@ func NewFilteredComponentStatusInformer(client kubernetes.Interface, resyncPerio if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ComponentStatuses().List(options) + return client.CoreV1().ComponentStatuses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ComponentStatuses().Watch(options) + return client.CoreV1().ComponentStatuses().Watch(context.TODO(), options) }, }, &corev1.ComponentStatus{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/configmap.go b/vendor/k8s.io/client-go/informers/core/v1/configmap.go index 48cb1a48e..625358178 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/informers/core/v1/configmap.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredConfigMapInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ConfigMaps(namespace).List(options) + return client.CoreV1().ConfigMaps(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ConfigMaps(namespace).Watch(options) + return client.CoreV1().ConfigMaps(namespace).Watch(context.TODO(), options) }, }, &corev1.ConfigMap{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go index 77fa8cf8a..cd0f25b7f 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/informers/core/v1/endpoints.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredEndpointsInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Endpoints(namespace).List(options) + return client.CoreV1().Endpoints(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Endpoints(namespace).Watch(options) + return client.CoreV1().Endpoints(namespace).Watch(context.TODO(), options) }, }, &corev1.Endpoints{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/event.go b/vendor/k8s.io/client-go/informers/core/v1/event.go index 52f4911c1..8825e9b7a 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/event.go +++ b/vendor/k8s.io/client-go/informers/core/v1/event.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Events(namespace).List(options) + return client.CoreV1().Events(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Events(namespace).Watch(options) + return client.CoreV1().Events(namespace).Watch(context.TODO(), options) }, }, &corev1.Event{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go index 7499e1869..4cbfda1f7 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/informers/core/v1/limitrange.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredLimitRangeInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().LimitRanges(namespace).List(options) + return client.CoreV1().LimitRanges(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().LimitRanges(namespace).Watch(options) + return client.CoreV1().LimitRanges(namespace).Watch(context.TODO(), options) }, }, &corev1.LimitRange{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/namespace.go b/vendor/k8s.io/client-go/informers/core/v1/namespace.go index 57a073355..506f930a7 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/informers/core/v1/namespace.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -60,13 +61,13 @@ func NewFilteredNamespaceInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Namespaces().List(options) + return client.CoreV1().Namespaces().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Namespaces().Watch(options) + return client.CoreV1().Namespaces().Watch(context.TODO(), options) }, }, &corev1.Namespace{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/node.go b/vendor/k8s.io/client-go/informers/core/v1/node.go index d9b85f83c..9939fc2cb 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/node.go +++ b/vendor/k8s.io/client-go/informers/core/v1/node.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -60,13 +61,13 @@ func NewFilteredNodeInformer(client kubernetes.Interface, resyncPeriod time.Dura if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Nodes().List(options) + return client.CoreV1().Nodes().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Nodes().Watch(options) + return client.CoreV1().Nodes().Watch(context.TODO(), options) }, }, &corev1.Node{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go index a50bcfc66..c82445997 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolume.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -60,13 +61,13 @@ func NewFilteredPersistentVolumeInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumes().List(options) + return client.CoreV1().PersistentVolumes().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumes().Watch(options) + return client.CoreV1().PersistentVolumes().Watch(context.TODO(), options) }, }, &corev1.PersistentVolume{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go index 3fb5e5f6c..7a7df1cff 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/informers/core/v1/persistentvolumeclaim.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredPersistentVolumeClaimInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumeClaims(namespace).List(options) + return client.CoreV1().PersistentVolumeClaims(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PersistentVolumeClaims(namespace).Watch(options) + return client.CoreV1().PersistentVolumeClaims(namespace).Watch(context.TODO(), options) }, }, &corev1.PersistentVolumeClaim{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/pod.go b/vendor/k8s.io/client-go/informers/core/v1/pod.go index 57aadd945..5c713a9b6 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/pod.go +++ b/vendor/k8s.io/client-go/informers/core/v1/pod.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredPodInformer(client kubernetes.Interface, namespace string, resyn if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Pods(namespace).List(options) + return client.CoreV1().Pods(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Pods(namespace).Watch(options) + return client.CoreV1().Pods(namespace).Watch(context.TODO(), options) }, }, &corev1.Pod{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go index ff47094fb..2a16e910d 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/informers/core/v1/podtemplate.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredPodTemplateInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PodTemplates(namespace).List(options) + return client.CoreV1().PodTemplates(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().PodTemplates(namespace).Watch(options) + return client.CoreV1().PodTemplates(namespace).Watch(context.TODO(), options) }, }, &corev1.PodTemplate{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go index 903fe3fba..930beb4cd 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/informers/core/v1/replicationcontroller.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredReplicationControllerInformer(client kubernetes.Interface, names if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ReplicationControllers(namespace).List(options) + return client.CoreV1().ReplicationControllers(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ReplicationControllers(namespace).Watch(options) + return client.CoreV1().ReplicationControllers(namespace).Watch(context.TODO(), options) }, }, &corev1.ReplicationController{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go index 27ae53ccb..619262a61 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/informers/core/v1/resourcequota.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredResourceQuotaInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ResourceQuotas(namespace).List(options) + return client.CoreV1().ResourceQuotas(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ResourceQuotas(namespace).Watch(options) + return client.CoreV1().ResourceQuotas(namespace).Watch(context.TODO(), options) }, }, &corev1.ResourceQuota{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/secret.go b/vendor/k8s.io/client-go/informers/core/v1/secret.go index e13776b2b..a6be07069 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/secret.go +++ b/vendor/k8s.io/client-go/informers/core/v1/secret.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredSecretInformer(client kubernetes.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Secrets(namespace).List(options) + return client.CoreV1().Secrets(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Secrets(namespace).Watch(options) + return client.CoreV1().Secrets(namespace).Watch(context.TODO(), options) }, }, &corev1.Secret{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/service.go b/vendor/k8s.io/client-go/informers/core/v1/service.go index 1c758668c..3d9ecc6e9 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/service.go +++ b/vendor/k8s.io/client-go/informers/core/v1/service.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredServiceInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Services(namespace).List(options) + return client.CoreV1().Services(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().Services(namespace).Watch(options) + return client.CoreV1().Services(namespace).Watch(context.TODO(), options) }, }, &corev1.Service{}, diff --git a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go index c701b8f1e..44371c9fa 100644 --- a/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/informers/core/v1/serviceaccount.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" corev1 "k8s.io/api/core/v1" @@ -61,13 +62,13 @@ func NewFilteredServiceAccountInformer(client kubernetes.Interface, namespace st if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceAccounts(namespace).List(options) + return client.CoreV1().ServiceAccounts(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.CoreV1().ServiceAccounts(namespace).Watch(options) + return client.CoreV1().ServiceAccounts(namespace).Watch(context.TODO(), options) }, }, &corev1.ServiceAccount{}, diff --git a/vendor/k8s.io/client-go/informers/discovery/v1alpha1/endpointslice.go b/vendor/k8s.io/client-go/informers/discovery/v1alpha1/endpointslice.go index a545ce155..c5e383c0b 100644 --- a/vendor/k8s.io/client-go/informers/discovery/v1alpha1/endpointslice.go +++ b/vendor/k8s.io/client-go/informers/discovery/v1alpha1/endpointslice.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" discoveryv1alpha1 "k8s.io/api/discovery/v1alpha1" @@ -61,13 +62,13 @@ func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1alpha1().EndpointSlices(namespace).List(options) + return client.DiscoveryV1alpha1().EndpointSlices(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1alpha1().EndpointSlices(namespace).Watch(options) + return client.DiscoveryV1alpha1().EndpointSlices(namespace).Watch(context.TODO(), options) }, }, &discoveryv1alpha1.EndpointSlice{}, diff --git a/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go b/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go index f658866c2..69ae38a91 100644 --- a/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go +++ b/vendor/k8s.io/client-go/informers/discovery/v1beta1/endpointslice.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredEndpointSliceInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1beta1().EndpointSlices(namespace).List(options) + return client.DiscoveryV1beta1().EndpointSlices(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(options) + return client.DiscoveryV1beta1().EndpointSlices(namespace).Watch(context.TODO(), options) }, }, &discoveryv1beta1.EndpointSlice{}, diff --git a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go index 0ac6fa282..025f6a5cf 100644 --- a/vendor/k8s.io/client-go/informers/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/informers/events/v1beta1/event.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" eventsv1beta1 "k8s.io/api/events/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredEventInformer(client kubernetes.Interface, namespace string, res if tweakListOptions != nil { tweakListOptions(&options) } - return client.EventsV1beta1().Events(namespace).List(options) + return client.EventsV1beta1().Events(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.EventsV1beta1().Events(namespace).Watch(options) + return client.EventsV1beta1().Events(namespace).Watch(context.TODO(), options) }, }, &eventsv1beta1.Event{}, diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go index 80e84eba8..050080a59 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/daemonset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredDaemonSetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().DaemonSets(namespace).List(options) + return client.ExtensionsV1beta1().DaemonSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(options) + return client.ExtensionsV1beta1().DaemonSets(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.DaemonSet{}, diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go index cef4b8150..1b16c5cc9 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredDeploymentInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Deployments(namespace).List(options) + return client.ExtensionsV1beta1().Deployments(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Deployments(namespace).Watch(options) + return client.ExtensionsV1beta1().Deployments(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.Deployment{}, diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go index 72a88f313..f01a88761 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/ingress.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Ingresses(namespace).List(options) + return client.ExtensionsV1beta1().Ingresses(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().Ingresses(namespace).Watch(options) + return client.ExtensionsV1beta1().Ingresses(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.Ingress{}, diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go index 92f4f0400..4a924619f 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/networkpolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(options) + return client.ExtensionsV1beta1().NetworkPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(options) + return client.ExtensionsV1beta1().NetworkPolicies(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.NetworkPolicy{}, diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go index 6f91e5458..11be2751c 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/podsecuritypolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().PodSecurityPolicies().List(options) + return client.ExtensionsV1beta1().PodSecurityPolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().PodSecurityPolicies().Watch(options) + return client.ExtensionsV1beta1().PodSecurityPolicies().Watch(context.TODO(), options) }, }, &extensionsv1beta1.PodSecurityPolicy{}, diff --git a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go index e8847aa2c..f7e224bcf 100644 --- a/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/informers/extensions/v1beta1/replicaset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredReplicaSetInformer(client kubernetes.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().ReplicaSets(namespace).List(options) + return client.ExtensionsV1beta1().ReplicaSets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(options) + return client.ExtensionsV1beta1().ReplicaSets(namespace).Watch(context.TODO(), options) }, }, &extensionsv1beta1.ReplicaSet{}, diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go index af1d874c7..9a4a90448 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/flowschema.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredFlowSchemaInformer(client kubernetes.Interface, resyncPeriod tim if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().FlowSchemas().List(options) + return client.FlowcontrolV1alpha1().FlowSchemas().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().FlowSchemas().Watch(options) + return client.FlowcontrolV1alpha1().FlowSchemas().Watch(context.TODO(), options) }, }, &flowcontrolv1alpha1.FlowSchema{}, diff --git a/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go index c145b7d41..b81f5c9c3 100644 --- a/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredPriorityLevelConfigurationInformer(client kubernetes.Interface, if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(options) + return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(options) + return client.FlowcontrolV1alpha1().PriorityLevelConfigurations().Watch(context.TODO(), options) }, }, &flowcontrolv1alpha1.PriorityLevelConfiguration{}, diff --git a/vendor/k8s.io/client-go/informers/generic.go b/vendor/k8s.io/client-go/informers/generic.go index 8e6df2461..5bc555da6 100644 --- a/vendor/k8s.io/client-go/informers/generic.go +++ b/vendor/k8s.io/client-go/informers/generic.go @@ -244,6 +244,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=networking.k8s.io, Version=v1beta1 case networkingv1beta1.SchemeGroupVersion.WithResource("ingresses"): return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Ingresses().Informer()}, nil + case networkingv1beta1.SchemeGroupVersion.WithResource("ingressclasses"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().IngressClasses().Informer()}, nil // Group=node.k8s.io, Version=v1alpha1 case nodev1alpha1.SchemeGroupVersion.WithResource("runtimeclasses"): @@ -306,6 +308,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Settings().V1alpha1().PodPresets().Informer()}, nil // Group=storage.k8s.io, Version=v1 + case storagev1.SchemeGroupVersion.WithResource("csidrivers"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSIDrivers().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("csinodes"): return &genericInformer{resource: resource.GroupResource(), informer: f.Storage().V1().CSINodes().Informer()}, nil case storagev1.SchemeGroupVersion.WithResource("storageclasses"): diff --git a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go index c2255c0df..a75c9ac21 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/informers/networking/v1/networkpolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" networkingv1 "k8s.io/api/networking/v1" @@ -61,13 +62,13 @@ func NewFilteredNetworkPolicyInformer(client kubernetes.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().NetworkPolicies(namespace).List(options) + return client.NetworkingV1().NetworkPolicies(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1().NetworkPolicies(namespace).Watch(options) + return client.NetworkingV1().NetworkPolicies(namespace).Watch(context.TODO(), options) }, }, &networkingv1.NetworkPolicy{}, diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go index 8abd00e17..8800d6c9c 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingress.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" networkingv1beta1 "k8s.io/api/networking/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredIngressInformer(client kubernetes.Interface, namespace string, r if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Ingresses(namespace).List(options) + return client.NetworkingV1beta1().Ingresses(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Ingresses(namespace).Watch(options) + return client.NetworkingV1beta1().Ingresses(namespace).Watch(context.TODO(), options) }, }, &networkingv1beta1.Ingress{}, diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go new file mode 100644 index 000000000..17864299b --- /dev/null +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/ingressclass.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + time "time" + + networkingv1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1beta1 "k8s.io/client-go/listers/networking/v1beta1" + cache "k8s.io/client-go/tools/cache" +) + +// IngressClassInformer provides access to a shared informer and lister for +// IngressClasses. +type IngressClassInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1beta1.IngressClassLister +} + +type ingressClassInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewIngressClassInformer constructs a new informer for IngressClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredIngressClassInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredIngressClassInformer constructs a new informer for IngressClass type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredIngressClassInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IngressClasses().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1beta1().IngressClasses().Watch(context.TODO(), options) + }, + }, + &networkingv1beta1.IngressClass{}, + resyncPeriod, + indexers, + ) +} + +func (f *ingressClassInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredIngressClassInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *ingressClassInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1beta1.IngressClass{}, f.defaultInformer) +} + +func (f *ingressClassInformer) Lister() v1beta1.IngressClassLister { + return v1beta1.NewIngressClassLister(f.Informer().GetIndexer()) +} diff --git a/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go b/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go index ab170dfc8..2dcc3129a 100644 --- a/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go +++ b/vendor/k8s.io/client-go/informers/networking/v1beta1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // Ingresses returns a IngressInformer. Ingresses() IngressInformer + // IngressClasses returns a IngressClassInformer. + IngressClasses() IngressClassInformer } type version struct { @@ -43,3 +45,8 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList func (v *version) Ingresses() IngressInformer { return &ingressInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } + +// IngressClasses returns a IngressClassInformer. +func (v *version) IngressClasses() IngressClassInformer { + return &ingressClassInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go b/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go index 31edf930a..d314a9573 100644 --- a/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go +++ b/vendor/k8s.io/client-go/informers/node/v1alpha1/runtimeclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" nodev1alpha1 "k8s.io/api/node/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1alpha1().RuntimeClasses().List(options) + return client.NodeV1alpha1().RuntimeClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1alpha1().RuntimeClasses().Watch(options) + return client.NodeV1alpha1().RuntimeClasses().Watch(context.TODO(), options) }, }, &nodev1alpha1.RuntimeClass{}, diff --git a/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go b/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go index 6972993ad..07619b230 100644 --- a/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go +++ b/vendor/k8s.io/client-go/informers/node/v1beta1/runtimeclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" nodev1beta1 "k8s.io/api/node/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredRuntimeClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1beta1().RuntimeClasses().List(options) + return client.NodeV1beta1().RuntimeClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NodeV1beta1().RuntimeClasses().Watch(options) + return client.NodeV1beta1().RuntimeClasses().Watch(context.TODO(), options) }, }, &nodev1beta1.RuntimeClass{}, diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go index dce61f7f1..4530343ec 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/poddisruptionbudget.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" policyv1beta1 "k8s.io/api/policy/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredPodDisruptionBudgetInformer(client kubernetes.Interface, namespa if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(options) + return client.PolicyV1beta1().PodDisruptionBudgets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(options) + return client.PolicyV1beta1().PodDisruptionBudgets(namespace).Watch(context.TODO(), options) }, }, &policyv1beta1.PodDisruptionBudget{}, diff --git a/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go index 7ce5684fb..b87d23434 100644 --- a/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/informers/policy/v1beta1/podsecuritypolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" policyv1beta1 "k8s.io/api/policy/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredPodSecurityPolicyInformer(client kubernetes.Interface, resyncPer if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1beta1().PodSecurityPolicies().List(options) + return client.PolicyV1beta1().PodSecurityPolicies().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.PolicyV1beta1().PodSecurityPolicies().Watch(options) + return client.PolicyV1beta1().PodSecurityPolicies().Watch(context.TODO(), options) }, }, &policyv1beta1.PodSecurityPolicy{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go index b8096e6bc..0572be264 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrole.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" rbacv1 "k8s.io/api/rbac/v1" @@ -60,13 +61,13 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoles().List(options) + return client.RbacV1().ClusterRoles().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoles().Watch(options) + return client.RbacV1().ClusterRoles().Watch(context.TODO(), options) }, }, &rbacv1.ClusterRole{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go index 5ef3407c4..51026c055 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/clusterrolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" rbacv1 "k8s.io/api/rbac/v1" @@ -60,13 +61,13 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoleBindings().List(options) + return client.RbacV1().ClusterRoleBindings().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().ClusterRoleBindings().Watch(options) + return client.RbacV1().ClusterRoleBindings().Watch(context.TODO(), options) }, }, &rbacv1.ClusterRoleBinding{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1/role.go index 2d98874e5..986a5f29f 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/role.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" rbacv1 "k8s.io/api/rbac/v1" @@ -61,13 +62,13 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().Roles(namespace).List(options) + return client.RbacV1().Roles(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().Roles(namespace).Watch(options) + return client.RbacV1().Roles(namespace).Watch(context.TODO(), options) }, }, &rbacv1.Role{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go index a97107de1..0264049fb 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1/rolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" rbacv1 "k8s.io/api/rbac/v1" @@ -61,13 +62,13 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().RoleBindings(namespace).List(options) + return client.RbacV1().RoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1().RoleBindings(namespace).Watch(options) + return client.RbacV1().RoleBindings(namespace).Watch(context.TODO(), options) }, }, &rbacv1.RoleBinding{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go index 58c9c4125..70d9885f0 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrole.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoles().List(options) + return client.RbacV1alpha1().ClusterRoles().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoles().Watch(options) + return client.RbacV1alpha1().ClusterRoles().Watch(context.TODO(), options) }, }, &rbacv1alpha1.ClusterRole{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go index 759c716bf..8c18f6792 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/clusterrolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoleBindings().List(options) + return client.RbacV1alpha1().ClusterRoleBindings().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().ClusterRoleBindings().Watch(options) + return client.RbacV1alpha1().ClusterRoleBindings().Watch(context.TODO(), options) }, }, &rbacv1alpha1.ClusterRoleBinding{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go index 1d1f99f06..7dc4551d9 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/role.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -61,13 +62,13 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().Roles(namespace).List(options) + return client.RbacV1alpha1().Roles(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().Roles(namespace).Watch(options) + return client.RbacV1alpha1().Roles(namespace).Watch(context.TODO(), options) }, }, &rbacv1alpha1.Role{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go index 9fcb01d3a..d49ec8b36 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1alpha1/rolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -61,13 +62,13 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().RoleBindings(namespace).List(options) + return client.RbacV1alpha1().RoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1alpha1().RoleBindings(namespace).Watch(options) + return client.RbacV1alpha1().RoleBindings(namespace).Watch(context.TODO(), options) }, }, &rbacv1alpha1.RoleBinding{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go index b82c1c740..e50e1d393 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrole.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredClusterRoleInformer(client kubernetes.Interface, resyncPeriod ti if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoles().List(options) + return client.RbacV1beta1().ClusterRoles().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoles().Watch(options) + return client.RbacV1beta1().ClusterRoles().Watch(context.TODO(), options) }, }, &rbacv1beta1.ClusterRole{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go index d662e7f56..a7ea4cd38 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/clusterrolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredClusterRoleBindingInformer(client kubernetes.Interface, resyncPe if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoleBindings().List(options) + return client.RbacV1beta1().ClusterRoleBindings().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().ClusterRoleBindings().Watch(options) + return client.RbacV1beta1().ClusterRoleBindings().Watch(context.TODO(), options) }, }, &rbacv1beta1.ClusterRoleBinding{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go index b885beb27..e56961e81 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/role.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredRoleInformer(client kubernetes.Interface, namespace string, resy if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().Roles(namespace).List(options) + return client.RbacV1beta1().Roles(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().Roles(namespace).Watch(options) + return client.RbacV1beta1().Roles(namespace).Watch(context.TODO(), options) }, }, &rbacv1beta1.Role{}, diff --git a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go index 63d9d7264..d893882db 100644 --- a/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/informers/rbac/v1beta1/rolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" rbacv1beta1 "k8s.io/api/rbac/v1beta1" @@ -61,13 +62,13 @@ func NewFilteredRoleBindingInformer(client kubernetes.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().RoleBindings(namespace).List(options) + return client.RbacV1beta1().RoleBindings(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.RbacV1beta1().RoleBindings(namespace).Watch(options) + return client.RbacV1beta1().RoleBindings(namespace).Watch(context.TODO(), options) }, }, &rbacv1beta1.RoleBinding{}, diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go index a9ee6289e..730616b4a 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1/priorityclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" schedulingv1 "k8s.io/api/scheduling/v1" @@ -60,13 +61,13 @@ func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1().PriorityClasses().List(options) + return client.SchedulingV1().PriorityClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1().PriorityClasses().Watch(options) + return client.SchedulingV1().PriorityClasses().Watch(context.TODO(), options) }, }, &schedulingv1.PriorityClass{}, diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go index cd90dd765..f82b66436 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1alpha1/priorityclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1alpha1().PriorityClasses().List(options) + return client.SchedulingV1alpha1().PriorityClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1alpha1().PriorityClasses().Watch(options) + return client.SchedulingV1alpha1().PriorityClasses().Watch(context.TODO(), options) }, }, &schedulingv1alpha1.PriorityClass{}, diff --git a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go index 3c7d90938..fc7848891 100644 --- a/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go +++ b/vendor/k8s.io/client-go/informers/scheduling/v1beta1/priorityclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredPriorityClassInformer(client kubernetes.Interface, resyncPeriod if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1beta1().PriorityClasses().List(options) + return client.SchedulingV1beta1().PriorityClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SchedulingV1beta1().PriorityClasses().Watch(options) + return client.SchedulingV1beta1().PriorityClasses().Watch(context.TODO(), options) }, }, &schedulingv1beta1.PriorityClass{}, diff --git a/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go index 33fcf2359..8c10b16c8 100644 --- a/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/informers/settings/v1alpha1/podpreset.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" settingsv1alpha1 "k8s.io/api/settings/v1alpha1" @@ -61,13 +62,13 @@ func NewFilteredPodPresetInformer(client kubernetes.Interface, namespace string, if tweakListOptions != nil { tweakListOptions(&options) } - return client.SettingsV1alpha1().PodPresets(namespace).List(options) + return client.SettingsV1alpha1().PodPresets(namespace).List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.SettingsV1alpha1().PodPresets(namespace).Watch(options) + return client.SettingsV1alpha1().PodPresets(namespace).Watch(context.TODO(), options) }, }, &settingsv1alpha1.PodPreset{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go b/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go new file mode 100644 index 000000000..6fd1e678d --- /dev/null +++ b/vendor/k8s.io/client-go/informers/storage/v1/csidriver.go @@ -0,0 +1,89 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + storagev1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1 "k8s.io/client-go/listers/storage/v1" + cache "k8s.io/client-go/tools/cache" +) + +// CSIDriverInformer provides access to a shared informer and lister for +// CSIDrivers. +type CSIDriverInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.CSIDriverLister +} + +type cSIDriverInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewCSIDriverInformer constructs a new informer for CSIDriver type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredCSIDriverInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredCSIDriverInformer constructs a new informer for CSIDriver type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSIDrivers().List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.StorageV1().CSIDrivers().Watch(context.TODO(), options) + }, + }, + &storagev1.CSIDriver{}, + resyncPeriod, + indexers, + ) +} + +func (f *cSIDriverInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredCSIDriverInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *cSIDriverInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&storagev1.CSIDriver{}, f.defaultInformer) +} + +func (f *cSIDriverInformer) Lister() v1.CSIDriverLister { + return v1.NewCSIDriverLister(f.Informer().GetIndexer()) +} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/csinode.go b/vendor/k8s.io/client-go/informers/storage/v1/csinode.go index eed947c4a..96416967f 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/csinode.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/csinode.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" storagev1 "k8s.io/api/storage/v1" @@ -60,13 +61,13 @@ func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.D if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSINodes().List(options) + return client.StorageV1().CSINodes().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().CSINodes().Watch(options) + return client.StorageV1().CSINodes().Watch(context.TODO(), options) }, }, &storagev1.CSINode{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1/interface.go b/vendor/k8s.io/client-go/informers/storage/v1/interface.go index 59f367d33..157759140 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/interface.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/interface.go @@ -24,6 +24,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // CSIDrivers returns a CSIDriverInformer. + CSIDrivers() CSIDriverInformer // CSINodes returns a CSINodeInformer. CSINodes() CSINodeInformer // StorageClasses returns a StorageClassInformer. @@ -43,6 +45,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// CSIDrivers returns a CSIDriverInformer. +func (v *version) CSIDrivers() CSIDriverInformer { + return &cSIDriverInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // CSINodes returns a CSINodeInformer. func (v *version) CSINodes() CSINodeInformer { return &cSINodeInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go index b4609b4d2..8cde79d9a 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/storageclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" storagev1 "k8s.io/api/storage/v1" @@ -60,13 +61,13 @@ func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().StorageClasses().List(options) + return client.StorageV1().StorageClasses().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().StorageClasses().Watch(options) + return client.StorageV1().StorageClasses().Watch(context.TODO(), options) }, }, &storagev1.StorageClass{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go index 7ca3b86f2..be605ff48 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1/volumeattachment.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" time "time" storagev1 "k8s.io/api/storage/v1" @@ -60,13 +61,13 @@ func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().VolumeAttachments().List(options) + return client.StorageV1().VolumeAttachments().List(context.TODO(), options) }, WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1().VolumeAttachments().Watch(options) + return client.StorageV1().VolumeAttachments().Watch(context.TODO(), options) }, }, &storagev1.VolumeAttachment{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go index e169c8a29..445496dad 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1alpha1/volumeattachment.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" time "time" storagev1alpha1 "k8s.io/api/storage/v1alpha1" @@ -60,13 +61,13 @@ func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().VolumeAttachments().List(options) + return client.StorageV1alpha1().VolumeAttachments().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1alpha1().VolumeAttachments().Watch(options) + return client.StorageV1alpha1().VolumeAttachments().Watch(context.TODO(), options) }, }, &storagev1alpha1.VolumeAttachment{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go index 7f7cb216d..f138a915b 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/csidriver.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredCSIDriverInformer(client kubernetes.Interface, resyncPeriod time if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSIDrivers().List(options) + return client.StorageV1beta1().CSIDrivers().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSIDrivers().Watch(options) + return client.StorageV1beta1().CSIDrivers().Watch(context.TODO(), options) }, }, &storagev1beta1.CSIDriver{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go index 218bb1183..6ba63172a 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/csinode.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredCSINodeInformer(client kubernetes.Interface, resyncPeriod time.D if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSINodes().List(options) + return client.StorageV1beta1().CSINodes().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().CSINodes().Watch(options) + return client.StorageV1beta1().CSINodes().Watch(context.TODO(), options) }, }, &storagev1beta1.CSINode{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go index ed898a77b..a6582bf3d 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/storageclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredStorageClassInformer(client kubernetes.Interface, resyncPeriod t if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().StorageClasses().List(options) + return client.StorageV1beta1().StorageClasses().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().StorageClasses().Watch(options) + return client.StorageV1beta1().StorageClasses().Watch(context.TODO(), options) }, }, &storagev1beta1.StorageClass{}, diff --git a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go index c75fc06b1..e89424634 100644 --- a/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go +++ b/vendor/k8s.io/client-go/informers/storage/v1beta1/volumeattachment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" time "time" storagev1beta1 "k8s.io/api/storage/v1beta1" @@ -60,13 +61,13 @@ func NewFilteredVolumeAttachmentInformer(client kubernetes.Interface, resyncPeri if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().VolumeAttachments().List(options) + return client.StorageV1beta1().VolumeAttachments().List(context.TODO(), options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.StorageV1beta1().VolumeAttachments().Watch(options) + return client.StorageV1beta1().VolumeAttachments().Watch(context.TODO(), options) }, }, &storagev1beta1.VolumeAttachment{}, diff --git a/vendor/k8s.io/client-go/kubernetes/clientset.go b/vendor/k8s.io/client-go/kubernetes/clientset.go index cf98b0500..d76e9ac9b 100644 --- a/vendor/k8s.io/client-go/kubernetes/clientset.go +++ b/vendor/k8s.io/client-go/kubernetes/clientset.go @@ -371,7 +371,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go index 1f5e5e380..cf458f482 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/admissionregistration/v1" @@ -37,14 +38,14 @@ type MutatingWebhookConfigurationsGetter interface { // MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources. type MutatingWebhookConfigurationInterface interface { - Create(*v1.MutatingWebhookConfiguration) (*v1.MutatingWebhookConfiguration, error) - Update(*v1.MutatingWebhookConfiguration) (*v1.MutatingWebhookConfiguration, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error) - List(opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) + Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.MutatingWebhookConfiguration, error) + Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.MutatingWebhookConfiguration, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.MutatingWebhookConfiguration, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.MutatingWebhookConfigurationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) MutatingWebhookConfigurationExpansion } @@ -61,19 +62,19 @@ func newMutatingWebhookConfigurations(c *AdmissionregistrationV1Client) *mutatin } // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. -func (c *mutatingWebhookConfigurations) Get(name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.MutatingWebhookConfiguration, err error) { result = &v1.MutatingWebhookConfiguration{} err = c.client.Get(). Resource("mutatingwebhookconfigurations"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { +func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.MutatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *mutatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v Resource("mutatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. -func (c *mutatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *mutatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.In Resource("mutatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration) (result *v1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.MutatingWebhookConfiguration, err error) { result = &v1.MutatingWebhookConfiguration{} err = c.client.Post(). Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). Body(mutatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration) (result *v1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.MutatingWebhookConfiguration, err error) { result = &v1.MutatingWebhookConfiguration{} err = c.client.Put(). Resource("mutatingwebhookconfigurations"). Name(mutatingWebhookConfiguration.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(mutatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *mutatingWebhookConfigurations) Delete(name string, options *metav1.DeleteOptions) error { +func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("mutatingwebhookconfigurations"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *mutatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("mutatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched mutatingWebhookConfiguration. -func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.MutatingWebhookConfiguration, err error) { result = &v1.MutatingWebhookConfiguration{} err = c.client.Patch(pt). Resource("mutatingwebhookconfigurations"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go index 7987b6e30..c7191c0fe 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/admissionregistration/v1" @@ -37,14 +38,14 @@ type ValidatingWebhookConfigurationsGetter interface { // ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources. type ValidatingWebhookConfigurationInterface interface { - Create(*v1.ValidatingWebhookConfiguration) (*v1.ValidatingWebhookConfiguration, error) - Update(*v1.ValidatingWebhookConfiguration) (*v1.ValidatingWebhookConfiguration, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error) - List(opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) + Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*v1.ValidatingWebhookConfiguration, error) + Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*v1.ValidatingWebhookConfiguration, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ValidatingWebhookConfiguration, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ValidatingWebhookConfigurationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) ValidatingWebhookConfigurationExpansion } @@ -61,19 +62,19 @@ func newValidatingWebhookConfigurations(c *AdmissionregistrationV1Client) *valid } // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. -func (c *validatingWebhookConfigurations) Get(name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ValidatingWebhookConfiguration, err error) { result = &v1.ValidatingWebhookConfiguration{} err = c.client.Get(). Resource("validatingwebhookconfigurations"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) List(opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { +func (c *validatingWebhookConfigurations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ValidatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *validatingWebhookConfigurations) List(opts metav1.ListOptions) (result Resource("validatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. -func (c *validatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *validatingWebhookConfigurations) Watch(opts metav1.ListOptions) (watch. Resource("validatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration) (result *v1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { result = &v1.ValidatingWebhookConfiguration{} err = c.client.Post(). Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). Body(validatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration) (result *v1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (result *v1.ValidatingWebhookConfiguration, err error) { result = &v1.ValidatingWebhookConfiguration{} err = c.client.Put(). Resource("validatingwebhookconfigurations"). Name(validatingWebhookConfiguration.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(validatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *validatingWebhookConfigurations) Delete(name string, options *metav1.DeleteOptions) error { +func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("validatingwebhookconfigurations"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *validatingWebhookConfigurations) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("validatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched validatingWebhookConfiguration. -func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ValidatingWebhookConfiguration, err error) { result = &v1.ValidatingWebhookConfiguration{} err = c.client.Patch(pt). Resource("validatingwebhookconfigurations"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 4524896cd..73ab9ecde 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/admissionregistration/v1beta1" @@ -37,14 +38,14 @@ type MutatingWebhookConfigurationsGetter interface { // MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources. type MutatingWebhookConfigurationInterface interface { - Create(*v1beta1.MutatingWebhookConfiguration) (*v1beta1.MutatingWebhookConfiguration, error) - Update(*v1beta1.MutatingWebhookConfiguration) (*v1beta1.MutatingWebhookConfiguration, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.MutatingWebhookConfiguration, error) - List(opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) + Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.MutatingWebhookConfiguration, error) + Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.MutatingWebhookConfiguration, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.MutatingWebhookConfiguration, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.MutatingWebhookConfigurationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) MutatingWebhookConfigurationExpansion } @@ -61,19 +62,19 @@ func newMutatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) *mu } // Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. -func (c *mutatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { result = &v1beta1.MutatingWebhookConfiguration{} err = c.client.Get(). Resource("mutatingwebhookconfigurations"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. -func (c *mutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { +func (c *mutatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.MutatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *mutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1bet Resource("mutatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. -func (c *mutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *mutatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *mutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interf Resource("mutatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration) (result *v1beta1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Create(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { result = &v1beta1.MutatingWebhookConfiguration{} err = c.client.Post(). Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). Body(mutatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. -func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration) (result *v1beta1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Update(ctx context.Context, mutatingWebhookConfiguration *v1beta1.MutatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.MutatingWebhookConfiguration, err error) { result = &v1beta1.MutatingWebhookConfiguration{} err = c.client.Put(). Resource("mutatingwebhookconfigurations"). Name(mutatingWebhookConfiguration.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(mutatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *mutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error { +func (c *mutatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("mutatingwebhookconfigurations"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *mutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *mutatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("mutatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched mutatingWebhookConfiguration. -func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { +func (c *mutatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.MutatingWebhookConfiguration, err error) { result = &v1beta1.MutatingWebhookConfiguration{} err = c.client.Patch(pt). Resource("mutatingwebhookconfigurations"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 7e711b300..5ab0b9e37 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/admissionregistration/v1beta1" @@ -37,14 +38,14 @@ type ValidatingWebhookConfigurationsGetter interface { // ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources. type ValidatingWebhookConfigurationInterface interface { - Create(*v1beta1.ValidatingWebhookConfiguration) (*v1beta1.ValidatingWebhookConfiguration, error) - Update(*v1beta1.ValidatingWebhookConfiguration) (*v1beta1.ValidatingWebhookConfiguration, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ValidatingWebhookConfiguration, error) - List(opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) + Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) + Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (*v1beta1.ValidatingWebhookConfiguration, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ValidatingWebhookConfiguration, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ValidatingWebhookConfigurationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) ValidatingWebhookConfigurationExpansion } @@ -61,19 +62,19 @@ func newValidatingWebhookConfigurations(c *AdmissionregistrationV1beta1Client) * } // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. -func (c *validatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { result = &v1beta1.ValidatingWebhookConfiguration{} err = c.client.Get(). Resource("validatingwebhookconfigurations"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. -func (c *validatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { +func (c *validatingWebhookConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *validatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1b Resource("validatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. -func (c *validatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *validatingWebhookConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *validatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Inte Resource("validatingwebhookconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration) (result *v1beta1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Create(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.CreateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { result = &v1beta1.ValidatingWebhookConfiguration{} err = c.client.Post(). Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). Body(validatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any. -func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration) (result *v1beta1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Update(ctx context.Context, validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration, opts v1.UpdateOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) { result = &v1beta1.ValidatingWebhookConfiguration{} err = c.client.Put(). Resource("validatingwebhookconfigurations"). Name(validatingWebhookConfiguration.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(validatingWebhookConfiguration). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. -func (c *validatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error { +func (c *validatingWebhookConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("validatingwebhookconfigurations"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *validatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *validatingWebhookConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("validatingwebhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched validatingWebhookConfiguration. -func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { +func (c *validatingWebhookConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) { result = &v1beta1.ValidatingWebhookConfiguration{} err = c.client.Patch(pt). Resource("validatingwebhookconfigurations"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go index e28e4d2a3..dba06207a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/controllerrevision.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/apps/v1" @@ -37,14 +38,14 @@ type ControllerRevisionsGetter interface { // ControllerRevisionInterface has methods to work with ControllerRevision resources. type ControllerRevisionInterface interface { - Create(*v1.ControllerRevision) (*v1.ControllerRevision, error) - Update(*v1.ControllerRevision) (*v1.ControllerRevision, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ControllerRevision, error) - List(opts metav1.ListOptions) (*v1.ControllerRevisionList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ControllerRevision, err error) + Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (*v1.ControllerRevision, error) + Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (*v1.ControllerRevision, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ControllerRevision, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ControllerRevisionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) ControllerRevisionExpansion } @@ -63,20 +64,20 @@ func newControllerRevisions(c *AppsV1Client, namespace string) *controllerRevisi } // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *controllerRevisions) Get(name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { +func (c *controllerRevisions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ControllerRevision, err error) { result = &v1.ControllerRevision{} err = c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { +func (c *controllerRevisions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ControllerRevisionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *controllerRevisions) List(opts metav1.ListOptions) (result *v1.Controll Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *controllerRevisions) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *controllerRevisions) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *controllerRevisions) Watch(opts metav1.ListOptions) (watch.Interface, e Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Create(controllerRevision *v1.ControllerRevision) (result *v1.ControllerRevision, err error) { +func (c *controllerRevisions) Create(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.CreateOptions) (result *v1.ControllerRevision, err error) { result = &v1.ControllerRevision{} err = c.client.Post(). Namespace(c.ns). Resource("controllerrevisions"). + VersionedParams(&opts, scheme.ParameterCodec). Body(controllerRevision). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Update(controllerRevision *v1.ControllerRevision) (result *v1.ControllerRevision, err error) { +func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1.ControllerRevision, opts metav1.UpdateOptions) (result *v1.ControllerRevision, err error) { result = &v1.ControllerRevision{} err = c.client.Put(). Namespace(c.ns). Resource("controllerrevisions"). Name(controllerRevision.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(controllerRevision). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(name string, options *metav1.DeleteOptions) error { +func (c *controllerRevisions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched controllerRevision. -func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ControllerRevision, err error) { +func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ControllerRevision, err error) { result = &v1.ControllerRevision{} err = c.client.Patch(pt). Namespace(c.ns). Resource("controllerrevisions"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go index a535cdabe..0bb397af7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/daemonset.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/apps/v1" @@ -37,15 +38,15 @@ type DaemonSetsGetter interface { // DaemonSetInterface has methods to work with DaemonSet resources. type DaemonSetInterface interface { - Create(*v1.DaemonSet) (*v1.DaemonSet, error) - Update(*v1.DaemonSet) (*v1.DaemonSet, error) - UpdateStatus(*v1.DaemonSet) (*v1.DaemonSet, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.DaemonSet, error) - List(opts metav1.ListOptions) (*v1.DaemonSetList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DaemonSet, err error) + Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (*v1.DaemonSet, error) + Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) + UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (*v1.DaemonSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.DaemonSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DaemonSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) DaemonSetExpansion } @@ -64,20 +65,20 @@ func newDaemonSets(c *AppsV1Client, namespace string) *daemonSets { } // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *daemonSets) Get(name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) { +func (c *daemonSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.DaemonSet, err error) { result = &v1.DaemonSet{} err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) List(opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { +func (c *daemonSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DaemonSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *daemonSets) List(opts metav1.ListOptions) (result *v1.DaemonSetList, er Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested daemonSets. -func (c *daemonSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *daemonSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *daemonSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Create(daemonSet *v1.DaemonSet) (result *v1.DaemonSet, err error) { +func (c *daemonSets) Create(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.CreateOptions) (result *v1.DaemonSet, err error) { result = &v1.DaemonSet{} err = c.client.Post(). Namespace(c.ns). Resource("daemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Update(daemonSet *v1.DaemonSet) (result *v1.DaemonSet, err error) { +func (c *daemonSets) Update(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { result = &v1.DaemonSet{} err = c.client.Put(). Namespace(c.ns). Resource("daemonsets"). Name(daemonSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *daemonSets) UpdateStatus(daemonSet *v1.DaemonSet) (result *v1.DaemonSet, err error) { +func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1.DaemonSet, opts metav1.UpdateOptions) (result *v1.DaemonSet, err error) { result = &v1.DaemonSet{} err = c.client.Put(). Namespace(c.ns). Resource("daemonsets"). Name(daemonSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(name string, options *metav1.DeleteOptions) error { +func (c *daemonSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *daemonSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched daemonSet. -func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.DaemonSet, err error) { +func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.DaemonSet, err error) { result = &v1.DaemonSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("daemonsets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go index f9799a453..69d1b86dc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/apps/v1" @@ -38,17 +39,17 @@ type DeploymentsGetter interface { // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { - Create(*v1.Deployment) (*v1.Deployment, error) - Update(*v1.Deployment) (*v1.Deployment, error) - UpdateStatus(*v1.Deployment) (*v1.Deployment, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Deployment, error) - List(opts metav1.ListOptions) (*v1.DeploymentList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Deployment, err error) - GetScale(deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) - UpdateScale(deploymentName string, scale *autoscalingv1.Scale) (*autoscalingv1.Scale, error) + Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (*v1.Deployment, error) + Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) + UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (*v1.Deployment, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Deployment, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.DeploymentList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) + GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) DeploymentExpansion } @@ -68,20 +69,20 @@ func newDeployments(c *AppsV1Client, namespace string) *deployments { } // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(name string, options metav1.GetOptions) (result *v1.Deployment, err error) { +func (c *deployments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Deployment, err error) { result = &v1.Deployment{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(opts metav1.ListOptions) (result *v1.DeploymentList, err error) { +func (c *deployments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *deployments) List(opts metav1.ListOptions) (result *v1.DeploymentList, Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *deployments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,93 +110,96 @@ func (c *deployments) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(deployment *v1.Deployment) (result *v1.Deployment, err error) { +func (c *deployments) Create(ctx context.Context, deployment *v1.Deployment, opts metav1.CreateOptions) (result *v1.Deployment, err error) { result = &v1.Deployment{} err = c.client.Post(). Namespace(c.ns). Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(deployment *v1.Deployment) (result *v1.Deployment, err error) { +func (c *deployments) Update(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { result = &v1.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *deployments) UpdateStatus(deployment *v1.Deployment) (result *v1.Deployment, err error) { +func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1.Deployment, opts metav1.UpdateOptions) (result *v1.Deployment, err error) { result = &v1.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(name string, options *metav1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Deployment, err error) { +func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Deployment, err error) { result = &v1.Deployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("deployments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the deployment, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. -func (c *deployments) GetScale(deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { +func (c *deployments) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -203,21 +207,22 @@ func (c *deployments) GetScale(deploymentName string, options metav1.GetOptions) Name(deploymentName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *deployments) UpdateScale(deploymentName string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) { +func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deploymentName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go index ff3504e78..377b9ca37 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/replicaset.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/apps/v1" @@ -38,17 +39,17 @@ type ReplicaSetsGetter interface { // ReplicaSetInterface has methods to work with ReplicaSet resources. type ReplicaSetInterface interface { - Create(*v1.ReplicaSet) (*v1.ReplicaSet, error) - Update(*v1.ReplicaSet) (*v1.ReplicaSet, error) - UpdateStatus(*v1.ReplicaSet) (*v1.ReplicaSet, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ReplicaSet, error) - List(opts metav1.ListOptions) (*v1.ReplicaSetList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicaSet, err error) - GetScale(replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) - UpdateScale(replicaSetName string, scale *autoscalingv1.Scale) (*autoscalingv1.Scale, error) + Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (*v1.ReplicaSet, error) + Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) + UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (*v1.ReplicaSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicaSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicaSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) + GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) ReplicaSetExpansion } @@ -68,20 +69,20 @@ func newReplicaSets(c *AppsV1Client, namespace string) *replicaSets { } // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { +func (c *replicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicaSet, err error) { result = &v1.ReplicaSet{} err = c.client.Get(). Namespace(c.ns). Resource("replicasets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { +func (c *replicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicaSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *replicaSets) List(opts metav1.ListOptions) (result *v1.ReplicaSetList, Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *replicaSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,93 +110,96 @@ func (c *replicaSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(replicaSet *v1.ReplicaSet) (result *v1.ReplicaSet, err error) { +func (c *replicaSets) Create(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.CreateOptions) (result *v1.ReplicaSet, err error) { result = &v1.ReplicaSet{} err = c.client.Post(). Namespace(c.ns). Resource("replicasets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(replicaSet *v1.ReplicaSet) (result *v1.ReplicaSet, err error) { +func (c *replicaSets) Update(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { result = &v1.ReplicaSet{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *replicaSets) UpdateStatus(replicaSet *v1.ReplicaSet) (result *v1.ReplicaSet, err error) { +func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1.ReplicaSet, opts metav1.UpdateOptions) (result *v1.ReplicaSet, err error) { result = &v1.ReplicaSet{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(name string, options *metav1.DeleteOptions) error { +func (c *replicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *replicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicaSet, err error) { +func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicaSet, err error) { result = &v1.ReplicaSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("replicasets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the replicaSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. -func (c *replicaSets) GetScale(replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { +func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -203,21 +207,22 @@ func (c *replicaSets) GetScale(replicaSetName string, options metav1.GetOptions) Name(replicaSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *replicaSets) UpdateScale(replicaSetName string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) { +func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go index c12c470bb..33a9f535c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1/statefulset.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/apps/v1" @@ -38,17 +39,17 @@ type StatefulSetsGetter interface { // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { - Create(*v1.StatefulSet) (*v1.StatefulSet, error) - Update(*v1.StatefulSet) (*v1.StatefulSet, error) - UpdateStatus(*v1.StatefulSet) (*v1.StatefulSet, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.StatefulSet, error) - List(opts metav1.ListOptions) (*v1.StatefulSetList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StatefulSet, err error) - GetScale(statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) - UpdateScale(statefulSetName string, scale *autoscalingv1.Scale) (*autoscalingv1.Scale, error) + Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (*v1.StatefulSet, error) + Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) + UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (*v1.StatefulSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StatefulSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.StatefulSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) + GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) StatefulSetExpansion } @@ -68,20 +69,20 @@ func newStatefulSets(c *AppsV1Client, namespace string) *statefulSets { } // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { +func (c *statefulSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StatefulSet, err error) { result = &v1.StatefulSet{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { +func (c *statefulSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StatefulSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *statefulSets) List(opts metav1.ListOptions) (result *v1.StatefulSetList Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested statefulSets. -func (c *statefulSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *statefulSets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,93 +110,96 @@ func (c *statefulSets) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(statefulSet *v1.StatefulSet) (result *v1.StatefulSet, err error) { +func (c *statefulSets) Create(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.CreateOptions) (result *v1.StatefulSet, err error) { result = &v1.StatefulSet{} err = c.client.Post(). Namespace(c.ns). Resource("statefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(statefulSet *v1.StatefulSet) (result *v1.StatefulSet, err error) { +func (c *statefulSets) Update(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { result = &v1.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *statefulSets) UpdateStatus(statefulSet *v1.StatefulSet) (result *v1.StatefulSet, err error) { +func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1.StatefulSet, opts metav1.UpdateOptions) (result *v1.StatefulSet, err error) { result = &v1.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(name string, options *metav1.DeleteOptions) error { +func (c *statefulSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *statefulSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StatefulSet, err error) { +func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StatefulSet, err error) { result = &v1.StatefulSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("statefulsets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the statefulSet, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. -func (c *statefulSets) GetScale(statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { +func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -203,21 +207,22 @@ func (c *statefulSets) GetScale(statefulSetName string, options metav1.GetOption Name(statefulSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *statefulSets) UpdateScale(statefulSetName string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) { +func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go index 45ddb9159..e247e07d0 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/apps/v1beta1" @@ -37,14 +38,14 @@ type ControllerRevisionsGetter interface { // ControllerRevisionInterface has methods to work with ControllerRevision resources. type ControllerRevisionInterface interface { - Create(*v1beta1.ControllerRevision) (*v1beta1.ControllerRevision, error) - Update(*v1beta1.ControllerRevision) (*v1beta1.ControllerRevision, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ControllerRevision, error) - List(opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ControllerRevision, err error) + Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (*v1beta1.ControllerRevision, error) + Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (*v1beta1.ControllerRevision, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ControllerRevision, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ControllerRevisionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) ControllerRevisionExpansion } @@ -63,20 +64,20 @@ func newControllerRevisions(c *AppsV1beta1Client, namespace string) *controllerR } // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { +func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ControllerRevision, err error) { result = &v1beta1.ControllerRevision{} err = c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { +func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ControllerRevisionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta1.Control Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Create(controllerRevision *v1beta1.ControllerRevision) (result *v1beta1.ControllerRevision, err error) { +func (c *controllerRevisions) Create(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.CreateOptions) (result *v1beta1.ControllerRevision, err error) { result = &v1beta1.ControllerRevision{} err = c.client.Post(). Namespace(c.ns). Resource("controllerrevisions"). + VersionedParams(&opts, scheme.ParameterCodec). Body(controllerRevision). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Update(controllerRevision *v1beta1.ControllerRevision) (result *v1beta1.ControllerRevision, err error) { +func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1beta1.ControllerRevision, opts v1.UpdateOptions) (result *v1beta1.ControllerRevision, err error) { result = &v1beta1.ControllerRevision{} err = c.client.Put(). Namespace(c.ns). Resource("controllerrevisions"). Name(controllerRevision.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(controllerRevision). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) error { +func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched controllerRevision. -func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ControllerRevision, err error) { +func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ControllerRevision, err error) { result = &v1beta1.ControllerRevision{} err = c.client.Patch(pt). Namespace(c.ns). Resource("controllerrevisions"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go index 05fdcb7a6..dc0dad044 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/apps/v1beta1" @@ -37,15 +38,15 @@ type DeploymentsGetter interface { // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { - Create(*v1beta1.Deployment) (*v1beta1.Deployment, error) - Update(*v1beta1.Deployment) (*v1beta1.Deployment, error) - UpdateStatus(*v1beta1.Deployment) (*v1beta1.Deployment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Deployment, error) - List(opts v1.ListOptions) (*v1beta1.DeploymentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) + Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) + Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) + UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) DeploymentExpansion } @@ -64,20 +65,20 @@ func newDeployments(c *AppsV1beta1Client, namespace string) *deployments { } // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { +func (c *deployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { +func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { +func (c *deployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Post(). Namespace(c.ns). Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { +func (c *deployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { +func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { +func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("deployments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index c4b35b424..32ec548ab 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/apps/v1beta1" @@ -37,15 +38,15 @@ type StatefulSetsGetter interface { // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { - Create(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) - Update(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) - UpdateStatus(*v1beta1.StatefulSet) (*v1beta1.StatefulSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.StatefulSet, error) - List(opts v1.ListOptions) (*v1beta1.StatefulSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) + Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (*v1beta1.StatefulSet, error) + Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) + UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (*v1beta1.StatefulSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StatefulSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StatefulSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) StatefulSetExpansion } @@ -64,20 +65,20 @@ func newStatefulSets(c *AppsV1beta1Client, namespace string) *statefulSets { } // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { +func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StatefulSet, err error) { result = &v1beta1.StatefulSet{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { +func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StatefulSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta1.StatefulSetLis Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested statefulSets. -func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { +func (c *statefulSets) Create(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.CreateOptions) (result *v1beta1.StatefulSet, err error) { result = &v1beta1.StatefulSet{} err = c.client.Post(). Namespace(c.ns). Resource("statefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { +func (c *statefulSets) Update(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { result = &v1beta1.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *statefulSets) UpdateStatus(statefulSet *v1beta1.StatefulSet) (result *v1beta1.StatefulSet, err error) { +func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta1.StatefulSet, opts v1.UpdateOptions) (result *v1beta1.StatefulSet, err error) { result = &v1beta1.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error { +func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *statefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { +func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StatefulSet, err error) { result = &v1beta1.StatefulSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("statefulsets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go index e1d602515..e8de2d0fd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" "time" v1beta2 "k8s.io/api/apps/v1beta2" @@ -37,14 +38,14 @@ type ControllerRevisionsGetter interface { // ControllerRevisionInterface has methods to work with ControllerRevision resources. type ControllerRevisionInterface interface { - Create(*v1beta2.ControllerRevision) (*v1beta2.ControllerRevision, error) - Update(*v1beta2.ControllerRevision) (*v1beta2.ControllerRevision, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta2.ControllerRevision, error) - List(opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ControllerRevision, err error) + Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (*v1beta2.ControllerRevision, error) + Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (*v1beta2.ControllerRevision, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ControllerRevision, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ControllerRevisionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) ControllerRevisionExpansion } @@ -63,20 +64,20 @@ func newControllerRevisions(c *AppsV1beta2Client, namespace string) *controllerR } // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any. -func (c *controllerRevisions) Get(name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { +func (c *controllerRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) { result = &v1beta2.ControllerRevision{} err = c.client.Get(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. -func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { +func (c *controllerRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *controllerRevisions) List(opts v1.ListOptions) (result *v1beta2.Control Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested controllerRevisions. -func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *controllerRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *controllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error Resource("controllerrevisions"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Create(controllerRevision *v1beta2.ControllerRevision) (result *v1beta2.ControllerRevision, err error) { +func (c *controllerRevisions) Create(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.CreateOptions) (result *v1beta2.ControllerRevision, err error) { result = &v1beta2.ControllerRevision{} err = c.client.Post(). Namespace(c.ns). Resource("controllerrevisions"). + VersionedParams(&opts, scheme.ParameterCodec). Body(controllerRevision). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any. -func (c *controllerRevisions) Update(controllerRevision *v1beta2.ControllerRevision) (result *v1beta2.ControllerRevision, err error) { +func (c *controllerRevisions) Update(ctx context.Context, controllerRevision *v1beta2.ControllerRevision, opts v1.UpdateOptions) (result *v1beta2.ControllerRevision, err error) { result = &v1beta2.ControllerRevision{} err = c.client.Put(). Namespace(c.ns). Resource("controllerrevisions"). Name(controllerRevision.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(controllerRevision). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs. -func (c *controllerRevisions) Delete(name string, options *v1.DeleteOptions) error { +func (c *controllerRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *controllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *controllerRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("controllerrevisions"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched controllerRevision. -func (c *controllerRevisions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ControllerRevision, err error) { +func (c *controllerRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ControllerRevision, err error) { result = &v1beta2.ControllerRevision{} err = c.client.Patch(pt). Namespace(c.ns). Resource("controllerrevisions"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go index f8b7ac259..6d3a26d33 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/daemonset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" "time" v1beta2 "k8s.io/api/apps/v1beta2" @@ -37,15 +38,15 @@ type DaemonSetsGetter interface { // DaemonSetInterface has methods to work with DaemonSet resources. type DaemonSetInterface interface { - Create(*v1beta2.DaemonSet) (*v1beta2.DaemonSet, error) - Update(*v1beta2.DaemonSet) (*v1beta2.DaemonSet, error) - UpdateStatus(*v1beta2.DaemonSet) (*v1beta2.DaemonSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta2.DaemonSet, error) - List(opts v1.ListOptions) (*v1beta2.DaemonSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.DaemonSet, err error) + Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (*v1beta2.DaemonSet, error) + Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) + UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (*v1beta2.DaemonSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.DaemonSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DaemonSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) DaemonSetExpansion } @@ -64,20 +65,20 @@ func newDaemonSets(c *AppsV1beta2Client, namespace string) *daemonSets { } // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) { +func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.DaemonSet, err error) { result = &v1beta2.DaemonSet{} err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { +func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DaemonSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta2.DaemonSetList, e Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested daemonSets. -func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Create(daemonSet *v1beta2.DaemonSet) (result *v1beta2.DaemonSet, err error) { +func (c *daemonSets) Create(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.CreateOptions) (result *v1beta2.DaemonSet, err error) { result = &v1beta2.DaemonSet{} err = c.client.Post(). Namespace(c.ns). Resource("daemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Update(daemonSet *v1beta2.DaemonSet) (result *v1beta2.DaemonSet, err error) { +func (c *daemonSets) Update(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { result = &v1beta2.DaemonSet{} err = c.client.Put(). Namespace(c.ns). Resource("daemonsets"). Name(daemonSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *daemonSets) UpdateStatus(daemonSet *v1beta2.DaemonSet) (result *v1beta2.DaemonSet, err error) { +func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta2.DaemonSet, opts v1.UpdateOptions) (result *v1beta2.DaemonSet, err error) { result = &v1beta2.DaemonSet{} err = c.client.Put(). Namespace(c.ns). Resource("daemonsets"). Name(daemonSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error { +func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched daemonSet. -func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.DaemonSet, err error) { +func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.DaemonSet, err error) { result = &v1beta2.DaemonSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("daemonsets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go index 510250b06..2cdb539ef 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" "time" v1beta2 "k8s.io/api/apps/v1beta2" @@ -37,15 +38,15 @@ type DeploymentsGetter interface { // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { - Create(*v1beta2.Deployment) (*v1beta2.Deployment, error) - Update(*v1beta2.Deployment) (*v1beta2.Deployment, error) - UpdateStatus(*v1beta2.Deployment) (*v1beta2.Deployment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta2.Deployment, error) - List(opts v1.ListOptions) (*v1beta2.DeploymentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.Deployment, err error) + Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (*v1beta2.Deployment, error) + Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) + UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (*v1beta2.Deployment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.Deployment, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.DeploymentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) DeploymentExpansion } @@ -64,20 +65,20 @@ func newDeployments(c *AppsV1beta2Client, namespace string) *deployments { } // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { +func (c *deployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.Deployment, err error) { result = &v1beta2.Deployment{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { +func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta2.DeploymentList, Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(deployment *v1beta2.Deployment) (result *v1beta2.Deployment, err error) { +func (c *deployments) Create(ctx context.Context, deployment *v1beta2.Deployment, opts v1.CreateOptions) (result *v1beta2.Deployment, err error) { result = &v1beta2.Deployment{} err = c.client.Post(). Namespace(c.ns). Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(deployment *v1beta2.Deployment) (result *v1beta2.Deployment, err error) { +func (c *deployments) Update(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { result = &v1beta2.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *deployments) UpdateStatus(deployment *v1beta2.Deployment) (result *v1beta2.Deployment, err error) { +func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta2.Deployment, opts v1.UpdateOptions) (result *v1beta2.Deployment, err error) { result = &v1beta2.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.Deployment, err error) { +func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.Deployment, err error) { result = &v1beta2.Deployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("deployments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go index 7b738774b..d7365bebb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/replicaset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" "time" v1beta2 "k8s.io/api/apps/v1beta2" @@ -37,15 +38,15 @@ type ReplicaSetsGetter interface { // ReplicaSetInterface has methods to work with ReplicaSet resources. type ReplicaSetInterface interface { - Create(*v1beta2.ReplicaSet) (*v1beta2.ReplicaSet, error) - Update(*v1beta2.ReplicaSet) (*v1beta2.ReplicaSet, error) - UpdateStatus(*v1beta2.ReplicaSet) (*v1beta2.ReplicaSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta2.ReplicaSet, error) - List(opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ReplicaSet, err error) + Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (*v1beta2.ReplicaSet, error) + Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) + UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (*v1beta2.ReplicaSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.ReplicaSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.ReplicaSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) ReplicaSetExpansion } @@ -64,20 +65,20 @@ func newReplicaSets(c *AppsV1beta2Client, namespace string) *replicaSets { } // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { +func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.ReplicaSet, err error) { result = &v1beta2.ReplicaSet{} err = c.client.Get(). Namespace(c.ns). Resource("replicasets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { +func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.ReplicaSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta2.ReplicaSetList, Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(replicaSet *v1beta2.ReplicaSet) (result *v1beta2.ReplicaSet, err error) { +func (c *replicaSets) Create(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.CreateOptions) (result *v1beta2.ReplicaSet, err error) { result = &v1beta2.ReplicaSet{} err = c.client.Post(). Namespace(c.ns). Resource("replicasets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(replicaSet *v1beta2.ReplicaSet) (result *v1beta2.ReplicaSet, err error) { +func (c *replicaSets) Update(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { result = &v1beta2.ReplicaSet{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *replicaSets) UpdateStatus(replicaSet *v1beta2.ReplicaSet) (result *v1beta2.ReplicaSet, err error) { +func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta2.ReplicaSet, opts v1.UpdateOptions) (result *v1beta2.ReplicaSet, err error) { result = &v1beta2.ReplicaSet{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error { +func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *replicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ReplicaSet, err error) { +func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.ReplicaSet, err error) { result = &v1beta2.ReplicaSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("replicasets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go index de7c3db8b..745831699 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/apps/v1beta2/statefulset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta2 import ( + "context" "time" v1beta2 "k8s.io/api/apps/v1beta2" @@ -37,17 +38,17 @@ type StatefulSetsGetter interface { // StatefulSetInterface has methods to work with StatefulSet resources. type StatefulSetInterface interface { - Create(*v1beta2.StatefulSet) (*v1beta2.StatefulSet, error) - Update(*v1beta2.StatefulSet) (*v1beta2.StatefulSet, error) - UpdateStatus(*v1beta2.StatefulSet) (*v1beta2.StatefulSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta2.StatefulSet, error) - List(opts v1.ListOptions) (*v1beta2.StatefulSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.StatefulSet, err error) - GetScale(statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error) - UpdateScale(statefulSetName string, scale *v1beta2.Scale) (*v1beta2.Scale, error) + Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (*v1beta2.StatefulSet, error) + Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) + UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (*v1beta2.StatefulSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta2.StatefulSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta2.StatefulSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) + GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (*v1beta2.Scale, error) + UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (*v1beta2.Scale, error) StatefulSetExpansion } @@ -67,20 +68,20 @@ func newStatefulSets(c *AppsV1beta2Client, namespace string) *statefulSets { } // Get takes name of the statefulSet, and returns the corresponding statefulSet object, and an error if there is any. -func (c *statefulSets) Get(name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { +func (c *statefulSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta2.StatefulSet, err error) { result = &v1beta2.StatefulSet{} err = c.client.Get(). Namespace(c.ns). Resource("statefulsets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. -func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { +func (c *statefulSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta2.StatefulSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -91,13 +92,13 @@ func (c *statefulSets) List(opts v1.ListOptions) (result *v1beta2.StatefulSetLis Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested statefulSets. -func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *statefulSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -108,93 +109,96 @@ func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("statefulsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a statefulSet and creates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Create(statefulSet *v1beta2.StatefulSet) (result *v1beta2.StatefulSet, err error) { +func (c *statefulSets) Create(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.CreateOptions) (result *v1beta2.StatefulSet, err error) { result = &v1beta2.StatefulSet{} err = c.client.Post(). Namespace(c.ns). Resource("statefulsets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a statefulSet and updates it. Returns the server's representation of the statefulSet, and an error, if there is any. -func (c *statefulSets) Update(statefulSet *v1beta2.StatefulSet) (result *v1beta2.StatefulSet, err error) { +func (c *statefulSets) Update(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { result = &v1beta2.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *statefulSets) UpdateStatus(statefulSet *v1beta2.StatefulSet) (result *v1beta2.StatefulSet, err error) { +func (c *statefulSets) UpdateStatus(ctx context.Context, statefulSet *v1beta2.StatefulSet, opts v1.UpdateOptions) (result *v1beta2.StatefulSet, err error) { result = &v1beta2.StatefulSet{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(statefulSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the statefulSet and deletes it. Returns an error if one occurs. -func (c *statefulSets) Delete(name string, options *v1.DeleteOptions) error { +func (c *statefulSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *statefulSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *statefulSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("statefulsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.StatefulSet, err error) { +func (c *statefulSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta2.StatefulSet, err error) { result = &v1beta2.StatefulSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("statefulsets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the statefulSet, and returns the corresponding v1beta2.Scale object, and an error if there is any. -func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { +func (c *statefulSets) GetScale(ctx context.Context, statefulSetName string, options v1.GetOptions) (result *v1beta2.Scale, err error) { result = &v1beta2.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -202,21 +206,22 @@ func (c *statefulSets) GetScale(statefulSetName string, options v1.GetOptions) ( Name(statefulSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *statefulSets) UpdateScale(statefulSetName string, scale *v1beta2.Scale) (result *v1beta2.Scale, err error) { +func (c *statefulSets) UpdateScale(ctx context.Context, statefulSetName string, scale *v1beta2.Scale, opts v1.UpdateOptions) (result *v1beta2.Scale, err error) { result = &v1beta2.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("statefulsets"). Name(statefulSetName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go b/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go index 414d48006..ea748c662 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/auditregistration/v1alpha1/auditsink.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/auditregistration/v1alpha1" @@ -37,14 +38,14 @@ type AuditSinksGetter interface { // AuditSinkInterface has methods to work with AuditSink resources. type AuditSinkInterface interface { - Create(*v1alpha1.AuditSink) (*v1alpha1.AuditSink, error) - Update(*v1alpha1.AuditSink) (*v1alpha1.AuditSink, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.AuditSink, error) - List(opts v1.ListOptions) (*v1alpha1.AuditSinkList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) + Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (*v1alpha1.AuditSink, error) + Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (*v1alpha1.AuditSink, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.AuditSink, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.AuditSinkList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AuditSink, err error) AuditSinkExpansion } @@ -61,19 +62,19 @@ func newAuditSinks(c *AuditregistrationV1alpha1Client) *auditSinks { } // Get takes name of the auditSink, and returns the corresponding auditSink object, and an error if there is any. -func (c *auditSinks) Get(name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { +func (c *auditSinks) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.AuditSink, err error) { result = &v1alpha1.AuditSink{} err = c.client.Get(). Resource("auditsinks"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of AuditSinks that match those selectors. -func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { +func (c *auditSinks) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.AuditSinkList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *auditSinks) List(opts v1.ListOptions) (result *v1alpha1.AuditSinkList, Resource("auditsinks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested auditSinks. -func (c *auditSinks) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *auditSinks) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *auditSinks) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("auditsinks"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a auditSink and creates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *auditSinks) Create(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { +func (c *auditSinks) Create(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.CreateOptions) (result *v1alpha1.AuditSink, err error) { result = &v1alpha1.AuditSink{} err = c.client.Post(). Resource("auditsinks"). + VersionedParams(&opts, scheme.ParameterCodec). Body(auditSink). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a auditSink and updates it. Returns the server's representation of the auditSink, and an error, if there is any. -func (c *auditSinks) Update(auditSink *v1alpha1.AuditSink) (result *v1alpha1.AuditSink, err error) { +func (c *auditSinks) Update(ctx context.Context, auditSink *v1alpha1.AuditSink, opts v1.UpdateOptions) (result *v1alpha1.AuditSink, err error) { result = &v1alpha1.AuditSink{} err = c.client.Put(). Resource("auditsinks"). Name(auditSink.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(auditSink). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the auditSink and deletes it. Returns an error if one occurs. -func (c *auditSinks) Delete(name string, options *v1.DeleteOptions) error { +func (c *auditSinks) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("auditsinks"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *auditSinks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *auditSinks) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("auditsinks"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched auditSink. -func (c *auditSinks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.AuditSink, err error) { +func (c *auditSinks) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.AuditSink, err error) { result = &v1alpha1.AuditSink{} err = c.client.Patch(pt). Resource("auditsinks"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go index 177209ec6..0413fb2b6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/generated_expansion.go @@ -17,3 +17,5 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1 + +type TokenReviewExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go index 25a8d6a17..ca7cd47d2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1 import ( + "context" + + v1 "k8s.io/api/authentication/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type TokenReviewsGetter interface { // TokenReviewInterface has methods to work with TokenReview resources. type TokenReviewInterface interface { + Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (*v1.TokenReview, error) TokenReviewExpansion } @@ -44,3 +50,15 @@ func newTokenReviews(c *AuthenticationV1Client) *tokenReviews { client: c.RESTClient(), } } + +// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. +func (c *tokenReviews) Create(ctx context.Context, tokenReview *v1.TokenReview, opts metav1.CreateOptions) (result *v1.TokenReview, err error) { + result = &v1.TokenReview{} + err = c.client.Post(). + Resource("tokenreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tokenReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go deleted file mode 100644 index 8a21b7c76..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1/tokenreview_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authenticationapi "k8s.io/api/authentication/v1" -) - -type TokenReviewExpansion interface { - Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) - CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) -} - -func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - return c.CreateContext(context.Background(), tokenReview) -} - -func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - result = &authenticationapi.TokenReview{} - err = c.client.Post(). - Context(ctx). - Resource("tokenreviews"). - Body(tokenReview). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go index f6df76963..60bf15ab9 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/generated_expansion.go @@ -17,3 +17,5 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1beta1 + +type TokenReviewExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go index 0ac3561e1..5da122433 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1beta1 import ( + "context" + + v1beta1 "k8s.io/api/authentication/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type TokenReviewsGetter interface { // TokenReviewInterface has methods to work with TokenReview resources. type TokenReviewInterface interface { + Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (*v1beta1.TokenReview, error) TokenReviewExpansion } @@ -44,3 +50,15 @@ func newTokenReviews(c *AuthenticationV1beta1Client) *tokenReviews { client: c.RESTClient(), } } + +// Create takes the representation of a tokenReview and creates it. Returns the server's representation of the tokenReview, and an error, if there is any. +func (c *tokenReviews) Create(ctx context.Context, tokenReview *v1beta1.TokenReview, opts v1.CreateOptions) (result *v1beta1.TokenReview, err error) { + result = &v1beta1.TokenReview{} + err = c.client.Post(). + Resource("tokenreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tokenReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go deleted file mode 100644 index 0476b1735..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authentication/v1beta1/tokenreview_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authenticationapi "k8s.io/api/authentication/v1beta1" -) - -type TokenReviewExpansion interface { - Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) - CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) -} - -func (c *tokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - return c.CreateContext(context.Background(), tokenReview) -} - -func (c *tokenReviews) CreateContext(ctx context.Context, tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) { - result = &authenticationapi.TokenReview{} - err = c.client.Post(). - Context(ctx). - Resource("tokenreviews"). - Body(tokenReview). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go index 177209ec6..fe8c72cd4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/generated_expansion.go @@ -17,3 +17,11 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1 + +type LocalSubjectAccessReviewExpansion interface{} + +type SelfSubjectAccessReviewExpansion interface{} + +type SelfSubjectRulesReviewExpansion interface{} + +type SubjectAccessReviewExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go index 0292c7861..84b2efe16 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1 import ( + "context" + + v1 "k8s.io/api/authorization/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type LocalSubjectAccessReviewsGetter interface { // LocalSubjectAccessReviewInterface has methods to work with LocalSubjectAccessReview resources. type LocalSubjectAccessReviewInterface interface { + Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (*v1.LocalSubjectAccessReview, error) LocalSubjectAccessReviewExpansion } @@ -46,3 +52,16 @@ func newLocalSubjectAccessReviews(c *AuthorizationV1Client, namespace string) *l ns: namespace, } } + +// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. +func (c *localSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1.LocalSubjectAccessReview, opts metav1.CreateOptions) (result *v1.LocalSubjectAccessReview, err error) { + result = &v1.LocalSubjectAccessReview{} + err = c.client.Post(). + Namespace(c.ns). + Resource("localsubjectaccessreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localSubjectAccessReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go deleted file mode 100644 index 9836308bd..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/localsubjectaccessreview_expansion.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -type LocalSubjectAccessReviewExpansion interface { - Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) - CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) -} - -func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - return c.CreateContext(context.Background(), sar) -} - -func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - result = &authorizationapi.LocalSubjectAccessReview{} - err = c.client.Post(). - Context(ctx). - Namespace(c.ns). - Resource("localsubjectaccessreviews"). - Body(sar). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go index 1e3a45817..2006196c1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1 import ( + "context" + + v1 "k8s.io/api/authorization/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type SelfSubjectAccessReviewsGetter interface { // SelfSubjectAccessReviewInterface has methods to work with SelfSubjectAccessReview resources. type SelfSubjectAccessReviewInterface interface { + Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*v1.SelfSubjectAccessReview, error) SelfSubjectAccessReviewExpansion } @@ -44,3 +50,15 @@ func newSelfSubjectAccessReviews(c *AuthorizationV1Client) *selfSubjectAccessRev client: c.RESTClient(), } } + +// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. +func (c *selfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1.SelfSubjectAccessReview, opts metav1.CreateOptions) (result *v1.SelfSubjectAccessReview, err error) { + result = &v1.SelfSubjectAccessReview{} + err = c.client.Post(). + Resource("selfsubjectaccessreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(selfSubjectAccessReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go deleted file mode 100644 index 916e5b43f..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectaccessreview_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -type SelfSubjectAccessReviewExpansion interface { - Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) - CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) -} - -func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - return c.CreateContext(context.Background(), sar) -} - -func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - result = &authorizationapi.SelfSubjectAccessReview{} - err = c.client.Post(). - Context(ctx). - Resource("selfsubjectaccessreviews"). - Body(sar). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go index 50a0233eb..25d99f7b5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1 import ( + "context" + + v1 "k8s.io/api/authorization/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type SelfSubjectRulesReviewsGetter interface { // SelfSubjectRulesReviewInterface has methods to work with SelfSubjectRulesReview resources. type SelfSubjectRulesReviewInterface interface { + Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (*v1.SelfSubjectRulesReview, error) SelfSubjectRulesReviewExpansion } @@ -44,3 +50,15 @@ func newSelfSubjectRulesReviews(c *AuthorizationV1Client) *selfSubjectRulesRevie client: c.RESTClient(), } } + +// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. +func (c *selfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1.SelfSubjectRulesReview, opts metav1.CreateOptions) (result *v1.SelfSubjectRulesReview, err error) { + result = &v1.SelfSubjectRulesReview{} + err = c.client.Post(). + Resource("selfsubjectrulesreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(selfSubjectRulesReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go deleted file mode 100644 index 365282ed8..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/selfsubjectrulesreview_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -type SelfSubjectRulesReviewExpansion interface { - Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) - CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) -} - -func (c *selfSubjectRulesReviews) Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - return c.CreateContext(context.Background(), srr) -} - -func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - result = &authorizationapi.SelfSubjectRulesReview{} - err = c.client.Post(). - Context(ctx). - Resource("selfsubjectrulesreviews"). - Body(srr). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go index 9c09008c3..8ac0566a2 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1 import ( + "context" + + v1 "k8s.io/api/authorization/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type SubjectAccessReviewsGetter interface { // SubjectAccessReviewInterface has methods to work with SubjectAccessReview resources. type SubjectAccessReviewInterface interface { + Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (*v1.SubjectAccessReview, error) SubjectAccessReviewExpansion } @@ -44,3 +50,15 @@ func newSubjectAccessReviews(c *AuthorizationV1Client) *subjectAccessReviews { client: c.RESTClient(), } } + +// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. +func (c *subjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1.SubjectAccessReview, opts metav1.CreateOptions) (result *v1.SubjectAccessReview, err error) { + result = &v1.SubjectAccessReview{} + err = c.client.Post(). + Resource("subjectaccessreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(subjectAccessReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go deleted file mode 100644 index 927544f12..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1/subjectaccessreview_expansion.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1" -) - -// The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface. -type SubjectAccessReviewExpansion interface { - Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) - CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) -} - -func (c *subjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - return c.CreateContext(context.Background(), sar) -} - -func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - result = &authorizationapi.SubjectAccessReview{} - err = c.client.Post(). - Context(ctx). - Resource("subjectaccessreviews"). - Body(sar). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go index f6df76963..ae2388301 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/generated_expansion.go @@ -17,3 +17,11 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. package v1beta1 + +type LocalSubjectAccessReviewExpansion interface{} + +type SelfSubjectAccessReviewExpansion interface{} + +type SelfSubjectRulesReviewExpansion interface{} + +type SubjectAccessReviewExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go index f5e86a76a..78584ba94 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1beta1 import ( + "context" + + v1beta1 "k8s.io/api/authorization/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type LocalSubjectAccessReviewsGetter interface { // LocalSubjectAccessReviewInterface has methods to work with LocalSubjectAccessReview resources. type LocalSubjectAccessReviewInterface interface { + Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (*v1beta1.LocalSubjectAccessReview, error) LocalSubjectAccessReviewExpansion } @@ -46,3 +52,16 @@ func newLocalSubjectAccessReviews(c *AuthorizationV1beta1Client, namespace strin ns: namespace, } } + +// Create takes the representation of a localSubjectAccessReview and creates it. Returns the server's representation of the localSubjectAccessReview, and an error, if there is any. +func (c *localSubjectAccessReviews) Create(ctx context.Context, localSubjectAccessReview *v1beta1.LocalSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.LocalSubjectAccessReview, err error) { + result = &v1beta1.LocalSubjectAccessReview{} + err = c.client.Post(). + Namespace(c.ns). + Resource("localsubjectaccessreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localSubjectAccessReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go deleted file mode 100644 index 148cf6282..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview_expansion.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -type LocalSubjectAccessReviewExpansion interface { - Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) - CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) -} - -func (c *localSubjectAccessReviews) Create(sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - return c.CreateContext(context.Background(), sar) -} - -func (c *localSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.LocalSubjectAccessReview) (result *authorizationapi.LocalSubjectAccessReview, err error) { - result = &authorizationapi.LocalSubjectAccessReview{} - err = c.client.Post(). - Context(ctx). - Namespace(c.ns). - Resource("localsubjectaccessreviews"). - Body(sar). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go index 906712cc3..0286c93fe 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1beta1 import ( + "context" + + v1beta1 "k8s.io/api/authorization/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type SelfSubjectAccessReviewsGetter interface { // SelfSubjectAccessReviewInterface has methods to work with SelfSubjectAccessReview resources. type SelfSubjectAccessReviewInterface interface { + Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (*v1beta1.SelfSubjectAccessReview, error) SelfSubjectAccessReviewExpansion } @@ -44,3 +50,15 @@ func newSelfSubjectAccessReviews(c *AuthorizationV1beta1Client) *selfSubjectAcce client: c.RESTClient(), } } + +// Create takes the representation of a selfSubjectAccessReview and creates it. Returns the server's representation of the selfSubjectAccessReview, and an error, if there is any. +func (c *selfSubjectAccessReviews) Create(ctx context.Context, selfSubjectAccessReview *v1beta1.SelfSubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectAccessReview, err error) { + result = &v1beta1.SelfSubjectAccessReview{} + err = c.client.Post(). + Resource("selfsubjectaccessreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(selfSubjectAccessReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go deleted file mode 100644 index 6edead0e7..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -type SelfSubjectAccessReviewExpansion interface { - Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) - CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) -} - -func (c *selfSubjectAccessReviews) Create(sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - return c.CreateContext(context.Background(), sar) -} - -func (c *selfSubjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SelfSubjectAccessReview) (result *authorizationapi.SelfSubjectAccessReview, err error) { - result = &authorizationapi.SelfSubjectAccessReview{} - err = c.client.Post(). - Context(ctx). - Resource("selfsubjectaccessreviews"). - Body(sar). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go index 56c0f99d4..d772973ec 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1beta1 import ( + "context" + + v1beta1 "k8s.io/api/authorization/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type SelfSubjectRulesReviewsGetter interface { // SelfSubjectRulesReviewInterface has methods to work with SelfSubjectRulesReview resources. type SelfSubjectRulesReviewInterface interface { + Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (*v1beta1.SelfSubjectRulesReview, error) SelfSubjectRulesReviewExpansion } @@ -44,3 +50,15 @@ func newSelfSubjectRulesReviews(c *AuthorizationV1beta1Client) *selfSubjectRules client: c.RESTClient(), } } + +// Create takes the representation of a selfSubjectRulesReview and creates it. Returns the server's representation of the selfSubjectRulesReview, and an error, if there is any. +func (c *selfSubjectRulesReviews) Create(ctx context.Context, selfSubjectRulesReview *v1beta1.SelfSubjectRulesReview, opts v1.CreateOptions) (result *v1beta1.SelfSubjectRulesReview, err error) { + result = &v1beta1.SelfSubjectRulesReview{} + err = c.client.Post(). + Resource("selfsubjectrulesreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(selfSubjectRulesReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go deleted file mode 100644 index a459d5c3e..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview_expansion.go +++ /dev/null @@ -1,43 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -type SelfSubjectRulesReviewExpansion interface { - Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) - CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) -} - -func (c *selfSubjectRulesReviews) Create(srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - return c.CreateContext(context.Background(), srr) -} - -func (c *selfSubjectRulesReviews) CreateContext(ctx context.Context, srr *authorizationapi.SelfSubjectRulesReview) (result *authorizationapi.SelfSubjectRulesReview, err error) { - result = &authorizationapi.SelfSubjectRulesReview{} - err = c.client.Post(). - Context(ctx). - Resource("selfsubjectrulesreviews"). - Body(srr). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go index 79f1ec535..aebe8398c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go @@ -19,6 +19,11 @@ limitations under the License. package v1beta1 import ( + "context" + + v1beta1 "k8s.io/api/authorization/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" rest "k8s.io/client-go/rest" ) @@ -30,6 +35,7 @@ type SubjectAccessReviewsGetter interface { // SubjectAccessReviewInterface has methods to work with SubjectAccessReview resources. type SubjectAccessReviewInterface interface { + Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (*v1beta1.SubjectAccessReview, error) SubjectAccessReviewExpansion } @@ -44,3 +50,15 @@ func newSubjectAccessReviews(c *AuthorizationV1beta1Client) *subjectAccessReview client: c.RESTClient(), } } + +// Create takes the representation of a subjectAccessReview and creates it. Returns the server's representation of the subjectAccessReview, and an error, if there is any. +func (c *subjectAccessReviews) Create(ctx context.Context, subjectAccessReview *v1beta1.SubjectAccessReview, opts v1.CreateOptions) (result *v1beta1.SubjectAccessReview, err error) { + result = &v1beta1.SubjectAccessReview{} + err = c.client.Post(). + Resource("subjectaccessreviews"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(subjectAccessReview). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go deleted file mode 100644 index 7072e29ca..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/authorization/v1beta1/subjectaccessreview_expansion.go +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "context" - - authorizationapi "k8s.io/api/authorization/v1beta1" -) - -// The SubjectAccessReviewExpansion interface allows manually adding extra methods to the AuthorizationInterface. -type SubjectAccessReviewExpansion interface { - Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) - CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) -} - -func (c *subjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - return c.CreateContext(context.Background(), sar) -} - -func (c *subjectAccessReviews) CreateContext(ctx context.Context, sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) { - result = &authorizationapi.SubjectAccessReview{} - err = c.client.Post(). - Context(ctx). - Resource("subjectaccessreviews"). - Body(sar). - Do(). - Into(result) - return -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 0e0839fb5..ca8e0da8b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/autoscaling/v1" @@ -37,15 +38,15 @@ type HorizontalPodAutoscalersGetter interface { // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { - Create(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) - Update(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) - UpdateStatus(*v1.HorizontalPodAutoscaler) (*v1.HorizontalPodAutoscaler, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.HorizontalPodAutoscaler, error) - List(opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) + Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*v1.HorizontalPodAutoscaler, error) + Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) + UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*v1.HorizontalPodAutoscaler, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.HorizontalPodAutoscaler, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } @@ -64,20 +65,20 @@ func newHorizontalPodAutoscalers(c *AutoscalingV1Client, namespace string) *hori } // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.HorizontalPodAutoscaler, err error) { result = &v1.HorizontalPodAutoscaler{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *horizontalPodAutoscalers) List(opts metav1.ListOptions) (result *v1.Hor Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *horizontalPodAutoscalers) Watch(opts metav1.ListOptions) (watch.Interfa Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (result *v1.HorizontalPodAutoscaler, err error) { result = &v1.HorizontalPodAutoscaler{} err = c.client.Post(). Namespace(c.ns). Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { result = &v1.HorizontalPodAutoscaler{} err = c.client.Put(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(horizontalPodAutoscaler.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v1.HorizontalPodAutoscaler) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (result *v1.HorizontalPodAutoscaler, err error) { result = &v1.HorizontalPodAutoscaler{} err = c.client.Put(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(horizontalPodAutoscaler.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(name string, options *metav1.DeleteOptions) error { +func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { result = &v1.HorizontalPodAutoscaler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("horizontalpodautoscalers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 02d5cfb9b..f1637c1b8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -19,6 +19,7 @@ limitations under the License. package v2beta1 import ( + "context" "time" v2beta1 "k8s.io/api/autoscaling/v2beta1" @@ -37,15 +38,15 @@ type HorizontalPodAutoscalersGetter interface { // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { - Create(*v2beta1.HorizontalPodAutoscaler) (*v2beta1.HorizontalPodAutoscaler, error) - Update(*v2beta1.HorizontalPodAutoscaler) (*v2beta1.HorizontalPodAutoscaler, error) - UpdateStatus(*v2beta1.HorizontalPodAutoscaler) (*v2beta1.HorizontalPodAutoscaler, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v2beta1.HorizontalPodAutoscaler, error) - List(opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) + Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta1.HorizontalPodAutoscaler, error) + Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) + UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta1.HorizontalPodAutoscaler, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta1.HorizontalPodAutoscaler, error) + List(ctx context.Context, opts v1.ListOptions) (*v2beta1.HorizontalPodAutoscalerList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } @@ -64,20 +65,20 @@ func newHorizontalPodAutoscalers(c *AutoscalingV2beta1Client, namespace string) } // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta1.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta1.Ho Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler) (result *v2beta1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Post(). Namespace(c.ns). Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler) (result *v2beta1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Put(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(horizontalPodAutoscaler.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler) (result *v2beta1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta1.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Put(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(horizontalPodAutoscaler.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions) error { +func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta1.HorizontalPodAutoscaler, err error) { result = &v2beta1.HorizontalPodAutoscaler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("horizontalpodautoscalers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index 91a0fa64f..c7fad1080 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -19,6 +19,7 @@ limitations under the License. package v2beta2 import ( + "context" "time" v2beta2 "k8s.io/api/autoscaling/v2beta2" @@ -37,15 +38,15 @@ type HorizontalPodAutoscalersGetter interface { // HorizontalPodAutoscalerInterface has methods to work with HorizontalPodAutoscaler resources. type HorizontalPodAutoscalerInterface interface { - Create(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) - Update(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) - UpdateStatus(*v2beta2.HorizontalPodAutoscaler) (*v2beta2.HorizontalPodAutoscaler, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) - List(opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) + Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (*v2beta2.HorizontalPodAutoscaler, error) + Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) + UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (*v2beta2.HorizontalPodAutoscaler, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2beta2.HorizontalPodAutoscaler, error) + List(ctx context.Context, opts v1.ListOptions) (*v2beta2.HorizontalPodAutoscalerList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } @@ -64,20 +65,20 @@ func newHorizontalPodAutoscalers(c *AutoscalingV2beta2Client, namespace string) } // Get takes name of the horizontalPodAutoscaler, and returns the corresponding horizontalPodAutoscaler object, and an error if there is any. -func (c *horizontalPodAutoscalers) Get(name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { result = &v2beta2.HorizontalPodAutoscaler{} err = c.client.Get(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. -func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { +func (c *horizontalPodAutoscalers) List(ctx context.Context, opts v1.ListOptions) (result *v2beta2.HorizontalPodAutoscalerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *horizontalPodAutoscalers) List(opts v1.ListOptions) (result *v2beta2.Ho Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested horizontalPodAutoscalers. -func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *horizontalPodAutoscalers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *horizontalPodAutoscalers) Watch(opts v1.ListOptions) (watch.Interface, Resource("horizontalpodautoscalers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a horizontalPodAutoscaler and creates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Create(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Create(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.CreateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { result = &v2beta2.HorizontalPodAutoscaler{} err = c.client.Post(). Namespace(c.ns). Resource("horizontalpodautoscalers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a horizontalPodAutoscaler and updates it. Returns the server's representation of the horizontalPodAutoscaler, and an error, if there is any. -func (c *horizontalPodAutoscalers) Update(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Update(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { result = &v2beta2.HorizontalPodAutoscaler{} err = c.client.Put(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(horizontalPodAutoscaler.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *horizontalPodAutoscalers) UpdateStatus(horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler) (result *v2beta2.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *v2beta2.HorizontalPodAutoscaler, opts v1.UpdateOptions) (result *v2beta2.HorizontalPodAutoscaler, err error) { result = &v2beta2.HorizontalPodAutoscaler{} err = c.client.Put(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(horizontalPodAutoscaler.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(horizontalPodAutoscaler). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the horizontalPodAutoscaler and deletes it. Returns an error if one occurs. -func (c *horizontalPodAutoscalers) Delete(name string, options *v1.DeleteOptions) error { +func (c *horizontalPodAutoscalers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *horizontalPodAutoscalers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *horizontalPodAutoscalers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("horizontalpodautoscalers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2beta2.HorizontalPodAutoscaler, err error) { result = &v2beta2.HorizontalPodAutoscaler{} err = c.client.Patch(pt). Namespace(c.ns). Resource("horizontalpodautoscalers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index b55c602b3..a20c8e0e4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/batch/v1" @@ -37,15 +38,15 @@ type JobsGetter interface { // JobInterface has methods to work with Job resources. type JobInterface interface { - Create(*v1.Job) (*v1.Job, error) - Update(*v1.Job) (*v1.Job, error) - UpdateStatus(*v1.Job) (*v1.Job, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Job, error) - List(opts metav1.ListOptions) (*v1.JobList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) + Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (*v1.Job, error) + Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) + UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (*v1.Job, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Job, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.JobList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) JobExpansion } @@ -64,20 +65,20 @@ func newJobs(c *BatchV1Client, namespace string) *jobs { } // Get takes name of the job, and returns the corresponding job object, and an error if there is any. -func (c *jobs) Get(name string, options metav1.GetOptions) (result *v1.Job, err error) { +func (c *jobs) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Job, err error) { result = &v1.Job{} err = c.client.Get(). Namespace(c.ns). Resource("jobs"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Jobs that match those selectors. -func (c *jobs) List(opts metav1.ListOptions) (result *v1.JobList, err error) { +func (c *jobs) List(ctx context.Context, opts metav1.ListOptions) (result *v1.JobList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *jobs) List(opts metav1.ListOptions) (result *v1.JobList, err error) { Resource("jobs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested jobs. -func (c *jobs) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *jobs) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *jobs) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("jobs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a job and creates it. Returns the server's representation of the job, and an error, if there is any. -func (c *jobs) Create(job *v1.Job) (result *v1.Job, err error) { +func (c *jobs) Create(ctx context.Context, job *v1.Job, opts metav1.CreateOptions) (result *v1.Job, err error) { result = &v1.Job{} err = c.client.Post(). Namespace(c.ns). Resource("jobs"). + VersionedParams(&opts, scheme.ParameterCodec). Body(job). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a job and updates it. Returns the server's representation of the job, and an error, if there is any. -func (c *jobs) Update(job *v1.Job) (result *v1.Job, err error) { +func (c *jobs) Update(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { result = &v1.Job{} err = c.client.Put(). Namespace(c.ns). Resource("jobs"). Name(job.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(job). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *jobs) UpdateStatus(job *v1.Job) (result *v1.Job, err error) { +func (c *jobs) UpdateStatus(ctx context.Context, job *v1.Job, opts metav1.UpdateOptions) (result *v1.Job, err error) { result = &v1.Job{} err = c.client.Put(). Namespace(c.ns). Resource("jobs"). Name(job.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(job). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the job and deletes it. Returns an error if one occurs. -func (c *jobs) Delete(name string, options *metav1.DeleteOptions) error { +func (c *jobs) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("jobs"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *jobs) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *jobs) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("jobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched job. -func (c *jobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) { +func (c *jobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Job, err error) { result = &v1.Job{} err = c.client.Patch(pt). Namespace(c.ns). Resource("jobs"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go index d89d2fa21..076520296 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v1beta1/cronjob.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/batch/v1beta1" @@ -37,15 +38,15 @@ type CronJobsGetter interface { // CronJobInterface has methods to work with CronJob resources. type CronJobInterface interface { - Create(*v1beta1.CronJob) (*v1beta1.CronJob, error) - Update(*v1beta1.CronJob) (*v1beta1.CronJob, error) - UpdateStatus(*v1beta1.CronJob) (*v1beta1.CronJob, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.CronJob, error) - List(opts v1.ListOptions) (*v1beta1.CronJobList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CronJob, err error) + Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (*v1beta1.CronJob, error) + Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) + UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (*v1beta1.CronJob, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CronJob, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CronJobList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) CronJobExpansion } @@ -64,20 +65,20 @@ func newCronJobs(c *BatchV1beta1Client, namespace string) *cronJobs { } // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. -func (c *cronJobs) Get(name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { +func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CronJob, err error) { result = &v1beta1.CronJob{} err = c.client.Get(). Namespace(c.ns). Resource("cronjobs"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) List(opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { +func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CronJobList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *cronJobs) List(opts v1.ListOptions) (result *v1beta1.CronJobList, err e Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested cronJobs. -func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *cronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Create(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, err error) { +func (c *cronJobs) Create(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.CreateOptions) (result *v1beta1.CronJob, err error) { result = &v1beta1.CronJob{} err = c.client.Post(). Namespace(c.ns). Resource("cronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cronJob). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Update(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, err error) { +func (c *cronJobs) Update(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { result = &v1beta1.CronJob{} err = c.client.Put(). Namespace(c.ns). Resource("cronjobs"). Name(cronJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(cronJob). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *cronJobs) UpdateStatus(cronJob *v1beta1.CronJob) (result *v1beta1.CronJob, err error) { +func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v1beta1.CronJob, opts v1.UpdateOptions) (result *v1beta1.CronJob, err error) { result = &v1beta1.CronJob{} err = c.client.Put(). Namespace(c.ns). Resource("cronjobs"). Name(cronJob.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cronJob). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error { +func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched cronJob. -func (c *cronJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CronJob, err error) { +func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CronJob, err error) { result = &v1beta1.CronJob{} err = c.client.Patch(pt). Namespace(c.ns). Resource("cronjobs"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go index 19123b604..a25054f24 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -19,6 +19,7 @@ limitations under the License. package v2alpha1 import ( + "context" "time" v2alpha1 "k8s.io/api/batch/v2alpha1" @@ -37,15 +38,15 @@ type CronJobsGetter interface { // CronJobInterface has methods to work with CronJob resources. type CronJobInterface interface { - Create(*v2alpha1.CronJob) (*v2alpha1.CronJob, error) - Update(*v2alpha1.CronJob) (*v2alpha1.CronJob, error) - UpdateStatus(*v2alpha1.CronJob) (*v2alpha1.CronJob, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v2alpha1.CronJob, error) - List(opts v1.ListOptions) (*v2alpha1.CronJobList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) + Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (*v2alpha1.CronJob, error) + Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error) + UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (*v2alpha1.CronJob, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v2alpha1.CronJob, error) + List(ctx context.Context, opts v1.ListOptions) (*v2alpha1.CronJobList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CronJob, err error) CronJobExpansion } @@ -64,20 +65,20 @@ func newCronJobs(c *BatchV2alpha1Client, namespace string) *cronJobs { } // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. -func (c *cronJobs) Get(name string, options v1.GetOptions) (result *v2alpha1.CronJob, err error) { +func (c *cronJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v2alpha1.CronJob, err error) { result = &v2alpha1.CronJob{} err = c.client.Get(). Namespace(c.ns). Resource("cronjobs"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. -func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) { +func (c *cronJobs) List(ctx context.Context, opts v1.ListOptions) (result *v2alpha1.CronJobList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *cronJobs) List(opts v1.ListOptions) (result *v2alpha1.CronJobList, err Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested cronJobs. -func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *cronJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("cronjobs"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Create(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { +func (c *cronJobs) Create(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.CreateOptions) (result *v2alpha1.CronJob, err error) { result = &v2alpha1.CronJob{} err = c.client.Post(). Namespace(c.ns). Resource("cronjobs"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cronJob). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. -func (c *cronJobs) Update(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { +func (c *cronJobs) Update(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (result *v2alpha1.CronJob, err error) { result = &v2alpha1.CronJob{} err = c.client.Put(). Namespace(c.ns). Resource("cronjobs"). Name(cronJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(cronJob). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *cronJobs) UpdateStatus(cronJob *v2alpha1.CronJob) (result *v2alpha1.CronJob, err error) { +func (c *cronJobs) UpdateStatus(ctx context.Context, cronJob *v2alpha1.CronJob, opts v1.UpdateOptions) (result *v2alpha1.CronJob, err error) { result = &v2alpha1.CronJob{} err = c.client.Put(). Namespace(c.ns). Resource("cronjobs"). Name(cronJob.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cronJob). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. -func (c *cronJobs) Delete(name string, options *v1.DeleteOptions) error { +func (c *cronJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cronJobs) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cronJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched cronJob. -func (c *cronJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { +func (c *cronJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v2alpha1.CronJob, err error) { result = &v2alpha1.CronJob{} err = c.client.Patch(pt). Namespace(c.ns). Resource("cronjobs"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index 712d3a01a..6b2623b8a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/certificates/v1beta1" @@ -37,15 +38,15 @@ type CertificateSigningRequestsGetter interface { // CertificateSigningRequestInterface has methods to work with CertificateSigningRequest resources. type CertificateSigningRequestInterface interface { - Create(*v1beta1.CertificateSigningRequest) (*v1beta1.CertificateSigningRequest, error) - Update(*v1beta1.CertificateSigningRequest) (*v1beta1.CertificateSigningRequest, error) - UpdateStatus(*v1beta1.CertificateSigningRequest) (*v1beta1.CertificateSigningRequest, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.CertificateSigningRequest, error) - List(opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) + Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (*v1beta1.CertificateSigningRequest, error) + Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) + UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (*v1beta1.CertificateSigningRequest, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CertificateSigningRequest, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CertificateSigningRequestList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) CertificateSigningRequestExpansion } @@ -62,19 +63,19 @@ func newCertificateSigningRequests(c *CertificatesV1beta1Client) *certificateSig } // Get takes name of the certificateSigningRequest, and returns the corresponding certificateSigningRequest object, and an error if there is any. -func (c *certificateSigningRequests) Get(name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CertificateSigningRequest, err error) { result = &v1beta1.CertificateSigningRequest{} err = c.client.Get(). Resource("certificatesigningrequests"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. -func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { +func (c *certificateSigningRequests) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CertificateSigningRequestList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *certificateSigningRequests) List(opts v1.ListOptions) (result *v1beta1. Resource("certificatesigningrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested certificateSigningRequests. -func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *certificateSigningRequests) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface Resource("certificatesigningrequests"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a certificateSigningRequest and creates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *certificateSigningRequests) Create(certificateSigningRequest *v1beta1.CertificateSigningRequest) (result *v1beta1.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) Create(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.CreateOptions) (result *v1beta1.CertificateSigningRequest, err error) { result = &v1beta1.CertificateSigningRequest{} err = c.client.Post(). Resource("certificatesigningrequests"). + VersionedParams(&opts, scheme.ParameterCodec). Body(certificateSigningRequest). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a certificateSigningRequest and updates it. Returns the server's representation of the certificateSigningRequest, and an error, if there is any. -func (c *certificateSigningRequests) Update(certificateSigningRequest *v1beta1.CertificateSigningRequest) (result *v1beta1.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) Update(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { result = &v1beta1.CertificateSigningRequest{} err = c.client.Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequest.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(certificateSigningRequest). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *certificateSigningRequests) UpdateStatus(certificateSigningRequest *v1beta1.CertificateSigningRequest) (result *v1beta1.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) UpdateStatus(ctx context.Context, certificateSigningRequest *v1beta1.CertificateSigningRequest, opts v1.UpdateOptions) (result *v1beta1.CertificateSigningRequest, err error) { result = &v1beta1.CertificateSigningRequest{} err = c.client.Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequest.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(certificateSigningRequest). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the certificateSigningRequest and deletes it. Returns an error if one occurs. -func (c *certificateSigningRequests) Delete(name string, options *v1.DeleteOptions) error { +func (c *certificateSigningRequests) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("certificatesigningrequests"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *certificateSigningRequests) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *certificateSigningRequests) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("certificatesigningrequests"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched certificateSigningRequest. -func (c *certificateSigningRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CertificateSigningRequest, err error) { result = &v1beta1.CertificateSigningRequest{} err = c.client.Patch(pt). Resource("certificatesigningrequests"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go index c63b80638..473789141 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/certificates/v1beta1/certificatesigningrequest_expansion.go @@ -17,21 +17,26 @@ limitations under the License. package v1beta1 import ( + "context" + certificates "k8s.io/api/certificates/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" ) type CertificateSigningRequestExpansion interface { - UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) + UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) } -func (c *certificateSigningRequests) UpdateApproval(certificateSigningRequest *certificates.CertificateSigningRequest) (result *certificates.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { result = &certificates.CertificateSigningRequest{} err = c.client.Put(). Resource("certificatesigningrequests"). Name(certificateSigningRequest.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(certificateSigningRequest). SubResource("approval"). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go index b6cf1b64f..4e8cbf9d6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1/lease.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/coordination/v1" @@ -37,14 +38,14 @@ type LeasesGetter interface { // LeaseInterface has methods to work with Lease resources. type LeaseInterface interface { - Create(*v1.Lease) (*v1.Lease, error) - Update(*v1.Lease) (*v1.Lease, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Lease, error) - List(opts metav1.ListOptions) (*v1.LeaseList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Lease, err error) + Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (*v1.Lease, error) + Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (*v1.Lease, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Lease, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LeaseList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) LeaseExpansion } @@ -63,20 +64,20 @@ func newLeases(c *CoordinationV1Client, namespace string) *leases { } // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. -func (c *leases) Get(name string, options metav1.GetOptions) (result *v1.Lease, err error) { +func (c *leases) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Lease, err error) { result = &v1.Lease{} err = c.client.Get(). Namespace(c.ns). Resource("leases"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) List(opts metav1.ListOptions) (result *v1.LeaseList, err error) { +func (c *leases) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LeaseList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *leases) List(opts metav1.ListOptions) (result *v1.LeaseList, err error) Resource("leases"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested leases. -func (c *leases) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *leases) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *leases) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("leases"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Create(lease *v1.Lease) (result *v1.Lease, err error) { +func (c *leases) Create(ctx context.Context, lease *v1.Lease, opts metav1.CreateOptions) (result *v1.Lease, err error) { result = &v1.Lease{} err = c.client.Post(). Namespace(c.ns). Resource("leases"). + VersionedParams(&opts, scheme.ParameterCodec). Body(lease). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Update(lease *v1.Lease) (result *v1.Lease, err error) { +func (c *leases) Update(ctx context.Context, lease *v1.Lease, opts metav1.UpdateOptions) (result *v1.Lease, err error) { result = &v1.Lease{} err = c.client.Put(). Namespace(c.ns). Resource("leases"). Name(lease.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(lease). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *leases) Delete(name string, options *metav1.DeleteOptions) error { +func (c *leases) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("leases"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *leases) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *leases) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("leases"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched lease. -func (c *leases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Lease, err error) { +func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Lease, err error) { result = &v1.Lease{} err = c.client.Patch(pt). Namespace(c.ns). Resource("leases"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go index 490d815aa..c73cb0a97 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/coordination/v1beta1/lease.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/coordination/v1beta1" @@ -37,14 +38,14 @@ type LeasesGetter interface { // LeaseInterface has methods to work with Lease resources. type LeaseInterface interface { - Create(*v1beta1.Lease) (*v1beta1.Lease, error) - Update(*v1beta1.Lease) (*v1beta1.Lease, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Lease, error) - List(opts v1.ListOptions) (*v1beta1.LeaseList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Lease, err error) + Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (*v1beta1.Lease, error) + Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (*v1beta1.Lease, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Lease, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LeaseList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) LeaseExpansion } @@ -63,20 +64,20 @@ func newLeases(c *CoordinationV1beta1Client, namespace string) *leases { } // Get takes name of the lease, and returns the corresponding lease object, and an error if there is any. -func (c *leases) Get(name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { +func (c *leases) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Lease, err error) { result = &v1beta1.Lease{} err = c.client.Get(). Namespace(c.ns). Resource("leases"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Leases that match those selectors. -func (c *leases) List(opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { +func (c *leases) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LeaseList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *leases) List(opts v1.ListOptions) (result *v1beta1.LeaseList, err error Resource("leases"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested leases. -func (c *leases) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *leases) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *leases) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("leases"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a lease and creates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Create(lease *v1beta1.Lease) (result *v1beta1.Lease, err error) { +func (c *leases) Create(ctx context.Context, lease *v1beta1.Lease, opts v1.CreateOptions) (result *v1beta1.Lease, err error) { result = &v1beta1.Lease{} err = c.client.Post(). Namespace(c.ns). Resource("leases"). + VersionedParams(&opts, scheme.ParameterCodec). Body(lease). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a lease and updates it. Returns the server's representation of the lease, and an error, if there is any. -func (c *leases) Update(lease *v1beta1.Lease) (result *v1beta1.Lease, err error) { +func (c *leases) Update(ctx context.Context, lease *v1beta1.Lease, opts v1.UpdateOptions) (result *v1beta1.Lease, err error) { result = &v1beta1.Lease{} err = c.client.Put(). Namespace(c.ns). Resource("leases"). Name(lease.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(lease). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the lease and deletes it. Returns an error if one occurs. -func (c *leases) Delete(name string, options *v1.DeleteOptions) error { +func (c *leases) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("leases"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *leases) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *leases) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("leases"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched lease. -func (c *leases) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Lease, err error) { +func (c *leases) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Lease, err error) { result = &v1beta1.Lease{} err = c.client.Patch(pt). Namespace(c.ns). Resource("leases"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index 302b2fdc3..faf5d19cc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type ComponentStatusesGetter interface { // ComponentStatusInterface has methods to work with ComponentStatus resources. type ComponentStatusInterface interface { - Create(*v1.ComponentStatus) (*v1.ComponentStatus, error) - Update(*v1.ComponentStatus) (*v1.ComponentStatus, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ComponentStatus, error) - List(opts metav1.ListOptions) (*v1.ComponentStatusList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) + Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (*v1.ComponentStatus, error) + Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (*v1.ComponentStatus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ComponentStatus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ComponentStatusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) ComponentStatusExpansion } @@ -61,19 +62,19 @@ func newComponentStatuses(c *CoreV1Client) *componentStatuses { } // Get takes name of the componentStatus, and returns the corresponding componentStatus object, and an error if there is any. -func (c *componentStatuses) Get(name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { +func (c *componentStatuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ComponentStatus, err error) { result = &v1.ComponentStatus{} err = c.client.Get(). Resource("componentstatuses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. -func (c *componentStatuses) List(opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { +func (c *componentStatuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ComponentStatusList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *componentStatuses) List(opts metav1.ListOptions) (result *v1.ComponentS Resource("componentstatuses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested componentStatuses. -func (c *componentStatuses) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *componentStatuses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *componentStatuses) Watch(opts metav1.ListOptions) (watch.Interface, err Resource("componentstatuses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a componentStatus and creates it. Returns the server's representation of the componentStatus, and an error, if there is any. -func (c *componentStatuses) Create(componentStatus *v1.ComponentStatus) (result *v1.ComponentStatus, err error) { +func (c *componentStatuses) Create(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.CreateOptions) (result *v1.ComponentStatus, err error) { result = &v1.ComponentStatus{} err = c.client.Post(). Resource("componentstatuses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(componentStatus). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a componentStatus and updates it. Returns the server's representation of the componentStatus, and an error, if there is any. -func (c *componentStatuses) Update(componentStatus *v1.ComponentStatus) (result *v1.ComponentStatus, err error) { +func (c *componentStatuses) Update(ctx context.Context, componentStatus *v1.ComponentStatus, opts metav1.UpdateOptions) (result *v1.ComponentStatus, err error) { result = &v1.ComponentStatus{} err = c.client.Put(). Resource("componentstatuses"). Name(componentStatus.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(componentStatus). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the componentStatus and deletes it. Returns an error if one occurs. -func (c *componentStatuses) Delete(name string, options *metav1.DeleteOptions) error { +func (c *componentStatuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("componentstatuses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *componentStatuses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *componentStatuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("componentstatuses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched componentStatus. -func (c *componentStatuses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) { +func (c *componentStatuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ComponentStatus, err error) { result = &v1.ComponentStatus{} err = c.client.Patch(pt). Resource("componentstatuses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index 18ce954ae..407d25a46 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type ConfigMapsGetter interface { // ConfigMapInterface has methods to work with ConfigMap resources. type ConfigMapInterface interface { - Create(*v1.ConfigMap) (*v1.ConfigMap, error) - Update(*v1.ConfigMap) (*v1.ConfigMap, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ConfigMap, error) - List(opts metav1.ListOptions) (*v1.ConfigMapList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) + Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (*v1.ConfigMap, error) + Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (*v1.ConfigMap, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ConfigMap, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ConfigMapList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) ConfigMapExpansion } @@ -63,20 +64,20 @@ func newConfigMaps(c *CoreV1Client, namespace string) *configMaps { } // Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any. -func (c *configMaps) Get(name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { +func (c *configMaps) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ConfigMap, err error) { result = &v1.ConfigMap{} err = c.client.Get(). Namespace(c.ns). Resource("configmaps"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. -func (c *configMaps) List(opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { +func (c *configMaps) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ConfigMapList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *configMaps) List(opts metav1.ListOptions) (result *v1.ConfigMapList, er Resource("configmaps"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested configMaps. -func (c *configMaps) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *configMaps) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *configMaps) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("configmaps"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *configMaps) Create(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) { +func (c *configMaps) Create(ctx context.Context, configMap *v1.ConfigMap, opts metav1.CreateOptions) (result *v1.ConfigMap, err error) { result = &v1.ConfigMap{} err = c.client.Post(). Namespace(c.ns). Resource("configmaps"). + VersionedParams(&opts, scheme.ParameterCodec). Body(configMap). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any. -func (c *configMaps) Update(configMap *v1.ConfigMap) (result *v1.ConfigMap, err error) { +func (c *configMaps) Update(ctx context.Context, configMap *v1.ConfigMap, opts metav1.UpdateOptions) (result *v1.ConfigMap, err error) { result = &v1.ConfigMap{} err = c.client.Put(). Namespace(c.ns). Resource("configmaps"). Name(configMap.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(configMap). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the configMap and deletes it. Returns an error if one occurs. -func (c *configMaps) Delete(name string, options *metav1.DeleteOptions) error { +func (c *configMaps) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("configmaps"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *configMaps) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *configMaps) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("configmaps"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched configMap. -func (c *configMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { +func (c *configMaps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ConfigMap, err error) { result = &v1.ConfigMap{} err = c.client.Patch(pt). Namespace(c.ns). Resource("configmaps"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index 978a2a196..c36eaaa4a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type EndpointsGetter interface { // EndpointsInterface has methods to work with Endpoints resources. type EndpointsInterface interface { - Create(*v1.Endpoints) (*v1.Endpoints, error) - Update(*v1.Endpoints) (*v1.Endpoints, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Endpoints, error) - List(opts metav1.ListOptions) (*v1.EndpointsList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) + Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (*v1.Endpoints, error) + Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (*v1.Endpoints, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Endpoints, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.EndpointsList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) EndpointsExpansion } @@ -63,20 +64,20 @@ func newEndpoints(c *CoreV1Client, namespace string) *endpoints { } // Get takes name of the endpoints, and returns the corresponding endpoints object, and an error if there is any. -func (c *endpoints) Get(name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { +func (c *endpoints) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Endpoints, err error) { result = &v1.Endpoints{} err = c.client.Get(). Namespace(c.ns). Resource("endpoints"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Endpoints that match those selectors. -func (c *endpoints) List(opts metav1.ListOptions) (result *v1.EndpointsList, err error) { +func (c *endpoints) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EndpointsList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *endpoints) List(opts metav1.ListOptions) (result *v1.EndpointsList, err Resource("endpoints"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested endpoints. -func (c *endpoints) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *endpoints) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *endpoints) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("endpoints"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a endpoints and creates it. Returns the server's representation of the endpoints, and an error, if there is any. -func (c *endpoints) Create(endpoints *v1.Endpoints) (result *v1.Endpoints, err error) { +func (c *endpoints) Create(ctx context.Context, endpoints *v1.Endpoints, opts metav1.CreateOptions) (result *v1.Endpoints, err error) { result = &v1.Endpoints{} err = c.client.Post(). Namespace(c.ns). Resource("endpoints"). + VersionedParams(&opts, scheme.ParameterCodec). Body(endpoints). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a endpoints and updates it. Returns the server's representation of the endpoints, and an error, if there is any. -func (c *endpoints) Update(endpoints *v1.Endpoints) (result *v1.Endpoints, err error) { +func (c *endpoints) Update(ctx context.Context, endpoints *v1.Endpoints, opts metav1.UpdateOptions) (result *v1.Endpoints, err error) { result = &v1.Endpoints{} err = c.client.Put(). Namespace(c.ns). Resource("endpoints"). Name(endpoints.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(endpoints). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the endpoints and deletes it. Returns an error if one occurs. -func (c *endpoints) Delete(name string, options *metav1.DeleteOptions) error { +func (c *endpoints) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("endpoints"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *endpoints) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *endpoints) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("endpoints"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched endpoints. -func (c *endpoints) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) { +func (c *endpoints) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Endpoints, err error) { result = &v1.Endpoints{} err = c.client.Patch(pt). Namespace(c.ns). Resource("endpoints"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go index 55cfa0901..9b669920f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type EventsGetter interface { // EventInterface has methods to work with Event resources. type EventInterface interface { - Create(*v1.Event) (*v1.Event, error) - Update(*v1.Event) (*v1.Event, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Event, error) - List(opts metav1.ListOptions) (*v1.EventList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) + Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (*v1.Event, error) + Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (*v1.Event, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Event, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.EventList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) EventExpansion } @@ -63,20 +64,20 @@ func newEvents(c *CoreV1Client, namespace string) *events { } // Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(name string, options metav1.GetOptions) (result *v1.Event, err error) { +func (c *events) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Event, err error) { result = &v1.Event{} err = c.client.Get(). Namespace(c.ns). Resource("events"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(opts metav1.ListOptions) (result *v1.EventList, err error) { +func (c *events) List(ctx context.Context, opts metav1.ListOptions) (result *v1.EventList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *events) List(opts metav1.ListOptions) (result *v1.EventList, err error) Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested events. -func (c *events) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *events) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *events) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(event *v1.Event) (result *v1.Event, err error) { +func (c *events) Create(ctx context.Context, event *v1.Event, opts metav1.CreateOptions) (result *v1.Event, err error) { result = &v1.Event{} err = c.client.Post(). Namespace(c.ns). Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). Body(event). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(event *v1.Event) (result *v1.Event, err error) { +func (c *events) Update(ctx context.Context, event *v1.Event, opts metav1.UpdateOptions) (result *v1.Event, err error) { result = &v1.Event{} err = c.client.Put(). Namespace(c.ns). Resource("events"). Name(event.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(event). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(name string, options *metav1.DeleteOptions) error { +func (c *events) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("events"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *events) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("events"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched event. -func (c *events) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) { +func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Event, err error) { result = &v1.Event{} err = c.client.Patch(pt). Namespace(c.ns). Resource("events"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go index 5a82afa42..211cf0603 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go @@ -17,9 +17,10 @@ limitations under the License. package v1 import ( + "context" "fmt" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" @@ -54,7 +55,7 @@ func (e *events) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). - Do(). + Do(context.TODO()). Into(result) return result, err } @@ -71,7 +72,7 @@ func (e *events) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { Resource("events"). Name(event.Name). Body(event). - Do(). + Do(context.TODO()). Into(result) return result, err } @@ -91,7 +92,7 @@ func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) Resource("events"). Name(incompleteEvent.Name). Body(data). - Do(). + Do(context.TODO()). Into(result) return result, err } @@ -118,7 +119,7 @@ func (e *events) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.Ev refUID = &stringRefUID } fieldSelector := e.GetFieldSelector(&ref.Name, &ref.Namespace, refKind, refUID) - return e.List(metav1.ListOptions{FieldSelector: fieldSelector.String()}) + return e.List(context.TODO(), metav1.ListOptions{FieldSelector: fieldSelector.String()}) } // Returns the appropriate field selector based on the API version being used to communicate with the server. diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go index 6e8591b12..2cb81aa40 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/generated_expansion.go @@ -37,3 +37,5 @@ type ReplicationControllerExpansion interface{} type ResourceQuotaExpansion interface{} type SecretExpansion interface{} + +type ServiceAccountExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index 2eeae11a8..7031cd77e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type LimitRangesGetter interface { // LimitRangeInterface has methods to work with LimitRange resources. type LimitRangeInterface interface { - Create(*v1.LimitRange) (*v1.LimitRange, error) - Update(*v1.LimitRange) (*v1.LimitRange, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.LimitRange, error) - List(opts metav1.ListOptions) (*v1.LimitRangeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) + Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (*v1.LimitRange, error) + Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (*v1.LimitRange, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.LimitRange, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.LimitRangeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) LimitRangeExpansion } @@ -63,20 +64,20 @@ func newLimitRanges(c *CoreV1Client, namespace string) *limitRanges { } // Get takes name of the limitRange, and returns the corresponding limitRange object, and an error if there is any. -func (c *limitRanges) Get(name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { +func (c *limitRanges) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.LimitRange, err error) { result = &v1.LimitRange{} err = c.client.Get(). Namespace(c.ns). Resource("limitranges"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. -func (c *limitRanges) List(opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { +func (c *limitRanges) List(ctx context.Context, opts metav1.ListOptions) (result *v1.LimitRangeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *limitRanges) List(opts metav1.ListOptions) (result *v1.LimitRangeList, Resource("limitranges"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested limitRanges. -func (c *limitRanges) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *limitRanges) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *limitRanges) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("limitranges"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a limitRange and creates it. Returns the server's representation of the limitRange, and an error, if there is any. -func (c *limitRanges) Create(limitRange *v1.LimitRange) (result *v1.LimitRange, err error) { +func (c *limitRanges) Create(ctx context.Context, limitRange *v1.LimitRange, opts metav1.CreateOptions) (result *v1.LimitRange, err error) { result = &v1.LimitRange{} err = c.client.Post(). Namespace(c.ns). Resource("limitranges"). + VersionedParams(&opts, scheme.ParameterCodec). Body(limitRange). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a limitRange and updates it. Returns the server's representation of the limitRange, and an error, if there is any. -func (c *limitRanges) Update(limitRange *v1.LimitRange) (result *v1.LimitRange, err error) { +func (c *limitRanges) Update(ctx context.Context, limitRange *v1.LimitRange, opts metav1.UpdateOptions) (result *v1.LimitRange, err error) { result = &v1.LimitRange{} err = c.client.Put(). Namespace(c.ns). Resource("limitranges"). Name(limitRange.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(limitRange). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the limitRange and deletes it. Returns an error if one occurs. -func (c *limitRanges) Delete(name string, options *metav1.DeleteOptions) error { +func (c *limitRanges) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("limitranges"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *limitRanges) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *limitRanges) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("limitranges"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched limitRange. -func (c *limitRanges) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) { +func (c *limitRanges) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.LimitRange, err error) { result = &v1.LimitRange{} err = c.client.Patch(pt). Namespace(c.ns). Resource("limitranges"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index 8a81fe850..55b03d65b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type NamespacesGetter interface { // NamespaceInterface has methods to work with Namespace resources. type NamespaceInterface interface { - Create(*v1.Namespace) (*v1.Namespace, error) - Update(*v1.Namespace) (*v1.Namespace, error) - UpdateStatus(*v1.Namespace) (*v1.Namespace, error) - Delete(name string, options *metav1.DeleteOptions) error - Get(name string, options metav1.GetOptions) (*v1.Namespace, error) - List(opts metav1.ListOptions) (*v1.NamespaceList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) + Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (*v1.Namespace, error) + Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) + UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Namespace, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NamespaceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) NamespaceExpansion } @@ -61,19 +62,19 @@ func newNamespaces(c *CoreV1Client) *namespaces { } // Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any. -func (c *namespaces) Get(name string, options metav1.GetOptions) (result *v1.Namespace, err error) { +func (c *namespaces) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.client.Get(). Resource("namespaces"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Namespaces that match those selectors. -func (c *namespaces) List(opts metav1.ListOptions) (result *v1.NamespaceList, err error) { +func (c *namespaces) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NamespaceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *namespaces) List(opts metav1.ListOptions) (result *v1.NamespaceList, er Resource("namespaces"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested namespaces. -func (c *namespaces) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *namespaces) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *namespaces) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("namespaces"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *namespaces) Create(namespace *v1.Namespace) (result *v1.Namespace, err error) { +func (c *namespaces) Create(ctx context.Context, namespace *v1.Namespace, opts metav1.CreateOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.client.Post(). Resource("namespaces"). + VersionedParams(&opts, scheme.ParameterCodec). Body(namespace). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any. -func (c *namespaces) Update(namespace *v1.Namespace) (result *v1.Namespace, err error) { +func (c *namespaces) Update(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.client.Put(). Resource("namespaces"). Name(namespace.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(namespace). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *namespaces) UpdateStatus(namespace *v1.Namespace) (result *v1.Namespace, err error) { +func (c *namespaces) UpdateStatus(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.client.Put(). Resource("namespaces"). Name(namespace.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(namespace). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the namespace and deletes it. Returns an error if one occurs. -func (c *namespaces) Delete(name string, options *metav1.DeleteOptions) error { +func (c *namespaces) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("namespaces"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched namespace. -func (c *namespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) { +func (c *namespaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.client.Patch(pt). Resource("namespaces"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go index 17effe29c..be1116db1 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/namespace_expansion.go @@ -16,16 +16,22 @@ limitations under the License. package v1 -import "k8s.io/api/core/v1" +import ( + "context" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" +) // The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface. type NamespaceExpansion interface { - Finalize(item *v1.Namespace) (*v1.Namespace, error) + Finalize(ctx context.Context, item *v1.Namespace, opts metav1.UpdateOptions) (*v1.Namespace, error) } // Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs. -func (c *namespaces) Finalize(namespace *v1.Namespace) (result *v1.Namespace, err error) { +func (c *namespaces) Finalize(ctx context.Context, namespace *v1.Namespace, opts metav1.UpdateOptions) (result *v1.Namespace, err error) { result = &v1.Namespace{} - err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do().Into(result) + err = c.client.Put().Resource("namespaces").Name(namespace.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("finalize").Body(namespace).Do(ctx).Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go index d19fab895..6176808f4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,15 +38,15 @@ type NodesGetter interface { // NodeInterface has methods to work with Node resources. type NodeInterface interface { - Create(*v1.Node) (*v1.Node, error) - Update(*v1.Node) (*v1.Node, error) - UpdateStatus(*v1.Node) (*v1.Node, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Node, error) - List(opts metav1.ListOptions) (*v1.NodeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) + Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (*v1.Node, error) + Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) + UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (*v1.Node, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Node, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NodeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) NodeExpansion } @@ -62,19 +63,19 @@ func newNodes(c *CoreV1Client) *nodes { } // Get takes name of the node, and returns the corresponding node object, and an error if there is any. -func (c *nodes) Get(name string, options metav1.GetOptions) (result *v1.Node, err error) { +func (c *nodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Node, err error) { result = &v1.Node{} err = c.client.Get(). Resource("nodes"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Nodes that match those selectors. -func (c *nodes) List(opts metav1.ListOptions) (result *v1.NodeList, err error) { +func (c *nodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NodeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *nodes) List(opts metav1.ListOptions) (result *v1.NodeList, err error) { Resource("nodes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested nodes. -func (c *nodes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *nodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *nodes) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("nodes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. -func (c *nodes) Create(node *v1.Node) (result *v1.Node, err error) { +func (c *nodes) Create(ctx context.Context, node *v1.Node, opts metav1.CreateOptions) (result *v1.Node, err error) { result = &v1.Node{} err = c.client.Post(). Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). Body(node). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. -func (c *nodes) Update(node *v1.Node) (result *v1.Node, err error) { +func (c *nodes) Update(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { result = &v1.Node{} err = c.client.Put(). Resource("nodes"). Name(node.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(node). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *nodes) UpdateStatus(node *v1.Node) (result *v1.Node, err error) { +func (c *nodes) UpdateStatus(ctx context.Context, node *v1.Node, opts metav1.UpdateOptions) (result *v1.Node, err error) { result = &v1.Node{} err = c.client.Put(). Resource("nodes"). Name(node.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(node). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the node and deletes it. Returns an error if one occurs. -func (c *nodes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *nodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("nodes"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *nodes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *nodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("nodes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched node. -func (c *nodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) { +func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Node, err error) { result = &v1.Node{} err = c.client.Patch(pt). Resource("nodes"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go index 5db29c3f7..bdf7bfed8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go @@ -17,7 +17,9 @@ limitations under the License. package v1 import ( - "k8s.io/api/core/v1" + "context" + + v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" ) @@ -25,19 +27,19 @@ import ( type NodeExpansion interface { // PatchStatus modifies the status of an existing node. It returns the copy // of the node that the server returns, or an error. - PatchStatus(nodeName string, data []byte) (*v1.Node, error) + PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) } // PatchStatus modifies the status of an existing node. It returns the copy of // the node that the server returns, or an error. -func (c *nodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) { +func (c *nodes) PatchStatus(ctx context.Context, nodeName string, data []byte) (*v1.Node, error) { result := &v1.Node{} err := c.client.Patch(types.StrategicMergePatchType). Resource("nodes"). Name(nodeName). SubResource("status"). Body(data). - Do(). + Do(ctx). Into(result) return result, err } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index 74514825e..1eb9db635 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,15 +38,15 @@ type PersistentVolumesGetter interface { // PersistentVolumeInterface has methods to work with PersistentVolume resources. type PersistentVolumeInterface interface { - Create(*v1.PersistentVolume) (*v1.PersistentVolume, error) - Update(*v1.PersistentVolume) (*v1.PersistentVolume, error) - UpdateStatus(*v1.PersistentVolume) (*v1.PersistentVolume, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PersistentVolume, error) - List(opts metav1.ListOptions) (*v1.PersistentVolumeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) + Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (*v1.PersistentVolume, error) + Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) + UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (*v1.PersistentVolume, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolume, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) PersistentVolumeExpansion } @@ -62,19 +63,19 @@ func newPersistentVolumes(c *CoreV1Client) *persistentVolumes { } // Get takes name of the persistentVolume, and returns the corresponding persistentVolume object, and an error if there is any. -func (c *persistentVolumes) Get(name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { +func (c *persistentVolumes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolume, err error) { result = &v1.PersistentVolume{} err = c.client.Get(). Resource("persistentvolumes"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. -func (c *persistentVolumes) List(opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { +func (c *persistentVolumes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *persistentVolumes) List(opts metav1.ListOptions) (result *v1.Persistent Resource("persistentvolumes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested persistentVolumes. -func (c *persistentVolumes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *persistentVolumes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *persistentVolumes) Watch(opts metav1.ListOptions) (watch.Interface, err Resource("persistentvolumes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a persistentVolume and creates it. Returns the server's representation of the persistentVolume, and an error, if there is any. -func (c *persistentVolumes) Create(persistentVolume *v1.PersistentVolume) (result *v1.PersistentVolume, err error) { +func (c *persistentVolumes) Create(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.CreateOptions) (result *v1.PersistentVolume, err error) { result = &v1.PersistentVolume{} err = c.client.Post(). Resource("persistentvolumes"). + VersionedParams(&opts, scheme.ParameterCodec). Body(persistentVolume). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a persistentVolume and updates it. Returns the server's representation of the persistentVolume, and an error, if there is any. -func (c *persistentVolumes) Update(persistentVolume *v1.PersistentVolume) (result *v1.PersistentVolume, err error) { +func (c *persistentVolumes) Update(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { result = &v1.PersistentVolume{} err = c.client.Put(). Resource("persistentvolumes"). Name(persistentVolume.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(persistentVolume). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *persistentVolumes) UpdateStatus(persistentVolume *v1.PersistentVolume) (result *v1.PersistentVolume, err error) { +func (c *persistentVolumes) UpdateStatus(ctx context.Context, persistentVolume *v1.PersistentVolume, opts metav1.UpdateOptions) (result *v1.PersistentVolume, err error) { result = &v1.PersistentVolume{} err = c.client.Put(). Resource("persistentvolumes"). Name(persistentVolume.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(persistentVolume). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the persistentVolume and deletes it. Returns an error if one occurs. -func (c *persistentVolumes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *persistentVolumes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("persistentvolumes"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *persistentVolumes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *persistentVolumes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("persistentvolumes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched persistentVolume. -func (c *persistentVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) { +func (c *persistentVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolume, err error) { result = &v1.PersistentVolume{} err = c.client.Patch(pt). Resource("persistentvolumes"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index 410ab37dc..f4e205f4e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,15 +38,15 @@ type PersistentVolumeClaimsGetter interface { // PersistentVolumeClaimInterface has methods to work with PersistentVolumeClaim resources. type PersistentVolumeClaimInterface interface { - Create(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) - Update(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) - UpdateStatus(*v1.PersistentVolumeClaim) (*v1.PersistentVolumeClaim, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PersistentVolumeClaim, error) - List(opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) + Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (*v1.PersistentVolumeClaim, error) + Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) + UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*v1.PersistentVolumeClaim, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PersistentVolumeClaim, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PersistentVolumeClaimList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) PersistentVolumeClaimExpansion } @@ -64,20 +65,20 @@ func newPersistentVolumeClaims(c *CoreV1Client, namespace string) *persistentVol } // Get takes name of the persistentVolumeClaim, and returns the corresponding persistentVolumeClaim object, and an error if there is any. -func (c *persistentVolumeClaims) Get(name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { +func (c *persistentVolumeClaims) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PersistentVolumeClaim, err error) { result = &v1.PersistentVolumeClaim{} err = c.client.Get(). Namespace(c.ns). Resource("persistentvolumeclaims"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. -func (c *persistentVolumeClaims) List(opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { +func (c *persistentVolumeClaims) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PersistentVolumeClaimList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *persistentVolumeClaims) List(opts metav1.ListOptions) (result *v1.Persi Resource("persistentvolumeclaims"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested persistentVolumeClaims. -func (c *persistentVolumeClaims) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *persistentVolumeClaims) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *persistentVolumeClaims) Watch(opts metav1.ListOptions) (watch.Interface Resource("persistentvolumeclaims"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a persistentVolumeClaim and creates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. -func (c *persistentVolumeClaims) Create(persistentVolumeClaim *v1.PersistentVolumeClaim) (result *v1.PersistentVolumeClaim, err error) { +func (c *persistentVolumeClaims) Create(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.CreateOptions) (result *v1.PersistentVolumeClaim, err error) { result = &v1.PersistentVolumeClaim{} err = c.client.Post(). Namespace(c.ns). Resource("persistentvolumeclaims"). + VersionedParams(&opts, scheme.ParameterCodec). Body(persistentVolumeClaim). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a persistentVolumeClaim and updates it. Returns the server's representation of the persistentVolumeClaim, and an error, if there is any. -func (c *persistentVolumeClaims) Update(persistentVolumeClaim *v1.PersistentVolumeClaim) (result *v1.PersistentVolumeClaim, err error) { +func (c *persistentVolumeClaims) Update(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { result = &v1.PersistentVolumeClaim{} err = c.client.Put(). Namespace(c.ns). Resource("persistentvolumeclaims"). Name(persistentVolumeClaim.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(persistentVolumeClaim). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *persistentVolumeClaims) UpdateStatus(persistentVolumeClaim *v1.PersistentVolumeClaim) (result *v1.PersistentVolumeClaim, err error) { +func (c *persistentVolumeClaims) UpdateStatus(ctx context.Context, persistentVolumeClaim *v1.PersistentVolumeClaim, opts metav1.UpdateOptions) (result *v1.PersistentVolumeClaim, err error) { result = &v1.PersistentVolumeClaim{} err = c.client.Put(). Namespace(c.ns). Resource("persistentvolumeclaims"). Name(persistentVolumeClaim.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(persistentVolumeClaim). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the persistentVolumeClaim and deletes it. Returns an error if one occurs. -func (c *persistentVolumeClaims) Delete(name string, options *metav1.DeleteOptions) error { +func (c *persistentVolumeClaims) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("persistentvolumeclaims"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *persistentVolumeClaims) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *persistentVolumeClaims) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("persistentvolumeclaims"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched persistentVolumeClaim. -func (c *persistentVolumeClaims) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { +func (c *persistentVolumeClaims) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { result = &v1.PersistentVolumeClaim{} err = c.client.Patch(pt). Namespace(c.ns). Resource("persistentvolumeclaims"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index feacd307f..36092ab64 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,17 +38,17 @@ type PodsGetter interface { // PodInterface has methods to work with Pod resources. type PodInterface interface { - Create(*v1.Pod) (*v1.Pod, error) - Update(*v1.Pod) (*v1.Pod, error) - UpdateStatus(*v1.Pod) (*v1.Pod, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Pod, error) - List(opts metav1.ListOptions) (*v1.PodList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) - GetEphemeralContainers(podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error) - UpdateEphemeralContainers(podName string, ephemeralContainers *v1.EphemeralContainers) (*v1.EphemeralContainers, error) + Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (*v1.Pod, error) + Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) + UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (*v1.Pod, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Pod, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PodList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) + GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (*v1.EphemeralContainers, error) + UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (*v1.EphemeralContainers, error) PodExpansion } @@ -67,20 +68,20 @@ func newPods(c *CoreV1Client, namespace string) *pods { } // Get takes name of the pod, and returns the corresponding pod object, and an error if there is any. -func (c *pods) Get(name string, options metav1.GetOptions) (result *v1.Pod, err error) { +func (c *pods) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.client.Get(). Namespace(c.ns). Resource("pods"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Pods that match those selectors. -func (c *pods) List(opts metav1.ListOptions) (result *v1.PodList, err error) { +func (c *pods) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -91,13 +92,13 @@ func (c *pods) List(opts metav1.ListOptions) (result *v1.PodList, err error) { Resource("pods"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested pods. -func (c *pods) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *pods) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -108,93 +109,96 @@ func (c *pods) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("pods"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a pod and creates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *pods) Create(pod *v1.Pod) (result *v1.Pod, err error) { +func (c *pods) Create(ctx context.Context, pod *v1.Pod, opts metav1.CreateOptions) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.client.Post(). Namespace(c.ns). Resource("pods"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pod). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a pod and updates it. Returns the server's representation of the pod, and an error, if there is any. -func (c *pods) Update(pod *v1.Pod) (result *v1.Pod, err error) { +func (c *pods) Update(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.client.Put(). Namespace(c.ns). Resource("pods"). Name(pod.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(pod). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *pods) UpdateStatus(pod *v1.Pod) (result *v1.Pod, err error) { +func (c *pods) UpdateStatus(ctx context.Context, pod *v1.Pod, opts metav1.UpdateOptions) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.client.Put(). Namespace(c.ns). Resource("pods"). Name(pod.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(pod). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the pod and deletes it. Returns an error if one occurs. -func (c *pods) Delete(name string, options *metav1.DeleteOptions) error { +func (c *pods) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("pods"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *pods) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *pods) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("pods"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched pod. -func (c *pods) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) { +func (c *pods) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.client.Patch(pt). Namespace(c.ns). Resource("pods"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetEphemeralContainers takes name of the pod, and returns the corresponding v1.EphemeralContainers object, and an error if there is any. -func (c *pods) GetEphemeralContainers(podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) { +func (c *pods) GetEphemeralContainers(ctx context.Context, podName string, options metav1.GetOptions) (result *v1.EphemeralContainers, err error) { result = &v1.EphemeralContainers{} err = c.client.Get(). Namespace(c.ns). @@ -202,21 +206,22 @@ func (c *pods) GetEphemeralContainers(podName string, options metav1.GetOptions) Name(podName). SubResource("ephemeralcontainers"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateEphemeralContainers takes the top resource name and the representation of a ephemeralContainers and updates it. Returns the server's representation of the ephemeralContainers, and an error, if there is any. -func (c *pods) UpdateEphemeralContainers(podName string, ephemeralContainers *v1.EphemeralContainers) (result *v1.EphemeralContainers, err error) { +func (c *pods) UpdateEphemeralContainers(ctx context.Context, podName string, ephemeralContainers *v1.EphemeralContainers, opts metav1.UpdateOptions) (result *v1.EphemeralContainers, err error) { result = &v1.EphemeralContainers{} err = c.client.Put(). Namespace(c.ns). Resource("pods"). Name(podName). SubResource("ephemeralcontainers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(ephemeralContainers). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go index ed876be8b..8710a2c05 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/pod_expansion.go @@ -17,26 +17,29 @@ limitations under the License. package v1 import ( - "k8s.io/api/core/v1" + "context" + + v1 "k8s.io/api/core/v1" policy "k8s.io/api/policy/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" restclient "k8s.io/client-go/rest" ) // The PodExpansion interface allows manually adding extra methods to the PodInterface. type PodExpansion interface { - Bind(binding *v1.Binding) error - Evict(eviction *policy.Eviction) error + Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error + Evict(ctx context.Context, eviction *policy.Eviction) error GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request } // Bind applies the provided binding to the named pod in the current namespace (binding.Namespace is ignored). -func (c *pods) Bind(binding *v1.Binding) error { - return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).SubResource("binding").Body(binding).Do().Error() +func (c *pods) Bind(ctx context.Context, binding *v1.Binding, opts metav1.CreateOptions) error { + return c.client.Post().Namespace(c.ns).Resource("pods").Name(binding.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("binding").Body(binding).Do(ctx).Error() } -func (c *pods) Evict(eviction *policy.Eviction) error { - return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do().Error() +func (c *pods) Evict(ctx context.Context, eviction *policy.Eviction) error { + return c.client.Post().Namespace(c.ns).Resource("pods").Name(eviction.Name).SubResource("eviction").Body(eviction).Do(ctx).Error() } // Get constructs a request for getting the logs for a pod diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index 84d7c9805..012d3b52c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type PodTemplatesGetter interface { // PodTemplateInterface has methods to work with PodTemplate resources. type PodTemplateInterface interface { - Create(*v1.PodTemplate) (*v1.PodTemplate, error) - Update(*v1.PodTemplate) (*v1.PodTemplate, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PodTemplate, error) - List(opts metav1.ListOptions) (*v1.PodTemplateList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) + Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (*v1.PodTemplate, error) + Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (*v1.PodTemplate, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodTemplate, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PodTemplateList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) PodTemplateExpansion } @@ -63,20 +64,20 @@ func newPodTemplates(c *CoreV1Client, namespace string) *podTemplates { } // Get takes name of the podTemplate, and returns the corresponding podTemplate object, and an error if there is any. -func (c *podTemplates) Get(name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { +func (c *podTemplates) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodTemplate, err error) { result = &v1.PodTemplate{} err = c.client.Get(). Namespace(c.ns). Resource("podtemplates"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. -func (c *podTemplates) List(opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { +func (c *podTemplates) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodTemplateList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *podTemplates) List(opts metav1.ListOptions) (result *v1.PodTemplateList Resource("podtemplates"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested podTemplates. -func (c *podTemplates) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *podTemplates) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *podTemplates) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("podtemplates"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a podTemplate and creates it. Returns the server's representation of the podTemplate, and an error, if there is any. -func (c *podTemplates) Create(podTemplate *v1.PodTemplate) (result *v1.PodTemplate, err error) { +func (c *podTemplates) Create(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.CreateOptions) (result *v1.PodTemplate, err error) { result = &v1.PodTemplate{} err = c.client.Post(). Namespace(c.ns). Resource("podtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podTemplate). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a podTemplate and updates it. Returns the server's representation of the podTemplate, and an error, if there is any. -func (c *podTemplates) Update(podTemplate *v1.PodTemplate) (result *v1.PodTemplate, err error) { +func (c *podTemplates) Update(ctx context.Context, podTemplate *v1.PodTemplate, opts metav1.UpdateOptions) (result *v1.PodTemplate, err error) { result = &v1.PodTemplate{} err = c.client.Put(). Namespace(c.ns). Resource("podtemplates"). Name(podTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(podTemplate). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the podTemplate and deletes it. Returns an error if one occurs. -func (c *podTemplates) Delete(name string, options *metav1.DeleteOptions) error { +func (c *podTemplates) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("podtemplates"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podTemplates) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *podTemplates) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("podtemplates"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched podTemplate. -func (c *podTemplates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) { +func (c *podTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodTemplate, err error) { result = &v1.PodTemplate{} err = c.client.Patch(pt). Namespace(c.ns). Resource("podtemplates"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index dd3182db6..8e9ccd59d 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -38,17 +39,17 @@ type ReplicationControllersGetter interface { // ReplicationControllerInterface has methods to work with ReplicationController resources. type ReplicationControllerInterface interface { - Create(*v1.ReplicationController) (*v1.ReplicationController, error) - Update(*v1.ReplicationController) (*v1.ReplicationController, error) - UpdateStatus(*v1.ReplicationController) (*v1.ReplicationController, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ReplicationController, error) - List(opts metav1.ListOptions) (*v1.ReplicationControllerList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) - GetScale(replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) - UpdateScale(replicationControllerName string, scale *autoscalingv1.Scale) (*autoscalingv1.Scale, error) + Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (*v1.ReplicationController, error) + Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) + UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (*v1.ReplicationController, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ReplicationController, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ReplicationControllerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) + GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) + UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) ReplicationControllerExpansion } @@ -68,20 +69,20 @@ func newReplicationControllers(c *CoreV1Client, namespace string) *replicationCo } // Get takes name of the replicationController, and returns the corresponding replicationController object, and an error if there is any. -func (c *replicationControllers) Get(name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { +func (c *replicationControllers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ReplicationController, err error) { result = &v1.ReplicationController{} err = c.client.Get(). Namespace(c.ns). Resource("replicationcontrollers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. -func (c *replicationControllers) List(opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { +func (c *replicationControllers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ReplicationControllerList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -92,13 +93,13 @@ func (c *replicationControllers) List(opts metav1.ListOptions) (result *v1.Repli Resource("replicationcontrollers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested replicationControllers. -func (c *replicationControllers) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *replicationControllers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -109,93 +110,96 @@ func (c *replicationControllers) Watch(opts metav1.ListOptions) (watch.Interface Resource("replicationcontrollers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a replicationController and creates it. Returns the server's representation of the replicationController, and an error, if there is any. -func (c *replicationControllers) Create(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) { +func (c *replicationControllers) Create(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.CreateOptions) (result *v1.ReplicationController, err error) { result = &v1.ReplicationController{} err = c.client.Post(). Namespace(c.ns). Resource("replicationcontrollers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicationController). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a replicationController and updates it. Returns the server's representation of the replicationController, and an error, if there is any. -func (c *replicationControllers) Update(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) { +func (c *replicationControllers) Update(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { result = &v1.ReplicationController{} err = c.client.Put(). Namespace(c.ns). Resource("replicationcontrollers"). Name(replicationController.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicationController). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *replicationControllers) UpdateStatus(replicationController *v1.ReplicationController) (result *v1.ReplicationController, err error) { +func (c *replicationControllers) UpdateStatus(ctx context.Context, replicationController *v1.ReplicationController, opts metav1.UpdateOptions) (result *v1.ReplicationController, err error) { result = &v1.ReplicationController{} err = c.client.Put(). Namespace(c.ns). Resource("replicationcontrollers"). Name(replicationController.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicationController). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the replicationController and deletes it. Returns an error if one occurs. -func (c *replicationControllers) Delete(name string, options *metav1.DeleteOptions) error { +func (c *replicationControllers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicationcontrollers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicationControllers) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *replicationControllers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicationcontrollers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched replicationController. -func (c *replicationControllers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) { +func (c *replicationControllers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ReplicationController, err error) { result = &v1.ReplicationController{} err = c.client.Patch(pt). Namespace(c.ns). Resource("replicationcontrollers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the replicationController, and returns the corresponding autoscalingv1.Scale object, and an error if there is any. -func (c *replicationControllers) GetScale(replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { +func (c *replicationControllers) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -203,21 +207,22 @@ func (c *replicationControllers) GetScale(replicationControllerName string, opti Name(replicationControllerName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *replicationControllers) UpdateScale(replicationControllerName string, scale *autoscalingv1.Scale) (result *autoscalingv1.Scale, err error) { +func (c *replicationControllers) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (result *autoscalingv1.Scale, err error) { result = &autoscalingv1.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("replicationcontrollers"). Name(replicationControllerName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 5a178990e..6a41e35fd 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,15 +38,15 @@ type ResourceQuotasGetter interface { // ResourceQuotaInterface has methods to work with ResourceQuota resources. type ResourceQuotaInterface interface { - Create(*v1.ResourceQuota) (*v1.ResourceQuota, error) - Update(*v1.ResourceQuota) (*v1.ResourceQuota, error) - UpdateStatus(*v1.ResourceQuota) (*v1.ResourceQuota, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ResourceQuota, error) - List(opts metav1.ListOptions) (*v1.ResourceQuotaList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) + Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (*v1.ResourceQuota, error) + Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) + UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (*v1.ResourceQuota, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ResourceQuota, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ResourceQuotaList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) ResourceQuotaExpansion } @@ -64,20 +65,20 @@ func newResourceQuotas(c *CoreV1Client, namespace string) *resourceQuotas { } // Get takes name of the resourceQuota, and returns the corresponding resourceQuota object, and an error if there is any. -func (c *resourceQuotas) Get(name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { +func (c *resourceQuotas) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Get(). Namespace(c.ns). Resource("resourcequotas"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. -func (c *resourceQuotas) List(opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { +func (c *resourceQuotas) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ResourceQuotaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *resourceQuotas) List(opts metav1.ListOptions) (result *v1.ResourceQuota Resource("resourcequotas"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested resourceQuotas. -func (c *resourceQuotas) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *resourceQuotas) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *resourceQuotas) Watch(opts metav1.ListOptions) (watch.Interface, error) Resource("resourcequotas"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a resourceQuota and creates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *resourceQuotas) Create(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) { +func (c *resourceQuotas) Create(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.CreateOptions) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Post(). Namespace(c.ns). Resource("resourcequotas"). + VersionedParams(&opts, scheme.ParameterCodec). Body(resourceQuota). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a resourceQuota and updates it. Returns the server's representation of the resourceQuota, and an error, if there is any. -func (c *resourceQuotas) Update(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) { +func (c *resourceQuotas) Update(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Put(). Namespace(c.ns). Resource("resourcequotas"). Name(resourceQuota.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(resourceQuota). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *resourceQuotas) UpdateStatus(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) { +func (c *resourceQuotas) UpdateStatus(ctx context.Context, resourceQuota *v1.ResourceQuota, opts metav1.UpdateOptions) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Put(). Namespace(c.ns). Resource("resourcequotas"). Name(resourceQuota.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(resourceQuota). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the resourceQuota and deletes it. Returns an error if one occurs. -func (c *resourceQuotas) Delete(name string, options *metav1.DeleteOptions) error { +func (c *resourceQuotas) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *resourceQuotas) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *resourceQuotas) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("resourcequotas"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched resourceQuota. -func (c *resourceQuotas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) { +func (c *resourceQuotas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Patch(pt). Namespace(c.ns). Resource("resourcequotas"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index 85c143b17..b2bd80baa 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type SecretsGetter interface { // SecretInterface has methods to work with Secret resources. type SecretInterface interface { - Create(*v1.Secret) (*v1.Secret, error) - Update(*v1.Secret) (*v1.Secret, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Secret, error) - List(opts metav1.ListOptions) (*v1.SecretList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) + Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (*v1.Secret, error) + Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (*v1.Secret, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Secret, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.SecretList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) SecretExpansion } @@ -63,20 +64,20 @@ func newSecrets(c *CoreV1Client, namespace string) *secrets { } // Get takes name of the secret, and returns the corresponding secret object, and an error if there is any. -func (c *secrets) Get(name string, options metav1.GetOptions) (result *v1.Secret, err error) { +func (c *secrets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Secret, err error) { result = &v1.Secret{} err = c.client.Get(). Namespace(c.ns). Resource("secrets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Secrets that match those selectors. -func (c *secrets) List(opts metav1.ListOptions) (result *v1.SecretList, err error) { +func (c *secrets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.SecretList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *secrets) List(opts metav1.ListOptions) (result *v1.SecretList, err erro Resource("secrets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested secrets. -func (c *secrets) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *secrets) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *secrets) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("secrets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *secrets) Create(secret *v1.Secret) (result *v1.Secret, err error) { +func (c *secrets) Create(ctx context.Context, secret *v1.Secret, opts metav1.CreateOptions) (result *v1.Secret, err error) { result = &v1.Secret{} err = c.client.Post(). Namespace(c.ns). Resource("secrets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(secret). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any. -func (c *secrets) Update(secret *v1.Secret) (result *v1.Secret, err error) { +func (c *secrets) Update(ctx context.Context, secret *v1.Secret, opts metav1.UpdateOptions) (result *v1.Secret, err error) { result = &v1.Secret{} err = c.client.Put(). Namespace(c.ns). Resource("secrets"). Name(secret.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(secret). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the secret and deletes it. Returns an error if one occurs. -func (c *secrets) Delete(name string, options *metav1.DeleteOptions) error { +func (c *secrets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("secrets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *secrets) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *secrets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("secrets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched secret. -func (c *secrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) { +func (c *secrets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Secret, err error) { result = &v1.Secret{} err = c.client.Patch(pt). Namespace(c.ns). Resource("secrets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go index b0e09413e..ddde2ec6c 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/core/v1" @@ -37,14 +38,14 @@ type ServicesGetter interface { // ServiceInterface has methods to work with Service resources. type ServiceInterface interface { - Create(*v1.Service) (*v1.Service, error) - Update(*v1.Service) (*v1.Service, error) - UpdateStatus(*v1.Service) (*v1.Service, error) - Delete(name string, options *metav1.DeleteOptions) error - Get(name string, options metav1.GetOptions) (*v1.Service, error) - List(opts metav1.ListOptions) (*v1.ServiceList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) + Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (*v1.Service, error) + Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) + UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (*v1.Service, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Service, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) ServiceExpansion } @@ -63,20 +64,20 @@ func newServices(c *CoreV1Client, namespace string) *services { } // Get takes name of the service, and returns the corresponding service object, and an error if there is any. -func (c *services) Get(name string, options metav1.GetOptions) (result *v1.Service, err error) { +func (c *services) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Service, err error) { result = &v1.Service{} err = c.client.Get(). Namespace(c.ns). Resource("services"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Services that match those selectors. -func (c *services) List(opts metav1.ListOptions) (result *v1.ServiceList, err error) { +func (c *services) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *services) List(opts metav1.ListOptions) (result *v1.ServiceList, err er Resource("services"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested services. -func (c *services) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *services) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *services) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("services"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any. -func (c *services) Create(service *v1.Service) (result *v1.Service, err error) { +func (c *services) Create(ctx context.Context, service *v1.Service, opts metav1.CreateOptions) (result *v1.Service, err error) { result = &v1.Service{} err = c.client.Post(). Namespace(c.ns). Resource("services"). + VersionedParams(&opts, scheme.ParameterCodec). Body(service). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any. -func (c *services) Update(service *v1.Service) (result *v1.Service, err error) { +func (c *services) Update(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { result = &v1.Service{} err = c.client.Put(). Namespace(c.ns). Resource("services"). Name(service.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(service). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *services) UpdateStatus(service *v1.Service) (result *v1.Service, err error) { +func (c *services) UpdateStatus(ctx context.Context, service *v1.Service, opts metav1.UpdateOptions) (result *v1.Service, err error) { result = &v1.Service{} err = c.client.Put(). Namespace(c.ns). Resource("services"). Name(service.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(service). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the service and deletes it. Returns an error if one occurs. -func (c *services) Delete(name string, options *metav1.DeleteOptions) error { +func (c *services) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("services"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched service. -func (c *services) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) { +func (c *services) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Service, err error) { result = &v1.Service{} err = c.client.Patch(pt). Namespace(c.ns). Resource("services"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index 50af6a21c..c2ddfbfdb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -19,8 +19,10 @@ limitations under the License. package v1 import ( + "context" "time" + authenticationv1 "k8s.io/api/authentication/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" @@ -37,14 +39,16 @@ type ServiceAccountsGetter interface { // ServiceAccountInterface has methods to work with ServiceAccount resources. type ServiceAccountInterface interface { - Create(*v1.ServiceAccount) (*v1.ServiceAccount, error) - Update(*v1.ServiceAccount) (*v1.ServiceAccount, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ServiceAccount, error) - List(opts metav1.ListOptions) (*v1.ServiceAccountList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) + Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (*v1.ServiceAccount, error) + Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (*v1.ServiceAccount, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceAccount, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceAccountList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) + CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (*authenticationv1.TokenRequest, error) + ServiceAccountExpansion } @@ -63,20 +67,20 @@ func newServiceAccounts(c *CoreV1Client, namespace string) *serviceAccounts { } // Get takes name of the serviceAccount, and returns the corresponding serviceAccount object, and an error if there is any. -func (c *serviceAccounts) Get(name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { +func (c *serviceAccounts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceAccount, err error) { result = &v1.ServiceAccount{} err = c.client.Get(). Namespace(c.ns). Resource("serviceaccounts"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. -func (c *serviceAccounts) List(opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { +func (c *serviceAccounts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceAccountList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +91,13 @@ func (c *serviceAccounts) List(opts metav1.ListOptions) (result *v1.ServiceAccou Resource("serviceaccounts"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested serviceAccounts. -func (c *serviceAccounts) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *serviceAccounts) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +108,89 @@ func (c *serviceAccounts) Watch(opts metav1.ListOptions) (watch.Interface, error Resource("serviceaccounts"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a serviceAccount and creates it. Returns the server's representation of the serviceAccount, and an error, if there is any. -func (c *serviceAccounts) Create(serviceAccount *v1.ServiceAccount) (result *v1.ServiceAccount, err error) { +func (c *serviceAccounts) Create(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.CreateOptions) (result *v1.ServiceAccount, err error) { result = &v1.ServiceAccount{} err = c.client.Post(). Namespace(c.ns). Resource("serviceaccounts"). + VersionedParams(&opts, scheme.ParameterCodec). Body(serviceAccount). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a serviceAccount and updates it. Returns the server's representation of the serviceAccount, and an error, if there is any. -func (c *serviceAccounts) Update(serviceAccount *v1.ServiceAccount) (result *v1.ServiceAccount, err error) { +func (c *serviceAccounts) Update(ctx context.Context, serviceAccount *v1.ServiceAccount, opts metav1.UpdateOptions) (result *v1.ServiceAccount, err error) { result = &v1.ServiceAccount{} err = c.client.Put(). Namespace(c.ns). Resource("serviceaccounts"). Name(serviceAccount.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(serviceAccount). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the serviceAccount and deletes it. Returns an error if one occurs. -func (c *serviceAccounts) Delete(name string, options *metav1.DeleteOptions) error { +func (c *serviceAccounts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("serviceaccounts"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *serviceAccounts) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *serviceAccounts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("serviceaccounts"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched serviceAccount. -func (c *serviceAccounts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) { +func (c *serviceAccounts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceAccount, err error) { result = &v1.ServiceAccount{} err = c.client.Patch(pt). Namespace(c.ns). Resource("serviceaccounts"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). + Into(result) + return +} + +// CreateToken takes the representation of a tokenRequest and creates it. Returns the server's representation of the tokenRequest, and an error, if there is any. +func (c *serviceAccounts) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (result *authenticationv1.TokenRequest, err error) { + result = &authenticationv1.TokenRequest{} + err = c.client.Post(). + Namespace(c.ns). + Resource("serviceaccounts"). + Name(serviceAccountName). + SubResource("token"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(tokenRequest). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go deleted file mode 100644 index eaf643f15..000000000 --- a/vendor/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount_expansion.go +++ /dev/null @@ -1,41 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - authenticationv1 "k8s.io/api/authentication/v1" -) - -// The ServiceAccountExpansion interface allows manually adding extra methods -// to the ServiceAccountInterface. -type ServiceAccountExpansion interface { - CreateToken(name string, tr *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) -} - -// CreateToken creates a new token for a serviceaccount. -func (c *serviceAccounts) CreateToken(name string, tr *authenticationv1.TokenRequest) (*authenticationv1.TokenRequest, error) { - result := &authenticationv1.TokenRequest{} - err := c.client.Post(). - Namespace(c.ns). - Resource("serviceaccounts"). - SubResource("token"). - Name(name). - Body(tr). - Do(). - Into(result) - return result, err -} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go index 417514761..63b4627d3 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1alpha1/endpointslice.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/discovery/v1alpha1" @@ -37,14 +38,14 @@ type EndpointSlicesGetter interface { // EndpointSliceInterface has methods to work with EndpointSlice resources. type EndpointSliceInterface interface { - Create(*v1alpha1.EndpointSlice) (*v1alpha1.EndpointSlice, error) - Update(*v1alpha1.EndpointSlice) (*v1alpha1.EndpointSlice, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.EndpointSlice, error) - List(opts v1.ListOptions) (*v1alpha1.EndpointSliceList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.EndpointSlice, err error) + Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (*v1alpha1.EndpointSlice, error) + Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (*v1alpha1.EndpointSlice, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.EndpointSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.EndpointSliceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EndpointSlice, err error) EndpointSliceExpansion } @@ -63,20 +64,20 @@ func newEndpointSlices(c *DiscoveryV1alpha1Client, namespace string) *endpointSl } // Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. -func (c *endpointSlices) Get(name string, options v1.GetOptions) (result *v1alpha1.EndpointSlice, err error) { +func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.EndpointSlice, err error) { result = &v1alpha1.EndpointSlice{} err = c.client.Get(). Namespace(c.ns). Resource("endpointslices"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) List(opts v1.ListOptions) (result *v1alpha1.EndpointSliceList, err error) { +func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.EndpointSliceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *endpointSlices) List(opts v1.ListOptions) (result *v1alpha1.EndpointSli Resource("endpointslices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested endpointSlices. -func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("endpointslices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Create(endpointSlice *v1alpha1.EndpointSlice) (result *v1alpha1.EndpointSlice, err error) { +func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.CreateOptions) (result *v1alpha1.EndpointSlice, err error) { result = &v1alpha1.EndpointSlice{} err = c.client.Post(). Namespace(c.ns). Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). Body(endpointSlice). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Update(endpointSlice *v1alpha1.EndpointSlice) (result *v1alpha1.EndpointSlice, err error) { +func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1alpha1.EndpointSlice, opts v1.UpdateOptions) (result *v1alpha1.EndpointSlice, err error) { result = &v1alpha1.EndpointSlice{} err = c.client.Put(). Namespace(c.ns). Resource("endpointslices"). Name(endpointSlice.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(endpointSlice). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *endpointSlices) Delete(name string, options *v1.DeleteOptions) error { +func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *endpointSlices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched endpointSlice. -func (c *endpointSlices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.EndpointSlice, err error) { +func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.EndpointSlice, err error) { result = &v1alpha1.EndpointSlice{} err = c.client.Patch(pt). Namespace(c.ns). Resource("endpointslices"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go index bba656b8f..a016663e7 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/discovery/v1beta1" @@ -37,14 +38,14 @@ type EndpointSlicesGetter interface { // EndpointSliceInterface has methods to work with EndpointSlice resources. type EndpointSliceInterface interface { - Create(*v1beta1.EndpointSlice) (*v1beta1.EndpointSlice, error) - Update(*v1beta1.EndpointSlice) (*v1beta1.EndpointSlice, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.EndpointSlice, error) - List(opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.EndpointSlice, err error) + Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (*v1beta1.EndpointSlice, error) + Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (*v1beta1.EndpointSlice, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.EndpointSlice, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EndpointSliceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) EndpointSliceExpansion } @@ -63,20 +64,20 @@ func newEndpointSlices(c *DiscoveryV1beta1Client, namespace string) *endpointSli } // Get takes name of the endpointSlice, and returns the corresponding endpointSlice object, and an error if there is any. -func (c *endpointSlices) Get(name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { +func (c *endpointSlices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EndpointSlice, err error) { result = &v1beta1.EndpointSlice{} err = c.client.Get(). Namespace(c.ns). Resource("endpointslices"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. -func (c *endpointSlices) List(opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { +func (c *endpointSlices) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EndpointSliceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *endpointSlices) List(opts v1.ListOptions) (result *v1beta1.EndpointSlic Resource("endpointslices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested endpointSlices. -func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *endpointSlices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *endpointSlices) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("endpointslices"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a endpointSlice and creates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Create(endpointSlice *v1beta1.EndpointSlice) (result *v1beta1.EndpointSlice, err error) { +func (c *endpointSlices) Create(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.CreateOptions) (result *v1beta1.EndpointSlice, err error) { result = &v1beta1.EndpointSlice{} err = c.client.Post(). Namespace(c.ns). Resource("endpointslices"). + VersionedParams(&opts, scheme.ParameterCodec). Body(endpointSlice). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a endpointSlice and updates it. Returns the server's representation of the endpointSlice, and an error, if there is any. -func (c *endpointSlices) Update(endpointSlice *v1beta1.EndpointSlice) (result *v1beta1.EndpointSlice, err error) { +func (c *endpointSlices) Update(ctx context.Context, endpointSlice *v1beta1.EndpointSlice, opts v1.UpdateOptions) (result *v1beta1.EndpointSlice, err error) { result = &v1beta1.EndpointSlice{} err = c.client.Put(). Namespace(c.ns). Resource("endpointslices"). Name(endpointSlice.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(endpointSlice). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the endpointSlice and deletes it. Returns an error if one occurs. -func (c *endpointSlices) Delete(name string, options *v1.DeleteOptions) error { +func (c *endpointSlices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *endpointSlices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *endpointSlices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("endpointslices"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched endpointSlice. -func (c *endpointSlices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.EndpointSlice, err error) { +func (c *endpointSlices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EndpointSlice, err error) { result = &v1beta1.EndpointSlice{} err = c.client.Patch(pt). Namespace(c.ns). Resource("endpointslices"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go index 143281b25..4cdc471fb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/events/v1beta1" @@ -37,14 +38,14 @@ type EventsGetter interface { // EventInterface has methods to work with Event resources. type EventInterface interface { - Create(*v1beta1.Event) (*v1beta1.Event, error) - Update(*v1beta1.Event) (*v1beta1.Event, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Event, error) - List(opts v1.ListOptions) (*v1beta1.EventList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Event, err error) + Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (*v1beta1.Event, error) + Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (*v1beta1.Event, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Event, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EventList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) EventExpansion } @@ -63,20 +64,20 @@ func newEvents(c *EventsV1beta1Client, namespace string) *events { } // Get takes name of the event, and returns the corresponding event object, and an error if there is any. -func (c *events) Get(name string, options v1.GetOptions) (result *v1beta1.Event, err error) { +func (c *events) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Event, err error) { result = &v1beta1.Event{} err = c.client.Get(). Namespace(c.ns). Resource("events"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Events that match those selectors. -func (c *events) List(opts v1.ListOptions) (result *v1beta1.EventList, err error) { +func (c *events) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EventList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *events) List(opts v1.ListOptions) (result *v1beta1.EventList, err error Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested events. -func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *events) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("events"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Create(event *v1beta1.Event) (result *v1beta1.Event, err error) { +func (c *events) Create(ctx context.Context, event *v1beta1.Event, opts v1.CreateOptions) (result *v1beta1.Event, err error) { result = &v1beta1.Event{} err = c.client.Post(). Namespace(c.ns). Resource("events"). + VersionedParams(&opts, scheme.ParameterCodec). Body(event). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any. -func (c *events) Update(event *v1beta1.Event) (result *v1beta1.Event, err error) { +func (c *events) Update(ctx context.Context, event *v1beta1.Event, opts v1.UpdateOptions) (result *v1beta1.Event, err error) { result = &v1beta1.Event{} err = c.client.Put(). Namespace(c.ns). Resource("events"). Name(event.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(event). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the event and deletes it. Returns an error if one occurs. -func (c *events) Delete(name string, options *v1.DeleteOptions) error { +func (c *events) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("events"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *events) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *events) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("events"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched event. -func (c *events) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Event, err error) { +func (c *events) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Event, err error) { result = &v1beta1.Event{} err = c.client.Patch(pt). Namespace(c.ns). Resource("events"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go index 312ee4283..e0ae41dfe 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go @@ -17,6 +17,7 @@ limitations under the License. package v1beta1 import ( + "context" "fmt" "k8s.io/api/events/v1beta1" @@ -51,7 +52,7 @@ func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0). Resource("events"). Body(event). - Do(). + Do(context.TODO()). Into(result) return result, err } @@ -72,7 +73,7 @@ func (e *events) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, Resource("events"). Name(event.Name). Body(event). - Do(). + Do(context.TODO()). Into(result) return result, err } @@ -92,7 +93,7 @@ func (e *events) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1 Resource("events"). Name(event.Name). Body(data). - Do(). + Do(context.TODO()). Into(result) return result, err } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index 93b1ae9b6..0ba8bfc94 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/extensions/v1beta1" @@ -37,15 +38,15 @@ type DaemonSetsGetter interface { // DaemonSetInterface has methods to work with DaemonSet resources. type DaemonSetInterface interface { - Create(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) - Update(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) - UpdateStatus(*v1beta1.DaemonSet) (*v1beta1.DaemonSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.DaemonSet, error) - List(opts v1.ListOptions) (*v1beta1.DaemonSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) + Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (*v1beta1.DaemonSet, error) + Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) + UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.DaemonSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) DaemonSetExpansion } @@ -64,20 +65,20 @@ func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets { } // Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any. -func (c *daemonSets) Get(name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { +func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) { result = &v1beta1.DaemonSet{} err = c.client.Get(). Namespace(c.ns). Resource("daemonsets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. -func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { +func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *daemonSets) List(opts v1.ListOptions) (result *v1beta1.DaemonSetList, e Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested daemonSets. -func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("daemonsets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Create(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { +func (c *daemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) { result = &v1beta1.DaemonSet{} err = c.client.Post(). Namespace(c.ns). Resource("daemonsets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any. -func (c *daemonSets) Update(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { +func (c *daemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { result = &v1beta1.DaemonSet{} err = c.client.Put(). Namespace(c.ns). Resource("daemonsets"). Name(daemonSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *daemonSets) UpdateStatus(daemonSet *v1beta1.DaemonSet) (result *v1beta1.DaemonSet, err error) { +func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) { result = &v1beta1.DaemonSet{} err = c.client.Put(). Namespace(c.ns). Resource("daemonsets"). Name(daemonSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(daemonSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the daemonSet and deletes it. Returns an error if one occurs. -func (c *daemonSets) Delete(name string, options *v1.DeleteOptions) error { +func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *daemonSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("daemonsets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched daemonSet. -func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { +func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) { result = &v1beta1.DaemonSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("daemonsets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index 5557b9f2b..4265f6dec 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/extensions/v1beta1" @@ -37,17 +38,17 @@ type DeploymentsGetter interface { // DeploymentInterface has methods to work with Deployment resources. type DeploymentInterface interface { - Create(*v1beta1.Deployment) (*v1beta1.Deployment, error) - Update(*v1beta1.Deployment) (*v1beta1.Deployment, error) - UpdateStatus(*v1beta1.Deployment) (*v1beta1.Deployment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Deployment, error) - List(opts v1.ListOptions) (*v1beta1.DeploymentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) - GetScale(deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) - UpdateScale(deploymentName string, scale *v1beta1.Scale) (*v1beta1.Scale, error) + Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (*v1beta1.Deployment, error) + Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) + UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (*v1beta1.Deployment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Deployment, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DeploymentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) + GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (*v1beta1.Scale, error) + UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) DeploymentExpansion } @@ -67,20 +68,20 @@ func newDeployments(c *ExtensionsV1beta1Client, namespace string) *deployments { } // Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any. -func (c *deployments) Get(name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { +func (c *deployments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Get(). Namespace(c.ns). Resource("deployments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Deployments that match those selectors. -func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { +func (c *deployments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DeploymentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -91,13 +92,13 @@ func (c *deployments) List(opts v1.ListOptions) (result *v1beta1.DeploymentList, Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested deployments. -func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *deployments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -108,93 +109,96 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("deployments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Create(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { +func (c *deployments) Create(ctx context.Context, deployment *v1beta1.Deployment, opts v1.CreateOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Post(). Namespace(c.ns). Resource("deployments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any. -func (c *deployments) Update(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { +func (c *deployments) Update(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *deployments) UpdateStatus(deployment *v1beta1.Deployment) (result *v1beta1.Deployment, err error) { +func (c *deployments) UpdateStatus(ctx context.Context, deployment *v1beta1.Deployment, opts v1.UpdateOptions) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deployment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(deployment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the deployment and deletes it. Returns an error if one occurs. -func (c *deployments) Delete(name string, options *v1.DeleteOptions) error { +func (c *deployments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("deployments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *deployments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *deployments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("deployments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { +func (c *deployments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Patch(pt). Namespace(c.ns). Resource("deployments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the deployment, and returns the corresponding v1beta1.Scale object, and an error if there is any. -func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { +func (c *deployments) GetScale(ctx context.Context, deploymentName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -202,21 +206,22 @@ func (c *deployments) GetScale(deploymentName string, options v1.GetOptions) (re Name(deploymentName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *deployments) UpdateScale(deploymentName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { +func (c *deployments) UpdateScale(ctx context.Context, deploymentName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("deployments"). Name(deploymentName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment_expansion.go index 24734be6a..5c409ac99 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment_expansion.go @@ -16,14 +16,20 @@ limitations under the License. package v1beta1 -import "k8s.io/api/extensions/v1beta1" +import ( + "context" + + "k8s.io/api/extensions/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + scheme "k8s.io/client-go/kubernetes/scheme" +) // The DeploymentExpansion interface allows manually adding extra methods to the DeploymentInterface. type DeploymentExpansion interface { - Rollback(*v1beta1.DeploymentRollback) error + Rollback(context.Context, *v1beta1.DeploymentRollback, metav1.CreateOptions) error } // Rollback applied the provided DeploymentRollback to the named deployment in the current namespace. -func (c *deployments) Rollback(deploymentRollback *v1beta1.DeploymentRollback) error { - return c.client.Post().Namespace(c.ns).Resource("deployments").Name(deploymentRollback.Name).SubResource("rollback").Body(deploymentRollback).Do().Error() +func (c *deployments) Rollback(ctx context.Context, deploymentRollback *v1beta1.DeploymentRollback, opts metav1.CreateOptions) error { + return c.client.Post().Namespace(c.ns).Resource("deployments").Name(deploymentRollback.Name).VersionedParams(&opts, scheme.ParameterCodec).SubResource("rollback").Body(deploymentRollback).Do(ctx).Error() } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index 4da51c368..b19e2455a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/extensions/v1beta1" @@ -37,15 +38,15 @@ type IngressesGetter interface { // IngressInterface has methods to work with Ingress resources. type IngressInterface interface { - Create(*v1beta1.Ingress) (*v1beta1.Ingress, error) - Update(*v1beta1.Ingress) (*v1beta1.Ingress, error) - UpdateStatus(*v1beta1.Ingress) (*v1beta1.Ingress, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Ingress, error) - List(opts v1.ListOptions) (*v1beta1.IngressList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) + Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) + Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) + UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) IngressExpansion } @@ -64,20 +65,20 @@ func newIngresses(c *ExtensionsV1beta1Client, namespace string) *ingresses { } // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *ingresses) Get(name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Get(). Namespace(c.ns). Resource("ingresses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err error) { +func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested ingresses. -func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Create(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Post(). Namespace(c.ns). Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Update(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Put(). Namespace(c.ns). Resource("ingresses"). Name(ingress.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *ingresses) UpdateStatus(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { +func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Put(). Namespace(c.ns). Resource("ingresses"). Name(ingress.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(name string, options *v1.DeleteOptions) error { +func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *ingresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *ingresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Patch(pt). Namespace(c.ns). Resource("ingresses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go index 0607e2dd4..ed9ae30de 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/networkpolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/extensions/v1beta1" @@ -37,14 +38,14 @@ type NetworkPoliciesGetter interface { // NetworkPolicyInterface has methods to work with NetworkPolicy resources. type NetworkPolicyInterface interface { - Create(*v1beta1.NetworkPolicy) (*v1beta1.NetworkPolicy, error) - Update(*v1beta1.NetworkPolicy) (*v1beta1.NetworkPolicy, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.NetworkPolicy, error) - List(opts v1.ListOptions) (*v1beta1.NetworkPolicyList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.NetworkPolicy, err error) + Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (*v1beta1.NetworkPolicy, error) + Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (*v1beta1.NetworkPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.NetworkPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NetworkPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) NetworkPolicyExpansion } @@ -63,20 +64,20 @@ func newNetworkPolicies(c *ExtensionsV1beta1Client, namespace string) *networkPo } // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. -func (c *networkPolicies) Get(name string, options v1.GetOptions) (result *v1beta1.NetworkPolicy, err error) { +func (c *networkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.NetworkPolicy, err error) { result = &v1beta1.NetworkPolicy{} err = c.client.Get(). Namespace(c.ns). Resource("networkpolicies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *networkPolicies) List(opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { +func (c *networkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NetworkPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *networkPolicies) List(opts v1.ListOptions) (result *v1beta1.NetworkPoli Resource("networkpolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested networkPolicies. -func (c *networkPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *networkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *networkPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("networkpolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *networkPolicies) Create(networkPolicy *v1beta1.NetworkPolicy) (result *v1beta1.NetworkPolicy, err error) { +func (c *networkPolicies) Create(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.CreateOptions) (result *v1beta1.NetworkPolicy, err error) { result = &v1beta1.NetworkPolicy{} err = c.client.Post(). Namespace(c.ns). Resource("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(networkPolicy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *networkPolicies) Update(networkPolicy *v1beta1.NetworkPolicy) (result *v1beta1.NetworkPolicy, err error) { +func (c *networkPolicies) Update(ctx context.Context, networkPolicy *v1beta1.NetworkPolicy, opts v1.UpdateOptions) (result *v1beta1.NetworkPolicy, err error) { result = &v1beta1.NetworkPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("networkpolicies"). Name(networkPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(networkPolicy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *networkPolicies) Delete(name string, options *v1.DeleteOptions) error { +func (c *networkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *networkPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *networkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched networkPolicy. -func (c *networkPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.NetworkPolicy, err error) { +func (c *networkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.NetworkPolicy, err error) { result = &v1beta1.NetworkPolicy{} err = c.client.Patch(pt). Namespace(c.ns). Resource("networkpolicies"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index a947a54a6..76e67dedb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/extensions/v1beta1" @@ -37,14 +38,14 @@ type PodSecurityPoliciesGetter interface { // PodSecurityPolicyInterface has methods to work with PodSecurityPolicy resources. type PodSecurityPolicyInterface interface { - Create(*v1beta1.PodSecurityPolicy) (*v1beta1.PodSecurityPolicy, error) - Update(*v1beta1.PodSecurityPolicy) (*v1beta1.PodSecurityPolicy, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) - List(opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) + Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (*v1beta1.PodSecurityPolicy, error) + Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (*v1beta1.PodSecurityPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) PodSecurityPolicyExpansion } @@ -61,19 +62,19 @@ func newPodSecurityPolicies(c *ExtensionsV1beta1Client) *podSecurityPolicies { } // Get takes name of the podSecurityPolicy, and returns the corresponding podSecurityPolicy object, and an error if there is any. -func (c *podSecurityPolicies) Get(name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Get(). Resource("podsecuritypolicies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. -func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { +func (c *podSecurityPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecu Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested podSecurityPolicies. -func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *podSecurityPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a podSecurityPolicy and creates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. -func (c *podSecurityPolicies) Create(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Post(). Resource("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podSecurityPolicy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a podSecurityPolicy and updates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. -func (c *podSecurityPolicies) Update(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Put(). Resource("podsecuritypolicies"). Name(podSecurityPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(podSecurityPolicy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. -func (c *podSecurityPolicies) Delete(name string, options *v1.DeleteOptions) error { +func (c *podSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("podsecuritypolicies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podSecurityPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("podsecuritypolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched podSecurityPolicy. -func (c *podSecurityPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Patch(pt). Resource("podsecuritypolicies"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index 444029058..64e3c1861 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/extensions/v1beta1" @@ -37,17 +38,17 @@ type ReplicaSetsGetter interface { // ReplicaSetInterface has methods to work with ReplicaSet resources. type ReplicaSetInterface interface { - Create(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) - Update(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) - UpdateStatus(*v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ReplicaSet, error) - List(opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) - GetScale(replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error) - UpdateScale(replicaSetName string, scale *v1beta1.Scale) (*v1beta1.Scale, error) + Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (*v1beta1.ReplicaSet, error) + Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) + UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (*v1beta1.ReplicaSet, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ReplicaSet, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) + GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (*v1beta1.Scale, error) + UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (*v1beta1.Scale, error) ReplicaSetExpansion } @@ -67,20 +68,20 @@ func newReplicaSets(c *ExtensionsV1beta1Client, namespace string) *replicaSets { } // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any. -func (c *replicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { +func (c *replicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) { result = &v1beta1.ReplicaSet{} err = c.client.Get(). Namespace(c.ns). Resource("replicasets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. -func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { +func (c *replicaSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -91,13 +92,13 @@ func (c *replicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested replicaSets. -func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *replicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -108,93 +109,96 @@ func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("replicasets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { +func (c *replicaSets) Create(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.CreateOptions) (result *v1beta1.ReplicaSet, err error) { result = &v1beta1.ReplicaSet{} err = c.client.Post(). Namespace(c.ns). Resource("replicasets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any. -func (c *replicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { +func (c *replicaSets) Update(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { result = &v1beta1.ReplicaSet{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *replicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) { +func (c *replicaSets) UpdateStatus(ctx context.Context, replicaSet *v1beta1.ReplicaSet, opts v1.UpdateOptions) (result *v1beta1.ReplicaSet, err error) { result = &v1beta1.ReplicaSet{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSet.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(replicaSet). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs. -func (c *replicaSets) Delete(name string, options *v1.DeleteOptions) error { +func (c *replicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *replicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *replicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("replicasets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { +func (c *replicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ReplicaSet, err error) { result = &v1beta1.ReplicaSet{} err = c.client.Patch(pt). Namespace(c.ns). Resource("replicasets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } // GetScale takes name of the replicaSet, and returns the corresponding v1beta1.Scale object, and an error if there is any. -func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { +func (c *replicaSets) GetScale(ctx context.Context, replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.client.Get(). Namespace(c.ns). @@ -202,21 +206,22 @@ func (c *replicaSets) GetScale(replicaSetName string, options v1.GetOptions) (re Name(replicaSetName). SubResource("scale"). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // UpdateScale takes the top resource name and the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any. -func (c *replicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) { +func (c *replicaSets) UpdateScale(ctx context.Context, replicaSetName string, scale *v1beta1.Scale, opts v1.UpdateOptions) (result *v1beta1.Scale, err error) { result = &v1beta1.Scale{} err = c.client.Put(). Namespace(c.ns). Resource("replicasets"). Name(replicaSetName). SubResource("scale"). + VersionedParams(&opts, scheme.ParameterCodec). Body(scale). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go index db71d29a5..319636f77 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" @@ -37,15 +38,15 @@ type FlowSchemasGetter interface { // FlowSchemaInterface has methods to work with FlowSchema resources. type FlowSchemaInterface interface { - Create(*v1alpha1.FlowSchema) (*v1alpha1.FlowSchema, error) - Update(*v1alpha1.FlowSchema) (*v1alpha1.FlowSchema, error) - UpdateStatus(*v1alpha1.FlowSchema) (*v1alpha1.FlowSchema, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.FlowSchema, error) - List(opts v1.ListOptions) (*v1alpha1.FlowSchemaList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.FlowSchema, err error) + Create(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.CreateOptions) (*v1alpha1.FlowSchema, error) + Update(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) + UpdateStatus(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (*v1alpha1.FlowSchema, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.FlowSchema, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.FlowSchemaList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FlowSchema, err error) FlowSchemaExpansion } @@ -62,19 +63,19 @@ func newFlowSchemas(c *FlowcontrolV1alpha1Client) *flowSchemas { } // Get takes name of the flowSchema, and returns the corresponding flowSchema object, and an error if there is any. -func (c *flowSchemas) Get(name string, options v1.GetOptions) (result *v1alpha1.FlowSchema, err error) { +func (c *flowSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.FlowSchema, err error) { result = &v1alpha1.FlowSchema{} err = c.client.Get(). Resource("flowschemas"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. -func (c *flowSchemas) List(opts v1.ListOptions) (result *v1alpha1.FlowSchemaList, err error) { +func (c *flowSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.FlowSchemaList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *flowSchemas) List(opts v1.ListOptions) (result *v1alpha1.FlowSchemaList Resource("flowschemas"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested flowSchemas. -func (c *flowSchemas) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *flowSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *flowSchemas) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("flowschemas"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a flowSchema and creates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Create(flowSchema *v1alpha1.FlowSchema) (result *v1alpha1.FlowSchema, err error) { +func (c *flowSchemas) Create(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.CreateOptions) (result *v1alpha1.FlowSchema, err error) { result = &v1alpha1.FlowSchema{} err = c.client.Post(). Resource("flowschemas"). + VersionedParams(&opts, scheme.ParameterCodec). Body(flowSchema). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a flowSchema and updates it. Returns the server's representation of the flowSchema, and an error, if there is any. -func (c *flowSchemas) Update(flowSchema *v1alpha1.FlowSchema) (result *v1alpha1.FlowSchema, err error) { +func (c *flowSchemas) Update(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (result *v1alpha1.FlowSchema, err error) { result = &v1alpha1.FlowSchema{} err = c.client.Put(). Resource("flowschemas"). Name(flowSchema.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(flowSchema). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *flowSchemas) UpdateStatus(flowSchema *v1alpha1.FlowSchema) (result *v1alpha1.FlowSchema, err error) { +func (c *flowSchemas) UpdateStatus(ctx context.Context, flowSchema *v1alpha1.FlowSchema, opts v1.UpdateOptions) (result *v1alpha1.FlowSchema, err error) { result = &v1alpha1.FlowSchema{} err = c.client.Put(). Resource("flowschemas"). Name(flowSchema.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(flowSchema). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the flowSchema and deletes it. Returns an error if one occurs. -func (c *flowSchemas) Delete(name string, options *v1.DeleteOptions) error { +func (c *flowSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("flowschemas"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *flowSchemas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *flowSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("flowschemas"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched flowSchema. -func (c *flowSchemas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.FlowSchema, err error) { +func (c *flowSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.FlowSchema, err error) { result = &v1alpha1.FlowSchema{} err = c.client.Patch(pt). Resource("flowschemas"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go index eb99cca60..1290e7936 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/flowcontrol/v1alpha1" @@ -37,15 +38,15 @@ type PriorityLevelConfigurationsGetter interface { // PriorityLevelConfigurationInterface has methods to work with PriorityLevelConfiguration resources. type PriorityLevelConfigurationInterface interface { - Create(*v1alpha1.PriorityLevelConfiguration) (*v1alpha1.PriorityLevelConfiguration, error) - Update(*v1alpha1.PriorityLevelConfiguration) (*v1alpha1.PriorityLevelConfiguration, error) - UpdateStatus(*v1alpha1.PriorityLevelConfiguration) (*v1alpha1.PriorityLevelConfiguration, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.PriorityLevelConfiguration, error) - List(opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) + Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (*v1alpha1.PriorityLevelConfiguration, error) + Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) + UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (*v1alpha1.PriorityLevelConfiguration, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PriorityLevelConfiguration, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityLevelConfigurationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) PriorityLevelConfigurationExpansion } @@ -62,19 +63,19 @@ func newPriorityLevelConfigurations(c *FlowcontrolV1alpha1Client) *priorityLevel } // Get takes name of the priorityLevelConfiguration, and returns the corresponding priorityLevelConfiguration object, and an error if there is any. -func (c *priorityLevelConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Get(). Resource("prioritylevelconfigurations"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. -func (c *priorityLevelConfigurations) List(opts v1.ListOptions) (result *v1alpha1.PriorityLevelConfigurationList, err error) { +func (c *priorityLevelConfigurations) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityLevelConfigurationList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *priorityLevelConfigurations) List(opts v1.ListOptions) (result *v1alpha Resource("prioritylevelconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested priorityLevelConfigurations. -func (c *priorityLevelConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *priorityLevelConfigurations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *priorityLevelConfigurations) Watch(opts v1.ListOptions) (watch.Interfac Resource("prioritylevelconfigurations"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a priorityLevelConfiguration and creates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Create(priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration) (result *v1alpha1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) Create(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.CreateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Post(). Resource("prioritylevelconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityLevelConfiguration). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a priorityLevelConfiguration and updates it. Returns the server's representation of the priorityLevelConfiguration, and an error, if there is any. -func (c *priorityLevelConfigurations) Update(priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration) (result *v1alpha1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) Update(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Put(). Resource("prioritylevelconfigurations"). Name(priorityLevelConfiguration.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityLevelConfiguration). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *priorityLevelConfigurations) UpdateStatus(priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration) (result *v1alpha1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) UpdateStatus(ctx context.Context, priorityLevelConfiguration *v1alpha1.PriorityLevelConfiguration, opts v1.UpdateOptions) (result *v1alpha1.PriorityLevelConfiguration, err error) { result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Put(). Resource("prioritylevelconfigurations"). Name(priorityLevelConfiguration.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityLevelConfiguration). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the priorityLevelConfiguration and deletes it. Returns an error if one occurs. -func (c *priorityLevelConfigurations) Delete(name string, options *v1.DeleteOptions) error { +func (c *priorityLevelConfigurations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("prioritylevelconfigurations"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityLevelConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *priorityLevelConfigurations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("prioritylevelconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched priorityLevelConfiguration. -func (c *priorityLevelConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) { +func (c *priorityLevelConfigurations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityLevelConfiguration, err error) { result = &v1alpha1.PriorityLevelConfiguration{} err = c.client.Patch(pt). Resource("prioritylevelconfigurations"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go index 3f39be957..19c0c880f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1/networkpolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/networking/v1" @@ -37,14 +38,14 @@ type NetworkPoliciesGetter interface { // NetworkPolicyInterface has methods to work with NetworkPolicy resources. type NetworkPolicyInterface interface { - Create(*v1.NetworkPolicy) (*v1.NetworkPolicy, error) - Update(*v1.NetworkPolicy) (*v1.NetworkPolicy, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.NetworkPolicy, error) - List(opts metav1.ListOptions) (*v1.NetworkPolicyList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.NetworkPolicy, err error) + Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (*v1.NetworkPolicy, error) + Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (*v1.NetworkPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) NetworkPolicyExpansion } @@ -63,20 +64,20 @@ func newNetworkPolicies(c *NetworkingV1Client, namespace string) *networkPolicie } // Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. -func (c *networkPolicies) Get(name string, options metav1.GetOptions) (result *v1.NetworkPolicy, err error) { +func (c *networkPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPolicy, err error) { result = &v1.NetworkPolicy{} err = c.client.Get(). Namespace(c.ns). Resource("networkpolicies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. -func (c *networkPolicies) List(opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { +func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *networkPolicies) List(opts metav1.ListOptions) (result *v1.NetworkPolic Resource("networkpolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested networkPolicies. -func (c *networkPolicies) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *networkPolicies) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *networkPolicies) Watch(opts metav1.ListOptions) (watch.Interface, error Resource("networkpolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *networkPolicies) Create(networkPolicy *v1.NetworkPolicy) (result *v1.NetworkPolicy, err error) { +func (c *networkPolicies) Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { result = &v1.NetworkPolicy{} err = c.client.Post(). Namespace(c.ns). Resource("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(networkPolicy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. -func (c *networkPolicies) Update(networkPolicy *v1.NetworkPolicy) (result *v1.NetworkPolicy, err error) { +func (c *networkPolicies) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { result = &v1.NetworkPolicy{} err = c.client.Put(). Namespace(c.ns). Resource("networkpolicies"). Name(networkPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(networkPolicy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. -func (c *networkPolicies) Delete(name string, options *metav1.DeleteOptions) error { +func (c *networkPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *networkPolicies) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *networkPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("networkpolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched networkPolicy. -func (c *networkPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.NetworkPolicy, err error) { +func (c *networkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { result = &v1.NetworkPolicy{} err = c.client.Patch(pt). Namespace(c.ns). Resource("networkpolicies"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/generated_expansion.go index 1442649b3..f74c7257a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/generated_expansion.go @@ -19,3 +19,5 @@ limitations under the License. package v1beta1 type IngressExpansion interface{} + +type IngressClassExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go index 8d76678f1..0857c05d6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingress.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/networking/v1beta1" @@ -37,15 +38,15 @@ type IngressesGetter interface { // IngressInterface has methods to work with Ingress resources. type IngressInterface interface { - Create(*v1beta1.Ingress) (*v1beta1.Ingress, error) - Update(*v1beta1.Ingress) (*v1beta1.Ingress, error) - UpdateStatus(*v1beta1.Ingress) (*v1beta1.Ingress, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Ingress, error) - List(opts v1.ListOptions) (*v1beta1.IngressList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) + Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (*v1beta1.Ingress, error) + Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) + UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (*v1beta1.Ingress, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Ingress, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) IngressExpansion } @@ -64,20 +65,20 @@ func newIngresses(c *NetworkingV1beta1Client, namespace string) *ingresses { } // Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. -func (c *ingresses) Get(name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Get(). Namespace(c.ns). Resource("ingresses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Ingresses that match those selectors. -func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err error) { +func (c *ingresses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *ingresses) List(opts v1.ListOptions) (result *v1beta1.IngressList, err Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested ingresses. -func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *ingresses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("ingresses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Create(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Create(ctx context.Context, ingress *v1beta1.Ingress, opts v1.CreateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Post(). Namespace(c.ns). Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any. -func (c *ingresses) Update(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Update(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Put(). Namespace(c.ns). Resource("ingresses"). Name(ingress.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *ingresses) UpdateStatus(ingress *v1beta1.Ingress) (result *v1beta1.Ingress, err error) { +func (c *ingresses) UpdateStatus(ctx context.Context, ingress *v1beta1.Ingress, opts v1.UpdateOptions) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Put(). Namespace(c.ns). Resource("ingresses"). Name(ingress.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(ingress). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the ingress and deletes it. Returns an error if one occurs. -func (c *ingresses) Delete(name string, options *v1.DeleteOptions) error { +func (c *ingresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *ingresses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *ingresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("ingresses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Patch(pt). Namespace(c.ns). Resource("ingresses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go new file mode 100644 index 000000000..2a4237425 --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/ingressclass.go @@ -0,0 +1,168 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "k8s.io/api/networking/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// IngressClassesGetter has a method to return a IngressClassInterface. +// A group's client should implement this interface. +type IngressClassesGetter interface { + IngressClasses() IngressClassInterface +} + +// IngressClassInterface has methods to work with IngressClass resources. +type IngressClassInterface interface { + Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (*v1beta1.IngressClass, error) + Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (*v1beta1.IngressClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.IngressClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.IngressClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) + IngressClassExpansion +} + +// ingressClasses implements IngressClassInterface +type ingressClasses struct { + client rest.Interface +} + +// newIngressClasses returns a IngressClasses +func newIngressClasses(c *NetworkingV1beta1Client) *ingressClasses { + return &ingressClasses{ + client: c.RESTClient(), + } +} + +// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. +func (c *ingressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.IngressClass, err error) { + result = &v1beta1.IngressClass{} + err = c.client.Get(). + Resource("ingressclasses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. +func (c *ingressClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.IngressClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.IngressClassList{} + err = c.client.Get(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ingressClasses. +func (c *ingressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. +func (c *ingressClasses) Create(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.CreateOptions) (result *v1beta1.IngressClass, err error) { + result = &v1beta1.IngressClass{} + err = c.client.Post(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingressClass). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. +func (c *ingressClasses) Update(ctx context.Context, ingressClass *v1beta1.IngressClass, opts v1.UpdateOptions) (result *v1beta1.IngressClass, err error) { + result = &v1beta1.IngressClass{} + err = c.client.Put(). + Resource("ingressclasses"). + Name(ingressClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingressClass). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. +func (c *ingressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("ingressclasses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ingressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ingressclasses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ingressClass. +func (c *ingressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.IngressClass, err error) { + result = &v1beta1.IngressClass{} + err = c.client.Patch(pt). + Resource("ingressclasses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go index ee523f8e7..849ac219f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/networking/v1beta1/networking_client.go @@ -27,6 +27,7 @@ import ( type NetworkingV1beta1Interface interface { RESTClient() rest.Interface IngressesGetter + IngressClassesGetter } // NetworkingV1beta1Client is used to interact with features provided by the networking.k8s.io group. @@ -38,6 +39,10 @@ func (c *NetworkingV1beta1Client) Ingresses(namespace string) IngressInterface { return newIngresses(c, namespace) } +func (c *NetworkingV1beta1Client) IngressClasses() IngressClassInterface { + return newIngressClasses(c) +} + // NewForConfig creates a new NetworkingV1beta1Client for the given config. func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) { config := *c diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go index 044460ec0..402c23e8a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/node/v1alpha1/runtimeclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/node/v1alpha1" @@ -37,14 +38,14 @@ type RuntimeClassesGetter interface { // RuntimeClassInterface has methods to work with RuntimeClass resources. type RuntimeClassInterface interface { - Create(*v1alpha1.RuntimeClass) (*v1alpha1.RuntimeClass, error) - Update(*v1alpha1.RuntimeClass) (*v1alpha1.RuntimeClass, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.RuntimeClass, error) - List(opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RuntimeClass, err error) + Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (*v1alpha1.RuntimeClass, error) + Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (*v1alpha1.RuntimeClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RuntimeClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RuntimeClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) RuntimeClassExpansion } @@ -61,19 +62,19 @@ func newRuntimeClasses(c *NodeV1alpha1Client) *runtimeClasses { } // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *runtimeClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { +func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RuntimeClass, err error) { result = &v1alpha1.RuntimeClass{} err = c.client.Get(). Resource("runtimeclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { +func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RuntimeClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *runtimeClasses) List(opts v1.ListOptions) (result *v1alpha1.RuntimeClas Resource("runtimeclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *runtimeClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *runtimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *runtimeClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("runtimeclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Create(runtimeClass *v1alpha1.RuntimeClass) (result *v1alpha1.RuntimeClass, err error) { +func (c *runtimeClasses) Create(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.CreateOptions) (result *v1alpha1.RuntimeClass, err error) { result = &v1alpha1.RuntimeClass{} err = c.client.Post(). Resource("runtimeclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(runtimeClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Update(runtimeClass *v1alpha1.RuntimeClass) (result *v1alpha1.RuntimeClass, err error) { +func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1alpha1.RuntimeClass, opts v1.UpdateOptions) (result *v1alpha1.RuntimeClass, err error) { result = &v1alpha1.RuntimeClass{} err = c.client.Put(). Resource("runtimeclasses"). Name(runtimeClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(runtimeClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(name string, options *v1.DeleteOptions) error { +func (c *runtimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("runtimeclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *runtimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("runtimeclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched runtimeClass. -func (c *runtimeClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { +func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RuntimeClass, err error) { result = &v1alpha1.RuntimeClass{} err = c.client.Patch(pt). Resource("runtimeclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go b/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go index b3f7c497f..b0d1886ec 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/node/v1beta1/runtimeclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/node/v1beta1" @@ -37,14 +38,14 @@ type RuntimeClassesGetter interface { // RuntimeClassInterface has methods to work with RuntimeClass resources. type RuntimeClassInterface interface { - Create(*v1beta1.RuntimeClass) (*v1beta1.RuntimeClass, error) - Update(*v1beta1.RuntimeClass) (*v1beta1.RuntimeClass, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.RuntimeClass, error) - List(opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.RuntimeClass, err error) + Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (*v1beta1.RuntimeClass, error) + Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (*v1beta1.RuntimeClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RuntimeClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RuntimeClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) RuntimeClassExpansion } @@ -61,19 +62,19 @@ func newRuntimeClasses(c *NodeV1beta1Client) *runtimeClasses { } // Get takes name of the runtimeClass, and returns the corresponding runtimeClass object, and an error if there is any. -func (c *runtimeClasses) Get(name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { +func (c *runtimeClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RuntimeClass, err error) { result = &v1beta1.RuntimeClass{} err = c.client.Get(). Resource("runtimeclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. -func (c *runtimeClasses) List(opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { +func (c *runtimeClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RuntimeClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *runtimeClasses) List(opts v1.ListOptions) (result *v1beta1.RuntimeClass Resource("runtimeclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested runtimeClasses. -func (c *runtimeClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *runtimeClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *runtimeClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("runtimeclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a runtimeClass and creates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Create(runtimeClass *v1beta1.RuntimeClass) (result *v1beta1.RuntimeClass, err error) { +func (c *runtimeClasses) Create(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.CreateOptions) (result *v1beta1.RuntimeClass, err error) { result = &v1beta1.RuntimeClass{} err = c.client.Post(). Resource("runtimeclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(runtimeClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a runtimeClass and updates it. Returns the server's representation of the runtimeClass, and an error, if there is any. -func (c *runtimeClasses) Update(runtimeClass *v1beta1.RuntimeClass) (result *v1beta1.RuntimeClass, err error) { +func (c *runtimeClasses) Update(ctx context.Context, runtimeClass *v1beta1.RuntimeClass, opts v1.UpdateOptions) (result *v1beta1.RuntimeClass, err error) { result = &v1beta1.RuntimeClass{} err = c.client.Put(). Resource("runtimeclasses"). Name(runtimeClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(runtimeClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the runtimeClass and deletes it. Returns an error if one occurs. -func (c *runtimeClasses) Delete(name string, options *v1.DeleteOptions) error { +func (c *runtimeClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("runtimeclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *runtimeClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *runtimeClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("runtimeclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched runtimeClass. -func (c *runtimeClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.RuntimeClass, err error) { +func (c *runtimeClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RuntimeClass, err error) { result = &v1beta1.RuntimeClass{} err = c.client.Patch(pt). Resource("runtimeclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction_expansion.go index 40bad265f..c003671f5 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/eviction_expansion.go @@ -17,15 +17,17 @@ limitations under the License. package v1beta1 import ( + "context" + policy "k8s.io/api/policy/v1beta1" ) // The EvictionExpansion interface allows manually adding extra methods to the ScaleInterface. type EvictionExpansion interface { - Evict(eviction *policy.Eviction) error + Evict(ctx context.Context, eviction *policy.Eviction) error } -func (c *evictions) Evict(eviction *policy.Eviction) error { +func (c *evictions) Evict(ctx context.Context, eviction *policy.Eviction) error { return c.client.Post(). AbsPath("/api/v1"). Namespace(eviction.Namespace). @@ -33,6 +35,6 @@ func (c *evictions) Evict(eviction *policy.Eviction) error { Name(eviction.Name). SubResource("eviction"). Body(eviction). - Do(). + Do(ctx). Error() } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 864af9a26..95b7ff1b8 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/policy/v1beta1" @@ -37,15 +38,15 @@ type PodDisruptionBudgetsGetter interface { // PodDisruptionBudgetInterface has methods to work with PodDisruptionBudget resources. type PodDisruptionBudgetInterface interface { - Create(*v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) - Update(*v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) - UpdateStatus(*v1beta1.PodDisruptionBudget) (*v1beta1.PodDisruptionBudget, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.PodDisruptionBudget, error) - List(opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) + Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (*v1beta1.PodDisruptionBudget, error) + Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) + UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (*v1beta1.PodDisruptionBudget, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodDisruptionBudget, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } @@ -64,20 +65,20 @@ func newPodDisruptionBudgets(c *PolicyV1beta1Client, namespace string) *podDisru } // Get takes name of the podDisruptionBudget, and returns the corresponding podDisruptionBudget object, and an error if there is any. -func (c *podDisruptionBudgets) Get(name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodDisruptionBudget, err error) { result = &v1beta1.PodDisruptionBudget{} err = c.client.Get(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. -func (c *podDisruptionBudgets) List(opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { +func (c *podDisruptionBudgets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodDisruptionBudgetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,13 +89,13 @@ func (c *podDisruptionBudgets) List(opts v1.ListOptions) (result *v1beta1.PodDis Resource("poddisruptionbudgets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested podDisruptionBudgets. -func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *podDisruptionBudgets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -105,87 +106,90 @@ func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, erro Resource("poddisruptionbudgets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a podDisruptionBudget and creates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *podDisruptionBudgets) Create(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) Create(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.CreateOptions) (result *v1beta1.PodDisruptionBudget, err error) { result = &v1beta1.PodDisruptionBudget{} err = c.client.Post(). Namespace(c.ns). Resource("poddisruptionbudgets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podDisruptionBudget). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a podDisruptionBudget and updates it. Returns the server's representation of the podDisruptionBudget, and an error, if there is any. -func (c *podDisruptionBudgets) Update(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) Update(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { result = &v1beta1.PodDisruptionBudget{} err = c.client.Put(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(podDisruptionBudget.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(podDisruptionBudget). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *podDisruptionBudgets) UpdateStatus(podDisruptionBudget *v1beta1.PodDisruptionBudget) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) UpdateStatus(ctx context.Context, podDisruptionBudget *v1beta1.PodDisruptionBudget, opts v1.UpdateOptions) (result *v1beta1.PodDisruptionBudget, err error) { result = &v1beta1.PodDisruptionBudget{} err = c.client.Put(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(podDisruptionBudget.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podDisruptionBudget). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the podDisruptionBudget and deletes it. Returns an error if one occurs. -func (c *podDisruptionBudgets) Delete(name string, options *v1.DeleteOptions) error { +func (c *podDisruptionBudgets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podDisruptionBudgets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podDisruptionBudgets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("poddisruptionbudgets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched podDisruptionBudget. -func (c *podDisruptionBudgets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { result = &v1beta1.PodDisruptionBudget{} err = c.client.Patch(pt). Namespace(c.ns). Resource("poddisruptionbudgets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go index d02096d74..15d7bb9e4 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/policy/v1beta1" @@ -37,14 +38,14 @@ type PodSecurityPoliciesGetter interface { // PodSecurityPolicyInterface has methods to work with PodSecurityPolicy resources. type PodSecurityPolicyInterface interface { - Create(*v1beta1.PodSecurityPolicy) (*v1beta1.PodSecurityPolicy, error) - Update(*v1beta1.PodSecurityPolicy) (*v1beta1.PodSecurityPolicy, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) - List(opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) + Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (*v1beta1.PodSecurityPolicy, error) + Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (*v1beta1.PodSecurityPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) PodSecurityPolicyExpansion } @@ -61,19 +62,19 @@ func newPodSecurityPolicies(c *PolicyV1beta1Client) *podSecurityPolicies { } // Get takes name of the podSecurityPolicy, and returns the corresponding podSecurityPolicy object, and an error if there is any. -func (c *podSecurityPolicies) Get(name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Get(). Resource("podsecuritypolicies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. -func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { +func (c *podSecurityPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PodSecurityPolicyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *podSecurityPolicies) List(opts v1.ListOptions) (result *v1beta1.PodSecu Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested podSecurityPolicies. -func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *podSecurityPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error Resource("podsecuritypolicies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a podSecurityPolicy and creates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. -func (c *podSecurityPolicies) Create(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Create(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.CreateOptions) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Post(). Resource("podsecuritypolicies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podSecurityPolicy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a podSecurityPolicy and updates it. Returns the server's representation of the podSecurityPolicy, and an error, if there is any. -func (c *podSecurityPolicies) Update(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Update(ctx context.Context, podSecurityPolicy *v1beta1.PodSecurityPolicy, opts v1.UpdateOptions) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Put(). Resource("podsecuritypolicies"). Name(podSecurityPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(podSecurityPolicy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the podSecurityPolicy and deletes it. Returns an error if one occurs. -func (c *podSecurityPolicies) Delete(name string, options *v1.DeleteOptions) error { +func (c *podSecurityPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("podsecuritypolicies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podSecurityPolicies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podSecurityPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("podsecuritypolicies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched podSecurityPolicy. -func (c *podSecurityPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Patch(pt). Resource("podsecuritypolicies"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go index 0a47c4411..787324d65 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrole.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/rbac/v1" @@ -37,14 +38,14 @@ type ClusterRolesGetter interface { // ClusterRoleInterface has methods to work with ClusterRole resources. type ClusterRoleInterface interface { - Create(*v1.ClusterRole) (*v1.ClusterRole, error) - Update(*v1.ClusterRole) (*v1.ClusterRole, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ClusterRole, error) - List(opts metav1.ListOptions) (*v1.ClusterRoleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRole, err error) + Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (*v1.ClusterRole, error) + Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (*v1.ClusterRole, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterRole, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) ClusterRoleExpansion } @@ -61,19 +62,19 @@ func newClusterRoles(c *RbacV1Client) *clusterRoles { } // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *clusterRoles) Get(name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { +func (c *clusterRoles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRole, err error) { result = &v1.ClusterRole{} err = c.client.Get(). Resource("clusterroles"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { +func (c *clusterRoles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterRoles) List(opts metav1.ListOptions) (result *v1.ClusterRoleList Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *clusterRoles) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *clusterRoles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterRoles) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Create(clusterRole *v1.ClusterRole) (result *v1.ClusterRole, err error) { +func (c *clusterRoles) Create(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.CreateOptions) (result *v1.ClusterRole, err error) { result = &v1.ClusterRole{} err = c.client.Post(). Resource("clusterroles"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRole). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Update(clusterRole *v1.ClusterRole) (result *v1.ClusterRole, err error) { +func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1.ClusterRole, opts metav1.UpdateOptions) (result *v1.ClusterRole, err error) { result = &v1.ClusterRole{} err = c.client.Put(). Resource("clusterroles"). Name(clusterRole.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRole). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(name string, options *metav1.DeleteOptions) error { +func (c *clusterRoles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clusterroles"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterRoles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterroles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRole, err error) { +func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRole, err error) { result = &v1.ClusterRole{} err = c.client.Patch(pt). Resource("clusterroles"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go index c16ebc312..83e8c81bb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/rbac/v1" @@ -37,14 +38,14 @@ type ClusterRoleBindingsGetter interface { // ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources. type ClusterRoleBindingInterface interface { - Create(*v1.ClusterRoleBinding) (*v1.ClusterRoleBinding, error) - Update(*v1.ClusterRoleBinding) (*v1.ClusterRoleBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.ClusterRoleBinding, error) - List(opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRoleBinding, err error) + Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (*v1.ClusterRoleBinding, error) + Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (*v1.ClusterRoleBinding, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ClusterRoleBinding, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ClusterRoleBindingList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } @@ -61,19 +62,19 @@ func newClusterRoleBindings(c *RbacV1Client) *clusterRoleBindings { } // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *clusterRoleBindings) Get(name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ClusterRoleBinding, err error) { result = &v1.ClusterRoleBinding{} err = c.client.Get(). Resource("clusterrolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { +func (c *clusterRoleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ClusterRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterRoleBindings) List(opts metav1.ListOptions) (result *v1.ClusterR Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *clusterRoleBindings) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *clusterRoleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterRoleBindings) Watch(opts metav1.ListOptions) (watch.Interface, e Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Create(clusterRoleBinding *v1.ClusterRoleBinding) (result *v1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.CreateOptions) (result *v1.ClusterRoleBinding, err error) { result = &v1.ClusterRoleBinding{} err = c.client.Post(). Resource("clusterrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRoleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Update(clusterRoleBinding *v1.ClusterRoleBinding) (result *v1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1.ClusterRoleBinding, opts metav1.UpdateOptions) (result *v1.ClusterRoleBinding, err error) { result = &v1.ClusterRoleBinding{} err = c.client.Put(). Resource("clusterrolebindings"). Name(clusterRoleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRoleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(name string, options *metav1.DeleteOptions) error { +func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("clusterrolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ClusterRoleBinding, err error) { result = &v1.ClusterRoleBinding{} err = c.client.Patch(pt). Resource("clusterrolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go index a17d791ff..c31e22b63 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/role.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/rbac/v1" @@ -37,14 +38,14 @@ type RolesGetter interface { // RoleInterface has methods to work with Role resources. type RoleInterface interface { - Create(*v1.Role) (*v1.Role, error) - Update(*v1.Role) (*v1.Role, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.Role, error) - List(opts metav1.ListOptions) (*v1.RoleList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Role, err error) + Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (*v1.Role, error) + Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (*v1.Role, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Role, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) RoleExpansion } @@ -63,20 +64,20 @@ func newRoles(c *RbacV1Client, namespace string) *roles { } // Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *roles) Get(name string, options metav1.GetOptions) (result *v1.Role, err error) { +func (c *roles) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Role, err error) { result = &v1.Role{} err = c.client.Get(). Namespace(c.ns). Resource("roles"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(opts metav1.ListOptions) (result *v1.RoleList, err error) { +func (c *roles) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *roles) List(opts metav1.ListOptions) (result *v1.RoleList, err error) { Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested roles. -func (c *roles) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *roles) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *roles) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Create(role *v1.Role) (result *v1.Role, err error) { +func (c *roles) Create(ctx context.Context, role *v1.Role, opts metav1.CreateOptions) (result *v1.Role, err error) { result = &v1.Role{} err = c.client.Post(). Namespace(c.ns). Resource("roles"). + VersionedParams(&opts, scheme.ParameterCodec). Body(role). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Update(role *v1.Role) (result *v1.Role, err error) { +func (c *roles) Update(ctx context.Context, role *v1.Role, opts metav1.UpdateOptions) (result *v1.Role, err error) { result = &v1.Role{} err = c.client.Put(). Namespace(c.ns). Resource("roles"). Name(role.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(role). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(name string, options *metav1.DeleteOptions) error { +func (c *roles) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("roles"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *roles) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("roles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched role. -func (c *roles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Role, err error) { +func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Role, err error) { result = &v1.Role{} err = c.client.Patch(pt). Namespace(c.ns). Resource("roles"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go index c87e45718..160fc16e6 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1/rolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/rbac/v1" @@ -37,14 +38,14 @@ type RoleBindingsGetter interface { // RoleBindingInterface has methods to work with RoleBinding resources. type RoleBindingInterface interface { - Create(*v1.RoleBinding) (*v1.RoleBinding, error) - Update(*v1.RoleBinding) (*v1.RoleBinding, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.RoleBinding, error) - List(opts metav1.ListOptions) (*v1.RoleBindingList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RoleBinding, err error) + Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (*v1.RoleBinding, error) + Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (*v1.RoleBinding, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.RoleBinding, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.RoleBindingList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) RoleBindingExpansion } @@ -63,20 +64,20 @@ func newRoleBindings(c *RbacV1Client, namespace string) *roleBindings { } // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *roleBindings) Get(name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { +func (c *roleBindings) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.RoleBinding, err error) { result = &v1.RoleBinding{} err = c.client.Get(). Namespace(c.ns). Resource("rolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { +func (c *roleBindings) List(ctx context.Context, opts metav1.ListOptions) (result *v1.RoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *roleBindings) List(opts metav1.ListOptions) (result *v1.RoleBindingList Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested roleBindings. -func (c *roleBindings) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *roleBindings) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *roleBindings) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Create(roleBinding *v1.RoleBinding) (result *v1.RoleBinding, err error) { +func (c *roleBindings) Create(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.CreateOptions) (result *v1.RoleBinding, err error) { result = &v1.RoleBinding{} err = c.client.Post(). Namespace(c.ns). Resource("rolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(roleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Update(roleBinding *v1.RoleBinding) (result *v1.RoleBinding, err error) { +func (c *roleBindings) Update(ctx context.Context, roleBinding *v1.RoleBinding, opts metav1.UpdateOptions) (result *v1.RoleBinding, err error) { result = &v1.RoleBinding{} err = c.client.Put(). Namespace(c.ns). Resource("rolebindings"). Name(roleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(roleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(name string, options *metav1.DeleteOptions) error { +func (c *roleBindings) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *roleBindings) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.RoleBinding, err error) { +func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.RoleBinding, err error) { result = &v1.RoleBinding{} err = c.client.Patch(pt). Namespace(c.ns). Resource("rolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index 77e66877e..678d3711f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -37,14 +38,14 @@ type ClusterRolesGetter interface { // ClusterRoleInterface has methods to work with ClusterRole resources. type ClusterRoleInterface interface { - Create(*v1alpha1.ClusterRole) (*v1alpha1.ClusterRole, error) - Update(*v1alpha1.ClusterRole) (*v1alpha1.ClusterRole, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.ClusterRole, error) - List(opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) + Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (*v1alpha1.ClusterRole, error) + Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (*v1alpha1.ClusterRole, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterRole, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) ClusterRoleExpansion } @@ -61,19 +62,19 @@ func newClusterRoles(c *RbacV1alpha1Client) *clusterRoles { } // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *clusterRoles) Get(name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { +func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRole, err error) { result = &v1alpha1.ClusterRole{} err = c.client.Get(). Resource("clusterroles"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { +func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterRoles) List(opts v1.ListOptions) (result *v1alpha1.ClusterRoleLi Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Create(clusterRole *v1alpha1.ClusterRole) (result *v1alpha1.ClusterRole, err error) { +func (c *clusterRoles) Create(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.CreateOptions) (result *v1alpha1.ClusterRole, err error) { result = &v1alpha1.ClusterRole{} err = c.client.Post(). Resource("clusterroles"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRole). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Update(clusterRole *v1alpha1.ClusterRole) (result *v1alpha1.ClusterRole, err error) { +func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1alpha1.ClusterRole, opts v1.UpdateOptions) (result *v1alpha1.ClusterRole, err error) { result = &v1alpha1.ClusterRole{} err = c.client.Put(). Resource("clusterroles"). Name(clusterRole.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRole). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterroles"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterroles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) { +func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRole, err error) { result = &v1alpha1.ClusterRole{} err = c.client.Patch(pt). Resource("clusterroles"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index 0d1b9d205..7a9ca2953 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -37,14 +38,14 @@ type ClusterRoleBindingsGetter interface { // ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources. type ClusterRoleBindingInterface interface { - Create(*v1alpha1.ClusterRoleBinding) (*v1alpha1.ClusterRoleBinding, error) - Update(*v1alpha1.ClusterRoleBinding) (*v1alpha1.ClusterRoleBinding, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.ClusterRoleBinding, error) - List(opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) + Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (*v1alpha1.ClusterRoleBinding, error) + Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (*v1alpha1.ClusterRoleBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterRoleBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } @@ -61,19 +62,19 @@ func newClusterRoleBindings(c *RbacV1alpha1Client) *clusterRoleBindings { } // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *clusterRoleBindings) Get(name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterRoleBinding, err error) { result = &v1alpha1.ClusterRoleBinding{} err = c.client.Get(). Resource("clusterrolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { +func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1alpha1.Cluste Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Create(clusterRoleBinding *v1alpha1.ClusterRoleBinding) (result *v1alpha1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { result = &v1alpha1.ClusterRoleBinding{} err = c.client.Post(). Resource("clusterrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRoleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Update(clusterRoleBinding *v1alpha1.ClusterRoleBinding) (result *v1alpha1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1alpha1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1alpha1.ClusterRoleBinding, err error) { result = &v1alpha1.ClusterRoleBinding{} err = c.client.Put(). Resource("clusterrolebindings"). Name(clusterRoleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRoleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterrolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { result = &v1alpha1.ClusterRoleBinding{} err = c.client.Patch(pt). Resource("clusterrolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index 4a4b67240..56ec6e373 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -37,14 +38,14 @@ type RolesGetter interface { // RoleInterface has methods to work with Role resources. type RoleInterface interface { - Create(*v1alpha1.Role) (*v1alpha1.Role, error) - Update(*v1alpha1.Role) (*v1alpha1.Role, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Role, error) - List(opts v1.ListOptions) (*v1alpha1.RoleList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) + Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (*v1alpha1.Role, error) + Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (*v1alpha1.Role, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Role, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) RoleExpansion } @@ -63,20 +64,20 @@ func newRoles(c *RbacV1alpha1Client, namespace string) *roles { } // Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *roles) Get(name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { +func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Role, err error) { result = &v1alpha1.Role{} err = c.client.Get(). Namespace(c.ns). Resource("roles"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { +func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *roles) List(opts v1.ListOptions) (result *v1alpha1.RoleList, err error) Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested roles. -func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *roles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Create(role *v1alpha1.Role) (result *v1alpha1.Role, err error) { +func (c *roles) Create(ctx context.Context, role *v1alpha1.Role, opts v1.CreateOptions) (result *v1alpha1.Role, err error) { result = &v1alpha1.Role{} err = c.client.Post(). Namespace(c.ns). Resource("roles"). + VersionedParams(&opts, scheme.ParameterCodec). Body(role). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Update(role *v1alpha1.Role) (result *v1alpha1.Role, err error) { +func (c *roles) Update(ctx context.Context, role *v1alpha1.Role, opts v1.UpdateOptions) (result *v1alpha1.Role, err error) { result = &v1alpha1.Role{} err = c.client.Put(). Namespace(c.ns). Resource("roles"). Name(role.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(role). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(name string, options *v1.DeleteOptions) error { +func (c *roles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("roles"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("roles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched role. -func (c *roles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) { +func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Role, err error) { result = &v1alpha1.Role{} err = c.client.Patch(pt). Namespace(c.ns). Resource("roles"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index bf4e5a10e..b4b1df5dc 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/rbac/v1alpha1" @@ -37,14 +38,14 @@ type RoleBindingsGetter interface { // RoleBindingInterface has methods to work with RoleBinding resources. type RoleBindingInterface interface { - Create(*v1alpha1.RoleBinding) (*v1alpha1.RoleBinding, error) - Update(*v1alpha1.RoleBinding) (*v1alpha1.RoleBinding, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.RoleBinding, error) - List(opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) + Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (*v1alpha1.RoleBinding, error) + Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (*v1alpha1.RoleBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.RoleBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) RoleBindingExpansion } @@ -63,20 +64,20 @@ func newRoleBindings(c *RbacV1alpha1Client, namespace string) *roleBindings { } // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *roleBindings) Get(name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { +func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.RoleBinding, err error) { result = &v1alpha1.RoleBinding{} err = c.client.Get(). Namespace(c.ns). Resource("rolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { +func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.RoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *roleBindings) List(opts v1.ListOptions) (result *v1alpha1.RoleBindingLi Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested roleBindings. -func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *roleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Create(roleBinding *v1alpha1.RoleBinding) (result *v1alpha1.RoleBinding, err error) { +func (c *roleBindings) Create(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.CreateOptions) (result *v1alpha1.RoleBinding, err error) { result = &v1alpha1.RoleBinding{} err = c.client.Post(). Namespace(c.ns). Resource("rolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(roleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Update(roleBinding *v1alpha1.RoleBinding) (result *v1alpha1.RoleBinding, err error) { +func (c *roleBindings) Update(ctx context.Context, roleBinding *v1alpha1.RoleBinding, opts v1.UpdateOptions) (result *v1alpha1.RoleBinding, err error) { result = &v1alpha1.RoleBinding{} err = c.client.Put(). Namespace(c.ns). Resource("rolebindings"). Name(roleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(roleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(name string, options *v1.DeleteOptions) error { +func (c *roleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) { +func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.RoleBinding, err error) { result = &v1alpha1.RoleBinding{} err = c.client.Patch(pt). Namespace(c.ns). Resource("rolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go index 21d3cab37..4db46666a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/rbac/v1beta1" @@ -37,14 +38,14 @@ type ClusterRolesGetter interface { // ClusterRoleInterface has methods to work with ClusterRole resources. type ClusterRoleInterface interface { - Create(*v1beta1.ClusterRole) (*v1beta1.ClusterRole, error) - Update(*v1beta1.ClusterRole) (*v1beta1.ClusterRole, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ClusterRole, error) - List(opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterRole, err error) + Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (*v1beta1.ClusterRole, error) + Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (*v1beta1.ClusterRole, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterRole, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) ClusterRoleExpansion } @@ -61,19 +62,19 @@ func newClusterRoles(c *RbacV1beta1Client) *clusterRoles { } // Get takes name of the clusterRole, and returns the corresponding clusterRole object, and an error if there is any. -func (c *clusterRoles) Get(name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { +func (c *clusterRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRole, err error) { result = &v1beta1.ClusterRole{} err = c.client.Get(). Resource("clusterroles"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. -func (c *clusterRoles) List(opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { +func (c *clusterRoles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterRoles) List(opts v1.ListOptions) (result *v1beta1.ClusterRoleLis Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterRoles. -func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("clusterroles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterRole and creates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Create(clusterRole *v1beta1.ClusterRole) (result *v1beta1.ClusterRole, err error) { +func (c *clusterRoles) Create(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.CreateOptions) (result *v1beta1.ClusterRole, err error) { result = &v1beta1.ClusterRole{} err = c.client.Post(). Resource("clusterroles"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRole). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterRole and updates it. Returns the server's representation of the clusterRole, and an error, if there is any. -func (c *clusterRoles) Update(clusterRole *v1beta1.ClusterRole) (result *v1beta1.ClusterRole, err error) { +func (c *clusterRoles) Update(ctx context.Context, clusterRole *v1beta1.ClusterRole, opts v1.UpdateOptions) (result *v1beta1.ClusterRole, err error) { result = &v1beta1.ClusterRole{} err = c.client.Put(). Resource("clusterroles"). Name(clusterRole.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRole). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterRole and deletes it. Returns an error if one occurs. -func (c *clusterRoles) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterroles"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterroles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterRole, err error) { +func (c *clusterRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRole, err error) { result = &v1beta1.ClusterRole{} err = c.client.Patch(pt). Resource("clusterroles"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index 47eb9e4e7..f45777c23 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/rbac/v1beta1" @@ -37,14 +38,14 @@ type ClusterRoleBindingsGetter interface { // ClusterRoleBindingInterface has methods to work with ClusterRoleBinding resources. type ClusterRoleBindingInterface interface { - Create(*v1beta1.ClusterRoleBinding) (*v1beta1.ClusterRoleBinding, error) - Update(*v1beta1.ClusterRoleBinding) (*v1beta1.ClusterRoleBinding, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ClusterRoleBinding, error) - List(opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) + Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (*v1beta1.ClusterRoleBinding, error) + Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (*v1beta1.ClusterRoleBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterRoleBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterRoleBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } @@ -61,19 +62,19 @@ func newClusterRoleBindings(c *RbacV1beta1Client) *clusterRoleBindings { } // Get takes name of the clusterRoleBinding, and returns the corresponding clusterRoleBinding object, and an error if there is any. -func (c *clusterRoleBindings) Get(name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterRoleBinding, err error) { result = &v1beta1.ClusterRoleBinding{} err = c.client.Get(). Resource("clusterrolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. -func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { +func (c *clusterRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterRoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *clusterRoleBindings) List(opts v1.ListOptions) (result *v1beta1.Cluster Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterRoleBindings. -func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error Resource("clusterrolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterRoleBinding and creates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Create(clusterRoleBinding *v1beta1.ClusterRoleBinding) (result *v1beta1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Create(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.CreateOptions) (result *v1beta1.ClusterRoleBinding, err error) { result = &v1beta1.ClusterRoleBinding{} err = c.client.Post(). Resource("clusterrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRoleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterRoleBinding and updates it. Returns the server's representation of the clusterRoleBinding, and an error, if there is any. -func (c *clusterRoleBindings) Update(clusterRoleBinding *v1beta1.ClusterRoleBinding) (result *v1beta1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Update(ctx context.Context, clusterRoleBinding *v1beta1.ClusterRoleBinding, opts v1.UpdateOptions) (result *v1beta1.ClusterRoleBinding, err error) { result = &v1beta1.ClusterRoleBinding{} err = c.client.Put(). Resource("clusterrolebindings"). Name(clusterRoleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterRoleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterRoleBinding and deletes it. Returns an error if one occurs. -func (c *clusterRoleBindings) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterrolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterRoleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterrolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterRoleBinding, err error) { result = &v1beta1.ClusterRoleBinding{} err = c.client.Patch(pt). Resource("clusterrolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go index 2b61aad52..c172e7f67 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/role.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/rbac/v1beta1" @@ -37,14 +38,14 @@ type RolesGetter interface { // RoleInterface has methods to work with Role resources. type RoleInterface interface { - Create(*v1beta1.Role) (*v1beta1.Role, error) - Update(*v1beta1.Role) (*v1beta1.Role, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Role, error) - List(opts v1.ListOptions) (*v1beta1.RoleList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Role, err error) + Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (*v1beta1.Role, error) + Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (*v1beta1.Role, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Role, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) RoleExpansion } @@ -63,20 +64,20 @@ func newRoles(c *RbacV1beta1Client, namespace string) *roles { } // Get takes name of the role, and returns the corresponding role object, and an error if there is any. -func (c *roles) Get(name string, options v1.GetOptions) (result *v1beta1.Role, err error) { +func (c *roles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Role, err error) { result = &v1beta1.Role{} err = c.client.Get(). Namespace(c.ns). Resource("roles"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Roles that match those selectors. -func (c *roles) List(opts v1.ListOptions) (result *v1beta1.RoleList, err error) { +func (c *roles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *roles) List(opts v1.ListOptions) (result *v1beta1.RoleList, err error) Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested roles. -func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *roles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("roles"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a role and creates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Create(role *v1beta1.Role) (result *v1beta1.Role, err error) { +func (c *roles) Create(ctx context.Context, role *v1beta1.Role, opts v1.CreateOptions) (result *v1beta1.Role, err error) { result = &v1beta1.Role{} err = c.client.Post(). Namespace(c.ns). Resource("roles"). + VersionedParams(&opts, scheme.ParameterCodec). Body(role). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a role and updates it. Returns the server's representation of the role, and an error, if there is any. -func (c *roles) Update(role *v1beta1.Role) (result *v1beta1.Role, err error) { +func (c *roles) Update(ctx context.Context, role *v1beta1.Role, opts v1.UpdateOptions) (result *v1beta1.Role, err error) { result = &v1beta1.Role{} err = c.client.Put(). Namespace(c.ns). Resource("roles"). Name(role.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(role). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the role and deletes it. Returns an error if one occurs. -func (c *roles) Delete(name string, options *v1.DeleteOptions) error { +func (c *roles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("roles"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roles) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("roles"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched role. -func (c *roles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Role, err error) { +func (c *roles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Role, err error) { result = &v1beta1.Role{} err = c.client.Patch(pt). Namespace(c.ns). Resource("roles"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go index 0bd118fdf..f37bfb744 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/rbac/v1beta1" @@ -37,14 +38,14 @@ type RoleBindingsGetter interface { // RoleBindingInterface has methods to work with RoleBinding resources. type RoleBindingInterface interface { - Create(*v1beta1.RoleBinding) (*v1beta1.RoleBinding, error) - Update(*v1beta1.RoleBinding) (*v1beta1.RoleBinding, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.RoleBinding, error) - List(opts v1.ListOptions) (*v1beta1.RoleBindingList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.RoleBinding, err error) + Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (*v1beta1.RoleBinding, error) + Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (*v1beta1.RoleBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RoleBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RoleBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) RoleBindingExpansion } @@ -63,20 +64,20 @@ func newRoleBindings(c *RbacV1beta1Client, namespace string) *roleBindings { } // Get takes name of the roleBinding, and returns the corresponding roleBinding object, and an error if there is any. -func (c *roleBindings) Get(name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { +func (c *roleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RoleBinding, err error) { result = &v1beta1.RoleBinding{} err = c.client.Get(). Namespace(c.ns). Resource("rolebindings"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. -func (c *roleBindings) List(opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { +func (c *roleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RoleBindingList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *roleBindings) List(opts v1.ListOptions) (result *v1beta1.RoleBindingLis Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested roleBindings. -func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *roleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("rolebindings"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a roleBinding and creates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Create(roleBinding *v1beta1.RoleBinding) (result *v1beta1.RoleBinding, err error) { +func (c *roleBindings) Create(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.CreateOptions) (result *v1beta1.RoleBinding, err error) { result = &v1beta1.RoleBinding{} err = c.client.Post(). Namespace(c.ns). Resource("rolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). Body(roleBinding). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a roleBinding and updates it. Returns the server's representation of the roleBinding, and an error, if there is any. -func (c *roleBindings) Update(roleBinding *v1beta1.RoleBinding) (result *v1beta1.RoleBinding, err error) { +func (c *roleBindings) Update(ctx context.Context, roleBinding *v1beta1.RoleBinding, opts v1.UpdateOptions) (result *v1beta1.RoleBinding, err error) { result = &v1beta1.RoleBinding{} err = c.client.Put(). Namespace(c.ns). Resource("rolebindings"). Name(roleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(roleBinding). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the roleBinding and deletes it. Returns an error if one occurs. -func (c *roleBindings) Delete(name string, options *v1.DeleteOptions) error { +func (c *roleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *roleBindings) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *roleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("rolebindings"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.RoleBinding, err error) { +func (c *roleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RoleBinding, err error) { result = &v1beta1.RoleBinding{} err = c.client.Patch(pt). Namespace(c.ns). Resource("rolebindings"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go index 3abbb7b8e..06185d5fb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1/priorityclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/scheduling/v1" @@ -37,14 +38,14 @@ type PriorityClassesGetter interface { // PriorityClassInterface has methods to work with PriorityClass resources. type PriorityClassInterface interface { - Create(*v1.PriorityClass) (*v1.PriorityClass, error) - Update(*v1.PriorityClass) (*v1.PriorityClass, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.PriorityClass, error) - List(opts metav1.ListOptions) (*v1.PriorityClassList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PriorityClass, err error) + Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (*v1.PriorityClass, error) + Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (*v1.PriorityClass, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PriorityClass, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PriorityClassList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) PriorityClassExpansion } @@ -61,19 +62,19 @@ func newPriorityClasses(c *SchedulingV1Client) *priorityClasses { } // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *priorityClasses) Get(name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { +func (c *priorityClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PriorityClass, err error) { result = &v1.PriorityClass{} err = c.client.Get(). Resource("priorityclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { +func (c *priorityClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PriorityClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *priorityClasses) List(opts metav1.ListOptions) (result *v1.PriorityClas Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *priorityClasses) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *priorityClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *priorityClasses) Watch(opts metav1.ListOptions) (watch.Interface, error Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Create(priorityClass *v1.PriorityClass) (result *v1.PriorityClass, err error) { +func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.CreateOptions) (result *v1.PriorityClass, err error) { result = &v1.PriorityClass{} err = c.client.Post(). Resource("priorityclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Update(priorityClass *v1.PriorityClass) (result *v1.PriorityClass, err error) { +func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1.PriorityClass, opts metav1.UpdateOptions) (result *v1.PriorityClass, err error) { result = &v1.PriorityClass{} err = c.client.Put(). Resource("priorityclasses"). Name(priorityClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(name string, options *metav1.DeleteOptions) error { +func (c *priorityClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("priorityclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *priorityClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("priorityclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched priorityClass. -func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PriorityClass, err error) { +func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PriorityClass, err error) { result = &v1.PriorityClass{} err = c.client.Patch(pt). Resource("priorityclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 29d646fb1..ae9875e9a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/scheduling/v1alpha1" @@ -37,14 +38,14 @@ type PriorityClassesGetter interface { // PriorityClassInterface has methods to work with PriorityClass resources. type PriorityClassInterface interface { - Create(*v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error) - Update(*v1alpha1.PriorityClass) (*v1alpha1.PriorityClass, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.PriorityClass, error) - List(opts v1.ListOptions) (*v1alpha1.PriorityClassList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) + Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (*v1alpha1.PriorityClass, error) + Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (*v1alpha1.PriorityClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PriorityClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PriorityClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) PriorityClassExpansion } @@ -61,19 +62,19 @@ func newPriorityClasses(c *SchedulingV1alpha1Client) *priorityClasses { } // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { +func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PriorityClass, err error) { result = &v1alpha1.PriorityClass{} err = c.client.Get(). Resource("priorityclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { +func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PriorityClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *priorityClasses) List(opts v1.ListOptions) (result *v1alpha1.PriorityCl Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Create(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) { +func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.CreateOptions) (result *v1alpha1.PriorityClass, err error) { result = &v1alpha1.PriorityClass{} err = c.client.Post(). Resource("priorityclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Update(priorityClass *v1alpha1.PriorityClass) (result *v1alpha1.PriorityClass, err error) { +func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1alpha1.PriorityClass, opts v1.UpdateOptions) (result *v1alpha1.PriorityClass, err error) { result = &v1alpha1.PriorityClass{} err = c.client.Put(). Resource("priorityclasses"). Name(priorityClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error { +func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("priorityclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *priorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("priorityclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched priorityClass. -func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PriorityClass, err error) { +func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PriorityClass, err error) { result = &v1alpha1.PriorityClass{} err = c.client.Patch(pt). Resource("priorityclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go index 5e402f8e3..70ed597bb 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/scheduling/v1beta1" @@ -37,14 +38,14 @@ type PriorityClassesGetter interface { // PriorityClassInterface has methods to work with PriorityClass resources. type PriorityClassInterface interface { - Create(*v1beta1.PriorityClass) (*v1beta1.PriorityClass, error) - Update(*v1beta1.PriorityClass) (*v1beta1.PriorityClass, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.PriorityClass, error) - List(opts v1.ListOptions) (*v1beta1.PriorityClassList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error) + Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (*v1beta1.PriorityClass, error) + Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (*v1beta1.PriorityClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.PriorityClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PriorityClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) PriorityClassExpansion } @@ -61,19 +62,19 @@ func newPriorityClasses(c *SchedulingV1beta1Client) *priorityClasses { } // Get takes name of the priorityClass, and returns the corresponding priorityClass object, and an error if there is any. -func (c *priorityClasses) Get(name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { +func (c *priorityClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.PriorityClass, err error) { result = &v1beta1.PriorityClass{} err = c.client.Get(). Resource("priorityclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. -func (c *priorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { +func (c *priorityClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PriorityClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *priorityClasses) List(opts v1.ListOptions) (result *v1beta1.PriorityCla Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested priorityClasses. -func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *priorityClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *priorityClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("priorityclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a priorityClass and creates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Create(priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) { +func (c *priorityClasses) Create(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.CreateOptions) (result *v1beta1.PriorityClass, err error) { result = &v1beta1.PriorityClass{} err = c.client.Post(). Resource("priorityclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a priorityClass and updates it. Returns the server's representation of the priorityClass, and an error, if there is any. -func (c *priorityClasses) Update(priorityClass *v1beta1.PriorityClass) (result *v1beta1.PriorityClass, err error) { +func (c *priorityClasses) Update(ctx context.Context, priorityClass *v1beta1.PriorityClass, opts v1.UpdateOptions) (result *v1beta1.PriorityClass, err error) { result = &v1beta1.PriorityClass{} err = c.client.Put(). Resource("priorityclasses"). Name(priorityClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(priorityClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the priorityClass and deletes it. Returns an error if one occurs. -func (c *priorityClasses) Delete(name string, options *v1.DeleteOptions) error { +func (c *priorityClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("priorityclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *priorityClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *priorityClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("priorityclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched priorityClass. -func (c *priorityClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PriorityClass, err error) { +func (c *priorityClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.PriorityClass, err error) { result = &v1beta1.PriorityClass{} err = c.client.Patch(pt). Resource("priorityclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go index 8fd6adc56..aa1cb364e 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/settings/v1alpha1/podpreset.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/settings/v1alpha1" @@ -37,14 +38,14 @@ type PodPresetsGetter interface { // PodPresetInterface has methods to work with PodPreset resources. type PodPresetInterface interface { - Create(*v1alpha1.PodPreset) (*v1alpha1.PodPreset, error) - Update(*v1alpha1.PodPreset) (*v1alpha1.PodPreset, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.PodPreset, error) - List(opts v1.ListOptions) (*v1alpha1.PodPresetList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodPreset, err error) + Create(ctx context.Context, podPreset *v1alpha1.PodPreset, opts v1.CreateOptions) (*v1alpha1.PodPreset, error) + Update(ctx context.Context, podPreset *v1alpha1.PodPreset, opts v1.UpdateOptions) (*v1alpha1.PodPreset, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PodPreset, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PodPresetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PodPreset, err error) PodPresetExpansion } @@ -63,20 +64,20 @@ func newPodPresets(c *SettingsV1alpha1Client, namespace string) *podPresets { } // Get takes name of the podPreset, and returns the corresponding podPreset object, and an error if there is any. -func (c *podPresets) Get(name string, options v1.GetOptions) (result *v1alpha1.PodPreset, err error) { +func (c *podPresets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PodPreset, err error) { result = &v1alpha1.PodPreset{} err = c.client.Get(). Namespace(c.ns). Resource("podpresets"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of PodPresets that match those selectors. -func (c *podPresets) List(opts v1.ListOptions) (result *v1alpha1.PodPresetList, err error) { +func (c *podPresets) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PodPresetList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -87,13 +88,13 @@ func (c *podPresets) List(opts v1.ListOptions) (result *v1alpha1.PodPresetList, Resource("podpresets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested podPresets. -func (c *podPresets) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *podPresets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -104,71 +105,74 @@ func (c *podPresets) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("podpresets"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a podPreset and creates it. Returns the server's representation of the podPreset, and an error, if there is any. -func (c *podPresets) Create(podPreset *v1alpha1.PodPreset) (result *v1alpha1.PodPreset, err error) { +func (c *podPresets) Create(ctx context.Context, podPreset *v1alpha1.PodPreset, opts v1.CreateOptions) (result *v1alpha1.PodPreset, err error) { result = &v1alpha1.PodPreset{} err = c.client.Post(). Namespace(c.ns). Resource("podpresets"). + VersionedParams(&opts, scheme.ParameterCodec). Body(podPreset). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a podPreset and updates it. Returns the server's representation of the podPreset, and an error, if there is any. -func (c *podPresets) Update(podPreset *v1alpha1.PodPreset) (result *v1alpha1.PodPreset, err error) { +func (c *podPresets) Update(ctx context.Context, podPreset *v1alpha1.PodPreset, opts v1.UpdateOptions) (result *v1alpha1.PodPreset, err error) { result = &v1alpha1.PodPreset{} err = c.client.Put(). Namespace(c.ns). Resource("podpresets"). Name(podPreset.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(podPreset). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the podPreset and deletes it. Returns an error if one occurs. -func (c *podPresets) Delete(name string, options *v1.DeleteOptions) error { +func (c *podPresets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("podpresets"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *podPresets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *podPresets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("podpresets"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched podPreset. -func (c *podPresets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodPreset, err error) { +func (c *podPresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PodPreset, err error) { result = &v1alpha1.PodPreset{} err = c.client.Patch(pt). Namespace(c.ns). Resource("podpresets"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csidriver.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csidriver.go new file mode 100644 index 000000000..92e82251d --- /dev/null +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csidriver.go @@ -0,0 +1,168 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// CSIDriversGetter has a method to return a CSIDriverInterface. +// A group's client should implement this interface. +type CSIDriversGetter interface { + CSIDrivers() CSIDriverInterface +} + +// CSIDriverInterface has methods to work with CSIDriver resources. +type CSIDriverInterface interface { + Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (*v1.CSIDriver, error) + Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (*v1.CSIDriver, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSIDriver, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CSIDriverList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) + CSIDriverExpansion +} + +// cSIDrivers implements CSIDriverInterface +type cSIDrivers struct { + client rest.Interface +} + +// newCSIDrivers returns a CSIDrivers +func newCSIDrivers(c *StorageV1Client) *cSIDrivers { + return &cSIDrivers{ + client: c.RESTClient(), + } +} + +// Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. +func (c *cSIDrivers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSIDriver, err error) { + result = &v1.CSIDriver{} + err = c.client.Get(). + Resource("csidrivers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. +func (c *cSIDrivers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSIDriverList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.CSIDriverList{} + err = c.client.Get(). + Resource("csidrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested cSIDrivers. +func (c *cSIDrivers) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("csidrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. +func (c *cSIDrivers) Create(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.CreateOptions) (result *v1.CSIDriver, err error) { + result = &v1.CSIDriver{} + err = c.client.Post(). + Resource("csidrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cSIDriver). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. +func (c *cSIDrivers) Update(ctx context.Context, cSIDriver *v1.CSIDriver, opts metav1.UpdateOptions) (result *v1.CSIDriver, err error) { + result = &v1.CSIDriver{} + err = c.client.Put(). + Resource("csidrivers"). + Name(cSIDriver.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cSIDriver). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. +func (c *cSIDrivers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("csidrivers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *cSIDrivers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("csidrivers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cSIDriver. +func (c *cSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSIDriver, err error) { + result = &v1.CSIDriver{} + err = c.client.Patch(pt). + Resource("csidrivers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go index 209054175..f8ba24544 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/csinode.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/storage/v1" @@ -37,14 +38,14 @@ type CSINodesGetter interface { // CSINodeInterface has methods to work with CSINode resources. type CSINodeInterface interface { - Create(*v1.CSINode) (*v1.CSINode, error) - Update(*v1.CSINode) (*v1.CSINode, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.CSINode, error) - List(opts metav1.ListOptions) (*v1.CSINodeList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CSINode, err error) + Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (*v1.CSINode, error) + Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (*v1.CSINode, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.CSINode, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.CSINodeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) CSINodeExpansion } @@ -61,19 +62,19 @@ func newCSINodes(c *StorageV1Client) *cSINodes { } // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. -func (c *cSINodes) Get(name string, options metav1.GetOptions) (result *v1.CSINode, err error) { +func (c *cSINodes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.CSINode, err error) { result = &v1.CSINode{} err = c.client.Get(). Resource("csinodes"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) List(opts metav1.ListOptions) (result *v1.CSINodeList, err error) { +func (c *cSINodes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.CSINodeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *cSINodes) List(opts metav1.ListOptions) (result *v1.CSINodeList, err er Resource("csinodes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested cSINodes. -func (c *cSINodes) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *cSINodes) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *cSINodes) Watch(opts metav1.ListOptions) (watch.Interface, error) { Resource("csinodes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Create(cSINode *v1.CSINode) (result *v1.CSINode, err error) { +func (c *cSINodes) Create(ctx context.Context, cSINode *v1.CSINode, opts metav1.CreateOptions) (result *v1.CSINode, err error) { result = &v1.CSINode{} err = c.client.Post(). Resource("csinodes"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cSINode). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Update(cSINode *v1.CSINode) (result *v1.CSINode, err error) { +func (c *cSINodes) Update(ctx context.Context, cSINode *v1.CSINode, opts metav1.UpdateOptions) (result *v1.CSINode, err error) { result = &v1.CSINode{} err = c.client.Put(). Resource("csinodes"). Name(cSINode.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(cSINode). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *cSINodes) Delete(name string, options *metav1.DeleteOptions) error { +func (c *cSINodes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("csinodes"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cSINodes) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *cSINodes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("csinodes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched cSINode. -func (c *cSINodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.CSINode, err error) { +func (c *cSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.CSINode, err error) { result = &v1.CSINode{} err = c.client.Patch(pt). Resource("csinodes"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go index d147620ae..af8111776 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/generated_expansion.go @@ -18,6 +18,8 @@ limitations under the License. package v1 +type CSIDriverExpansion interface{} + type CSINodeExpansion interface{} type StorageClassExpansion interface{} diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go index 822f08914..f03beae85 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storage_client.go @@ -26,6 +26,7 @@ import ( type StorageV1Interface interface { RESTClient() rest.Interface + CSIDriversGetter CSINodesGetter StorageClassesGetter VolumeAttachmentsGetter @@ -36,6 +37,10 @@ type StorageV1Client struct { restClient rest.Interface } +func (c *StorageV1Client) CSIDrivers() CSIDriverInterface { + return newCSIDrivers(c) +} + func (c *StorageV1Client) CSINodes() CSINodeInterface { return newCSINodes(c) } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go index 3f4c48f0a..046ec3a1b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/storageclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/storage/v1" @@ -37,14 +38,14 @@ type StorageClassesGetter interface { // StorageClassInterface has methods to work with StorageClass resources. type StorageClassInterface interface { - Create(*v1.StorageClass) (*v1.StorageClass, error) - Update(*v1.StorageClass) (*v1.StorageClass, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.StorageClass, error) - List(opts metav1.ListOptions) (*v1.StorageClassList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) + Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (*v1.StorageClass, error) + Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (*v1.StorageClass, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.StorageClass, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.StorageClassList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) StorageClassExpansion } @@ -61,19 +62,19 @@ func newStorageClasses(c *StorageV1Client) *storageClasses { } // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. -func (c *storageClasses) Get(name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { +func (c *storageClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.StorageClass, err error) { result = &v1.StorageClass{} err = c.client.Get(). Resource("storageclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) List(opts metav1.ListOptions) (result *v1.StorageClassList, err error) { +func (c *storageClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.StorageClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *storageClasses) List(opts metav1.ListOptions) (result *v1.StorageClassL Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested storageClasses. -func (c *storageClasses) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *storageClasses) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *storageClasses) Watch(opts metav1.ListOptions) (watch.Interface, error) Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Create(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) { +func (c *storageClasses) Create(ctx context.Context, storageClass *v1.StorageClass, opts metav1.CreateOptions) (result *v1.StorageClass, err error) { result = &v1.StorageClass{} err = c.client.Post(). Resource("storageclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(storageClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Update(storageClass *v1.StorageClass) (result *v1.StorageClass, err error) { +func (c *storageClasses) Update(ctx context.Context, storageClass *v1.StorageClass, opts metav1.UpdateOptions) (result *v1.StorageClass, err error) { result = &v1.StorageClass{} err = c.client.Put(). Resource("storageclasses"). Name(storageClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(storageClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *storageClasses) Delete(name string, options *metav1.DeleteOptions) error { +func (c *storageClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("storageclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *storageClasses) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *storageClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("storageclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched storageClass. -func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.StorageClass, err error) { +func (c *storageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.StorageClass, err error) { result = &v1.StorageClass{} err = c.client.Patch(pt). Resource("storageclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go index 0f45097b2..e4162975f 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1/volumeattachment.go @@ -19,6 +19,7 @@ limitations under the License. package v1 import ( + "context" "time" v1 "k8s.io/api/storage/v1" @@ -37,15 +38,15 @@ type VolumeAttachmentsGetter interface { // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { - Create(*v1.VolumeAttachment) (*v1.VolumeAttachment, error) - Update(*v1.VolumeAttachment) (*v1.VolumeAttachment, error) - UpdateStatus(*v1.VolumeAttachment) (*v1.VolumeAttachment, error) - Delete(name string, options *metav1.DeleteOptions) error - DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error - Get(name string, options metav1.GetOptions) (*v1.VolumeAttachment, error) - List(opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) - Watch(opts metav1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeAttachment, err error) + Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (*v1.VolumeAttachment, error) + Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) + UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (*v1.VolumeAttachment, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VolumeAttachment, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VolumeAttachmentList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) VolumeAttachmentExpansion } @@ -62,19 +63,19 @@ func newVolumeAttachments(c *StorageV1Client) *volumeAttachments { } // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *volumeAttachments) Get(name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { +func (c *volumeAttachments) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VolumeAttachment, err error) { result = &v1.VolumeAttachment{} err = c.client.Get(). Resource("volumeattachments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { +func (c *volumeAttachments) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *volumeAttachments) List(opts metav1.ListOptions) (result *v1.VolumeAtta Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *volumeAttachments) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c *volumeAttachments) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *volumeAttachments) Watch(opts metav1.ListOptions) (watch.Interface, err Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Create(volumeAttachment *v1.VolumeAttachment) (result *v1.VolumeAttachment, err error) { +func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.CreateOptions) (result *v1.VolumeAttachment, err error) { result = &v1.VolumeAttachment{} err = c.client.Post(). Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Update(volumeAttachment *v1.VolumeAttachment) (result *v1.VolumeAttachment, err error) { +func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { result = &v1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1.VolumeAttachment) (result *v1.VolumeAttachment, err error) { +func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1.VolumeAttachment, opts metav1.UpdateOptions) (result *v1.VolumeAttachment, err error) { result = &v1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(name string, options *metav1.DeleteOptions) error { +func (c *volumeAttachments) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { +func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched volumeAttachment. -func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.VolumeAttachment, err error) { +func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VolumeAttachment, err error) { result = &v1.VolumeAttachment{} err = c.client.Patch(pt). Resource("volumeattachments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go index 7fef94e8d..9012fde99 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -19,6 +19,7 @@ limitations under the License. package v1alpha1 import ( + "context" "time" v1alpha1 "k8s.io/api/storage/v1alpha1" @@ -37,15 +38,15 @@ type VolumeAttachmentsGetter interface { // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { - Create(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error) - Update(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error) - UpdateStatus(*v1alpha1.VolumeAttachment) (*v1alpha1.VolumeAttachment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.VolumeAttachment, error) - List(opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) + Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (*v1alpha1.VolumeAttachment, error) + Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) + UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (*v1alpha1.VolumeAttachment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.VolumeAttachment, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.VolumeAttachmentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) VolumeAttachmentExpansion } @@ -62,19 +63,19 @@ func newVolumeAttachments(c *StorageV1alpha1Client) *volumeAttachments { } // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { +func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.VolumeAttachment, err error) { result = &v1alpha1.VolumeAttachment{} err = c.client.Get(). Resource("volumeattachments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { +func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1alpha1.VolumeAt Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *volumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Create(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) { +func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.CreateOptions) (result *v1alpha1.VolumeAttachment, err error) { result = &v1alpha1.VolumeAttachment{} err = c.client.Post(). Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Update(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) { +func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { result = &v1alpha1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1alpha1.VolumeAttachment) (result *v1alpha1.VolumeAttachment, err error) { +func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1alpha1.VolumeAttachment, opts v1.UpdateOptions) (result *v1alpha1.VolumeAttachment, err error) { result = &v1alpha1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error { +func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched volumeAttachment. -func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { +func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.VolumeAttachment, err error) { result = &v1alpha1.VolumeAttachment{} err = c.client.Patch(pt). Resource("volumeattachments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go index 86cf9bf18..2ad263042 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csidriver.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/storage/v1beta1" @@ -37,14 +38,14 @@ type CSIDriversGetter interface { // CSIDriverInterface has methods to work with CSIDriver resources. type CSIDriverInterface interface { - Create(*v1beta1.CSIDriver) (*v1beta1.CSIDriver, error) - Update(*v1beta1.CSIDriver) (*v1beta1.CSIDriver, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.CSIDriver, error) - List(opts v1.ListOptions) (*v1beta1.CSIDriverList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CSIDriver, err error) + Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (*v1beta1.CSIDriver, error) + Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (*v1beta1.CSIDriver, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSIDriver, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSIDriverList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) CSIDriverExpansion } @@ -61,19 +62,19 @@ func newCSIDrivers(c *StorageV1beta1Client) *cSIDrivers { } // Get takes name of the cSIDriver, and returns the corresponding cSIDriver object, and an error if there is any. -func (c *cSIDrivers) Get(name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { +func (c *cSIDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSIDriver, err error) { result = &v1beta1.CSIDriver{} err = c.client.Get(). Resource("csidrivers"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. -func (c *cSIDrivers) List(opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { +func (c *cSIDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSIDriverList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *cSIDrivers) List(opts v1.ListOptions) (result *v1beta1.CSIDriverList, e Resource("csidrivers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested cSIDrivers. -func (c *cSIDrivers) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *cSIDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *cSIDrivers) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("csidrivers"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a cSIDriver and creates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Create(cSIDriver *v1beta1.CSIDriver) (result *v1beta1.CSIDriver, err error) { +func (c *cSIDrivers) Create(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.CreateOptions) (result *v1beta1.CSIDriver, err error) { result = &v1beta1.CSIDriver{} err = c.client.Post(). Resource("csidrivers"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cSIDriver). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a cSIDriver and updates it. Returns the server's representation of the cSIDriver, and an error, if there is any. -func (c *cSIDrivers) Update(cSIDriver *v1beta1.CSIDriver) (result *v1beta1.CSIDriver, err error) { +func (c *cSIDrivers) Update(ctx context.Context, cSIDriver *v1beta1.CSIDriver, opts v1.UpdateOptions) (result *v1beta1.CSIDriver, err error) { result = &v1beta1.CSIDriver{} err = c.client.Put(). Resource("csidrivers"). Name(cSIDriver.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(cSIDriver). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the cSIDriver and deletes it. Returns an error if one occurs. -func (c *cSIDrivers) Delete(name string, options *v1.DeleteOptions) error { +func (c *cSIDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("csidrivers"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cSIDrivers) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cSIDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("csidrivers"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched cSIDriver. -func (c *cSIDrivers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CSIDriver, err error) { +func (c *cSIDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSIDriver, err error) { result = &v1beta1.CSIDriver{} err = c.client.Patch(pt). Resource("csidrivers"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go index e5540c128..babb89aba 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/csinode.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/storage/v1beta1" @@ -37,14 +38,14 @@ type CSINodesGetter interface { // CSINodeInterface has methods to work with CSINode resources. type CSINodeInterface interface { - Create(*v1beta1.CSINode) (*v1beta1.CSINode, error) - Update(*v1beta1.CSINode) (*v1beta1.CSINode, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.CSINode, error) - List(opts v1.ListOptions) (*v1beta1.CSINodeList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CSINode, err error) + Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (*v1beta1.CSINode, error) + Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (*v1beta1.CSINode, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.CSINode, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.CSINodeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) CSINodeExpansion } @@ -61,19 +62,19 @@ func newCSINodes(c *StorageV1beta1Client) *cSINodes { } // Get takes name of the cSINode, and returns the corresponding cSINode object, and an error if there is any. -func (c *cSINodes) Get(name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { +func (c *cSINodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.CSINode, err error) { result = &v1beta1.CSINode{} err = c.client.Get(). Resource("csinodes"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of CSINodes that match those selectors. -func (c *cSINodes) List(opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { +func (c *cSINodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.CSINodeList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *cSINodes) List(opts v1.ListOptions) (result *v1beta1.CSINodeList, err e Resource("csinodes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested cSINodes. -func (c *cSINodes) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *cSINodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *cSINodes) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("csinodes"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a cSINode and creates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Create(cSINode *v1beta1.CSINode) (result *v1beta1.CSINode, err error) { +func (c *cSINodes) Create(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.CreateOptions) (result *v1beta1.CSINode, err error) { result = &v1beta1.CSINode{} err = c.client.Post(). Resource("csinodes"). + VersionedParams(&opts, scheme.ParameterCodec). Body(cSINode). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a cSINode and updates it. Returns the server's representation of the cSINode, and an error, if there is any. -func (c *cSINodes) Update(cSINode *v1beta1.CSINode) (result *v1beta1.CSINode, err error) { +func (c *cSINodes) Update(ctx context.Context, cSINode *v1beta1.CSINode, opts v1.UpdateOptions) (result *v1beta1.CSINode, err error) { result = &v1beta1.CSINode{} err = c.client.Put(). Resource("csinodes"). Name(cSINode.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(cSINode). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the cSINode and deletes it. Returns an error if one occurs. -func (c *cSINodes) Delete(name string, options *v1.DeleteOptions) error { +func (c *cSINodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("csinodes"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *cSINodes) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *cSINodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("csinodes"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched cSINode. -func (c *cSINodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.CSINode, err error) { +func (c *cSINodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.CSINode, err error) { result = &v1beta1.CSINode{} err = c.client.Patch(pt). Resource("csinodes"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index 8a8f38916..d6a8da98a 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/storage/v1beta1" @@ -37,14 +38,14 @@ type StorageClassesGetter interface { // StorageClassInterface has methods to work with StorageClass resources. type StorageClassInterface interface { - Create(*v1beta1.StorageClass) (*v1beta1.StorageClass, error) - Update(*v1beta1.StorageClass) (*v1beta1.StorageClass, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.StorageClass, error) - List(opts v1.ListOptions) (*v1beta1.StorageClassList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) + Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (*v1beta1.StorageClass, error) + Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (*v1beta1.StorageClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.StorageClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.StorageClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) StorageClassExpansion } @@ -61,19 +62,19 @@ func newStorageClasses(c *StorageV1beta1Client) *storageClasses { } // Get takes name of the storageClass, and returns the corresponding storageClass object, and an error if there is any. -func (c *storageClasses) Get(name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { +func (c *storageClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.StorageClass, err error) { result = &v1beta1.StorageClass{} err = c.client.Get(). Resource("storageclasses"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. -func (c *storageClasses) List(opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { +func (c *storageClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.StorageClassList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -83,13 +84,13 @@ func (c *storageClasses) List(opts v1.ListOptions) (result *v1beta1.StorageClass Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested storageClasses. -func (c *storageClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *storageClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -99,66 +100,69 @@ func (c *storageClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("storageclasses"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a storageClass and creates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Create(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) { +func (c *storageClasses) Create(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.CreateOptions) (result *v1beta1.StorageClass, err error) { result = &v1beta1.StorageClass{} err = c.client.Post(). Resource("storageclasses"). + VersionedParams(&opts, scheme.ParameterCodec). Body(storageClass). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a storageClass and updates it. Returns the server's representation of the storageClass, and an error, if there is any. -func (c *storageClasses) Update(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) { +func (c *storageClasses) Update(ctx context.Context, storageClass *v1beta1.StorageClass, opts v1.UpdateOptions) (result *v1beta1.StorageClass, err error) { result = &v1beta1.StorageClass{} err = c.client.Put(). Resource("storageclasses"). Name(storageClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(storageClass). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the storageClass and deletes it. Returns an error if one occurs. -func (c *storageClasses) Delete(name string, options *v1.DeleteOptions) error { +func (c *storageClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("storageclasses"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *storageClasses) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *storageClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("storageclasses"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched storageClass. -func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) { +func (c *storageClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.StorageClass, err error) { result = &v1beta1.StorageClass{} err = c.client.Patch(pt). Resource("storageclasses"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go index d319407f2..951a5e71b 100644 --- a/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/vendor/k8s.io/client-go/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -19,6 +19,7 @@ limitations under the License. package v1beta1 import ( + "context" "time" v1beta1 "k8s.io/api/storage/v1beta1" @@ -37,15 +38,15 @@ type VolumeAttachmentsGetter interface { // VolumeAttachmentInterface has methods to work with VolumeAttachment resources. type VolumeAttachmentInterface interface { - Create(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) - Update(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) - UpdateStatus(*v1beta1.VolumeAttachment) (*v1beta1.VolumeAttachment, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.VolumeAttachment, error) - List(opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) + Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (*v1beta1.VolumeAttachment, error) + Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) + UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (*v1beta1.VolumeAttachment, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeAttachment, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeAttachmentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) VolumeAttachmentExpansion } @@ -62,19 +63,19 @@ func newVolumeAttachments(c *StorageV1beta1Client) *volumeAttachments { } // Get takes name of the volumeAttachment, and returns the corresponding volumeAttachment object, and an error if there is any. -func (c *volumeAttachments) Get(name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { +func (c *volumeAttachments) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Get(). Resource("volumeattachments"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. -func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { +func (c *volumeAttachments) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeAttachmentList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -84,13 +85,13 @@ func (c *volumeAttachments) List(opts v1.ListOptions) (result *v1beta1.VolumeAtt Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested volumeAttachments. -func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *volumeAttachments) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -100,81 +101,84 @@ func (c *volumeAttachments) Watch(opts v1.ListOptions) (watch.Interface, error) Resource("volumeattachments"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a volumeAttachment and creates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Create(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { +func (c *volumeAttachments) Create(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.CreateOptions) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Post(). Resource("volumeattachments"). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a volumeAttachment and updates it. Returns the server's representation of the volumeAttachment, and an error, if there is any. -func (c *volumeAttachments) Update(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { +func (c *volumeAttachments) Update(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *volumeAttachments) UpdateStatus(volumeAttachment *v1beta1.VolumeAttachment) (result *v1beta1.VolumeAttachment, err error) { +func (c *volumeAttachments) UpdateStatus(ctx context.Context, volumeAttachment *v1beta1.VolumeAttachment, opts v1.UpdateOptions) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Put(). Resource("volumeattachments"). Name(volumeAttachment.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(volumeAttachment). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the volumeAttachment and deletes it. Returns an error if one occurs. -func (c *volumeAttachments) Delete(name string, options *v1.DeleteOptions) error { +func (c *volumeAttachments) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("volumeattachments"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *volumeAttachments) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *volumeAttachments) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("volumeattachments"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched volumeAttachment. -func (c *volumeAttachments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { +func (c *volumeAttachments) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeAttachment, err error) { result = &v1beta1.VolumeAttachment{} err = c.client.Patch(pt). Resource("volumeattachments"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/client-go/listers/apps/v1/deployment_expansion.go b/vendor/k8s.io/client-go/listers/apps/v1/deployment_expansion.go deleted file mode 100644 index 7802eca5a..000000000 --- a/vendor/k8s.io/client-go/listers/apps/v1/deployment_expansion.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "fmt" - - apps "k8s.io/api/apps/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" -) - -// DeploymentListerExpansion allows custom methods to be added to -// DeploymentLister. -type DeploymentListerExpansion interface { - GetDeploymentsForReplicaSet(rs *apps.ReplicaSet) ([]*apps.Deployment, error) -} - -// DeploymentNamespaceListerExpansion allows custom methods to be added to -// DeploymentNamespaceLister. -type DeploymentNamespaceListerExpansion interface{} - -// GetDeploymentsForReplicaSet returns a list of Deployments that potentially -// match a ReplicaSet. Only the one specified in the ReplicaSet's ControllerRef -// will actually manage it. -// Returns an error only if no matching Deployments are found. -func (s *deploymentLister) GetDeploymentsForReplicaSet(rs *apps.ReplicaSet) ([]*apps.Deployment, error) { - if len(rs.Labels) == 0 { - return nil, fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name) - } - - // TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label - dList, err := s.Deployments(rs.Namespace).List(labels.Everything()) - if err != nil { - return nil, err - } - - var deployments []*apps.Deployment - for _, d := range dList { - selector, err := metav1.LabelSelectorAsSelector(d.Spec.Selector) - if err != nil { - return nil, fmt.Errorf("invalid label selector: %v", err) - } - // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. - if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) { - continue - } - deployments = append(deployments, d) - } - - if len(deployments) == 0 { - return nil, fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels) - } - - return deployments, nil -} diff --git a/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go index 7f5815f79..0c357589d 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1/expansion_generated.go @@ -25,3 +25,11 @@ type ControllerRevisionListerExpansion interface{} // ControllerRevisionNamespaceListerExpansion allows custom methods to be added to // ControllerRevisionNamespaceLister. type ControllerRevisionNamespaceListerExpansion interface{} + +// DeploymentListerExpansion allows custom methods to be added to +// DeploymentLister. +type DeploymentListerExpansion interface{} + +// DeploymentNamespaceListerExpansion allows custom methods to be added to +// DeploymentNamespaceLister. +type DeploymentNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment_expansion.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment_expansion.go deleted file mode 100644 index 1537167a0..000000000 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/deployment_expansion.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta2 - -import ( - "fmt" - - apps "k8s.io/api/apps/v1beta2" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" -) - -// DeploymentListerExpansion allows custom methods to be added to -// DeploymentLister. -type DeploymentListerExpansion interface { - GetDeploymentsForReplicaSet(rs *apps.ReplicaSet) ([]*apps.Deployment, error) -} - -// DeploymentNamespaceListerExpansion allows custom methods to be added to -// DeploymentNamespaceLister. -type DeploymentNamespaceListerExpansion interface{} - -// GetDeploymentsForReplicaSet returns a list of Deployments that potentially -// match a ReplicaSet. Only the one specified in the ReplicaSet's ControllerRef -// will actually manage it. -// Returns an error only if no matching Deployments are found. -func (s *deploymentLister) GetDeploymentsForReplicaSet(rs *apps.ReplicaSet) ([]*apps.Deployment, error) { - if len(rs.Labels) == 0 { - return nil, fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name) - } - - // TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label - dList, err := s.Deployments(rs.Namespace).List(labels.Everything()) - if err != nil { - return nil, err - } - - var deployments []*apps.Deployment - for _, d := range dList { - selector, err := metav1.LabelSelectorAsSelector(d.Spec.Selector) - if err != nil { - return nil, fmt.Errorf("invalid label selector: %v", err) - } - // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. - if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) { - continue - } - deployments = append(deployments, d) - } - - if len(deployments) == 0 { - return nil, fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels) - } - - return deployments, nil -} diff --git a/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go b/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go index bac6ccb9a..b6d202118 100644 --- a/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/apps/v1beta2/expansion_generated.go @@ -25,3 +25,11 @@ type ControllerRevisionListerExpansion interface{} // ControllerRevisionNamespaceListerExpansion allows custom methods to be added to // ControllerRevisionNamespaceLister. type ControllerRevisionNamespaceListerExpansion interface{} + +// DeploymentListerExpansion allows custom methods to be added to +// DeploymentLister. +type DeploymentListerExpansion interface{} + +// DeploymentNamespaceListerExpansion allows custom methods to be added to +// DeploymentNamespaceLister. +type DeploymentNamespaceListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go index fac0221b8..2168a7f48 100644 --- a/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/core/v1/expansion_generated.go @@ -58,6 +58,10 @@ type LimitRangeNamespaceListerExpansion interface{} // NamespaceLister. type NamespaceListerExpansion interface{} +// NodeListerExpansion allows custom methods to be added to +// NodeLister. +type NodeListerExpansion interface{} + // PersistentVolumeListerExpansion allows custom methods to be added to // PersistentVolumeLister. type PersistentVolumeListerExpansion interface{} @@ -102,6 +106,14 @@ type SecretListerExpansion interface{} // SecretNamespaceLister. type SecretNamespaceListerExpansion interface{} +// ServiceListerExpansion allows custom methods to be added to +// ServiceLister. +type ServiceListerExpansion interface{} + +// ServiceNamespaceListerExpansion allows custom methods to be added to +// ServiceNamespaceLister. +type ServiceNamespaceListerExpansion interface{} + // ServiceAccountListerExpansion allows custom methods to be added to // ServiceAccountLister. type ServiceAccountListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/core/v1/node_expansion.go b/vendor/k8s.io/client-go/listers/core/v1/node_expansion.go deleted file mode 100644 index 9e5c55ab3..000000000 --- a/vendor/k8s.io/client-go/listers/core/v1/node_expansion.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/labels" -) - -// NodeConditionPredicate is a function that indicates whether the given node's conditions meet -// some set of criteria defined by the function. -type NodeConditionPredicate func(node *v1.Node) bool - -// NodeListerExpansion allows custom methods to be added to -// NodeLister. -type NodeListerExpansion interface { - ListWithPredicate(predicate NodeConditionPredicate) ([]*v1.Node, error) -} - -func (l *nodeLister) ListWithPredicate(predicate NodeConditionPredicate) ([]*v1.Node, error) { - nodes, err := l.List(labels.Everything()) - if err != nil { - return nil, err - } - - var filtered []*v1.Node - for i := range nodes { - if predicate(nodes[i]) { - filtered = append(filtered, nodes[i]) - } - } - - return filtered, nil -} diff --git a/vendor/k8s.io/client-go/listers/core/v1/service_expansion.go b/vendor/k8s.io/client-go/listers/core/v1/service_expansion.go deleted file mode 100644 index e283d2509..000000000 --- a/vendor/k8s.io/client-go/listers/core/v1/service_expansion.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1 - -import ( - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/labels" -) - -// ServiceListerExpansion allows custom methods to be added to -// ServiceLister. -type ServiceListerExpansion interface { - GetPodServices(pod *v1.Pod) ([]*v1.Service, error) -} - -// ServiceNamespaceListerExpansion allows custom methods to be added to -// ServiceNamespaceLister. -type ServiceNamespaceListerExpansion interface{} - -// TODO: Move this back to scheduler as a helper function that takes a Store, -// rather than a method of ServiceLister. -func (s *serviceLister) GetPodServices(pod *v1.Pod) ([]*v1.Service, error) { - allServices, err := s.Services(pod.Namespace).List(labels.Everything()) - if err != nil { - return nil, err - } - - var services []*v1.Service - for i := range allServices { - service := allServices[i] - if service.Spec.Selector == nil { - // services with nil selectors match nothing, not everything. - continue - } - selector := labels.Set(service.Spec.Selector).AsSelectorPreValidated() - if selector.Matches(labels.Set(pod.Labels)) { - services = append(services, service) - } - } - - return services, nil -} diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment_expansion.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment_expansion.go deleted file mode 100644 index b9a14167e..000000000 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/deployment_expansion.go +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "fmt" - - extensions "k8s.io/api/extensions/v1beta1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/labels" -) - -// DeploymentListerExpansion allows custom methods to be added to -// DeploymentLister. -type DeploymentListerExpansion interface { - GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) ([]*extensions.Deployment, error) -} - -// DeploymentNamespaceListerExpansion allows custom methods to be added to -// DeploymentNamespaceLister. -type DeploymentNamespaceListerExpansion interface{} - -// GetDeploymentsForReplicaSet returns a list of Deployments that potentially -// match a ReplicaSet. Only the one specified in the ReplicaSet's ControllerRef -// will actually manage it. -// Returns an error only if no matching Deployments are found. -func (s *deploymentLister) GetDeploymentsForReplicaSet(rs *extensions.ReplicaSet) ([]*extensions.Deployment, error) { - if len(rs.Labels) == 0 { - return nil, fmt.Errorf("no deployments found for ReplicaSet %v because it has no labels", rs.Name) - } - - // TODO: MODIFY THIS METHOD so that it checks for the podTemplateSpecHash label - dList, err := s.Deployments(rs.Namespace).List(labels.Everything()) - if err != nil { - return nil, err - } - - var deployments []*extensions.Deployment - for _, d := range dList { - selector, err := metav1.LabelSelectorAsSelector(d.Spec.Selector) - if err != nil { - return nil, fmt.Errorf("invalid label selector: %v", err) - } - // If a deployment with a nil or empty selector creeps in, it should match nothing, not everything. - if selector.Empty() || !selector.Matches(labels.Set(rs.Labels)) { - continue - } - deployments = append(deployments, d) - } - - if len(deployments) == 0 { - return nil, fmt.Errorf("could not find deployments set for ReplicaSet %s in namespace %s with labels: %v", rs.Name, rs.Namespace, rs.Labels) - } - - return deployments, nil -} diff --git a/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go index 6d55ae9b8..5599219d9 100644 --- a/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/extensions/v1beta1/expansion_generated.go @@ -18,6 +18,14 @@ limitations under the License. package v1beta1 +// DeploymentListerExpansion allows custom methods to be added to +// DeploymentLister. +type DeploymentListerExpansion interface{} + +// DeploymentNamespaceListerExpansion allows custom methods to be added to +// DeploymentNamespaceLister. +type DeploymentNamespaceListerExpansion interface{} + // IngressListerExpansion allows custom methods to be added to // IngressLister. type IngressListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/networking/v1beta1/expansion_generated.go b/vendor/k8s.io/client-go/listers/networking/v1beta1/expansion_generated.go index df6da06eb..d8c99c186 100644 --- a/vendor/k8s.io/client-go/listers/networking/v1beta1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/networking/v1beta1/expansion_generated.go @@ -25,3 +25,7 @@ type IngressListerExpansion interface{} // IngressNamespaceListerExpansion allows custom methods to be added to // IngressNamespaceLister. type IngressNamespaceListerExpansion interface{} + +// IngressClassListerExpansion allows custom methods to be added to +// IngressClassLister. +type IngressClassListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/listers/networking/v1beta1/ingressclass.go b/vendor/k8s.io/client-go/listers/networking/v1beta1/ingressclass.go new file mode 100644 index 000000000..1d39956ac --- /dev/null +++ b/vendor/k8s.io/client-go/listers/networking/v1beta1/ingressclass.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1beta1 + +import ( + v1beta1 "k8s.io/api/networking/v1beta1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// IngressClassLister helps list IngressClasses. +type IngressClassLister interface { + // List lists all IngressClasses in the indexer. + List(selector labels.Selector) (ret []*v1beta1.IngressClass, err error) + // Get retrieves the IngressClass from the index for a given name. + Get(name string) (*v1beta1.IngressClass, error) + IngressClassListerExpansion +} + +// ingressClassLister implements the IngressClassLister interface. +type ingressClassLister struct { + indexer cache.Indexer +} + +// NewIngressClassLister returns a new IngressClassLister. +func NewIngressClassLister(indexer cache.Indexer) IngressClassLister { + return &ingressClassLister{indexer: indexer} +} + +// List lists all IngressClasses in the indexer. +func (s *ingressClassLister) List(selector labels.Selector) (ret []*v1beta1.IngressClass, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1beta1.IngressClass)) + }) + return ret, err +} + +// Get retrieves the IngressClass from the index for a given name. +func (s *ingressClassLister) Get(name string) (*v1beta1.IngressClass, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1beta1.Resource("ingressclass"), name) + } + return obj.(*v1beta1.IngressClass), nil +} diff --git a/vendor/k8s.io/client-go/listers/storage/v1/csidriver.go b/vendor/k8s.io/client-go/listers/storage/v1/csidriver.go new file mode 100644 index 000000000..68b2f8be1 --- /dev/null +++ b/vendor/k8s.io/client-go/listers/storage/v1/csidriver.go @@ -0,0 +1,65 @@ +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "k8s.io/api/storage/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// CSIDriverLister helps list CSIDrivers. +type CSIDriverLister interface { + // List lists all CSIDrivers in the indexer. + List(selector labels.Selector) (ret []*v1.CSIDriver, err error) + // Get retrieves the CSIDriver from the index for a given name. + Get(name string) (*v1.CSIDriver, error) + CSIDriverListerExpansion +} + +// cSIDriverLister implements the CSIDriverLister interface. +type cSIDriverLister struct { + indexer cache.Indexer +} + +// NewCSIDriverLister returns a new CSIDriverLister. +func NewCSIDriverLister(indexer cache.Indexer) CSIDriverLister { + return &cSIDriverLister{indexer: indexer} +} + +// List lists all CSIDrivers in the indexer. +func (s *cSIDriverLister) List(selector labels.Selector) (ret []*v1.CSIDriver, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.CSIDriver)) + }) + return ret, err +} + +// Get retrieves the CSIDriver from the index for a given name. +func (s *cSIDriverLister) Get(name string) (*v1.CSIDriver, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("csidriver"), name) + } + return obj.(*v1.CSIDriver), nil +} diff --git a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go index 41efa3245..172f835f7 100644 --- a/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go +++ b/vendor/k8s.io/client-go/listers/storage/v1/expansion_generated.go @@ -18,6 +18,10 @@ limitations under the License. package v1 +// CSIDriverListerExpansion allows custom methods to be added to +// CSIDriverLister. +type CSIDriverListerExpansion interface{} + // CSINodeListerExpansion allows custom methods to be added to // CSINodeLister. type CSINodeListerExpansion interface{} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/README.md b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/README.md index 21a39ae86..096f99e1d 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/README.md +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/README.md @@ -38,7 +38,13 @@ This plugin provides an integration with Azure Active Directory device flow. If * Replace `APISERVER_APPLICATION_ID` with the application ID of your `apiserver` application ID * Be sure to also (create and) select a context that uses above user - 6. The access token is acquired when first `kubectl` command is executed +6. (Optionally) the AAD token has `aud` claim with `spn:` prefix. To omit that, add following auth configuration: + + ``` + --auth-provider-arg=config-mode="1" + ``` + + 7. The access token is acquired when first `kubectl` command is executed ``` kubectl get pods diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go index e583100cc..f59f2f59e 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/azure/azure.go @@ -22,6 +22,7 @@ import ( "fmt" "net/http" "os" + "strconv" "sync" "github.com/Azure/go-autorest/autorest" @@ -33,6 +34,8 @@ import ( restclient "k8s.io/client-go/rest" ) +type configMode int + const ( azureTokenKey = "azureTokenKey" tokenType = "Bearer" @@ -46,6 +49,10 @@ const ( cfgExpiresOn = "expires-on" cfgEnvironment = "environment" cfgApiserverID = "apiserver-id" + cfgConfigMode = "config-mode" + + configModeDefault configMode = 0 + configModeOmitSPNPrefix configMode = 1 ) func init() { @@ -78,17 +85,37 @@ func (c *azureTokenCache) setToken(tokenKey string, token *azureToken) { } func newAzureAuthProvider(_ string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { - var ts tokenSource - - environment, err := azure.EnvironmentFromName(cfg[cfgEnvironment]) + var ( + ts tokenSource + environment azure.Environment + err error + mode configMode + ) + + environment, err = azure.EnvironmentFromName(cfg[cfgEnvironment]) if err != nil { environment = azure.PublicCloud } - ts, err = newAzureTokenSourceDeviceCode(environment, cfg[cfgClientID], cfg[cfgTenantID], cfg[cfgApiserverID]) + + mode = configModeDefault + if cfg[cfgConfigMode] != "" { + configModeInt, err := strconv.Atoi(cfg[cfgConfigMode]) + if err != nil { + return nil, fmt.Errorf("failed to parse %s, error: %s", cfgConfigMode, err) + } + mode = configMode(configModeInt) + switch mode { + case configModeOmitSPNPrefix: + case configModeDefault: + default: + return nil, fmt.Errorf("%s:%s is not a valid mode", cfgConfigMode, cfg[cfgConfigMode]) + } + } + ts, err = newAzureTokenSourceDeviceCode(environment, cfg[cfgClientID], cfg[cfgTenantID], cfg[cfgApiserverID], mode) if err != nil { return nil, fmt.Errorf("creating a new azure token source for device code authentication: %v", err) } - cacheSource := newAzureTokenSource(ts, cache, cfg, persister) + cacheSource := newAzureTokenSource(ts, cache, cfg, mode, persister) return &azureAuthProvider{ tokenSource: cacheSource, @@ -156,19 +183,21 @@ type tokenSource interface { } type azureTokenSource struct { - source tokenSource - cache *azureTokenCache - lock sync.Mutex - cfg map[string]string - persister restclient.AuthProviderConfigPersister + source tokenSource + cache *azureTokenCache + lock sync.Mutex + configMode configMode + cfg map[string]string + persister restclient.AuthProviderConfigPersister } -func newAzureTokenSource(source tokenSource, cache *azureTokenCache, cfg map[string]string, persister restclient.AuthProviderConfigPersister) tokenSource { +func newAzureTokenSource(source tokenSource, cache *azureTokenCache, cfg map[string]string, configMode configMode, persister restclient.AuthProviderConfigPersister) tokenSource { return &azureTokenSource{ - source: source, - cache: cache, - cfg: cfg, - persister: persister, + source: source, + cache: cache, + cfg: cfg, + persister: persister, + configMode: configMode, } } @@ -232,9 +261,9 @@ func (ts *azureTokenSource) retrieveTokenFromCfg() (*azureToken, error) { if tenantID == "" { return nil, fmt.Errorf("no tenant ID in cfg: %s", cfgTenantID) } - apiserverID := ts.cfg[cfgApiserverID] - if apiserverID == "" { - return nil, fmt.Errorf("no apiserver ID in cfg: %s", apiserverID) + resourceID := ts.cfg[cfgApiserverID] + if resourceID == "" { + return nil, fmt.Errorf("no apiserver ID in cfg: %s", cfgApiserverID) } expiresIn := ts.cfg[cfgExpiresIn] if expiresIn == "" { @@ -244,6 +273,10 @@ func (ts *azureTokenSource) retrieveTokenFromCfg() (*azureToken, error) { if expiresOn == "" { return nil, fmt.Errorf("no expiresOn in cfg: %s", cfgExpiresOn) } + tokenAudience := resourceID + if ts.configMode == configModeDefault { + tokenAudience = fmt.Sprintf("spn:%s", resourceID) + } return &azureToken{ token: adal.Token{ @@ -252,13 +285,13 @@ func (ts *azureTokenSource) retrieveTokenFromCfg() (*azureToken, error) { ExpiresIn: json.Number(expiresIn), ExpiresOn: json.Number(expiresOn), NotBefore: json.Number(expiresOn), - Resource: fmt.Sprintf("spn:%s", apiserverID), + Resource: tokenAudience, Type: tokenType, }, environment: environment, clientID: clientID, tenantID: tenantID, - apiserverID: apiserverID, + apiserverID: resourceID, }, nil } @@ -272,6 +305,7 @@ func (ts *azureTokenSource) storeTokenInCfg(token *azureToken) error { newCfg[cfgApiserverID] = token.apiserverID newCfg[cfgExpiresIn] = string(token.token.ExpiresIn) newCfg[cfgExpiresOn] = string(token.token.ExpiresOn) + newCfg[cfgConfigMode] = strconv.Itoa(int(ts.configMode)) err := ts.persister.Persist(newCfg) if err != nil { @@ -287,9 +321,17 @@ func (ts *azureTokenSource) refreshToken(token *azureToken) (*azureToken, error) return nil, err } - oauthConfig, err := adal.NewOAuthConfig(env.ActiveDirectoryEndpoint, token.tenantID) - if err != nil { - return nil, fmt.Errorf("building the OAuth configuration for token refresh: %v", err) + var oauthConfig *adal.OAuthConfig + if ts.configMode == configModeOmitSPNPrefix { + oauthConfig, err = adal.NewOAuthConfigWithAPIVersion(env.ActiveDirectoryEndpoint, token.tenantID, nil) + if err != nil { + return nil, fmt.Errorf("building the OAuth configuration without api-version for token refresh: %v", err) + } + } else { + oauthConfig, err = adal.NewOAuthConfig(env.ActiveDirectoryEndpoint, token.tenantID) + if err != nil { + return nil, fmt.Errorf("building the OAuth configuration for token refresh: %v", err) + } } callback := func(t adal.Token) error { @@ -323,9 +365,10 @@ type azureTokenSourceDeviceCode struct { clientID string tenantID string apiserverID string + configMode configMode } -func newAzureTokenSourceDeviceCode(environment azure.Environment, clientID string, tenantID string, apiserverID string) (tokenSource, error) { +func newAzureTokenSourceDeviceCode(environment azure.Environment, clientID string, tenantID string, apiserverID string, configMode configMode) (tokenSource, error) { if clientID == "" { return nil, errors.New("client-id is empty") } @@ -340,13 +383,25 @@ func newAzureTokenSourceDeviceCode(environment azure.Environment, clientID strin clientID: clientID, tenantID: tenantID, apiserverID: apiserverID, + configMode: configMode, }, nil } func (ts *azureTokenSourceDeviceCode) Token() (*azureToken, error) { - oauthConfig, err := adal.NewOAuthConfig(ts.environment.ActiveDirectoryEndpoint, ts.tenantID) - if err != nil { - return nil, fmt.Errorf("building the OAuth configuration for device code authentication: %v", err) + var ( + oauthConfig *adal.OAuthConfig + err error + ) + if ts.configMode == configModeOmitSPNPrefix { + oauthConfig, err = adal.NewOAuthConfigWithAPIVersion(ts.environment.ActiveDirectoryEndpoint, ts.tenantID, nil) + if err != nil { + return nil, fmt.Errorf("building the OAuth configuration without api-version for device code authentication: %v", err) + } + } else { + oauthConfig, err = adal.NewOAuthConfig(ts.environment.ActiveDirectoryEndpoint, ts.tenantID) + if err != nil { + return nil, fmt.Errorf("building the OAuth configuration for device code authentication: %v", err) + } } client := &autorest.Client{} deviceCode, err := adal.InitiateDeviceAuth(client, *oauthConfig, ts.clientID, ts.apiserverID) diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go index 741729bb5..71ed045ac 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/exec.go @@ -20,6 +20,7 @@ import ( "bytes" "context" "crypto/tls" + "crypto/x509" "errors" "fmt" "io" @@ -42,6 +43,7 @@ import ( "k8s.io/client-go/pkg/apis/clientauthentication/v1alpha1" "k8s.io/client-go/pkg/apis/clientauthentication/v1beta1" "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/client-go/tools/metrics" "k8s.io/client-go/transport" "k8s.io/client-go/util/connrotation" "k8s.io/klog" @@ -260,6 +262,7 @@ func (a *Authenticator) cert() (*tls.Certificate, error) { func (a *Authenticator) getCreds() (*credentials, error) { a.mu.Lock() defer a.mu.Unlock() + if a.cachedCreds != nil && !a.credsExpired() { return a.cachedCreds, nil } @@ -267,6 +270,7 @@ func (a *Authenticator) getCreds() (*credentials, error) { if err := a.refreshCredsLocked(nil); err != nil { return nil, err } + return a.cachedCreds, nil } @@ -355,6 +359,17 @@ func (a *Authenticator) refreshCredsLocked(r *clientauthentication.Response) err if err != nil { return fmt.Errorf("failed parsing client key/certificate: %v", err) } + + // Leaf is initialized to be nil: + // https://golang.org/pkg/crypto/tls/#X509KeyPair + // Leaf certificate is the first certificate: + // https://golang.org/pkg/crypto/tls/#Certificate + // Populating leaf is useful for quickly accessing the underlying x509 + // certificate values. + cert.Leaf, err = x509.ParseCertificate(cert.Certificate[0]) + if err != nil { + return fmt.Errorf("failed parsing client leaf certificate: %v", err) + } newCreds.cert = &cert } @@ -362,10 +377,20 @@ func (a *Authenticator) refreshCredsLocked(r *clientauthentication.Response) err a.cachedCreds = newCreds // Only close all connections when TLS cert rotates. Token rotation doesn't // need the extra noise. - if len(a.onRotateList) > 0 && oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { + if oldCreds != nil && !reflect.DeepEqual(oldCreds.cert, a.cachedCreds.cert) { + // Can be nil if the exec auth plugin only returned token auth. + if oldCreds.cert != nil && oldCreds.cert.Leaf != nil { + metrics.ClientCertRotationAge.Observe(time.Now().Sub(oldCreds.cert.Leaf.NotBefore)) + } for _, onRotate := range a.onRotateList { onRotate() } } + + expiry := time.Time{} + if a.cachedCreds.cert != nil && a.cachedCreds.cert.Leaf != nil { + expiry = a.cachedCreds.cert.Leaf.NotAfter + } + expirationMetrics.set(a, expiry) return nil } diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/metrics.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/metrics.go new file mode 100644 index 000000000..caf0cca3e --- /dev/null +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/exec/metrics.go @@ -0,0 +1,60 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package exec + +import ( + "sync" + "time" + + "k8s.io/client-go/tools/metrics" +) + +type certificateExpirationTracker struct { + mu sync.RWMutex + m map[*Authenticator]time.Time + metricSet func(*time.Time) +} + +var expirationMetrics = &certificateExpirationTracker{ + m: map[*Authenticator]time.Time{}, + metricSet: func(e *time.Time) { + metrics.ClientCertExpiry.Set(e) + }, +} + +// set stores the given expiration time and updates the updates the certificate +// expiry metric to the earliest expiration time. +func (c *certificateExpirationTracker) set(a *Authenticator, t time.Time) { + c.mu.Lock() + defer c.mu.Unlock() + c.m[a] = t + + earliest := time.Time{} + for _, t := range c.m { + if t.IsZero() { + continue + } + if earliest.IsZero() || earliest.After(t) { + earliest = t + } + } + if earliest.IsZero() { + c.metricSet(nil) + } else { + c.metricSet(&earliest) + } +} diff --git a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go index 1383a97c6..940212015 100644 --- a/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go +++ b/vendor/k8s.io/client-go/plugin/pkg/client/auth/oidc/oidc.go @@ -76,24 +76,25 @@ func newClientCache() *clientCache { } type cacheKey struct { + clusterAddress string // Canonical issuer URL string of the provider. issuerURL string clientID string } -func (c *clientCache) getClient(issuer, clientID string) (*oidcAuthProvider, bool) { +func (c *clientCache) getClient(clusterAddress, issuer, clientID string) (*oidcAuthProvider, bool) { c.mu.RLock() defer c.mu.RUnlock() - client, ok := c.cache[cacheKey{issuer, clientID}] + client, ok := c.cache[cacheKey{clusterAddress: clusterAddress, issuerURL: issuer, clientID: clientID}] return client, ok } // setClient attempts to put the client in the cache but may return any clients // with the same keys set before. This is so there's only ever one client for a provider. -func (c *clientCache) setClient(issuer, clientID string, client *oidcAuthProvider) *oidcAuthProvider { +func (c *clientCache) setClient(clusterAddress, issuer, clientID string, client *oidcAuthProvider) *oidcAuthProvider { c.mu.Lock() defer c.mu.Unlock() - key := cacheKey{issuer, clientID} + key := cacheKey{clusterAddress: clusterAddress, issuerURL: issuer, clientID: clientID} // If another client has already initialized a client for the given provider we want // to use that client instead of the one we're trying to set. This is so all transports @@ -107,7 +108,7 @@ func (c *clientCache) setClient(issuer, clientID string, client *oidcAuthProvide return client } -func newOIDCAuthProvider(_ string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { +func newOIDCAuthProvider(clusterAddress string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) { issuer := cfg[cfgIssuerUrl] if issuer == "" { return nil, fmt.Errorf("Must provide %s", cfgIssuerUrl) @@ -119,7 +120,7 @@ func newOIDCAuthProvider(_ string, cfg map[string]string, persister restclient.A } // Check cache for existing provider. - if provider, ok := cache.getClient(issuer, clientID); ok { + if provider, ok := cache.getClient(clusterAddress, issuer, clientID); ok { return provider, nil } @@ -157,7 +158,7 @@ func newOIDCAuthProvider(_ string, cfg map[string]string, persister restclient.A persister: persister, } - return cache.setClient(issuer, clientID, provider), nil + return cache.setClient(clusterAddress, issuer, clientID, provider), nil } type oidcAuthProvider struct { diff --git a/vendor/k8s.io/client-go/rest/request.go b/vendor/k8s.io/client-go/rest/request.go index 9e0c26110..c5bc6a898 100644 --- a/vendor/k8s.io/client-go/rest/request.go +++ b/vendor/k8s.io/client-go/rest/request.go @@ -30,6 +30,7 @@ import ( "reflect" "strconv" "strings" + "sync" "time" "golang.org/x/net/http2" @@ -38,6 +39,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" + utilclock "k8s.io/apimachinery/pkg/util/clock" "k8s.io/apimachinery/pkg/util/net" "k8s.io/apimachinery/pkg/watch" restclientwatch "k8s.io/client-go/rest/watch" @@ -51,6 +53,9 @@ var ( // throttled (via the provided rateLimiter) for more than longThrottleLatency will // be logged. longThrottleLatency = 50 * time.Millisecond + + // extraLongThrottleLatency defines the threshold for logging requests at log level 2. + extraLongThrottleLatency = 1 * time.Second ) // HTTPClient is an interface for testing a request object. @@ -61,8 +66,8 @@ type HTTPClient interface { // ResponseWrapper is an interface for getting a response. // The response may be either accessed as a raw data (the whole output is put into memory) or as a stream. type ResponseWrapper interface { - DoRaw() ([]byte, error) - Stream() (io.ReadCloser, error) + DoRaw(context.Context) ([]byte, error) + Stream(context.Context) (io.ReadCloser, error) } // RequestConstructionError is returned when there's an error assembling a request. @@ -104,9 +109,6 @@ type Request struct { // output err error body io.Reader - - // This is only used for per-request timeouts, deadlines, and cancellations. - ctx context.Context } // NewRequest creates a new request helper object for accessing runtime.Objects on a server. @@ -438,13 +440,6 @@ func (r *Request) Body(obj interface{}) *Request { return r } -// Context adds a context to the request. Contexts are only used for -// timeouts, deadlines, and cancellations. -func (r *Request) Context(ctx context.Context) *Request { - r.ctx = ctx - return r -} - // URL returns the current working URL. func (r *Request) URL() *url.URL { p := r.pathPrefix @@ -548,29 +543,88 @@ func (r Request) finalURLTemplate() url.URL { return *url } -func (r *Request) tryThrottle() error { +func (r *Request) tryThrottle(ctx context.Context) error { if r.rateLimiter == nil { return nil } now := time.Now() - var err error - if r.ctx != nil { - err = r.rateLimiter.Wait(r.ctx) - } else { - r.rateLimiter.Accept() - } - if latency := time.Since(now); latency > longThrottleLatency { - klog.V(4).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) + err := r.rateLimiter.Wait(ctx) + + latency := time.Since(now) + if latency > longThrottleLatency { + klog.V(3).Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) + } + if latency > extraLongThrottleLatency { + // If the rate limiter latency is very high, the log message should be printed at a higher log level, + // but we use a throttled logger to prevent spamming. + globalThrottledLogger.Infof("Throttling request took %v, request: %s:%s", latency, r.verb, r.URL().String()) } + metrics.RateLimiterLatency.Observe(r.verb, r.finalURLTemplate(), latency) return err } +type throttleSettings struct { + logLevel klog.Level + minLogInterval time.Duration + + lastLogTime time.Time + lock sync.RWMutex +} + +type throttledLogger struct { + clock utilclock.PassiveClock + settings []*throttleSettings +} + +var globalThrottledLogger = &throttledLogger{ + clock: utilclock.RealClock{}, + settings: []*throttleSettings{ + { + logLevel: 2, + minLogInterval: 1 * time.Second, + }, { + logLevel: 0, + minLogInterval: 10 * time.Second, + }, + }, +} + +func (b *throttledLogger) attemptToLog() (klog.Level, bool) { + for _, setting := range b.settings { + if bool(klog.V(setting.logLevel)) { + // Return early without write locking if possible. + if func() bool { + setting.lock.RLock() + defer setting.lock.RUnlock() + return b.clock.Since(setting.lastLogTime) >= setting.minLogInterval + }() { + setting.lock.Lock() + defer setting.lock.Unlock() + if b.clock.Since(setting.lastLogTime) >= setting.minLogInterval { + setting.lastLogTime = b.clock.Now() + return setting.logLevel, true + } + } + return -1, false + } + } + return -1, false +} + +// Infof will write a log message at each logLevel specified by the reciever's throttleSettings +// as long as it hasn't written a log message more recently than minLogInterval. +func (b *throttledLogger) Infof(message string, args ...interface{}) { + if logLevel, ok := b.attemptToLog(); ok { + klog.V(logLevel).Infof(message, args...) + } +} + // Watch attempts to begin watching the requested location. // Returns a watch.Interface, or an error. -func (r *Request) Watch() (watch.Interface, error) { +func (r *Request) Watch(ctx context.Context) (watch.Interface, error) { // We specifically don't want to rate limit watches, so we // don't use r.rateLimiter here. if r.err != nil { @@ -582,9 +636,7 @@ func (r *Request) Watch() (watch.Interface, error) { if err != nil { return nil, err } - if r.ctx != nil { - req = req.WithContext(r.ctx) - } + req = req.WithContext(ctx) req.Header = r.headers client := r.c.Client if client == nil { @@ -603,7 +655,7 @@ func (r *Request) Watch() (watch.Interface, error) { if err != nil { // The watch stream mechanism handles many common partial data errors, so closed // connections can be retried in many cases. - if net.IsProbableEOF(err) { + if net.IsProbableEOF(err) || net.IsTimeout(err) { return watch.NewEmptyWatch(), nil } return nil, err @@ -659,12 +711,12 @@ func updateURLMetrics(req *Request, resp *http.Response, err error) { // Returns io.ReadCloser which could be used for streaming of the response, or an error // Any non-2xx http status code causes an error. If we get a non-2xx code, we try to convert the body into an APIStatus object. // If we can, we return that as an error. Otherwise, we create an error that lists the http status and the content of the response. -func (r *Request) Stream() (io.ReadCloser, error) { +func (r *Request) Stream(ctx context.Context) (io.ReadCloser, error) { if r.err != nil { return nil, r.err } - if err := r.tryThrottle(); err != nil { + if err := r.tryThrottle(ctx); err != nil { return nil, err } @@ -676,9 +728,7 @@ func (r *Request) Stream() (io.ReadCloser, error) { if r.body != nil { req.Body = ioutil.NopCloser(r.body) } - if r.ctx != nil { - req = req.WithContext(r.ctx) - } + req = req.WithContext(ctx) req.Header = r.headers client := r.c.Client if client == nil { @@ -746,7 +796,7 @@ func (r *Request) requestPreflightCheck() error { // received. It handles retry behavior and up front validation of requests. It will invoke // fn at most once. It will return an error if a problem occurred prior to connecting to the // server - the provided function is responsible for handling server errors. -func (r *Request) request(fn func(*http.Request, *http.Response)) error { +func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Response)) error { //Metrics for total request latency start := time.Now() defer func() { @@ -767,26 +817,30 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { client = http.DefaultClient } + // Throttle the first try before setting up the timeout configured on the + // client. We don't want a throttled client to return timeouts to callers + // before it makes a single request. + if err := r.tryThrottle(ctx); err != nil { + return err + } + + if r.timeout > 0 { + var cancel context.CancelFunc + ctx, cancel = context.WithTimeout(ctx, r.timeout) + defer cancel() + } + // Right now we make about ten retry attempts if we get a Retry-After response. maxRetries := 10 retries := 0 for { + url := r.URL().String() req, err := http.NewRequest(r.verb, url, r.body) if err != nil { return err } - if r.timeout > 0 { - if r.ctx == nil { - r.ctx = context.Background() - } - var cancelFn context.CancelFunc - r.ctx, cancelFn = context.WithTimeout(r.ctx, r.timeout) - defer cancelFn() - } - if r.ctx != nil { - req = req.WithContext(r.ctx) - } + req = req.WithContext(ctx) req.Header = r.headers r.backoff.Sleep(r.backoff.CalculateBackoff(r.URL())) @@ -794,7 +848,7 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { // We are retrying the request that we already send to apiserver // at least once before. // This request should also be throttled with the client-internal rate limiter. - if err := r.tryThrottle(); err != nil { + if err := r.tryThrottle(ctx); err != nil { return err } } @@ -806,19 +860,24 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) } if err != nil { - // "Connection reset by peer" is usually a transient error. + // "Connection reset by peer" or "apiserver is shutting down" are usually a transient errors. // Thus in case of "GET" operations, we simply retry it. // We are not automatically retrying "write" operations, as // they are not idempotent. - if !net.IsConnectionReset(err) || r.verb != "GET" { + if r.verb != "GET" { return err } - // For the purpose of retry, we set the artificial "retry-after" response. - // TODO: Should we clean the original response if it exists? - resp = &http.Response{ - StatusCode: http.StatusInternalServerError, - Header: http.Header{"Retry-After": []string{"1"}}, - Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + // For connection errors and apiserver shutdown errors retry. + if net.IsConnectionReset(err) || net.IsProbableEOF(err) { + // For the purpose of retry, we set the artificial "retry-after" response. + // TODO: Should we clean the original response if it exists? + resp = &http.Response{ + StatusCode: http.StatusInternalServerError, + Header: http.Header{"Retry-After": []string{"1"}}, + Body: ioutil.NopCloser(bytes.NewReader([]byte{})), + } + } else { + return err } } @@ -864,13 +923,9 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { // Error type: // * If the server responds with a status: *errors.StatusError or *errors.UnexpectedObjectError // * http.Client.Do errors are returned directly. -func (r *Request) Do() Result { - if err := r.tryThrottle(); err != nil { - return Result{err: err} - } - +func (r *Request) Do(ctx context.Context) Result { var result Result - err := r.request(func(req *http.Request, resp *http.Response) { + err := r.request(ctx, func(req *http.Request, resp *http.Response) { result = r.transformResponse(resp, req) }) if err != nil { @@ -880,13 +935,9 @@ func (r *Request) Do() Result { } // DoRaw executes the request but does not process the response body. -func (r *Request) DoRaw() ([]byte, error) { - if err := r.tryThrottle(); err != nil { - return nil, err - } - +func (r *Request) DoRaw(ctx context.Context) ([]byte, error) { var result Result - err := r.request(func(req *http.Request, resp *http.Response) { + err := r.request(ctx, func(req *http.Request, resp *http.Response) { result.body, result.err = ioutil.ReadAll(resp.Body) glogBody("Response Body", result.body) if resp.StatusCode < http.StatusOK || resp.StatusCode > http.StatusPartialContent { diff --git a/vendor/k8s.io/client-go/testing/actions.go b/vendor/k8s.io/client-go/testing/actions.go index f56b34ee8..b6b2c1f22 100644 --- a/vendor/k8s.io/client-go/testing/actions.go +++ b/vendor/k8s.io/client-go/testing/actions.go @@ -439,8 +439,18 @@ func (a ActionImpl) GetSubresource() string { return a.Subresource } func (a ActionImpl) Matches(verb, resource string) bool { + // Stay backwards compatible. + if !strings.Contains(resource, "/") { + return strings.EqualFold(verb, a.Verb) && + strings.EqualFold(resource, a.Resource.Resource) + } + + parts := strings.SplitN(resource, "/", 2) + topresource, subresource := parts[0], parts[1] + return strings.EqualFold(verb, a.Verb) && - strings.EqualFold(resource, a.Resource.Resource) + strings.EqualFold(topresource, a.Resource.Resource) && + strings.EqualFold(subresource, a.Subresource) } func (a ActionImpl) DeepCopy() Action { ret := a diff --git a/vendor/k8s.io/client-go/tools/cache/controller.go b/vendor/k8s.io/client-go/tools/cache/controller.go index 27a1c52cd..b513ce8b3 100644 --- a/vendor/k8s.io/client-go/tools/cache/controller.go +++ b/vendor/k8s.io/client-go/tools/cache/controller.go @@ -26,7 +26,16 @@ import ( "k8s.io/apimachinery/pkg/util/wait" ) -// Config contains all the settings for a Controller. +// This file implements a low-level controller that is used in +// sharedIndexInformer, which is an implementation of +// SharedIndexInformer. Such informers, in turn, are key components +// in the high level controllers that form the backbone of the +// Kubernetes control plane. Look at those for examples, or the +// example in +// https://github.com/kubernetes/client-go/tree/master/examples/workqueue +// . + +// Config contains all the settings for one of these low-level controllers. type Config struct { // The queue for your objects - has to be a DeltaFIFO due to // assumptions in the implementation. Your Process() function @@ -36,30 +45,29 @@ type Config struct { // Something that can list and watch your objects. ListerWatcher - // Something that can process your objects. + // Something that can process a popped Deltas. Process ProcessFunc - // The type of your objects. + // ObjectType is an example object of the type this controller is + // expected to handle. Only the type needs to be right, except + // that when that is `unstructured.Unstructured` the object's + // `"apiVersion"` and `"kind"` must also be right. ObjectType runtime.Object - // Reprocess everything at least this often. - // Note that if it takes longer for you to clear the queue than this - // period, you will end up processing items in the order determined - // by FIFO.Replace(). Currently, this is random. If this is a - // problem, we can change that replacement policy to append new - // things to the end of the queue instead of replacing the entire - // queue. + // FullResyncPeriod is the period at which ShouldResync is considered. FullResyncPeriod time.Duration - // ShouldResync, if specified, is invoked when the controller's reflector determines the next - // periodic sync should occur. If this returns true, it means the reflector should proceed with - // the resync. + // ShouldResync is periodically used by the reflector to determine + // whether to Resync the Queue. If ShouldResync is `nil` or + // returns true, it means the reflector should proceed with the + // resync. ShouldResync ShouldResyncFunc // If true, when Process() returns an error, re-enqueue the object. // TODO: add interface to let you inject a delay/backoff or drop // the object completely if desired. Pass the object in - // question to this interface as a parameter. + // question to this interface as a parameter. This is probably moot + // now that this functionality appears at a higher level. RetryOnError bool } @@ -71,7 +79,7 @@ type ShouldResyncFunc func() bool // ProcessFunc processes a single object. type ProcessFunc func(obj interface{}) error -// Controller is a generic controller framework. +// `*controller` implements Controller type controller struct { config Config reflector *Reflector @@ -79,10 +87,22 @@ type controller struct { clock clock.Clock } -// Controller is a generic controller framework. +// Controller is a low-level controller that is parameterized by a +// Config and used in sharedIndexInformer. type Controller interface { + // Run does two things. One is to construct and run a Reflector + // to pump objects/notifications from the Config's ListerWatcher + // to the Config's Queue and possibly invoke the occasional Resync + // on that Queue. The other is to repeatedly Pop from the Queue + // and process with the Config's ProcessFunc. Both of these + // continue until `stopCh` is closed. Run(stopCh <-chan struct{}) + + // HasSynced delegates to the Config's Queue HasSynced() bool + + // LastSyncResourceVersion delegates to the Reflector when there + // is one, otherwise returns the empty string LastSyncResourceVersion() string } @@ -95,7 +115,7 @@ func New(c *Config) Controller { return ctlr } -// Run begins processing items, and will continue until a value is sent down stopCh. +// Run begins processing items, and will continue until a value is sent down stopCh or it is closed. // It's an error to call Run more than once. // Run blocks; call via go. func (c *controller) Run(stopCh <-chan struct{}) { @@ -118,11 +138,11 @@ func (c *controller) Run(stopCh <-chan struct{}) { c.reflectorMutex.Unlock() var wg wait.Group - defer wg.Wait() wg.StartWithChannel(stopCh, r.Run) wait.Until(c.processLoop, time.Second, stopCh) + wg.Wait() } // Returns true once this controller has completed an initial resource listing @@ -344,7 +364,10 @@ func newInformer( // This will hold incoming changes. Note how we pass clientState in as a // KeyLister, that way resync operations will result in the correct set // of update/delete deltas. - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, clientState) + fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ + KnownObjects: clientState, + EmitDeltaTypeReplaced: true, + }) cfg := &Config{ Queue: fifo, @@ -357,7 +380,7 @@ func newInformer( // from oldest to newest for _, d := range obj.(Deltas) { switch d.Type { - case Sync, Added, Updated: + case Sync, Replaced, Added, Updated: if old, exists, err := clientState.Get(d.Object); err == nil && exists { if err := clientState.Update(d.Object); err != nil { return err diff --git a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go index 55ecdcdf7..40b6022c0 100644 --- a/vendor/k8s.io/client-go/tools/cache/delta_fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/delta_fifo.go @@ -26,15 +26,16 @@ import ( "k8s.io/klog" ) -// NewDeltaFIFO returns a Store which can be used process changes to items. +// NewDeltaFIFO returns a Queue which can be used to process changes to items. // -// keyFunc is used to figure out what key an object should have. (It's -// exposed in the returned DeltaFIFO's KeyOf() method, with bonus features.) +// keyFunc is used to figure out what key an object should have. (It is +// exposed in the returned DeltaFIFO's KeyOf() method, with additional handling +// around deleted objects and queue state). +// +// 'knownObjects' may be supplied to modify the behavior of Delete, +// Replace, and Resync. It may be nil if you do not need those +// modifications. // -// 'keyLister' is expected to return a list of keys that the consumer of -// this queue "knows about". It is used to decide which items are missing -// when Replace() is called; 'Deleted' deltas are produced for these items. -// It may be nil if you don't need to detect all deletions. // TODO: consider merging keyLister with this object, tracking a list of // "known" keys when Pop() is called. Have to think about how that // affects error retrying. @@ -56,18 +57,79 @@ import ( // and internal tests. // // Also see the comment on DeltaFIFO. +// +// Warning: This constructs a DeltaFIFO that does not differentiate between +// events caused by a call to Replace (e.g., from a relist, which may +// contain object updates), and synthetic events caused by a periodic resync +// (which just emit the existing object). See https://issue.k8s.io/86015 for details. +// +// Use `NewDeltaFIFOWithOptions(DeltaFIFOOptions{..., EmitDeltaTypeReplaced: true})` +// instead to receive a `Replaced` event depending on the type. +// +// Deprecated: Equivalent to NewDeltaFIFOWithOptions(DeltaFIFOOptions{KeyFunction: keyFunc, KnownObjects: knownObjects}) func NewDeltaFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter) *DeltaFIFO { + return NewDeltaFIFOWithOptions(DeltaFIFOOptions{ + KeyFunction: keyFunc, + KnownObjects: knownObjects, + }) +} + +// DeltaFIFOOptions is the configuration parameters for DeltaFIFO. All are +// optional. +type DeltaFIFOOptions struct { + + // KeyFunction is used to figure out what key an object should have. (It's + // exposed in the returned DeltaFIFO's KeyOf() method, with additional + // handling around deleted objects and queue state). + // Optional, the default is MetaNamespaceKeyFunc. + KeyFunction KeyFunc + + // KnownObjects is expected to return a list of keys that the consumer of + // this queue "knows about". It is used to decide which items are missing + // when Replace() is called; 'Deleted' deltas are produced for the missing items. + // KnownObjects may be nil if you can tolerate missing deletions on Replace(). + KnownObjects KeyListerGetter + + // EmitDeltaTypeReplaced indicates that the queue consumer + // understands the Replaced DeltaType. Before the `Replaced` event type was + // added, calls to Replace() were handled the same as Sync(). For + // backwards-compatibility purposes, this is false by default. + // When true, `Replaced` events will be sent for items passed to a Replace() call. + // When false, `Sync` events will be sent instead. + EmitDeltaTypeReplaced bool +} + +// NewDeltaFIFOWithOptions returns a Store which can be used process changes to +// items. See also the comment on DeltaFIFO. +func NewDeltaFIFOWithOptions(opts DeltaFIFOOptions) *DeltaFIFO { + if opts.KeyFunction == nil { + opts.KeyFunction = MetaNamespaceKeyFunc + } + f := &DeltaFIFO{ items: map[string]Deltas{}, queue: []string{}, - keyFunc: keyFunc, - knownObjects: knownObjects, + keyFunc: opts.KeyFunction, + knownObjects: opts.KnownObjects, + + emitDeltaTypeReplaced: opts.EmitDeltaTypeReplaced, } f.cond.L = &f.lock return f } -// DeltaFIFO is like FIFO, but allows you to process deletes. +// DeltaFIFO is like FIFO, but differs in two ways. One is that the +// accumulator associated with a given object's key is not that object +// but rather a Deltas, which is a slice of Delta values for that +// object. Applying an object to a Deltas means to append a Delta +// except when the potentially appended Delta is a Deleted and the +// Deltas already ends with a Deleted. In that case the Deltas does +// not grow, although the terminal Deleted will be replaced by the new +// Deleted if the older Deleted's object is a +// DeletedFinalStateUnknown. +// +// The other difference is that DeltaFIFO has an additional way that +// an object can be applied to an accumulator, called Sync. // // DeltaFIFO is a producer-consumer queue, where a Reflector is // intended to be the producer, and the consumer is whatever calls @@ -77,22 +139,22 @@ func NewDeltaFIFO(keyFunc KeyFunc, knownObjects KeyListerGetter) *DeltaFIFO { // * You want to process every object change (delta) at most once. // * When you process an object, you want to see everything // that's happened to it since you last processed it. -// * You want to process the deletion of objects. +// * You want to process the deletion of some of the objects. // * You might want to periodically reprocess objects. // // DeltaFIFO's Pop(), Get(), and GetByKey() methods return -// interface{} to satisfy the Store/Queue interfaces, but it +// interface{} to satisfy the Store/Queue interfaces, but they // will always return an object of type Deltas. // +// A DeltaFIFO's knownObjects KeyListerGetter provides the abilities +// to list Store keys and to get objects by Store key. The objects in +// question are called "known objects" and this set of objects +// modifies the behavior of the Delete, Replace, and Resync methods +// (each in a different way). +// // A note on threading: If you call Pop() in parallel from multiple // threads, you could end up with multiple threads processing slightly // different versions of the same object. -// -// A note on the KeyLister used by the DeltaFIFO: It's main purpose is -// to list keys that are "known", for the purpose of figuring out which -// items have been deleted when Replace() or Delete() are called. The deleted -// object will be included in the DeleteFinalStateUnknown markers. These objects -// could be stale. type DeltaFIFO struct { // lock/cond protects access to 'items' and 'queue'. lock sync.RWMutex @@ -114,9 +176,8 @@ type DeltaFIFO struct { // insertion and retrieval, and should be deterministic. keyFunc KeyFunc - // knownObjects list keys that are "known", for the - // purpose of figuring out which items have been deleted - // when Replace() or Delete() is called. + // knownObjects list keys that are "known" --- affecting Delete(), + // Replace(), and Resync() knownObjects KeyListerGetter // Indication the queue is closed. @@ -124,6 +185,10 @@ type DeltaFIFO struct { // Currently, not used to gate any of CRED operations. closed bool closedLock sync.Mutex + + // emitDeltaTypeReplaced is whether to emit the Replaced or Sync + // DeltaType when Replace() is called (to preserve backwards compat). + emitDeltaTypeReplaced bool } var ( @@ -185,9 +250,11 @@ func (f *DeltaFIFO) Update(obj interface{}) error { return f.queueActionLocked(Updated, obj) } -// Delete is just like Add, but makes an Deleted Delta. If the item does not -// already exist, it will be ignored. (It may have already been deleted by a -// Replace (re-list), for example. +// Delete is just like Add, but makes a Deleted Delta. If the given +// object does not already exist, it will be ignored. (It may have +// already been deleted by a Replace (re-list), for example.) In this +// method `f.knownObjects`, if not nil, provides (via GetByKey) +// _additional_ objects that are considered to already exist. func (f *DeltaFIFO) Delete(obj interface{}) error { id, err := f.KeyOf(obj) if err != nil { @@ -313,6 +380,9 @@ func (f *DeltaFIFO) queueActionLocked(actionType DeltaType, obj interface{}) err f.items[id] = newDeltas f.cond.Broadcast() } else { + // This never happens, because dedupDeltas never returns an empty list + // when given a non-empty list (as it is here). + // But if somehow it ever does return an empty list, then // We need to remove this from our map (extra items in the queue are // ignored if they are not in the map). delete(f.items, id) @@ -430,22 +500,34 @@ func (f *DeltaFIFO) Pop(process PopProcessFunc) (interface{}, error) { } } -// Replace will delete the contents of 'f', using instead the given map. -// 'f' takes ownership of the map, you should not reference the map again -// after calling this function. f's queue is reset, too; upon return, it -// will contain the items in the map, in no particular order. +// Replace atomically does two things: (1) it adds the given objects +// using the Sync or Replace DeltaType and then (2) it does some deletions. +// In particular: for every pre-existing key K that is not the key of +// an object in `list` there is the effect of +// `Delete(DeletedFinalStateUnknown{K, O})` where O is current object +// of K. If `f.knownObjects == nil` then the pre-existing keys are +// those in `f.items` and the current object of K is the `.Newest()` +// of the Deltas associated with K. Otherwise the pre-existing keys +// are those listed by `f.knownObjects` and the current object of K is +// what `f.knownObjects.GetByKey(K)` returns. func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { f.lock.Lock() defer f.lock.Unlock() keys := make(sets.String, len(list)) + // keep backwards compat for old clients + action := Sync + if f.emitDeltaTypeReplaced { + action = Replaced + } + for _, item := range list { key, err := f.KeyOf(item) if err != nil { return KeyError{item, err} } keys.Insert(key) - if err := f.queueActionLocked(Sync, item); err != nil { + if err := f.queueActionLocked(action, item); err != nil { return fmt.Errorf("couldn't enqueue object: %v", err) } } @@ -507,7 +589,9 @@ func (f *DeltaFIFO) Replace(list []interface{}, resourceVersion string) error { return nil } -// Resync will send a sync event for each item +// Resync adds, with a Sync type of Delta, every object listed by +// `f.knownObjects` whose key is not already queued for processing. +// If `f.knownObjects` is `nil` then Resync does nothing. func (f *DeltaFIFO) Resync() error { f.lock.Lock() defer f.lock.Unlock() @@ -577,10 +661,14 @@ const ( Added DeltaType = "Added" Updated DeltaType = "Updated" Deleted DeltaType = "Deleted" - // The other types are obvious. You'll get Sync deltas when: - // * A watch expires/errors out and a new list/watch cycle is started. - // * You've turned on periodic syncs. - // (Anything that trigger's DeltaFIFO's Replace() method.) + // Replaced is emitted when we encountered watch errors and had to do a + // relist. We don't know if the replaced object has changed. + // + // NOTE: Previous versions of DeltaFIFO would use Sync for Replace events + // as well. Hence, Replaced is only emitted when the option + // EmitDeltaTypeReplaced is true. + Replaced DeltaType = "Replaced" + // Sync is for synthetic events during a periodic resync. Sync DeltaType = "Sync" ) diff --git a/vendor/k8s.io/client-go/tools/cache/expiration_cache.go b/vendor/k8s.io/client-go/tools/cache/expiration_cache.go index 14ad492ec..e687593f6 100644 --- a/vendor/k8s.io/client-go/tools/cache/expiration_cache.go +++ b/vendor/k8s.io/client-go/tools/cache/expiration_cache.go @@ -194,9 +194,9 @@ func (c *ExpirationCache) Replace(list []interface{}, resourceVersion string) er return nil } -// Resync will touch all objects to put them into the processing queue +// Resync is a no-op for one of these func (c *ExpirationCache) Resync() error { - return c.cacheStorage.Resync() + return nil } // NewTTLStore creates and returns a ExpirationCache with a TTLPolicy diff --git a/vendor/k8s.io/client-go/tools/cache/fifo.go b/vendor/k8s.io/client-go/tools/cache/fifo.go index 7a3bc3d30..67bb1cba8 100644 --- a/vendor/k8s.io/client-go/tools/cache/fifo.go +++ b/vendor/k8s.io/client-go/tools/cache/fifo.go @@ -24,7 +24,7 @@ import ( ) // PopProcessFunc is passed to Pop() method of Queue interface. -// It is supposed to process the element popped from the queue. +// It is supposed to process the accumulator popped from the queue. type PopProcessFunc func(interface{}) error // ErrRequeue may be returned by a PopProcessFunc to safely requeue @@ -44,26 +44,38 @@ func (e ErrRequeue) Error() string { return e.Err.Error() } -// Queue is exactly like a Store, but has a Pop() method too. +// Queue extends Store with a collection of Store keys to "process". +// Every Add, Update, or Delete may put the object's key in that collection. +// A Queue has a way to derive the corresponding key given an accumulator. +// A Queue can be accessed concurrently from multiple goroutines. +// A Queue can be "closed", after which Pop operations return an error. type Queue interface { Store - // Pop blocks until it has something to process. - // It returns the object that was process and the result of processing. - // The PopProcessFunc may return an ErrRequeue{...} to indicate the item - // should be requeued before releasing the lock on the queue. + // Pop blocks until there is at least one key to process or the + // Queue is closed. In the latter case Pop returns with an error. + // In the former case Pop atomically picks one key to process, + // removes that (key, accumulator) association from the Store, and + // processes the accumulator. Pop returns the accumulator that + // was processed and the result of processing. The PopProcessFunc + // may return an ErrRequeue{inner} and in this case Pop will (a) + // return that (key, accumulator) association to the Queue as part + // of the atomic processing and (b) return the inner error from + // Pop. Pop(PopProcessFunc) (interface{}, error) - // AddIfNotPresent adds a value previously - // returned by Pop back into the queue as long - // as nothing else (presumably more recent) - // has since been added. + // AddIfNotPresent puts the given accumulator into the Queue (in + // association with the accumulator's key) if and only if that key + // is not already associated with a non-empty accumulator. AddIfNotPresent(interface{}) error - // HasSynced returns true if the first batch of items has been popped + // HasSynced returns true if the first batch of keys have all been + // popped. The first batch of keys are those of the first Replace + // operation if that happened before any Add, Update, or Delete; + // otherwise the first batch is empty. HasSynced() bool - // Close queue + // Close the queue Close() } @@ -79,11 +91,16 @@ func Pop(queue Queue) interface{} { return result } -// FIFO receives adds and updates from a Reflector, and puts them in a queue for -// FIFO order processing. If multiple adds/updates of a single item happen while -// an item is in the queue before it has been processed, it will only be -// processed once, and when it is processed, the most recent version will be -// processed. This can't be done with a channel. +// FIFO is a Queue in which (a) each accumulator is simply the most +// recently provided object and (b) the collection of keys to process +// is a FIFO. The accumulators all start out empty, and deleting an +// object from its accumulator empties the accumulator. The Resync +// operation is a no-op. +// +// Thus: if multiple adds/updates of a single object happen while that +// object's key is in the queue before it has been processed then it +// will only be processed once, and when it is processed the most +// recent version will be processed. This can't be done with a channel // // FIFO solves this use case: // * You want to process every object (exactly) once. @@ -94,7 +111,7 @@ func Pop(queue Queue) interface{} { type FIFO struct { lock sync.RWMutex cond sync.Cond - // We depend on the property that items in the set are in the queue and vice versa. + // We depend on the property that every key in `items` is also in `queue` items map[string]interface{} queue []string @@ -326,7 +343,8 @@ func (f *FIFO) Replace(list []interface{}, resourceVersion string) error { return nil } -// Resync will touch all objects to put them into the processing queue +// Resync will ensure that every object in the Store has its key in the queue. +// This should be a no-op, because that property is maintained by all operations. func (f *FIFO) Resync() error { f.lock.Lock() defer f.lock.Unlock() diff --git a/vendor/k8s.io/client-go/tools/cache/index.go b/vendor/k8s.io/client-go/tools/cache/index.go index bbfb3b55f..fa29e6a70 100644 --- a/vendor/k8s.io/client-go/tools/cache/index.go +++ b/vendor/k8s.io/client-go/tools/cache/index.go @@ -23,12 +23,15 @@ import ( "k8s.io/apimachinery/pkg/util/sets" ) -// Indexer is a storage interface that lets you list objects using multiple indexing functions. -// There are three kinds of strings here. -// One is a storage key, as defined in the Store interface. -// Another kind is a name of an index. -// The third kind of string is an "indexed value", which is produced by an -// IndexFunc and can be a field value or any other string computed from the object. +// Indexer extends Store with multiple indices and restricts each +// accumulator to simply hold the current object (and be empty after +// Delete). +// +// There are three kinds of strings here: +// 1. a storage key, as defined in the Store interface, +// 2. a name of an index, and +// 3. an "indexed value", which is produced by an IndexFunc and +// can be a field value or any other string computed from the object. type Indexer interface { Store // Index returns the stored objects whose set of indexed values diff --git a/vendor/k8s.io/client-go/tools/cache/listwatch.go b/vendor/k8s.io/client-go/tools/cache/listwatch.go index 8227b73b6..10b7e6512 100644 --- a/vendor/k8s.io/client-go/tools/cache/listwatch.go +++ b/vendor/k8s.io/client-go/tools/cache/listwatch.go @@ -24,7 +24,6 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" restclient "k8s.io/client-go/rest" - "k8s.io/client-go/tools/pager" ) // Lister is any object that knows how to perform an initial list. @@ -85,7 +84,7 @@ func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, Namespace(namespace). Resource(resource). VersionedParams(&options, metav1.ParameterCodec). - Do(). + Do(context.TODO()). Get() } watchFunc := func(options metav1.ListOptions) (watch.Interface, error) { @@ -95,16 +94,15 @@ func NewFilteredListWatchFromClient(c Getter, resource string, namespace string, Namespace(namespace). Resource(resource). VersionedParams(&options, metav1.ParameterCodec). - Watch() + Watch(context.TODO()) } return &ListWatch{ListFunc: listFunc, WatchFunc: watchFunc} } // List a set of apiserver resources func (lw *ListWatch) List(options metav1.ListOptions) (runtime.Object, error) { - if !lw.DisableChunking { - return pager.New(pager.SimplePageFunc(lw.ListFunc)).List(context.TODO(), options) - } + // ListWatch is used in Reflector, which already supports pagination. + // Don't paginate here to avoid duplication. return lw.ListFunc(options) } diff --git a/vendor/k8s.io/client-go/tools/cache/mutation_detector.go b/vendor/k8s.io/client-go/tools/cache/mutation_detector.go index fa6acab3e..bbec7d062 100644 --- a/vendor/k8s.io/client-go/tools/cache/mutation_detector.go +++ b/vendor/k8s.io/client-go/tools/cache/mutation_detector.go @@ -36,9 +36,12 @@ func init() { mutationDetectionEnabled, _ = strconv.ParseBool(os.Getenv("KUBE_CACHE_MUTATION_DETECTOR")) } -// MutationDetector is able to monitor if the object be modified outside. +// MutationDetector is able to monitor objects for mutation within a limited window of time type MutationDetector interface { + // AddObject adds the given object to the set being monitored for a while from now AddObject(obj interface{}) + + // Run starts the monitoring and does not return until the monitoring is stopped. Run(stopCh <-chan struct{}) } @@ -65,7 +68,13 @@ type defaultCacheMutationDetector struct { name string period time.Duration - lock sync.Mutex + // compareLock ensures only a single call to CompareObjects runs at a time + compareObjectsLock sync.Mutex + + // addLock guards addedObjs between AddObject and CompareObjects + addedObjsLock sync.Mutex + addedObjs []cacheObj + cachedObjs []cacheObj retainDuration time.Duration @@ -115,15 +124,22 @@ func (d *defaultCacheMutationDetector) AddObject(obj interface{}) { if obj, ok := obj.(runtime.Object); ok { copiedObj := obj.DeepCopyObject() - d.lock.Lock() - defer d.lock.Unlock() - d.cachedObjs = append(d.cachedObjs, cacheObj{cached: obj, copied: copiedObj}) + d.addedObjsLock.Lock() + defer d.addedObjsLock.Unlock() + d.addedObjs = append(d.addedObjs, cacheObj{cached: obj, copied: copiedObj}) } } func (d *defaultCacheMutationDetector) CompareObjects() { - d.lock.Lock() - defer d.lock.Unlock() + d.compareObjectsLock.Lock() + defer d.compareObjectsLock.Unlock() + + // move addedObjs into cachedObjs under lock + // this keeps the critical section small to avoid blocking AddObject while we compare cachedObjs + d.addedObjsLock.Lock() + d.cachedObjs = append(d.cachedObjs, d.addedObjs...) + d.addedObjs = nil + d.addedObjsLock.Unlock() altered := false for i, obj := range d.cachedObjs { diff --git a/vendor/k8s.io/client-go/tools/cache/reflector.go b/vendor/k8s.io/client-go/tools/cache/reflector.go index 62749ed7d..b646a28bf 100644 --- a/vendor/k8s.io/client-go/tools/cache/reflector.go +++ b/vendor/k8s.io/client-go/tools/cache/reflector.go @@ -26,7 +26,7 @@ import ( "sync" "time" - apierrs "k8s.io/apimachinery/pkg/api/errors" + apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -55,7 +55,10 @@ type Reflector struct { // stringification of expectedType otherwise. It is for display // only, and should not be used for parsing or comparison. expectedTypeName string - // The type of object we expect to place in the store. + // An example object of the type we expect to place in the store. + // Only the type needs to be right, except that when that is + // `unstructured.Unstructured` the object's `"apiVersion"` and + // `"kind"` must also be right. expectedType reflect.Type // The GVK of the object we expect to place in the store if unstructured. expectedGVK *schema.GroupVersionKind @@ -63,21 +66,34 @@ type Reflector struct { store Store // listerWatcher is used to perform lists and watches. listerWatcher ListerWatcher - // period controls timing between one watch ending and - // the beginning of the next one. - period time.Duration + + // backoff manages backoff of ListWatch + backoffManager wait.BackoffManager + resyncPeriod time.Duration + // ShouldResync is invoked periodically and whenever it returns `true` the Store's Resync operation is invoked ShouldResync func() bool // clock allows tests to manipulate time clock clock.Clock + // paginatedResult defines whether pagination should be forced for list calls. + // It is set based on the result of the initial list call. + paginatedResult bool // lastSyncResourceVersion is the resource version token last // observed when doing a sync with the underlying store // it is thread safe, but not synchronized with the underlying store lastSyncResourceVersion string + // isLastSyncResourceVersionUnavailable is true if the previous list or watch request with + // lastSyncResourceVersion failed with an "expired" or "too large resource version" error. + isLastSyncResourceVersionUnavailable bool // lastSyncResourceVersionMutex guards read/write access to lastSyncResourceVersion lastSyncResourceVersionMutex sync.RWMutex // WatchListPageSize is the requested chunk size of initial and resync watch lists. - // Defaults to pager.PageSize. + // If unset, for consistent reads (RV="") or reads that opt-into arbitrarily old data + // (RV="0") it will default to pager.PageSize, for the rest (RV != "" && RV != "0") + // it will turn off pagination to allow serving them from watch cache. + // NOTE: It should be used carefully as paginated lists are always served directly from + // etcd, which is significantly less efficient and may lead to serious performance and + // scalability problems. WatchListPageSize int64 } @@ -95,25 +111,33 @@ func NewNamespaceKeyedIndexerAndReflector(lw ListerWatcher, expectedType interfa return indexer, reflector } -// NewReflector creates a new Reflector object which will keep the given store up to -// date with the server's contents for the given resource. Reflector promises to -// only put things in the store that have the type of expectedType, unless expectedType -// is nil. If resyncPeriod is non-zero, then lists will be executed after every -// resyncPeriod, so that you can use reflectors to periodically process everything as -// well as incrementally processing the things that change. +// NewReflector creates a new Reflector object which will keep the +// given store up to date with the server's contents for the given +// resource. Reflector promises to only put things in the store that +// have the type of expectedType, unless expectedType is nil. If +// resyncPeriod is non-zero, then the reflector will periodically +// consult its ShouldResync function to determine whether to invoke +// the Store's Resync operation; `ShouldResync==nil` means always +// "yes". This enables you to use reflectors to periodically process +// everything as well as incrementally processing the things that +// change. func NewReflector(lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { return NewNamedReflector(naming.GetNameFromCallsite(internalPackages...), lw, expectedType, store, resyncPeriod) } // NewNamedReflector same as NewReflector, but with a specified name for logging func NewNamedReflector(name string, lw ListerWatcher, expectedType interface{}, store Store, resyncPeriod time.Duration) *Reflector { + realClock := &clock.RealClock{} r := &Reflector{ name: name, listerWatcher: lw, store: store, - period: time.Second, - resyncPeriod: resyncPeriod, - clock: &clock.RealClock{}, + // We used to make the call every 1sec (1 QPS), the goal here is to achieve ~98% traffic reduction when + // API server is not healthy. With these parameters, backoff will stop at [30,60) sec interval which is + // 0.22 QPS. If we don't backoff for 2min, assume API server is healthy and we reset the backoff. + backoffManager: wait.NewExponentialBackoffManager(800*time.Millisecond, 30*time.Second, 2*time.Minute, 2.0, 1.0, realClock), + resyncPeriod: resyncPeriod, + clock: realClock, } r.setExpectedType(expectedType) return r @@ -144,15 +168,17 @@ func (r *Reflector) setExpectedType(expectedType interface{}) { // call chains to NewReflector, so they'd be low entropy names for reflectors var internalPackages = []string{"client-go/tools/cache/"} -// Run starts a watch and handles watch events. Will restart the watch if it is closed. +// Run repeatedly uses the reflector's ListAndWatch to fetch all the +// objects and subsequent deltas. // Run will exit when stopCh is closed. func (r *Reflector) Run(stopCh <-chan struct{}) { - klog.V(3).Infof("Starting reflector %v (%s) from %s", r.expectedTypeName, r.resyncPeriod, r.name) - wait.Until(func() { + klog.V(2).Infof("Starting reflector %s (%s) from %s", r.expectedTypeName, r.resyncPeriod, r.name) + wait.BackoffUntil(func() { if err := r.ListAndWatch(stopCh); err != nil { utilruntime.HandleError(err) } - }, r.period, stopCh) + }, r.backoffManager, true, stopCh) + klog.V(2).Infof("Stopping reflector %s (%s) from %s", r.expectedTypeName, r.resyncPeriod, r.name) } var ( @@ -185,15 +211,13 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { klog.V(3).Infof("Listing and watching %v from %s", r.expectedTypeName, r.name) var resourceVersion string - // Explicitly set "0" as resource version - it's fine for the List() - // to be served from cache and potentially be delayed relative to - // etcd contents. Reflector framework will catch up via Watch() eventually. - options := metav1.ListOptions{ResourceVersion: "0"} + options := metav1.ListOptions{ResourceVersion: r.relistResourceVersion()} if err := func() error { initTrace := trace.New("Reflector ListAndWatch", trace.Field{"name", r.name}) defer initTrace.LogIfLong(10 * time.Second) var list runtime.Object + var paginatedResult bool var err error listCh := make(chan struct{}, 1) panicCh := make(chan interface{}, 1) @@ -208,11 +232,40 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { pager := pager.New(pager.SimplePageFunc(func(opts metav1.ListOptions) (runtime.Object, error) { return r.listerWatcher.List(opts) })) - if r.WatchListPageSize != 0 { + switch { + case r.WatchListPageSize != 0: pager.PageSize = r.WatchListPageSize + case r.paginatedResult: + // We got a paginated result initially. Assume this resource and server honor + // paging requests (i.e. watch cache is probably disabled) and leave the default + // pager size set. + case options.ResourceVersion != "" && options.ResourceVersion != "0": + // User didn't explicitly request pagination. + // + // With ResourceVersion != "", we have a possibility to list from watch cache, + // but we do that (for ResourceVersion != "0") only if Limit is unset. + // To avoid thundering herd on etcd (e.g. on master upgrades), we explicitly + // switch off pagination to force listing from watch cache (if enabled). + // With the existing semantic of RV (result is at least as fresh as provided RV), + // this is correct and doesn't lead to going back in time. + // + // We also don't turn off pagination for ResourceVersion="0", since watch cache + // is ignoring Limit in that case anyway, and if watch cache is not enabled + // we don't introduce regression. + pager.PageSize = 0 + } + + list, paginatedResult, err = pager.List(context.Background(), options) + if isExpiredError(err) || isTooLargeResourceVersionError(err) { + r.setIsLastSyncResourceVersionUnavailable(true) + // Retry immediately if the resource version used to list is unavailable. + // The pager already falls back to full list if paginated list calls fail due to an "Expired" error on + // continuation pages, but the pager might not be enabled, the full list might fail because the + // resource version it is listing at is expired or the cache may not yet be synced to the provided + // resource version. So we need to fallback to resourceVersion="" in all to recover and ensure + // the reflector makes forward progress. + list, paginatedResult, err = pager.List(context.Background(), metav1.ListOptions{ResourceVersion: r.relistResourceVersion()}) } - // Pager falls back to full list if paginated list calls fail due to an "Expired" error. - list, err = pager.List(context.Background(), options) close(listCh) }() select { @@ -225,6 +278,22 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { if err != nil { return fmt.Errorf("%s: Failed to list %v: %v", r.name, r.expectedTypeName, err) } + + // We check if the list was paginated and if so set the paginatedResult based on that. + // However, we want to do that only for the initial list (which is the only case + // when we set ResourceVersion="0"). The reasoning behind it is that later, in some + // situations we may force listing directly from etcd (by setting ResourceVersion="") + // which will return paginated result, even if watch cache is enabled. However, in + // that case, we still want to prefer sending requests to watch cache if possible. + // + // Paginated result returned for request with ResourceVersion="0" mean that watch + // cache is disabled and there are a lot of objects of a given type. In such case, + // there is no need to prefer listing from watch cache. + if options.ResourceVersion == "0" && paginatedResult { + r.paginatedResult = true + } + + r.setIsLastSyncResourceVersionUnavailable(false) // list was successful initTrace.Step("Objects listed") listMetaInterface, err := meta.ListAccessor(list) if err != nil { @@ -296,12 +365,19 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { AllowWatchBookmarks: true, } + // start the clock before sending the request, since some proxies won't flush headers until after the first watch event is sent + start := r.clock.Now() w, err := r.listerWatcher.Watch(options) if err != nil { - switch err { - case io.EOF: + switch { + case isExpiredError(err): + // Don't set LastSyncResourceVersionExpired - LIST call with ResourceVersion=RV already + // has a semantic that it returns data at least as fresh as provided RV. + // So first try to LIST with setting RV to resource version of last observed object. + klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.expectedTypeName, err) + case err == io.EOF: // watch closed normally - case io.ErrUnexpectedEOF: + case err == io.ErrUnexpectedEOF: klog.V(1).Infof("%s: Watch for %v closed with unexpected EOF: %v", r.name, r.expectedTypeName, err) default: utilruntime.HandleError(fmt.Errorf("%s: Failed to watch %v: %v", r.name, r.expectedTypeName, err)) @@ -317,11 +393,14 @@ func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { return nil } - if err := r.watchHandler(w, &resourceVersion, resyncerrc, stopCh); err != nil { + if err := r.watchHandler(start, w, &resourceVersion, resyncerrc, stopCh); err != nil { if err != errorStopRequested { switch { - case apierrs.IsResourceExpired(err): - klog.V(4).Infof("%s: watch of %v ended with: %v", r.name, r.expectedTypeName, err) + case isExpiredError(err): + // Don't set LastSyncResourceVersionUnavailable - LIST call with ResourceVersion=RV already + // has a semantic that it returns data at least as fresh as provided RV. + // So first try to LIST with setting RV to resource version of last observed object. + klog.V(4).Infof("%s: watch of %v closed with: %v", r.name, r.expectedTypeName, err) default: klog.Warningf("%s: watch of %v ended with: %v", r.name, r.expectedTypeName, err) } @@ -341,8 +420,7 @@ func (r *Reflector) syncWith(items []runtime.Object, resourceVersion string) err } // watchHandler watches w and keeps *resourceVersion up to date. -func (r *Reflector) watchHandler(w watch.Interface, resourceVersion *string, errc chan error, stopCh <-chan struct{}) error { - start := r.clock.Now() +func (r *Reflector) watchHandler(start time.Time, w watch.Interface, resourceVersion *string, errc chan error, stopCh <-chan struct{}) error { eventCount := 0 // Stopping the watcher should be idempotent and if we return from this function there's no way @@ -361,7 +439,7 @@ loop: break loop } if event.Type == watch.Error { - return apierrs.FromObject(event.Object) + return apierrors.FromObject(event.Object) } if r.expectedType != nil { if e, a := r.expectedType, reflect.TypeOf(event.Object); e != a { @@ -432,3 +510,67 @@ func (r *Reflector) setLastSyncResourceVersion(v string) { defer r.lastSyncResourceVersionMutex.Unlock() r.lastSyncResourceVersion = v } + +// relistResourceVersion determines the resource version the reflector should list or relist from. +// Returns either the lastSyncResourceVersion so that this reflector will relist with a resource +// versions no older than has already been observed in relist results or watch events, or, if the last relist resulted +// in an HTTP 410 (Gone) status code, returns "" so that the relist will use the latest resource version available in +// etcd via a quorum read. +func (r *Reflector) relistResourceVersion() string { + r.lastSyncResourceVersionMutex.RLock() + defer r.lastSyncResourceVersionMutex.RUnlock() + + if r.isLastSyncResourceVersionUnavailable { + // Since this reflector makes paginated list requests, and all paginated list requests skip the watch cache + // if the lastSyncResourceVersion is unavailable, we set ResourceVersion="" and list again to re-establish reflector + // to the latest available ResourceVersion, using a consistent read from etcd. + return "" + } + if r.lastSyncResourceVersion == "" { + // For performance reasons, initial list performed by reflector uses "0" as resource version to allow it to + // be served from the watch cache if it is enabled. + return "0" + } + return r.lastSyncResourceVersion +} + +// setIsLastSyncResourceVersionUnavailable sets if the last list or watch request with lastSyncResourceVersion returned +// "expired" or "too large resource version" error. +func (r *Reflector) setIsLastSyncResourceVersionUnavailable(isUnavailable bool) { + r.lastSyncResourceVersionMutex.Lock() + defer r.lastSyncResourceVersionMutex.Unlock() + r.isLastSyncResourceVersionUnavailable = isUnavailable +} + +func isExpiredError(err error) bool { + // In Kubernetes 1.17 and earlier, the api server returns both apierrors.StatusReasonExpired and + // apierrors.StatusReasonGone for HTTP 410 (Gone) status code responses. In 1.18 the kube server is more consistent + // and always returns apierrors.StatusReasonExpired. For backward compatibility we can only remove the apierrors.IsGone + // check when we fully drop support for Kubernetes 1.17 servers from reflectors. + return apierrors.IsResourceExpired(err) || apierrors.IsGone(err) +} + +func isTooLargeResourceVersionError(err error) bool { + if apierrors.HasStatusCause(err, metav1.CauseTypeResourceVersionTooLarge) { + return true + } + // In Kubernetes 1.17.0-1.18.5, the api server doesn't set the error status cause to + // metav1.CauseTypeResourceVersionTooLarge to indicate that the requested minimum resource + // version is larger than the largest currently available resource version. To ensure backward + // compatibility with these server versions we also need to detect the error based on the content + // of the error message field. + if !apierrors.IsTimeout(err) { + return false + } + apierr, ok := err.(apierrors.APIStatus) + if !ok || apierr == nil || apierr.Status().Details == nil { + return false + } + for _, cause := range apierr.Status().Details.Causes { + // Matches the message returned by api server 1.17.0-1.18.5 for this error condition + if cause.Message == "Too large resource version" { + return true + } + } + return false +} diff --git a/vendor/k8s.io/client-go/tools/cache/shared_informer.go b/vendor/k8s.io/client-go/tools/cache/shared_informer.go index f59a0852f..df8c67dce 100644 --- a/vendor/k8s.io/client-go/tools/cache/shared_informer.go +++ b/vendor/k8s.io/client-go/tools/cache/shared_informer.go @@ -21,11 +21,11 @@ import ( "sync" "time" + "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/clock" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/util/retry" "k8s.io/utils/buffer" "k8s.io/klog" @@ -46,15 +46,6 @@ import ( // An object state is either "absent" or present with a // ResourceVersion and other appropriate content. // -// A SharedInformer gets object states from apiservers using a -// sequence of LIST and WATCH operations. Through this sequence the -// apiservers provide a sequence of "collection states" to the -// informer, where each collection state defines the state of every -// object of the collection. No promise --- beyond what is implied by -// other remarks here --- is made about how one informer's sequence of -// collection states relates to a different informer's sequence of -// collection states. -// // A SharedInformer maintains a local cache, exposed by GetStore() and // by GetIndexer() in the case of an indexed informer, of the state of // each relevant object. This cache is eventually consistent with the @@ -67,10 +58,17 @@ import ( // To be formally complete, we say that the absent state meets any // restriction by label selector or field selector. // +// For a given informer and relevant object ID X, the sequence of +// states that appears in the informer's cache is a subsequence of the +// states authoritatively associated with X. That is, some states +// might never appear in the cache but ordering among the appearing +// states is correct. Note, however, that there is no promise about +// ordering between states seen for different objects. +// // The local cache starts out empty, and gets populated and updated // during `Run()`. // -// As a simple example, if a collection of objects is henceforeth +// As a simple example, if a collection of objects is henceforth // unchanging, a SharedInformer is created that links to that // collection, and that SharedInformer is `Run()` then that // SharedInformer's cache eventually holds an exact copy of that @@ -91,6 +89,10 @@ import ( // a given object, and `SplitMetaNamespaceKey(key)` to split a key // into its constituent parts. // +// Every query against the local cache is answered entirely from one +// snapshot of the cache's state. Thus, the result of a `List` call +// will not contain two entries with the same namespace and name. +// // A client is identified here by a ResourceEventHandler. For every // update to the SharedInformer's local cache and for every client // added before `Run()`, eventually either the SharedInformer is @@ -106,7 +108,16 @@ import ( // and index updates happen before such a prescribed notification. // For a given SharedInformer and client, the notifications are // delivered sequentially. For a given SharedInformer, client, and -// object ID, the notifications are delivered in order. +// object ID, the notifications are delivered in order. Because +// `ObjectMeta.UID` has no role in identifying objects, it is possible +// that when (1) object O1 with ID (e.g. namespace and name) X and +// `ObjectMeta.UID` U1 in the SharedInformer's local cache is deleted +// and later (2) another object O2 with ID X and ObjectMeta.UID U2 is +// created the informer's clients are not notified of (1) and (2) but +// rather are notified only of an update from O1 to O2. Clients that +// need to detect such cases might do so by comparing the `ObjectMeta.UID` +// field of the old and the new object in the code that handles update +// notifications (i.e. `OnUpdate` method of ResourceEventHandler). // // A client must process each notification promptly; a SharedInformer // is not engineered to deal well with a large backlog of @@ -114,11 +125,6 @@ import ( // to something else, for example through a // `client-go/util/workqueue`. // -// Each query to an informer's local cache --- whether a single-object -// lookup, a list operation, or a use of one of its indices --- is -// answered entirely from one of the collection states received by -// that informer. -// // A delete notification exposes the last locally known non-absent // state, except that its ResourceVersion is replaced with a // ResourceVersion in which the object is actually absent. @@ -128,14 +134,23 @@ type SharedInformer interface { // between different handlers. AddEventHandler(handler ResourceEventHandler) // AddEventHandlerWithResyncPeriod adds an event handler to the - // shared informer using the specified resync period. The resync - // operation consists of delivering to the handler a create - // notification for every object in the informer's local cache; it - // does not add any interactions with the authoritative storage. + // shared informer with the requested resync period; zero means + // this handler does not care about resyncs. The resync operation + // consists of delivering to the handler an update notification + // for every object in the informer's local cache; it does not add + // any interactions with the authoritative storage. Some + // informers do no resyncs at all, not even for handlers added + // with a non-zero resyncPeriod. For an informer that does + // resyncs, and for each handler that requests resyncs, that + // informer develops a nominal resync period that is no shorter + // than the requested period but may be longer. The actual time + // between any two resyncs may be longer than the nominal period + // because the implementation takes time to do work and there may + // be competing load and scheduling noise. AddEventHandlerWithResyncPeriod(handler ResourceEventHandler, resyncPeriod time.Duration) // GetStore returns the informer's local cache as a Store. GetStore() Store - // GetController gives back a synthetic interface that "votes" to start the informer + // GetController is deprecated, it does nothing useful GetController() Controller // Run starts and runs the shared informer, returning after it stops. // The informer will be stopped when stopCh is closed. @@ -159,21 +174,32 @@ type SharedIndexInformer interface { } // NewSharedInformer creates a new instance for the listwatcher. -func NewSharedInformer(lw ListerWatcher, objType runtime.Object, resyncPeriod time.Duration) SharedInformer { - return NewSharedIndexInformer(lw, objType, resyncPeriod, Indexers{}) +func NewSharedInformer(lw ListerWatcher, exampleObject runtime.Object, defaultEventHandlerResyncPeriod time.Duration) SharedInformer { + return NewSharedIndexInformer(lw, exampleObject, defaultEventHandlerResyncPeriod, Indexers{}) } // NewSharedIndexInformer creates a new instance for the listwatcher. -func NewSharedIndexInformer(lw ListerWatcher, objType runtime.Object, defaultEventHandlerResyncPeriod time.Duration, indexers Indexers) SharedIndexInformer { +// The created informer will not do resyncs if the given +// defaultEventHandlerResyncPeriod is zero. Otherwise: for each +// handler that with a non-zero requested resync period, whether added +// before or after the informer starts, the nominal resync period is +// the requested resync period rounded up to a multiple of the +// informer's resync checking period. Such an informer's resync +// checking period is established when the informer starts running, +// and is the maximum of (a) the minimum of the resync periods +// requested before the informer starts and the +// defaultEventHandlerResyncPeriod given here and (b) the constant +// `minimumResyncPeriod` defined in this file. +func NewSharedIndexInformer(lw ListerWatcher, exampleObject runtime.Object, defaultEventHandlerResyncPeriod time.Duration, indexers Indexers) SharedIndexInformer { realClock := &clock.RealClock{} sharedIndexInformer := &sharedIndexInformer{ processor: &sharedProcessor{clock: realClock}, indexer: NewIndexer(DeletionHandlingMetaNamespaceKeyFunc, indexers), listerWatcher: lw, - objectType: objType, + objectType: exampleObject, resyncCheckPeriod: defaultEventHandlerResyncPeriod, defaultEventHandlerResyncPeriod: defaultEventHandlerResyncPeriod, - cacheMutationDetector: NewCacheMutationDetector(fmt.Sprintf("%T", objType)), + cacheMutationDetector: NewCacheMutationDetector(fmt.Sprintf("%T", exampleObject)), clock: realClock, } return sharedIndexInformer @@ -228,6 +254,19 @@ func WaitForCacheSync(stopCh <-chan struct{}, cacheSyncs ...InformerSynced) bool return true } +// `*sharedIndexInformer` implements SharedIndexInformer and has three +// main components. One is an indexed local cache, `indexer Indexer`. +// The second main component is a Controller that pulls +// objects/notifications using the ListerWatcher and pushes them into +// a DeltaFIFO --- whose knownObjects is the informer's local cache +// --- while concurrently Popping Deltas values from that fifo and +// processing them with `sharedIndexInformer::HandleDeltas`. Each +// invocation of HandleDeltas, which is done with the fifo's lock +// held, processes each Delta in turn. For each Delta this both +// updates the local cache and stuffs the relevant notification into +// the sharedProcessor. The third main component is that +// sharedProcessor, which is responsible for relaying those +// notifications to each of the informer's clients. type sharedIndexInformer struct { indexer Indexer controller Controller @@ -235,9 +274,13 @@ type sharedIndexInformer struct { processor *sharedProcessor cacheMutationDetector MutationDetector - // This block is tracked to handle late initialization of the controller listerWatcher ListerWatcher - objectType runtime.Object + + // objectType is an example object of the type this informer is + // expected to handle. Only the type needs to be right, except + // that when that is `unstructured.Unstructured` the object's + // `"apiVersion"` and `"kind"` must also be right. + objectType runtime.Object // resyncCheckPeriod is how often we want the reflector's resync timer to fire so it can call // shouldResync to check if any of our listeners need a resync. @@ -293,7 +336,10 @@ type deleteNotification struct { func (s *sharedIndexInformer) Run(stopCh <-chan struct{}) { defer utilruntime.HandleCrash() - fifo := NewDeltaFIFO(MetaNamespaceKeyFunc, s.indexer) + fifo := NewDeltaFIFOWithOptions(DeltaFIFOOptions{ + KnownObjects: s.indexer, + EmitDeltaTypeReplaced: true, + }) cfg := &Config{ Queue: fifo, @@ -452,19 +498,33 @@ func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error { // from oldest to newest for _, d := range obj.(Deltas) { switch d.Type { - case Sync, Added, Updated: - isSync := d.Type == Sync + case Sync, Replaced, Added, Updated: s.cacheMutationDetector.AddObject(d.Object) if old, exists, err := s.indexer.Get(d.Object); err == nil && exists { if err := s.indexer.Update(d.Object); err != nil { return err } + + isSync := false + switch { + case d.Type == Sync: + // Sync events are only propagated to listeners that requested resync + isSync = true + case d.Type == Replaced: + if accessor, err := meta.Accessor(d.Object); err == nil { + if oldAccessor, err := meta.Accessor(old); err == nil { + // Replaced events that didn't change resourceVersion are treated as resync events + // and only propagated to listeners that requested resync + isSync = accessor.GetResourceVersion() == oldAccessor.GetResourceVersion() + } + } + } s.processor.distribute(updateNotification{oldObj: old, newObj: d.Object}, isSync) } else { if err := s.indexer.Add(d.Object); err != nil { return err } - s.processor.distribute(addNotification{newObj: d.Object}, isSync) + s.processor.distribute(addNotification{newObj: d.Object}, false) } case Deleted: if err := s.indexer.Delete(d.Object); err != nil { @@ -476,6 +536,12 @@ func (s *sharedIndexInformer) HandleDeltas(obj interface{}) error { return nil } +// sharedProcessor has a collection of processorListener and can +// distribute a notification object to its listeners. There are two +// kinds of distribute operations. The sync distributions go to a +// subset of the listeners that (a) is recomputed in the occasional +// calls to shouldResync and (b) every listener is initially put in. +// The non-sync distributions go to every listener. type sharedProcessor struct { listenersStarted bool listenersLock sync.RWMutex @@ -567,6 +633,17 @@ func (p *sharedProcessor) resyncCheckPeriodChanged(resyncCheckPeriod time.Durati } } +// processorListener relays notifications from a sharedProcessor to +// one ResourceEventHandler --- using two goroutines, two unbuffered +// channels, and an unbounded ring buffer. The `add(notification)` +// function sends the given notification to `addCh`. One goroutine +// runs `pop()`, which pumps notifications from `addCh` to `nextCh` +// using storage in the ring buffer while `nextCh` is not keeping up. +// Another goroutine runs `run()`, which receives notifications from +// `nextCh` and synchronously invokes the appropriate handler method. +// +// processorListener also keeps track of the adjusted requested resync +// period of the listener. type processorListener struct { nextCh chan interface{} addCh chan interface{} @@ -580,11 +657,22 @@ type processorListener struct { // we should try to do something better. pendingNotifications buffer.RingGrowing - // requestedResyncPeriod is how frequently the listener wants a full resync from the shared informer + // requestedResyncPeriod is how frequently the listener wants a + // full resync from the shared informer, but modified by two + // adjustments. One is imposing a lower bound, + // `minimumResyncPeriod`. The other is another lower bound, the + // sharedProcessor's `resyncCheckPeriod`, that is imposed (a) only + // in AddEventHandlerWithResyncPeriod invocations made after the + // sharedProcessor starts and (b) only if the informer does + // resyncs at all. requestedResyncPeriod time.Duration - // resyncPeriod is how frequently the listener wants a full resync from the shared informer. This - // value may differ from requestedResyncPeriod if the shared informer adjusts it to align with the - // informer's overall resync check period. + // resyncPeriod is the threshold that will be used in the logic + // for this listener. This value differs from + // requestedResyncPeriod only when the sharedIndexInformer does + // not do resyncs, in which case the value here is zero. The + // actual time between resyncs depends on when the + // sharedProcessor's `shouldResync` function is invoked and when + // the sharedIndexInformer processes `Sync` type Delta objects. resyncPeriod time.Duration // nextResync is the earliest time the listener should get a full resync nextResync time.Time @@ -648,29 +736,21 @@ func (p *processorListener) run() { // delivering again. stopCh := make(chan struct{}) wait.Until(func() { - // this gives us a few quick retries before a long pause and then a few more quick retries - err := wait.ExponentialBackoff(retry.DefaultRetry, func() (bool, error) { - for next := range p.nextCh { - switch notification := next.(type) { - case updateNotification: - p.handler.OnUpdate(notification.oldObj, notification.newObj) - case addNotification: - p.handler.OnAdd(notification.newObj) - case deleteNotification: - p.handler.OnDelete(notification.oldObj) - default: - utilruntime.HandleError(fmt.Errorf("unrecognized notification: %T", next)) - } + for next := range p.nextCh { + switch notification := next.(type) { + case updateNotification: + p.handler.OnUpdate(notification.oldObj, notification.newObj) + case addNotification: + p.handler.OnAdd(notification.newObj) + case deleteNotification: + p.handler.OnDelete(notification.oldObj) + default: + utilruntime.HandleError(fmt.Errorf("unrecognized notification: %T", next)) } - // the only way to get here is if the p.nextCh is empty and closed - return true, nil - }) - - // the only way to get here is if the p.nextCh is empty and closed - if err == nil { - close(stopCh) } - }, 1*time.Minute, stopCh) + // the only way to get here is if the p.nextCh is empty and closed + close(stopCh) + }, 1*time.Second, stopCh) } // shouldResync deterimines if the listener needs a resync. If the listener's resyncPeriod is 0, diff --git a/vendor/k8s.io/client-go/tools/cache/store.go b/vendor/k8s.io/client-go/tools/cache/store.go index fc844efe6..886e95d2d 100644 --- a/vendor/k8s.io/client-go/tools/cache/store.go +++ b/vendor/k8s.io/client-go/tools/cache/store.go @@ -23,27 +23,50 @@ import ( "k8s.io/apimachinery/pkg/api/meta" ) -// Store is a generic object storage interface. Reflector knows how to watch a server -// and update a store. A generic store is provided, which allows Reflector to be used -// as a local caching system, and an LRU store, which allows Reflector to work like a -// queue of items yet to be processed. +// Store is a generic object storage and processing interface. A +// Store holds a map from string keys to accumulators, and has +// operations to add, update, and delete a given object to/from the +// accumulator currently associated with a given key. A Store also +// knows how to extract the key from a given object, so many operations +// are given only the object. // -// Store makes no assumptions about stored object identity; it is the responsibility -// of a Store implementation to provide a mechanism to correctly key objects and to -// define the contract for obtaining objects by some arbitrary key type. +// In the simplest Store implementations each accumulator is simply +// the last given object, or empty after Delete, and thus the Store's +// behavior is simple storage. +// +// Reflector knows how to watch a server and update a Store. This +// package provides a variety of implementations of Store. type Store interface { + + // Add adds the given object to the accumulator associated with the given object's key Add(obj interface{}) error + + // Update updates the given object in the accumulator associated with the given object's key Update(obj interface{}) error + + // Delete deletes the given object from the accumulator associated with the given object's key Delete(obj interface{}) error + + // List returns a list of all the currently non-empty accumulators List() []interface{} + + // ListKeys returns a list of all the keys currently associated with non-empty accumulators ListKeys() []string + + // Get returns the accumulator associated with the given object's key Get(obj interface{}) (item interface{}, exists bool, err error) + + // GetByKey returns the accumulator associated with the given key GetByKey(key string) (item interface{}, exists bool, err error) // Replace will delete the contents of the store, using instead the // given list. Store takes ownership of the list, you should not reference // it after calling this function. Replace([]interface{}, string) error + + // Resync is meaningless in the terms appearing here but has + // meaning in some implementations that have non-trivial + // additional behavior (e.g., DeltaFIFO). Resync() error } @@ -106,9 +129,8 @@ func SplitMetaNamespaceKey(key string) (namespace, name string, err error) { return "", "", fmt.Errorf("unexpected key format: %q", key) } -// cache responsibilities are limited to: -// 1. Computing keys for objects via keyFunc -// 2. Invoking methods of a ThreadSafeStorage interface +// `*cache` implements Indexer in terms of a ThreadSafeStore and an +// associated KeyFunc. type cache struct { // cacheStorage bears the burden of thread safety for the cache cacheStorage ThreadSafeStore @@ -222,9 +244,9 @@ func (c *cache) Replace(list []interface{}, resourceVersion string) error { return nil } -// Resync touches all items in the store to force processing +// Resync is meaningless for one of these func (c *cache) Resync() error { - return c.cacheStorage.Resync() + return nil } // NewStore returns a Store implemented simply with a map and a lock. diff --git a/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go b/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go index e72325147..56251179b 100644 --- a/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go +++ b/vendor/k8s.io/client-go/tools/cache/thread_safe_store.go @@ -23,7 +23,11 @@ import ( "k8s.io/apimachinery/pkg/util/sets" ) -// ThreadSafeStore is an interface that allows concurrent access to a storage backend. +// ThreadSafeStore is an interface that allows concurrent indexed +// access to a storage backend. It is like Indexer but does not +// (necessarily) know how to extract the Store key from a given +// object. +// // TL;DR caveats: you must not modify anything returned by Get or List as it will break // the indexing feature in addition to not being thread safe. // @@ -51,6 +55,7 @@ type ThreadSafeStore interface { // AddIndexers adds more indexers to this store. If you call this after you already have data // in the store, the results are undefined. AddIndexers(newIndexers Indexers) error + // Resync is a no-op and is deprecated Resync() error } @@ -131,8 +136,8 @@ func (c *threadSafeMap) Replace(items map[string]interface{}, resourceVersion st } } -// Index returns a list of items that match on the index function -// Index is thread-safe so long as you treat all items as immutable +// Index returns a list of items that match the given object on the index function. +// Index is thread-safe so long as you treat all items as immutable. func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{}, error) { c.lock.RLock() defer c.lock.RUnlock() @@ -142,37 +147,37 @@ func (c *threadSafeMap) Index(indexName string, obj interface{}) ([]interface{}, return nil, fmt.Errorf("Index with name %s does not exist", indexName) } - indexKeys, err := indexFunc(obj) + indexedValues, err := indexFunc(obj) if err != nil { return nil, err } index := c.indices[indexName] - var returnKeySet sets.String - if len(indexKeys) == 1 { + var storeKeySet sets.String + if len(indexedValues) == 1 { // In majority of cases, there is exactly one value matching. // Optimize the most common path - deduping is not needed here. - returnKeySet = index[indexKeys[0]] + storeKeySet = index[indexedValues[0]] } else { // Need to de-dupe the return list. // Since multiple keys are allowed, this can happen. - returnKeySet = sets.String{} - for _, indexKey := range indexKeys { - for key := range index[indexKey] { - returnKeySet.Insert(key) + storeKeySet = sets.String{} + for _, indexedValue := range indexedValues { + for key := range index[indexedValue] { + storeKeySet.Insert(key) } } } - list := make([]interface{}, 0, returnKeySet.Len()) - for absoluteKey := range returnKeySet { - list = append(list, c.items[absoluteKey]) + list := make([]interface{}, 0, storeKeySet.Len()) + for storeKey := range storeKeySet { + list = append(list, c.items[storeKey]) } return list, nil } -// ByIndex returns a list of items that match an exact value on the index function -func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, error) { +// ByIndex returns a list of the items whose indexed values in the given index include the given indexed value +func (c *threadSafeMap) ByIndex(indexName, indexedValue string) ([]interface{}, error) { c.lock.RLock() defer c.lock.RUnlock() @@ -183,7 +188,7 @@ func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, erro index := c.indices[indexName] - set := index[indexKey] + set := index[indexedValue] list := make([]interface{}, 0, set.Len()) for key := range set { list = append(list, c.items[key]) @@ -192,9 +197,9 @@ func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, erro return list, nil } -// IndexKeys returns a list of keys that match on the index function. +// IndexKeys returns a list of the Store keys of the objects whose indexed values in the given index include the given indexed value. // IndexKeys is thread-safe so long as you treat all items as immutable. -func (c *threadSafeMap) IndexKeys(indexName, indexKey string) ([]string, error) { +func (c *threadSafeMap) IndexKeys(indexName, indexedValue string) ([]string, error) { c.lock.RLock() defer c.lock.RUnlock() @@ -205,7 +210,7 @@ func (c *threadSafeMap) IndexKeys(indexName, indexKey string) ([]string, error) index := c.indices[indexName] - set := index[indexKey] + set := index[indexedValue] return set.List(), nil } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go index 1f1209f8d..44317dd01 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/types.go @@ -70,6 +70,9 @@ type Cluster struct { LocationOfOrigin string // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` + // TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used. + // +optional + TLSServerName string `json:"tls-server-name,omitempty"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go index 2159ffc79..8ccacd3f8 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/types.go @@ -63,6 +63,9 @@ type Preferences struct { type Cluster struct { // Server is the address of the kubernetes cluster (https://hostname:port). Server string `json:"server"` + // TLSServerName is used to check server certificate. If TLSServerName is empty, the hostname used to contact the server is used. + // +optional + TLSServerName string `json:"tls-server-name,omitempty"` // InsecureSkipTLSVerify skips the validity check for the server's certificate. This will make your HTTPS connections insecure. // +optional InsecureSkipTLSVerify bool `json:"insecure-skip-tls-verify,omitempty"` diff --git a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go index 31e00ea6e..8f3631e15 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/api/v1/zz_generated.conversion.go @@ -233,6 +233,7 @@ func Convert_api_AuthProviderConfig_To_v1_AuthProviderConfig(in *api.AuthProvide func autoConvert_v1_Cluster_To_api_Cluster(in *Cluster, out *api.Cluster, s conversion.Scope) error { out.Server = in.Server + out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthority = in.CertificateAuthority out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) @@ -250,6 +251,7 @@ func Convert_v1_Cluster_To_api_Cluster(in *Cluster, out *api.Cluster, s conversi func autoConvert_api_Cluster_To_v1_Cluster(in *api.Cluster, out *Cluster, s conversion.Scope) error { // INFO: in.LocationOfOrigin opted out of conversion generation out.Server = in.Server + out.TLSServerName = in.TLSServerName out.InsecureSkipTLSVerify = in.InsecureSkipTLSVerify out.CertificateAuthority = in.CertificateAuthority out.CertificateAuthorityData = *(*[]byte)(unsafe.Pointer(&in.CertificateAuthorityData)) diff --git a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go index 44115130d..a9806384a 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/client_config.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/client_config.go @@ -210,6 +210,7 @@ func getServerIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, configClientConfig.CAFile = configClusterInfo.CertificateAuthority configClientConfig.CAData = configClusterInfo.CertificateAuthorityData configClientConfig.Insecure = configClusterInfo.InsecureSkipTLSVerify + configClientConfig.ServerName = configClusterInfo.TLSServerName mergo.MergeWithOverwrite(mergedConfig, configClientConfig) return mergedConfig, nil @@ -460,6 +461,14 @@ func (config *DirectClientConfig) getCluster() (clientcmdapi.Cluster, error) { mergedClusterInfo.CertificateAuthorityData = config.overrides.ClusterInfo.CertificateAuthorityData } + // if the --tls-server-name has been set in overrides, use that value. + // if the --server has been set in overrides, then use the value of --tls-server-name specified on the CLI too. This gives the property + // that setting a --server will effectively clear the KUBECONFIG value of tls-server-name if it is specified on the command line which is + // usually correct. + if config.overrides.ClusterInfo.TLSServerName != "" || config.overrides.ClusterInfo.Server != "" { + mergedClusterInfo.TLSServerName = config.overrides.ClusterInfo.TLSServerName + } + return *mergedClusterInfo, nil } diff --git a/vendor/k8s.io/client-go/tools/clientcmd/overrides.go b/vendor/k8s.io/client-go/tools/clientcmd/overrides.go index bfca03284..95cba0fac 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/overrides.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/overrides.go @@ -71,6 +71,7 @@ type ClusterOverrideFlags struct { APIVersion FlagInfo CertificateAuthority FlagInfo InsecureSkipTLSVerify FlagInfo + TLSServerName FlagInfo } // FlagInfo contains information about how to register a flag. This struct is useful if you want to provide a way for an extender to @@ -145,6 +146,7 @@ const ( FlagContext = "context" FlagNamespace = "namespace" FlagAPIServer = "server" + FlagTLSServerName = "tls-server-name" FlagInsecure = "insecure-skip-tls-verify" FlagCertFile = "client-certificate" FlagKeyFile = "client-key" @@ -189,6 +191,7 @@ func RecommendedClusterOverrideFlags(prefix string) ClusterOverrideFlags { APIServer: FlagInfo{prefix + FlagAPIServer, "", "", "The address and port of the Kubernetes API server"}, CertificateAuthority: FlagInfo{prefix + FlagCAFile, "", "", "Path to a cert file for the certificate authority"}, InsecureSkipTLSVerify: FlagInfo{prefix + FlagInsecure, "", "false", "If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure"}, + TLSServerName: FlagInfo{prefix + FlagTLSServerName, "", "", "If provided, this name will be used to validate server certificate. If this is not provided, hostname used to contact the server is used."}, } } @@ -226,6 +229,7 @@ func BindClusterFlags(clusterInfo *clientcmdapi.Cluster, flags *pflag.FlagSet, f flagNames.APIServer.BindStringFlag(flags, &clusterInfo.Server) flagNames.CertificateAuthority.BindStringFlag(flags, &clusterInfo.CertificateAuthority) flagNames.InsecureSkipTLSVerify.BindBoolFlag(flags, &clusterInfo.InsecureSkipTLSVerify) + flagNames.TLSServerName.BindStringFlag(flags, &clusterInfo.TLSServerName) } // BindFlags is a convenience method to bind the specified flags to their associated variables diff --git a/vendor/k8s.io/client-go/tools/clientcmd/validation.go b/vendor/k8s.io/client-go/tools/clientcmd/validation.go index 2f927072b..afe6f80b3 100644 --- a/vendor/k8s.io/client-go/tools/clientcmd/validation.go +++ b/vendor/k8s.io/client-go/tools/clientcmd/validation.go @@ -30,7 +30,7 @@ import ( var ( ErrNoContext = errors.New("no context chosen") - ErrEmptyConfig = errors.New("no configuration has been provided") + ErrEmptyConfig = errors.New("no configuration has been provided, try setting KUBERNETES_MASTER environment variable") // message is for consistency with old behavior ErrEmptyCluster = errors.New("cluster has no server defined") ) @@ -86,11 +86,41 @@ func (e errConfigurationInvalid) Error() string { return fmt.Sprintf("invalid configuration: %v", utilerrors.NewAggregate(e).Error()) } -// Errors implements the AggregateError interface +// Errors implements the utilerrors.Aggregate interface func (e errConfigurationInvalid) Errors() []error { return e } +// Is implements the utilerrors.Aggregate interface +func (e errConfigurationInvalid) Is(target error) bool { + return e.visit(func(err error) bool { + return errors.Is(err, target) + }) +} + +func (e errConfigurationInvalid) visit(f func(err error) bool) bool { + for _, err := range e { + switch err := err.(type) { + case errConfigurationInvalid: + if match := err.visit(f); match { + return match + } + case utilerrors.Aggregate: + for _, nestedErr := range err.Errors() { + if match := f(nestedErr); match { + return match + } + } + default: + if match := f(err); match { + return match + } + } + } + + return false +} + // IsConfigurationInvalid returns true if the provided error indicates the configuration is invalid. func IsConfigurationInvalid(err error) bool { switch err.(type) { diff --git a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go index 42fffd45a..61989a2cf 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/leaderelection.go @@ -241,7 +241,7 @@ func (le *LeaderElector) acquire(ctx context.Context) bool { desc := le.config.Lock.Describe() klog.Infof("attempting to acquire leader lease %v...", desc) wait.JitterUntil(func() { - succeeded = le.tryAcquireOrRenew() + succeeded = le.tryAcquireOrRenew(ctx) le.maybeReportTransition() if !succeeded { klog.V(4).Infof("failed to acquire lease %v", desc) @@ -263,18 +263,7 @@ func (le *LeaderElector) renew(ctx context.Context) { timeoutCtx, timeoutCancel := context.WithTimeout(ctx, le.config.RenewDeadline) defer timeoutCancel() err := wait.PollImmediateUntil(le.config.RetryPeriod, func() (bool, error) { - done := make(chan bool, 1) - go func() { - defer close(done) - done <- le.tryAcquireOrRenew() - }() - - select { - case <-timeoutCtx.Done(): - return false, fmt.Errorf("failed to tryAcquireOrRenew %s", timeoutCtx.Err()) - case result := <-done: - return result, nil - } + return le.tryAcquireOrRenew(timeoutCtx), nil }, timeoutCtx.Done()) le.maybeReportTransition() @@ -303,7 +292,7 @@ func (le *LeaderElector) release() bool { leaderElectionRecord := rl.LeaderElectionRecord{ LeaderTransitions: le.observedRecord.LeaderTransitions, } - if err := le.config.Lock.Update(leaderElectionRecord); err != nil { + if err := le.config.Lock.Update(context.TODO(), leaderElectionRecord); err != nil { klog.Errorf("Failed to release lock: %v", err) return false } @@ -315,7 +304,7 @@ func (le *LeaderElector) release() bool { // tryAcquireOrRenew tries to acquire a leader lease if it is not already acquired, // else it tries to renew the lease if it has already been acquired. Returns true // on success else returns false. -func (le *LeaderElector) tryAcquireOrRenew() bool { +func (le *LeaderElector) tryAcquireOrRenew(ctx context.Context) bool { now := metav1.Now() leaderElectionRecord := rl.LeaderElectionRecord{ HolderIdentity: le.config.Lock.Identity(), @@ -325,13 +314,13 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { } // 1. obtain or create the ElectionRecord - oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get() + oldLeaderElectionRecord, oldLeaderElectionRawRecord, err := le.config.Lock.Get(ctx) if err != nil { if !errors.IsNotFound(err) { klog.Errorf("error retrieving resource lock %v: %v", le.config.Lock.Describe(), err) return false } - if err = le.config.Lock.Create(leaderElectionRecord); err != nil { + if err = le.config.Lock.Create(ctx, leaderElectionRecord); err != nil { klog.Errorf("error initially creating leader election record: %v", err) return false } @@ -363,7 +352,7 @@ func (le *LeaderElector) tryAcquireOrRenew() bool { } // update the lock itself - if err = le.config.Lock.Update(leaderElectionRecord); err != nil { + if err = le.config.Lock.Update(ctx, leaderElectionRecord); err != nil { klog.Errorf("Failed to update lock: %v", err) return false } diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go index fd152b072..6390b4ef5 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/configmaplock.go @@ -17,6 +17,7 @@ limitations under the License. package resourcelock import ( + "context" "encoding/json" "errors" "fmt" @@ -41,10 +42,10 @@ type ConfigMapLock struct { } // Get returns the election record from a ConfigMap Annotation -func (cml *ConfigMapLock) Get() (*LeaderElectionRecord, []byte, error) { +func (cml *ConfigMapLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) { var record LeaderElectionRecord var err error - cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Get(cml.ConfigMapMeta.Name, metav1.GetOptions{}) + cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Get(ctx, cml.ConfigMapMeta.Name, metav1.GetOptions{}) if err != nil { return nil, nil, err } @@ -61,12 +62,12 @@ func (cml *ConfigMapLock) Get() (*LeaderElectionRecord, []byte, error) { } // Create attempts to create a LeaderElectionRecord annotation -func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error { +func (cml *ConfigMapLock) Create(ctx context.Context, ler LeaderElectionRecord) error { recordBytes, err := json.Marshal(ler) if err != nil { return err } - cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Create(&v1.ConfigMap{ + cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Create(ctx, &v1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: cml.ConfigMapMeta.Name, Namespace: cml.ConfigMapMeta.Namespace, @@ -74,12 +75,12 @@ func (cml *ConfigMapLock) Create(ler LeaderElectionRecord) error { LeaderElectionRecordAnnotationKey: string(recordBytes), }, }, - }) + }, metav1.CreateOptions{}) return err } // Update will update an existing annotation on a given resource. -func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error { +func (cml *ConfigMapLock) Update(ctx context.Context, ler LeaderElectionRecord) error { if cml.cm == nil { return errors.New("configmap not initialized, call get or create first") } @@ -87,8 +88,11 @@ func (cml *ConfigMapLock) Update(ler LeaderElectionRecord) error { if err != nil { return err } + if cml.cm.Annotations == nil { + cml.cm.Annotations = make(map[string]string) + } cml.cm.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes) - cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(cml.cm) + cml.cm, err = cml.Client.ConfigMaps(cml.ConfigMapMeta.Namespace).Update(ctx, cml.cm, metav1.UpdateOptions{}) return err } diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/endpointslock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/endpointslock.go index f5a8ffcc8..132c5a548 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/endpointslock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/endpointslock.go @@ -17,6 +17,7 @@ limitations under the License. package resourcelock import ( + "context" "encoding/json" "errors" "fmt" @@ -36,10 +37,10 @@ type EndpointsLock struct { } // Get returns the election record from a Endpoints Annotation -func (el *EndpointsLock) Get() (*LeaderElectionRecord, []byte, error) { +func (el *EndpointsLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) { var record LeaderElectionRecord var err error - el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Get(el.EndpointsMeta.Name, metav1.GetOptions{}) + el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Get(ctx, el.EndpointsMeta.Name, metav1.GetOptions{}) if err != nil { return nil, nil, err } @@ -56,12 +57,12 @@ func (el *EndpointsLock) Get() (*LeaderElectionRecord, []byte, error) { } // Create attempts to create a LeaderElectionRecord annotation -func (el *EndpointsLock) Create(ler LeaderElectionRecord) error { +func (el *EndpointsLock) Create(ctx context.Context, ler LeaderElectionRecord) error { recordBytes, err := json.Marshal(ler) if err != nil { return err } - el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Create(&v1.Endpoints{ + el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Create(ctx, &v1.Endpoints{ ObjectMeta: metav1.ObjectMeta{ Name: el.EndpointsMeta.Name, Namespace: el.EndpointsMeta.Namespace, @@ -69,12 +70,12 @@ func (el *EndpointsLock) Create(ler LeaderElectionRecord) error { LeaderElectionRecordAnnotationKey: string(recordBytes), }, }, - }) + }, metav1.CreateOptions{}) return err } // Update will update and existing annotation on a given resource. -func (el *EndpointsLock) Update(ler LeaderElectionRecord) error { +func (el *EndpointsLock) Update(ctx context.Context, ler LeaderElectionRecord) error { if el.e == nil { return errors.New("endpoint not initialized, call get or create first") } @@ -86,7 +87,7 @@ func (el *EndpointsLock) Update(ler LeaderElectionRecord) error { el.e.Annotations = make(map[string]string) } el.e.Annotations[LeaderElectionRecordAnnotationKey] = string(recordBytes) - el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Update(el.e) + el.e, err = el.Client.Endpoints(el.EndpointsMeta.Namespace).Update(ctx, el.e, metav1.UpdateOptions{}) return err } diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go index c9f175914..74630a31f 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/interface.go @@ -17,6 +17,7 @@ limitations under the License. package resourcelock import ( + "context" "fmt" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -73,13 +74,13 @@ type ResourceLockConfig struct { // by the leaderelection code. type Interface interface { // Get returns the LeaderElectionRecord - Get() (*LeaderElectionRecord, []byte, error) + Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) // Create attempts to create a LeaderElectionRecord - Create(ler LeaderElectionRecord) error + Create(ctx context.Context, ler LeaderElectionRecord) error // Update will update and existing LeaderElectionRecord - Update(ler LeaderElectionRecord) error + Update(ctx context.Context, ler LeaderElectionRecord) error // RecordEvent is used to record events RecordEvent(string) diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go index 74016b8df..3d76d174e 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/leaselock.go @@ -17,6 +17,7 @@ limitations under the License. package resourcelock import ( + "context" "encoding/json" "errors" "fmt" @@ -37,9 +38,9 @@ type LeaseLock struct { } // Get returns the election record from a Lease spec -func (ll *LeaseLock) Get() (*LeaderElectionRecord, []byte, error) { +func (ll *LeaseLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) { var err error - ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Get(ll.LeaseMeta.Name, metav1.GetOptions{}) + ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Get(ctx, ll.LeaseMeta.Name, metav1.GetOptions{}) if err != nil { return nil, nil, err } @@ -52,26 +53,26 @@ func (ll *LeaseLock) Get() (*LeaderElectionRecord, []byte, error) { } // Create attempts to create a Lease -func (ll *LeaseLock) Create(ler LeaderElectionRecord) error { +func (ll *LeaseLock) Create(ctx context.Context, ler LeaderElectionRecord) error { var err error - ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Create(&coordinationv1.Lease{ + ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Create(ctx, &coordinationv1.Lease{ ObjectMeta: metav1.ObjectMeta{ Name: ll.LeaseMeta.Name, Namespace: ll.LeaseMeta.Namespace, }, Spec: LeaderElectionRecordToLeaseSpec(&ler), - }) + }, metav1.CreateOptions{}) return err } // Update will update an existing Lease spec. -func (ll *LeaseLock) Update(ler LeaderElectionRecord) error { +func (ll *LeaseLock) Update(ctx context.Context, ler LeaderElectionRecord) error { if ll.lease == nil { return errors.New("lease not initialized, call get or create first") } ll.lease.Spec = LeaderElectionRecordToLeaseSpec(&ler) var err error - ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Update(ll.lease) + ll.lease, err = ll.Client.Leases(ll.LeaseMeta.Namespace).Update(ctx, ll.lease, metav1.UpdateOptions{}) return err } diff --git a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go index 8cb89dc4f..5ee1dcbb5 100644 --- a/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go +++ b/vendor/k8s.io/client-go/tools/leaderelection/resourcelock/multilock.go @@ -18,6 +18,7 @@ package resourcelock import ( "bytes" + "context" "encoding/json" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -34,13 +35,13 @@ type MultiLock struct { } // Get returns the older election record of the lock -func (ml *MultiLock) Get() (*LeaderElectionRecord, []byte, error) { - primary, primaryRaw, err := ml.Primary.Get() +func (ml *MultiLock) Get(ctx context.Context) (*LeaderElectionRecord, []byte, error) { + primary, primaryRaw, err := ml.Primary.Get(ctx) if err != nil { return nil, nil, err } - secondary, secondaryRaw, err := ml.Secondary.Get() + secondary, secondaryRaw, err := ml.Secondary.Get(ctx) if err != nil { // Lock is held by old client if apierrors.IsNotFound(err) && primary.HolderIdentity != ml.Identity() { @@ -60,25 +61,25 @@ func (ml *MultiLock) Get() (*LeaderElectionRecord, []byte, error) { } // Create attempts to create both primary lock and secondary lock -func (ml *MultiLock) Create(ler LeaderElectionRecord) error { - err := ml.Primary.Create(ler) +func (ml *MultiLock) Create(ctx context.Context, ler LeaderElectionRecord) error { + err := ml.Primary.Create(ctx, ler) if err != nil && !apierrors.IsAlreadyExists(err) { return err } - return ml.Secondary.Create(ler) + return ml.Secondary.Create(ctx, ler) } // Update will update and existing annotation on both two resources. -func (ml *MultiLock) Update(ler LeaderElectionRecord) error { - err := ml.Primary.Update(ler) +func (ml *MultiLock) Update(ctx context.Context, ler LeaderElectionRecord) error { + err := ml.Primary.Update(ctx, ler) if err != nil { return err } - _, _, err = ml.Secondary.Get() + _, _, err = ml.Secondary.Get(ctx) if err != nil && apierrors.IsNotFound(err) { - return ml.Secondary.Create(ler) + return ml.Secondary.Create(ctx, ler) } - return ml.Secondary.Update(ler) + return ml.Secondary.Update(ctx, ler) } // RecordEvent in leader election while adding meta-data diff --git a/vendor/k8s.io/client-go/tools/metrics/metrics.go b/vendor/k8s.io/client-go/tools/metrics/metrics.go index a01306c65..5194026bd 100644 --- a/vendor/k8s.io/client-go/tools/metrics/metrics.go +++ b/vendor/k8s.io/client-go/tools/metrics/metrics.go @@ -26,6 +26,16 @@ import ( var registerMetrics sync.Once +// DurationMetric is a measurement of some amount of time. +type DurationMetric interface { + Observe(duration time.Duration) +} + +// ExpiryMetric sets some time of expiry. If nil, assume not relevant. +type ExpiryMetric interface { + Set(expiry *time.Time) +} + // LatencyMetric observes client latency partitioned by verb and url. type LatencyMetric interface { Observe(verb string, u url.URL, latency time.Duration) @@ -37,21 +47,57 @@ type ResultMetric interface { } var ( + // ClientCertExpiry is the expiry time of a client certificate + ClientCertExpiry ExpiryMetric = noopExpiry{} + // ClientCertRotationAge is the age of a certificate that has just been rotated. + ClientCertRotationAge DurationMetric = noopDuration{} // RequestLatency is the latency metric that rest clients will update. RequestLatency LatencyMetric = noopLatency{} + // RateLimiterLatency is the client side rate limiter latency metric. + RateLimiterLatency LatencyMetric = noopLatency{} // RequestResult is the result metric that rest clients will update. RequestResult ResultMetric = noopResult{} ) +// RegisterOpts contains all the metrics to register. Metrics may be nil. +type RegisterOpts struct { + ClientCertExpiry ExpiryMetric + ClientCertRotationAge DurationMetric + RequestLatency LatencyMetric + RateLimiterLatency LatencyMetric + RequestResult ResultMetric +} + // Register registers metrics for the rest client to use. This can // only be called once. -func Register(lm LatencyMetric, rm ResultMetric) { +func Register(opts RegisterOpts) { registerMetrics.Do(func() { - RequestLatency = lm - RequestResult = rm + if opts.ClientCertExpiry != nil { + ClientCertExpiry = opts.ClientCertExpiry + } + if opts.ClientCertRotationAge != nil { + ClientCertRotationAge = opts.ClientCertRotationAge + } + if opts.RequestLatency != nil { + RequestLatency = opts.RequestLatency + } + if opts.RateLimiterLatency != nil { + RateLimiterLatency = opts.RateLimiterLatency + } + if opts.RequestResult != nil { + RequestResult = opts.RequestResult + } }) } +type noopDuration struct{} + +func (noopDuration) Observe(time.Duration) {} + +type noopExpiry struct{} + +func (noopExpiry) Set(*time.Time) {} + type noopLatency struct{} func (noopLatency) Observe(string, url.URL, time.Duration) {} diff --git a/vendor/k8s.io/client-go/tools/pager/pager.go b/vendor/k8s.io/client-go/tools/pager/pager.go index 307808be1..f6c6a0129 100644 --- a/vendor/k8s.io/client-go/tools/pager/pager.go +++ b/vendor/k8s.io/client-go/tools/pager/pager.go @@ -73,16 +73,18 @@ func New(fn ListPageFunc) *ListPager { // List returns a single list object, but attempts to retrieve smaller chunks from the // server to reduce the impact on the server. If the chunk attempt fails, it will load // the full list instead. The Limit field on options, if unset, will default to the page size. -func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runtime.Object, error) { +func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runtime.Object, bool, error) { if options.Limit == 0 { options.Limit = p.PageSize } requestedResourceVersion := options.ResourceVersion var list *metainternalversion.List + paginatedResult := false + for { select { case <-ctx.Done(): - return nil, ctx.Err() + return nil, paginatedResult, ctx.Err() default: } @@ -93,23 +95,24 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti // failing when the resource versions is established by the first page request falls out of the compaction // during the subsequent list requests). if !errors.IsResourceExpired(err) || !p.FullListIfExpired || options.Continue == "" { - return nil, err + return nil, paginatedResult, err } // the list expired while we were processing, fall back to a full list at // the requested ResourceVersion. options.Limit = 0 options.Continue = "" options.ResourceVersion = requestedResourceVersion - return p.PageFn(ctx, options) + result, err := p.PageFn(ctx, options) + return result, paginatedResult, err } m, err := meta.ListAccessor(obj) if err != nil { - return nil, fmt.Errorf("returned object must be a list: %v", err) + return nil, paginatedResult, fmt.Errorf("returned object must be a list: %v", err) } // exit early and return the object we got if we haven't processed any pages if len(m.GetContinue()) == 0 && list == nil { - return obj, nil + return obj, paginatedResult, nil } // initialize the list and fill its contents @@ -122,12 +125,12 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti list.Items = append(list.Items, obj) return nil }); err != nil { - return nil, err + return nil, paginatedResult, err } // if we have no more items, return the list if len(m.GetContinue()) == 0 { - return list, nil + return list, paginatedResult, nil } // set the next loop up @@ -136,6 +139,8 @@ func (p *ListPager) List(ctx context.Context, options metav1.ListOptions) (runti // `specifying resource version is not allowed when using continue` error. // See https://github.com/kubernetes/kubernetes/issues/85221#issuecomment-553748143. options.ResourceVersion = "" + // At this point, result is already paginated. + paginatedResult = true } } diff --git a/vendor/k8s.io/client-go/tools/record/event.go b/vendor/k8s.io/client-go/tools/record/event.go index 66f8bd634..64d1fd2d7 100644 --- a/vendor/k8s.io/client-go/tools/record/event.go +++ b/vendor/k8s.io/client-go/tools/record/event.go @@ -102,9 +102,6 @@ type EventRecorder interface { // Eventf is just like Event, but with Sprintf for the message field. Eventf(object runtime.Object, eventtype, reason, messageFmt string, args ...interface{}) - // PastEventf is just like Eventf, but with an option to specify the event's 'timestamp' field. - PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) - // AnnotatedEventf is just like eventf, but with annotations attached AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) } @@ -343,10 +340,6 @@ func (recorder *recorderImpl) Eventf(object runtime.Object, eventtype, reason, m recorder.Event(object, eventtype, reason, fmt.Sprintf(messageFmt, args...)) } -func (recorder *recorderImpl) PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) { - recorder.generateEvent(object, nil, timestamp, eventtype, reason, fmt.Sprintf(messageFmt, args...)) -} - func (recorder *recorderImpl) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { recorder.generateEvent(object, annotations, metav1.Now(), eventtype, reason, fmt.Sprintf(messageFmt, args...)) } diff --git a/vendor/k8s.io/client-go/tools/record/fake.go b/vendor/k8s.io/client-go/tools/record/fake.go index 6e031daaf..2ff444ea8 100644 --- a/vendor/k8s.io/client-go/tools/record/fake.go +++ b/vendor/k8s.io/client-go/tools/record/fake.go @@ -19,7 +19,6 @@ package record import ( "fmt" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" ) @@ -42,11 +41,8 @@ func (f *FakeRecorder) Eventf(object runtime.Object, eventtype, reason, messageF } } -func (f *FakeRecorder) PastEventf(object runtime.Object, timestamp metav1.Time, eventtype, reason, messageFmt string, args ...interface{}) { -} - func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) { - f.Eventf(object, eventtype, reason, messageFmt, args) + f.Eventf(object, eventtype, reason, messageFmt, args...) } // NewFakeRecorder creates new fake event recorder with event channel with diff --git a/vendor/k8s.io/client-go/transport/cache.go b/vendor/k8s.io/client-go/transport/cache.go index 980d36ae1..36d6500f5 100644 --- a/vendor/k8s.io/client-go/transport/cache.go +++ b/vendor/k8s.io/client-go/transport/cache.go @@ -25,6 +25,7 @@ import ( "time" utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/apimachinery/pkg/util/wait" ) // TlsTransportCache caches TLS http.RoundTrippers different configurations. The @@ -44,6 +45,8 @@ type tlsCacheKey struct { caData string certData string keyData string + certFile string + keyFile string getCert string serverName string nextProtos string @@ -91,6 +94,16 @@ func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { KeepAlive: 30 * time.Second, }).DialContext } + + // If we use are reloading files, we need to handle certificate rotation properly + // TODO(jackkleeman): We can also add rotation here when config.HasCertCallback() is true + if config.TLS.ReloadTLSFiles { + dynamicCertDialer := certRotatingDialer(tlsConfig.GetClientCertificate, dial) + tlsConfig.GetClientCertificate = dynamicCertDialer.GetClientCertificate + dial = dynamicCertDialer.connDialer.DialContext + go dynamicCertDialer.Run(wait.NeverStop) + } + // Cache a single transport for these options c.transports[key] = utilnet.SetTransportDefaults(&http.Transport{ Proxy: http.ProxyFromEnvironment, @@ -109,15 +122,23 @@ func tlsConfigKey(c *Config) (tlsCacheKey, error) { if err := loadTLSFiles(c); err != nil { return tlsCacheKey{}, err } - return tlsCacheKey{ + k := tlsCacheKey{ insecure: c.TLS.Insecure, caData: string(c.TLS.CAData), - certData: string(c.TLS.CertData), - keyData: string(c.TLS.KeyData), getCert: fmt.Sprintf("%p", c.TLS.GetCert), serverName: c.TLS.ServerName, nextProtos: strings.Join(c.TLS.NextProtos, ","), dial: fmt.Sprintf("%p", c.Dial), disableCompression: c.DisableCompression, - }, nil + } + + if c.TLS.ReloadTLSFiles { + k.certFile = c.TLS.CertFile + k.keyFile = c.TLS.KeyFile + } else { + k.certData = string(c.TLS.CertData) + k.keyData = string(c.TLS.KeyData) + } + + return k, nil } diff --git a/vendor/k8s.io/client-go/transport/cert_rotation.go b/vendor/k8s.io/client-go/transport/cert_rotation.go new file mode 100644 index 000000000..918e77f9a --- /dev/null +++ b/vendor/k8s.io/client-go/transport/cert_rotation.go @@ -0,0 +1,176 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package transport + +import ( + "bytes" + "crypto/tls" + "fmt" + "reflect" + "sync" + "time" + + utilnet "k8s.io/apimachinery/pkg/util/net" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/util/connrotation" + "k8s.io/client-go/util/workqueue" + "k8s.io/klog" +) + +const workItemKey = "key" + +// CertCallbackRefreshDuration is exposed so that integration tests can crank up the reload speed. +var CertCallbackRefreshDuration = 5 * time.Minute + +type reloadFunc func(*tls.CertificateRequestInfo) (*tls.Certificate, error) + +type dynamicClientCert struct { + clientCert *tls.Certificate + certMtx sync.RWMutex + + reload reloadFunc + connDialer *connrotation.Dialer + + // queue only ever has one item, but it has nice error handling backoff/retry semantics + queue workqueue.RateLimitingInterface +} + +func certRotatingDialer(reload reloadFunc, dial utilnet.DialFunc) *dynamicClientCert { + d := &dynamicClientCert{ + reload: reload, + connDialer: connrotation.NewDialer(connrotation.DialFunc(dial)), + queue: workqueue.NewNamedRateLimitingQueue(workqueue.DefaultControllerRateLimiter(), "DynamicClientCertificate"), + } + + return d +} + +// loadClientCert calls the callback and rotates connections if needed +func (c *dynamicClientCert) loadClientCert() (*tls.Certificate, error) { + cert, err := c.reload(nil) + if err != nil { + return nil, err + } + + // check to see if we have a change. If the values are the same, do nothing. + c.certMtx.RLock() + haveCert := c.clientCert != nil + if certsEqual(c.clientCert, cert) { + c.certMtx.RUnlock() + return c.clientCert, nil + } + c.certMtx.RUnlock() + + c.certMtx.Lock() + c.clientCert = cert + c.certMtx.Unlock() + + // The first certificate requested is not a rotation that is worth closing connections for + if !haveCert { + return cert, nil + } + + klog.V(1).Infof("certificate rotation detected, shutting down client connections to start using new credentials") + c.connDialer.CloseAll() + + return cert, nil +} + +// certsEqual compares tls Certificates, ignoring the Leaf which may get filled in dynamically +func certsEqual(left, right *tls.Certificate) bool { + if left == nil || right == nil { + return left == right + } + + if !byteMatrixEqual(left.Certificate, right.Certificate) { + return false + } + + if !reflect.DeepEqual(left.PrivateKey, right.PrivateKey) { + return false + } + + if !byteMatrixEqual(left.SignedCertificateTimestamps, right.SignedCertificateTimestamps) { + return false + } + + if !bytes.Equal(left.OCSPStaple, right.OCSPStaple) { + return false + } + + return true +} + +func byteMatrixEqual(left, right [][]byte) bool { + if len(left) != len(right) { + return false + } + + for i := range left { + if !bytes.Equal(left[i], right[i]) { + return false + } + } + return true +} + +// run starts the controller and blocks until stopCh is closed. +func (c *dynamicClientCert) Run(stopCh <-chan struct{}) { + defer utilruntime.HandleCrash() + defer c.queue.ShutDown() + + klog.V(3).Infof("Starting client certificate rotation controller") + defer klog.V(3).Infof("Shutting down client certificate rotation controller") + + go wait.Until(c.runWorker, time.Second, stopCh) + + go wait.PollImmediateUntil(CertCallbackRefreshDuration, func() (bool, error) { + c.queue.Add(workItemKey) + return false, nil + }, stopCh) + + <-stopCh +} + +func (c *dynamicClientCert) runWorker() { + for c.processNextWorkItem() { + } +} + +func (c *dynamicClientCert) processNextWorkItem() bool { + dsKey, quit := c.queue.Get() + if quit { + return false + } + defer c.queue.Done(dsKey) + + _, err := c.loadClientCert() + if err == nil { + c.queue.Forget(dsKey) + return true + } + + utilruntime.HandleError(fmt.Errorf("%v failed with : %v", dsKey, err)) + c.queue.AddRateLimited(dsKey) + + return true +} + +func (c *dynamicClientCert) GetClientCertificate(*tls.CertificateRequestInfo) (*tls.Certificate, error) { + return c.loadClientCert() +} diff --git a/vendor/k8s.io/client-go/transport/config.go b/vendor/k8s.io/client-go/transport/config.go index 9e18d11d3..c20a4a8fc 100644 --- a/vendor/k8s.io/client-go/transport/config.go +++ b/vendor/k8s.io/client-go/transport/config.go @@ -115,9 +115,10 @@ func (c *Config) Wrap(fn WrapperFunc) { // TLSConfig holds the information needed to set up a TLS transport. type TLSConfig struct { - CAFile string // Path of the PEM-encoded server trusted root certificates. - CertFile string // Path of the PEM-encoded client certificate. - KeyFile string // Path of the PEM-encoded client key. + CAFile string // Path of the PEM-encoded server trusted root certificates. + CertFile string // Path of the PEM-encoded client certificate. + KeyFile string // Path of the PEM-encoded client key. + ReloadTLSFiles bool // Set to indicate that the original config provided files, and that they should be reloaded Insecure bool // Server should be accessed without verifying the certificate. For testing only. ServerName string // Override for the server name passed to the server for SNI and used to verify certificates. diff --git a/vendor/k8s.io/client-go/transport/transport.go b/vendor/k8s.io/client-go/transport/transport.go index cd8de9828..143ebfa5c 100644 --- a/vendor/k8s.io/client-go/transport/transport.go +++ b/vendor/k8s.io/client-go/transport/transport.go @@ -23,6 +23,8 @@ import ( "fmt" "io/ioutil" "net/http" + "sync" + "time" utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/klog" @@ -81,7 +83,8 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { } var staticCert *tls.Certificate - if c.HasCertAuth() { + // Treat cert as static if either key or cert was data, not a file + if c.HasCertAuth() && !c.TLS.ReloadTLSFiles { // If key/cert were provided, verify them before setting up // tlsConfig.GetClientCertificate. cert, err := tls.X509KeyPair(c.TLS.CertData, c.TLS.KeyData) @@ -91,6 +94,11 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { staticCert = &cert } + var dynamicCertLoader func() (*tls.Certificate, error) + if c.TLS.ReloadTLSFiles { + dynamicCertLoader = cachingCertificateLoader(c.TLS.CertFile, c.TLS.KeyFile) + } + if c.HasCertAuth() || c.HasCertCallback() { tlsConfig.GetClientCertificate = func(*tls.CertificateRequestInfo) (*tls.Certificate, error) { // Note: static key/cert data always take precedence over cert @@ -98,6 +106,10 @@ func TLSConfigFor(c *Config) (*tls.Config, error) { if staticCert != nil { return staticCert, nil } + // key/cert files lead to ReloadTLSFiles being set - takes precedence over cert callback + if dynamicCertLoader != nil { + return dynamicCertLoader() + } if c.HasCertCallback() { cert, err := c.TLS.GetCert() if err != nil { @@ -129,6 +141,11 @@ func loadTLSFiles(c *Config) error { return err } + // Check that we are purely loading from files + if len(c.TLS.CertFile) > 0 && len(c.TLS.CertData) == 0 && len(c.TLS.KeyFile) > 0 && len(c.TLS.KeyData) == 0 { + c.TLS.ReloadTLSFiles = true + } + c.TLS.CertData, err = dataFromSliceOrFile(c.TLS.CertData, c.TLS.CertFile) if err != nil { return err @@ -243,3 +260,44 @@ func tryCancelRequest(rt http.RoundTripper, req *http.Request) { klog.Warningf("Unable to cancel request for %T", rt) } } + +type certificateCacheEntry struct { + cert *tls.Certificate + err error + birth time.Time +} + +// isStale returns true when this cache entry is too old to be usable +func (c *certificateCacheEntry) isStale() bool { + return time.Now().Sub(c.birth) > time.Second +} + +func newCertificateCacheEntry(certFile, keyFile string) certificateCacheEntry { + cert, err := tls.LoadX509KeyPair(certFile, keyFile) + return certificateCacheEntry{cert: &cert, err: err, birth: time.Now()} +} + +// cachingCertificateLoader ensures that we don't hammer the filesystem when opening many connections +// the underlying cert files are read at most once every second +func cachingCertificateLoader(certFile, keyFile string) func() (*tls.Certificate, error) { + current := newCertificateCacheEntry(certFile, keyFile) + var currentMtx sync.RWMutex + + return func() (*tls.Certificate, error) { + currentMtx.RLock() + if current.isStale() { + currentMtx.RUnlock() + + currentMtx.Lock() + defer currentMtx.Unlock() + + if current.isStale() { + current = newCertificateCacheEntry(certFile, keyFile) + } + } else { + defer currentMtx.RUnlock() + } + + return current.cert, current.err + } +} diff --git a/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go b/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go index 71bb6322e..6dc8ec5f2 100644 --- a/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go +++ b/vendor/k8s.io/client-go/util/workqueue/default_rate_limiters.go @@ -62,6 +62,54 @@ func (r *BucketRateLimiter) NumRequeues(item interface{}) int { func (r *BucketRateLimiter) Forget(item interface{}) { } +// ItemBucketRateLimiter implements a workqueue ratelimiter API using standard rate.Limiter. +// Each key is using a separate limiter. +type ItemBucketRateLimiter struct { + r rate.Limit + burst int + + limitersLock sync.Mutex + limiters map[interface{}]*rate.Limiter +} + +var _ RateLimiter = &ItemBucketRateLimiter{} + +// NewItemBucketRateLimiter creates new ItemBucketRateLimiter instance. +func NewItemBucketRateLimiter(r rate.Limit, burst int) *ItemBucketRateLimiter { + return &ItemBucketRateLimiter{ + r: r, + burst: burst, + limiters: make(map[interface{}]*rate.Limiter), + } +} + +// When returns a time.Duration which we need to wait before item is processed. +func (r *ItemBucketRateLimiter) When(item interface{}) time.Duration { + r.limitersLock.Lock() + defer r.limitersLock.Unlock() + + limiter, ok := r.limiters[item] + if !ok { + limiter = rate.NewLimiter(r.r, r.burst) + r.limiters[item] = limiter + } + + return limiter.Reserve().Delay() +} + +// NumRequeues returns always 0 (doesn't apply to ItemBucketRateLimiter). +func (r *ItemBucketRateLimiter) NumRequeues(item interface{}) int { + return 0 +} + +// Forget removes item from the internal state. +func (r *ItemBucketRateLimiter) Forget(item interface{}) { + r.limitersLock.Lock() + defer r.limitersLock.Unlock() + + delete(r.limiters, item) +} + // ItemExponentialFailureRateLimiter does a simple baseDelay*2^ limit // dealing with max failures and expiration are up to the caller type ItemExponentialFailureRateLimiter struct { diff --git a/vendor/k8s.io/client-go/util/workqueue/metrics.go b/vendor/k8s.io/client-go/util/workqueue/metrics.go index a3911bf2d..556e6432e 100644 --- a/vendor/k8s.io/client-go/util/workqueue/metrics.go +++ b/vendor/k8s.io/client-go/util/workqueue/metrics.go @@ -131,16 +131,14 @@ func (m *defaultQueueMetrics) updateUnfinishedWork() { var total float64 var oldest float64 for _, t := range m.processingStartTimes { - age := m.sinceInMicroseconds(t) + age := m.sinceInSeconds(t) total += age if age > oldest { oldest = age } } - // Convert to seconds; microseconds is unhelpfully granular for this. - total /= 1000000 m.unfinishedWorkSeconds.Set(total) - m.longestRunningProcessor.Set(oldest / 1000000) + m.longestRunningProcessor.Set(oldest) } type noMetrics struct{} @@ -150,11 +148,6 @@ func (noMetrics) get(item t) {} func (noMetrics) done(item t) {} func (noMetrics) updateUnfinishedWork() {} -// Gets the time since the specified start in microseconds. -func (m *defaultQueueMetrics) sinceInMicroseconds(start time.Time) float64 { - return float64(m.clock.Since(start).Nanoseconds() / time.Microsecond.Nanoseconds()) -} - // Gets the time since the specified start in seconds. func (m *defaultQueueMetrics) sinceInSeconds(start time.Time) float64 { return m.clock.Since(start).Seconds() diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go index f45be1bb8..949369cd7 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/args/args.go @@ -49,6 +49,9 @@ type CustomArgs struct { ClientsetOnly bool // FakeClient determines if client-gen generates the fake clients. FakeClient bool + // PluralExceptions specify list of exceptions used when pluralizing certain types. + // For example 'Endpoints:Endpoints', otherwise the pluralizer will generate 'Endpointes'. + PluralExceptions []string } func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { @@ -58,6 +61,7 @@ func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { ClientsetAPIPath: "/apis", ClientsetOnly: false, FakeClient: true, + PluralExceptions: []string{"Endpoints:Endpoints"}, } genericArgs.CustomArgs = customArgs genericArgs.InputDirs = DefaultInputDirs @@ -79,6 +83,8 @@ func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet, inputBase string) { pflag.BoolVar(&ca.ClientsetOnly, "clientset-only", ca.ClientsetOnly, "when set, client-gen only generates the clientset shell, without generating the individual typed clients") pflag.BoolVar(&ca.FakeClient, "fake-clientset", ca.FakeClient, "when set, client-gen will generate the fake clientset that can be used in tests") + fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType form") + // support old flags fs.SetNormalizeFunc(mapFlagName("clientset-path", "output-package", fs.GetNormalizeFunc())) } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go index 18980744f..a678a357b 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/client_generator.go @@ -37,10 +37,7 @@ import ( ) // NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } +func NameSystems(pluralExceptions map[string]string) namer.NameSystems { lowercaseNamer := namer.NewAllLowercasePluralNamer(pluralExceptions) publicNamer := &ExceptionNamer{ diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go index f5888aef1..ebd8506ec 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/fake/generator_fake_for_type.go @@ -122,9 +122,12 @@ func (g *genFakeForType) GenerateType(c *generator.Context, t *types.Type, w io. "group": canonicalGroup, "groupName": groupName, "version": g.version, + "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), + "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "PatchOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "PatchOptions"}), + "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), "Everything": c.Universe.Function(types.Name{Package: "k8s.io/apimachinery/pkg/labels", Name: "Everything"}), "GroupVersionResource": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionResource"}), "GroupVersionKind": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/runtime/schema", Name: "GroupVersionKind"}), @@ -309,7 +312,7 @@ var $.type|allLowercasePlural$Kind = $.GroupVersionKind|raw${Group: "$.groupName var listTemplate = ` // List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { +func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ @@ -322,7 +325,7 @@ func (c *Fake$.type|publicPlural$) List(opts $.ListOptions|raw$) (result *$.type var listUsingOptionsTemplate = ` // List takes label and field selectors, and returns the list of $.type|publicPlural$ that match those selectors. -func (c *Fake$.type|publicPlural$) List(opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { +func (c *Fake$.type|publicPlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.type|raw$List, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, c.ns, opts), &$.type|raw$List{}) $else$Invokes($.NewRootListAction|raw$($.type|allLowercasePlural$Resource, $.type|allLowercasePlural$Kind, opts), &$.type|raw$List{})$end$ @@ -346,7 +349,7 @@ func (c *Fake$.type|publicPlural$) List(opts $.ListOptions|raw$) (result *$.type var getTemplate = ` // Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get(name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewGetAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.resultType|raw${}) $else$Invokes($.NewRootGetAction|raw$($.type|allLowercasePlural$Resource, name), &$.resultType|raw${})$end$ @@ -359,7 +362,7 @@ func (c *Fake$.type|publicPlural$) Get(name string, options $.GetOptions|raw$) ( var getSubresourceTemplate = ` // Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *Fake$.type|publicPlural$) Get($.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${}) $else$Invokes($.NewRootGetSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.type|private$Name), &$.resultType|raw${})$end$ @@ -372,7 +375,7 @@ func (c *Fake$.type|publicPlural$) Get($.type|private$Name string, options $.Get var deleteTemplate = ` // Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *Fake$.type|publicPlural$) Delete(name string, options *$.DeleteOptions|raw$) error { +func (c *Fake$.type|publicPlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { _, err := c.Fake. $if .namespaced$Invokes($.NewDeleteAction|raw$($.type|allLowercasePlural$Resource, c.ns, name), &$.type|raw${}) $else$Invokes($.NewRootDeleteAction|raw$($.type|allLowercasePlural$Resource, name), &$.type|raw${})$end$ @@ -382,9 +385,9 @@ func (c *Fake$.type|publicPlural$) Delete(name string, options *$.DeleteOptions| var deleteCollectionTemplate = ` // DeleteCollection deletes a collection of objects. -func (c *Fake$.type|publicPlural$) DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { - $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOptions) - $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOptions) +func (c *Fake$.type|publicPlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { + $if .namespaced$action := $.NewDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, c.ns, listOpts) + $else$action := $.NewRootDeleteCollectionAction|raw$($.type|allLowercasePlural$Resource, listOpts) $end$ _, err := c.Fake.Invokes(action, &$.type|raw$List{}) return err @@ -392,7 +395,7 @@ func (c *Fake$.type|publicPlural$) DeleteCollection(options *$.DeleteOptions|raw ` var createTemplate = ` // Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewCreateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) $else$Invokes($.NewRootCreateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ @@ -405,7 +408,7 @@ func (c *Fake$.type|publicPlural$) Create($.inputType|private$ *$.inputType|raw$ var createSubresourceTemplate = ` // Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Create($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, $.type|private$Name, "$.subresourcePath$", c.ns, $.inputType|private$), &$.resultType|raw${}) $else$Invokes($.NewRootCreateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ @@ -418,7 +421,7 @@ func (c *Fake$.type|publicPlural$) Create($.type|private$Name string, $.inputTyp var updateTemplate = ` // Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewUpdateAction|raw$($.inputType|allLowercasePlural$Resource, c.ns, $.inputType|private$), &$.resultType|raw${}) $else$Invokes($.NewRootUpdateAction|raw$($.inputType|allLowercasePlural$Resource, $.inputType|private$), &$.resultType|raw${})$end$ @@ -431,7 +434,7 @@ func (c *Fake$.type|publicPlural$) Update($.inputType|private$ *$.inputType|raw$ var updateSubresourceTemplate = ` // Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *Fake$.type|publicPlural$) Update($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", c.ns, $.inputType|private$), &$.inputType|raw${}) $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "$.subresourcePath$", $.inputType|private$), &$.resultType|raw${})$end$ @@ -445,7 +448,7 @@ func (c *Fake$.type|publicPlural$) Update($.type|private$Name string, $.inputTyp var updateStatusTemplate = ` // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *Fake$.type|publicPlural$) UpdateStatus($.type|private$ *$.type|raw$) (*$.type|raw$, error) { +func (c *Fake$.type|publicPlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", c.ns, $.type|private$), &$.type|raw${}) $else$Invokes($.NewRootUpdateSubresourceAction|raw$($.type|allLowercasePlural$Resource, "status", $.type|private$), &$.type|raw${})$end$ @@ -458,7 +461,7 @@ func (c *Fake$.type|publicPlural$) UpdateStatus($.type|private$ *$.type|raw$) (* var watchTemplate = ` // Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *Fake$.type|publicPlural$) Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { +func (c *Fake$.type|publicPlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { return c.Fake. $if .namespaced$InvokesWatch($.NewWatchAction|raw$($.type|allLowercasePlural$Resource, c.ns, opts)) $else$InvokesWatch($.NewRootWatchAction|raw$($.type|allLowercasePlural$Resource, opts))$end$ @@ -467,7 +470,7 @@ func (c *Fake$.type|publicPlural$) Watch(opts $.ListOptions|raw$) ($.watchInterf var patchTemplate = ` // Patch applies the patch and returns the patched $.resultType|private$. -func (c *Fake$.type|publicPlural$) Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error) { +func (c *Fake$.type|publicPlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { obj, err := c.Fake. $if .namespaced$Invokes($.NewPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, c.ns, name, pt, data, subresources... ), &$.resultType|raw${}) $else$Invokes($.NewRootPatchSubresourceAction|raw$($.type|allLowercasePlural$Resource, name, pt, data, subresources...), &$.resultType|raw${})$end$ diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go index f7254343b..20e8796bf 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_clientset.go @@ -140,7 +140,7 @@ func NewForConfig(c *$.Config|raw$) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = $.flowcontrolNewTokenBucketRateLimiter|raw$(configShallowCopy.QPS, configShallowCopy.Burst) } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go index 3e8fc7c4c..13664d0d9 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/generators/generator_for_type.go @@ -43,7 +43,9 @@ type genClientForType struct { var _ generator.Generator = &genClientForType{} // Filter ignores all but one type because we're making a single file per type. -func (g *genClientForType) Filter(c *generator.Context, t *types.Type) bool { return t == g.typeToMatch } +func (g *genClientForType) Filter(c *generator.Context, t *types.Type) bool { + return t == g.typeToMatch +} func (g *genClientForType) Namers(c *generator.Context) namer.NameSystems { return namer.NameSystems{ @@ -116,9 +118,10 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i "type": t, "inputType": &inputType, "resultType": &resultType, - "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), + "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), }, }) @@ -135,9 +138,12 @@ func (g *genClientForType) GenerateType(c *generator.Context, t *types.Type, w i "subresourcePath": "", "GroupGoName": g.groupGoName, "Version": namer.IC(g.version), + "CreateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "CreateOptions"}), "DeleteOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "DeleteOptions"}), - "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), "GetOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "GetOptions"}), + "ListOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "ListOptions"}), + "PatchOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "PatchOptions"}), + "UpdateOptions": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/apis/meta/v1", Name: "UpdateOptions"}), "PatchType": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/types", Name: "PatchType"}), "watchInterface": c.Universe.Type(types.Name{Package: "k8s.io/apimachinery/pkg/watch", Name: "Interface"}), "RESTClientInterface": c.Universe.Type(types.Name{Package: "k8s.io/client-go/rest", Name: "Interface"}), @@ -304,22 +310,22 @@ func generateInterface(tags util.Tags) string { } var subresourceDefaultVerbTemplates = map[string]string{ - "create": `Create($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (*$.resultType|raw$, error)`, - "list": `List($.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "update": `Update($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (*$.resultType|raw$, error)`, - "get": `Get($.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, + "create": `Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, + "list": `List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, + "update": `Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, + "get": `Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, } var defaultVerbTemplates = map[string]string{ - "create": `Create(*$.inputType|raw$) (*$.resultType|raw$, error)`, - "update": `Update(*$.inputType|raw$) (*$.resultType|raw$, error)`, - "updateStatus": `UpdateStatus(*$.type|raw$) (*$.type|raw$, error)`, - "delete": `Delete(name string, options *$.DeleteOptions|raw$) error`, - "deleteCollection": `DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error`, - "get": `Get(name string, options $.GetOptions|raw$) (*$.resultType|raw$, error)`, - "list": `List(opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, - "watch": `Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, - "patch": `Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error)`, + "create": `Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (*$.resultType|raw$, error)`, + "update": `Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (*$.resultType|raw$, error)`, + "updateStatus": `UpdateStatus(ctx context.Context, $.inputType|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (*$.type|raw$, error)`, + "delete": `Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error`, + "deleteCollection": `DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error`, + "get": `Get(ctx context.Context, name string, opts $.GetOptions|raw$) (*$.resultType|raw$, error)`, + "list": `List(ctx context.Context, opts $.ListOptions|raw$) (*$.resultType|raw$List, error)`, + "watch": `Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error)`, + "patch": `Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error)`, } // group client will implement this interface. @@ -386,7 +392,7 @@ func new$.type|publicPlural$(c *$.GroupGoName$$.Version$Client) *$.type|privateP ` var listTemplate = ` // List takes label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List(opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { +func (c *$.type|privatePlural$) List(ctx context.Context, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -397,7 +403,7 @@ func (c *$.type|privatePlural$) List(opts $.ListOptions|raw$) (result *$.resultT Resource("$.type|resource$"). VersionedParams(&opts, $.schemeParameterCodec|raw$). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } @@ -405,7 +411,7 @@ func (c *$.type|privatePlural$) List(opts $.ListOptions|raw$) (result *$.resultT var listSubresourceTemplate = ` // List takes $.type|raw$ name, label and field selectors, and returns the list of $.resultType|publicPlural$ that match those selectors. -func (c *$.type|privatePlural$) List($.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { +func (c *$.type|privatePlural$) List(ctx context.Context, $.type|private$Name string, opts $.ListOptions|raw$) (result *$.resultType|raw$List, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -418,7 +424,7 @@ func (c *$.type|privatePlural$) List($.type|private$Name string, opts $.ListOpti SubResource("$.subresourcePath$"). VersionedParams(&opts, $.schemeParameterCodec|raw$). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } @@ -426,14 +432,14 @@ func (c *$.type|privatePlural$) List($.type|private$Name string, opts $.ListOpti var getTemplate = ` // Get takes name of the $.type|private$, and returns the corresponding $.resultType|private$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get(name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Get(ctx context.Context, name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Get(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name(name). VersionedParams(&options, $.schemeParameterCodec|raw$). - Do(). + Do(ctx). Into(result) return } @@ -441,7 +447,7 @@ func (c *$.type|privatePlural$) Get(name string, options $.GetOptions|raw$) (res var getSubresourceTemplate = ` // Get takes name of the $.type|private$, and returns the corresponding $.resultType|raw$ object, and an error if there is any. -func (c *$.type|privatePlural$) Get($.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Get(ctx context.Context, $.type|private$Name string, options $.GetOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Get(). $if .namespaced$Namespace(c.ns).$end$ @@ -449,7 +455,7 @@ func (c *$.type|privatePlural$) Get($.type|private$Name string, options $.GetOpt Name($.type|private$Name). SubResource("$.subresourcePath$"). VersionedParams(&options, $.schemeParameterCodec|raw$). - Do(). + Do(ctx). Into(result) return } @@ -457,46 +463,47 @@ func (c *$.type|privatePlural$) Get($.type|private$Name string, options $.GetOpt var deleteTemplate = ` // Delete takes name of the $.type|private$ and deletes it. Returns an error if one occurs. -func (c *$.type|privatePlural$) Delete(name string, options *$.DeleteOptions|raw$) error { +func (c *$.type|privatePlural$) Delete(ctx context.Context, name string, opts $.DeleteOptions|raw$) error { return c.client.Delete(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } ` var deleteCollectionTemplate = ` // DeleteCollection deletes a collection of objects. -func (c *$.type|privatePlural$) DeleteCollection(options *$.DeleteOptions|raw$, listOptions $.ListOptions|raw$) error { +func (c *$.type|privatePlural$) DeleteCollection(ctx context.Context, opts $.DeleteOptions|raw$, listOpts $.ListOptions|raw$) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil{ - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil{ + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). - VersionedParams(&listOptions, $.schemeParameterCodec|raw$). + VersionedParams(&listOpts, $.schemeParameterCodec|raw$). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } ` var createSubresourceTemplate = ` // Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Create(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Post(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name($.type|private$Name). SubResource("$.subresourcePath$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). Body($.inputType|private$). - Do(). + Do(ctx). Into(result) return } @@ -504,13 +511,14 @@ func (c *$.type|privatePlural$) Create($.type|private$Name string, $.inputType|p var createTemplate = ` // Create takes the representation of a $.inputType|private$ and creates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Create($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Create(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.CreateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Post(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). Body($.inputType|private$). - Do(). + Do(ctx). Into(result) return } @@ -518,15 +526,16 @@ func (c *$.type|privatePlural$) Create($.inputType|private$ *$.inputType|raw$) ( var updateSubresourceTemplate = ` // Update takes the top resource name and the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update($.type|private$Name string, $.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Update(ctx context.Context, $.type|private$Name string, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Put(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name($.type|private$Name). SubResource("$.subresourcePath$"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). Body($.inputType|private$). - Do(). + Do(ctx). Into(result) return } @@ -534,14 +543,15 @@ func (c *$.type|privatePlural$) Update($.type|private$Name string, $.inputType|p var updateTemplate = ` // Update takes the representation of a $.inputType|private$ and updates it. Returns the server's representation of the $.resultType|private$, and an error, if there is any. -func (c *$.type|privatePlural$) Update($.inputType|private$ *$.inputType|raw$) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Update(ctx context.Context, $.inputType|private$ *$.inputType|raw$, opts $.UpdateOptions|raw$) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Put(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name($.inputType|private$.Name). + VersionedParams(&opts, $.schemeParameterCodec|raw$). Body($.inputType|private$). - Do(). + Do(ctx). Into(result) return } @@ -550,16 +560,16 @@ func (c *$.type|privatePlural$) Update($.inputType|private$ *$.inputType|raw$) ( var updateStatusTemplate = ` // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (result *$.type|raw$, err error) { +func (c *$.type|privatePlural$) UpdateStatus(ctx context.Context, $.type|private$ *$.type|raw$, opts $.UpdateOptions|raw$) (result *$.type|raw$, err error) { result = &$.type|raw${} err = c.client.Put(). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). Name($.type|private$.Name). SubResource("status"). + VersionedParams(&opts, $.schemeParameterCodec|raw$). Body($.type|private$). - Do(). + Do(ctx). Into(result) return } @@ -567,7 +577,7 @@ func (c *$.type|privatePlural$) UpdateStatus($.type|private$ *$.type|raw$) (resu var watchTemplate = ` // Watch returns a $.watchInterface|raw$ that watches the requested $.type|privatePlural$. -func (c *$.type|privatePlural$) Watch(opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { +func (c *$.type|privatePlural$) Watch(ctx context.Context, opts $.ListOptions|raw$) ($.watchInterface|raw$, error) { var timeout time.Duration if opts.TimeoutSeconds != nil{ timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -578,21 +588,22 @@ func (c *$.type|privatePlural$) Watch(opts $.ListOptions|raw$) ($.watchInterface Resource("$.type|resource$"). VersionedParams(&opts, $.schemeParameterCodec|raw$). Timeout(timeout). - Watch() + Watch(ctx) } ` var patchTemplate = ` // Patch applies the patch and returns the patched $.resultType|private$. -func (c *$.type|privatePlural$) Patch(name string, pt $.PatchType|raw$, data []byte, subresources ...string) (result *$.resultType|raw$, err error) { +func (c *$.type|privatePlural$) Patch(ctx context.Context, name string, pt $.PatchType|raw$, data []byte, opts $.PatchOptions|raw$, subresources ...string) (result *$.resultType|raw$, err error) { result = &$.resultType|raw${} err = c.client.Patch(pt). $if .namespaced$Namespace(c.ns).$end$ Resource("$.type|resource$"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, $.schemeParameterCodec|raw$). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/main.go b/vendor/k8s.io/code-generator/cmd/client-gen/main.go index 6e0d187f5..393cc5fee 100644 --- a/vendor/k8s.io/code-generator/cmd/client-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/client-gen/main.go @@ -57,7 +57,7 @@ func main() { } if err := genericArgs.Execute( - generators.NameSystems(), + generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), generators.DefaultNameSystem(), generators.Packages, ); err != nil { diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go index 8a7be5260..de782e98f 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/cmd.go @@ -29,9 +29,6 @@ import ( "strings" flag "github.com/spf13/pflag" - "gonum.org/v1/gonum/graph" - "gonum.org/v1/gonum/graph/simple" - "gonum.org/v1/gonum/graph/topo" "k8s.io/code-generator/pkg/util" "k8s.io/gengo/args" @@ -374,38 +371,73 @@ func deps(c *generator.Context, pkgs []*protobufPackage) map[string][]string { return ret } +// given a set of pkg->[]deps, return the order that ensures all deps are processed before the things that depend on them func importOrder(deps map[string][]string) ([]string, error) { - nodes := map[string]graph.Node{} - names := map[int64]string{} - g := simple.NewDirectedGraph() - for pkg, imports := range deps { - for _, imp := range imports { - if _, found := nodes[pkg]; !found { - n := g.NewNode() - g.AddNode(n) - nodes[pkg] = n - names[n.ID()] = pkg - } - if _, found := nodes[imp]; !found { - n := g.NewNode() - g.AddNode(n) - nodes[imp] = n - names[n.ID()] = imp - } - g.SetEdge(g.NewEdge(nodes[imp], nodes[pkg])) + // add all nodes and edges + var remainingNodes = map[string]struct{}{} + var graph = map[edge]struct{}{} + for to, froms := range deps { + remainingNodes[to] = struct{}{} + for _, from := range froms { + remainingNodes[from] = struct{}{} + graph[edge{from: from, to: to}] = struct{}{} } } - ret := []string{} - sorted, err := topo.Sort(g) - if err != nil { - return nil, err + // find initial nodes without any dependencies + sorted := findAndRemoveNodesWithoutDependencies(remainingNodes, graph) + for i := 0; i < len(sorted); i++ { + node := sorted[i] + removeEdgesFrom(node, graph) + sorted = append(sorted, findAndRemoveNodesWithoutDependencies(remainingNodes, graph)...) + } + if len(remainingNodes) > 0 { + return nil, fmt.Errorf("cycle: remaining nodes: %#v, remaining edges: %#v", remainingNodes, graph) } for _, n := range sorted { - ret = append(ret, names[n.ID()]) - fmt.Println("topological order", names[n.ID()]) + fmt.Println("topological order", n) + } + return sorted, nil +} + +// edge describes a from->to relationship in a graph +type edge struct { + from string + to string +} + +// findAndRemoveNodesWithoutDependencies finds nodes in the given set which are not pointed to by any edges in the graph, +// removes them from the set of nodes, and returns them in sorted order +func findAndRemoveNodesWithoutDependencies(nodes map[string]struct{}, graph map[edge]struct{}) []string { + roots := []string{} + // iterate over all nodes as potential "to" nodes + for node := range nodes { + incoming := false + // iterate over all remaining edges + for edge := range graph { + // if there's any edge to the node we care about, it's not a root + if edge.to == node { + incoming = true + break + } + } + // if there are no incoming edges, remove from the set of remaining nodes and add to our results + if !incoming { + delete(nodes, node) + roots = append(roots, node) + } + } + sort.Strings(roots) + return roots +} + +// removeEdgesFrom removes any edges from the graph where edge.from == node +func removeEdgesFrom(node string, graph map[edge]struct{}) { + for edge := range graph { + if edge.from == node { + delete(graph, edge) + } } - return ret, nil } type positionOrder struct { diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go index 3115bc688..b3c8d2e87 100644 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/protobuf/parser.go @@ -375,6 +375,21 @@ func RewriteTypesWithProtobufStructTags(name string, structTags map[string]map[s }) } +func getFieldName(expr ast.Expr, structname string) (name string, err error) { + for { + switch t := expr.(type) { + case *ast.Ident: + return t.Name, nil + case *ast.SelectorExpr: + return t.Sel.Name, nil + case *ast.StarExpr: + expr = t.X + default: + return "", fmt.Errorf("unable to get name for tag from struct %q, field %#v", structname, t) + } + } +} + func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, toCopy []string) []error { var errs []error t, ok := decl.(*ast.GenDecl) @@ -403,14 +418,11 @@ func updateStructTags(decl ast.Decl, structTags map[string]map[string]string, to for i := range st.Fields.List { f := st.Fields.List[i] var name string + var err error if len(f.Names) == 0 { - switch t := f.Type.(type) { - case *ast.Ident: - name = t.Name - case *ast.SelectorExpr: - name = t.Sel.Name - default: - errs = append(errs, fmt.Errorf("unable to get name for tag from struct %q, field %#v", spec.Name.Name, t)) + name, err = getFieldName(f.Type, spec.Name.Name) + if err != nil { + errs = append(errs, err) continue } } else { diff --git a/vendor/k8s.io/code-generator/cmd/import-boss/main.go b/vendor/k8s.io/code-generator/cmd/import-boss/main.go index 0080f01eb..9d73eb480 100644 --- a/vendor/k8s.io/code-generator/cmd/import-boss/main.go +++ b/vendor/k8s.io/code-generator/cmd/import-boss/main.go @@ -77,11 +77,6 @@ func main() { // Override defaults. arguments.GoHeaderFilePath = filepath.Join(args.DefaultSourceTree(), util.BoilerplatePath()) - arguments.InputDirs = []string{ - "k8s.io/kubernetes/pkg/...", - "k8s.io/kubernetes/cmd/...", - "k8s.io/kubernetes/plugin/...", - } pflag.CommandLine.BoolVar(&arguments.IncludeTestFiles, "include-test-files", false, "If true, include *_test.go files.") if err := arguments.Execute( diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go index ba7f72091..ffd073a86 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/args/args.go @@ -31,13 +31,18 @@ type CustomArgs struct { InternalClientSetPackage string ListersPackage string SingleDirectory bool + + // PluralExceptions define a list of pluralizer exceptions in Type:PluralType format. + // The default list is "Endpoints:Endpoints" + PluralExceptions []string } // NewDefaults returns default arguments for the generator. func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { genericArgs := args.Default().WithoutDefaultFlagParsing() customArgs := &CustomArgs{ - SingleDirectory: false, + SingleDirectory: false, + PluralExceptions: []string{"Endpoints:Endpoints"}, } genericArgs.CustomArgs = customArgs @@ -57,6 +62,7 @@ func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&ca.VersionedClientSetPackage, "versioned-clientset-package", ca.VersionedClientSetPackage, "the full package name for the versioned clientset to use") fs.StringVar(&ca.ListersPackage, "listers-package", ca.ListersPackage, "the full package name for the listers to use") fs.BoolVar(&ca.SingleDirectory, "single-directory", ca.SingleDirectory, "if true, omit the intermediate \"internalversion\" and \"externalversions\" subdirectories") + fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType format") } // Validate checks the given arguments. diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go index cad907990..bb73c0db0 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/generic.go @@ -35,6 +35,7 @@ type genericGenerator struct { imports namer.ImportTracker groupVersions map[string]clientgentypes.GroupVersions groupGoNames map[string]string + pluralExceptions map[string]string typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type filtered bool } @@ -50,14 +51,11 @@ func (g *genericGenerator) Filter(c *generator.Context, t *types.Type) bool { } func (g *genericGenerator) Namers(c *generator.Context) namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } return namer.NameSystems{ "raw": namer.NewRawNamer(g.outputPackage, g.imports), - "allLowercasePlural": namer.NewAllLowercasePluralNamer(pluralExceptions), - "publicPlural": namer.NewPublicPluralNamer(pluralExceptions), - "resource": codegennamer.NewTagOverrideNamer("resourceName", namer.NewAllLowercasePluralNamer(pluralExceptions)), + "allLowercasePlural": namer.NewAllLowercasePluralNamer(g.pluralExceptions), + "publicPlural": namer.NewPublicPluralNamer(g.pluralExceptions), + "resource": codegennamer.NewTagOverrideNamer("resourceName", namer.NewAllLowercasePluralNamer(g.pluralExceptions)), } } diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go index 9204d6215..d7b60eccc 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/informer.go @@ -151,13 +151,13 @@ func NewFiltered$.type|public$Informer(client $.clientSetInterface|raw$$if .name if tweakListOptions != nil { tweakListOptions(&options) } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List(options) + return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).List(context.TODO(), options) }, WatchFunc: func(options $.v1ListOptions|raw$) ($.watchInterface|raw$, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch(options) + return client.$.group$$.version$().$.type|publicPlural$($if .namespaced$namespace$end$).Watch(context.TODO(), options) }, }, &$.type|raw${}, diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go index e936e29f0..04a953122 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/generators/packages.go @@ -31,13 +31,11 @@ import ( "k8s.io/code-generator/cmd/client-gen/generators/util" clientgentypes "k8s.io/code-generator/cmd/client-gen/types" informergenargs "k8s.io/code-generator/cmd/informer-gen/args" + genutil "k8s.io/code-generator/pkg/util" ) // NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } +func NameSystems(pluralExceptions map[string]string) namer.NameSystems { return namer.NameSystems{ "public": namer.NewPublicNamer(0), "private": namer.NewPrivateNamer(0), @@ -208,7 +206,9 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat if len(externalGroupVersions) != 0 { packageList = append(packageList, factoryInterfacePackage(externalVersionPackagePath, boilerplate, customArgs.VersionedClientSetPackage)) - packageList = append(packageList, factoryPackage(externalVersionPackagePath, boilerplate, groupGoNames, externalGroupVersions, customArgs.VersionedClientSetPackage, typesForGroupVersion)) + packageList = append(packageList, factoryPackage(externalVersionPackagePath, boilerplate, groupGoNames, genutil.PluralExceptionListToMapOrDie(customArgs.PluralExceptions), externalGroupVersions, + customArgs.VersionedClientSetPackage, + typesForGroupVersion)) for _, gvs := range externalGroupVersions { packageList = append(packageList, groupPackage(externalVersionPackagePath, gvs, boilerplate)) } @@ -216,7 +216,7 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat if len(internalGroupVersions) != 0 { packageList = append(packageList, factoryInterfacePackage(internalVersionPackagePath, boilerplate, customArgs.InternalClientSetPackage)) - packageList = append(packageList, factoryPackage(internalVersionPackagePath, boilerplate, groupGoNames, internalGroupVersions, customArgs.InternalClientSetPackage, typesForGroupVersion)) + packageList = append(packageList, factoryPackage(internalVersionPackagePath, boilerplate, groupGoNames, genutil.PluralExceptionListToMapOrDie(customArgs.PluralExceptions), internalGroupVersions, customArgs.InternalClientSetPackage, typesForGroupVersion)) for _, gvs := range internalGroupVersions { packageList = append(packageList, groupPackage(internalVersionPackagePath, gvs, boilerplate)) } @@ -225,7 +225,8 @@ func Packages(context *generator.Context, arguments *args.GeneratorArgs) generat return packageList } -func factoryPackage(basePackage string, boilerplate []byte, groupGoNames map[string]string, groupVersions map[string]clientgentypes.GroupVersions, clientSetPackage string, typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type) generator.Package { +func factoryPackage(basePackage string, boilerplate []byte, groupGoNames, pluralExceptions map[string]string, groupVersions map[string]clientgentypes.GroupVersions, clientSetPackage string, + typesForGroupVersion map[clientgentypes.GroupVersion][]*types.Type) generator.Package { return &generator.DefaultPackage{ PackageName: filepath.Base(basePackage), PackagePath: basePackage, @@ -250,6 +251,7 @@ func factoryPackage(basePackage string, boilerplate []byte, groupGoNames map[str outputPackage: basePackage, imports: generator.NewImportTracker(), groupVersions: groupVersions, + pluralExceptions: pluralExceptions, typesForGroupVersion: typesForGroupVersion, groupGoNames: groupGoNames, }) diff --git a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go index 14f3e923e..6a39f85db 100644 --- a/vendor/k8s.io/code-generator/cmd/informer-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/informer-gen/main.go @@ -53,7 +53,7 @@ func main() { // Run it. if err := genericArgs.Execute( - generators.NameSystems(), + generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), generators.DefaultNameSystem(), generators.Packages, ); err != nil { diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go b/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go index 34914ea8c..170334505 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/args/args.go @@ -26,12 +26,18 @@ import ( ) // CustomArgs is used by the gengo framework to pass args specific to this generator. -type CustomArgs struct{} +type CustomArgs struct { + // PluralExceptions specify list of exceptions used when pluralizing certain types. + // For example 'Endpoints:Endpoints', otherwise the pluralizer will generate 'Endpointes'. + PluralExceptions []string +} // NewDefaults returns default arguments for the generator. func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { genericArgs := args.Default().WithoutDefaultFlagParsing() - customArgs := &CustomArgs{} + customArgs := &CustomArgs{ + PluralExceptions: []string{"Endpoints:Endpoints"}, + } genericArgs.CustomArgs = customArgs if pkg := codegenutil.CurrentPackage(); len(pkg) != 0 { @@ -42,7 +48,9 @@ func NewDefaults() (*args.GeneratorArgs, *CustomArgs) { } // AddFlags add the generator flags to the flag set. -func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) {} +func (ca *CustomArgs) AddFlags(fs *pflag.FlagSet) { + fs.StringSliceVar(&ca.PluralExceptions, "plural-exceptions", ca.PluralExceptions, "list of comma separated plural exception definitions in Type:PluralizedType format") +} // Validate checks the given arguments. func Validate(genericArgs *args.GeneratorArgs) error { diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go index c8ed5ad4d..e10e9fb2f 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/generators/lister.go @@ -34,10 +34,7 @@ import ( ) // NameSystems returns the name system used by the generators in this package. -func NameSystems() namer.NameSystems { - pluralExceptions := map[string]string{ - "Endpoints": "Endpoints", - } +func NameSystems(pluralExceptions map[string]string) namer.NameSystems { return namer.NameSystems{ "public": namer.NewPublicNamer(0), "private": namer.NewPrivateNamer(0), diff --git a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go index aca16b2bd..953a64980 100644 --- a/vendor/k8s.io/code-generator/cmd/lister-gen/main.go +++ b/vendor/k8s.io/code-generator/cmd/lister-gen/main.go @@ -50,7 +50,7 @@ func main() { // Run it. if err := genericArgs.Execute( - generators.NameSystems(), + generators.NameSystems(util.PluralExceptionListToMapOrDie(customArgs.PluralExceptions)), generators.DefaultNameSystem(), generators.Packages, ); err != nil { diff --git a/vendor/k8s.io/code-generator/generate-groups.sh b/vendor/k8s.io/code-generator/generate-groups.sh index d82002dda..1c2fd7a55 100644 --- a/vendor/k8s.io/code-generator/generate-groups.sh +++ b/vendor/k8s.io/code-generator/generate-groups.sh @@ -52,6 +52,9 @@ shift 4 cd "$(dirname "${0}")" go install ./cmd/{defaulter-gen,client-gen,lister-gen,informer-gen,deepcopy-gen} ) +# Go installs the above commands to get installed in $GOBIN if defined, and $GOPATH/bin otherwise: +GOBIN="$(go env GOBIN)" +gobin="${GOBIN:-$(go env GOPATH)/bin}" function codegen::join() { local IFS="$1"; shift; echo "$*"; } @@ -68,22 +71,22 @@ done if [ "${GENS}" = "all" ] || grep -qw "deepcopy" <<<"${GENS}"; then echo "Generating deepcopy funcs" - "${GOPATH}/bin/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@" + "${gobin}/deepcopy-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" -O zz_generated.deepcopy --bounding-dirs "${APIS_PKG}" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "client" <<<"${GENS}"; then echo "Generating clientset for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" - "${GOPATH}/bin/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" + "${gobin}/client-gen" --clientset-name "${CLIENTSET_NAME_VERSIONED:-versioned}" --input-base "" --input "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "lister" <<<"${GENS}"; then echo "Generating listers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/listers" - "${GOPATH}/bin/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" + "${gobin}/lister-gen" --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" --output-package "${OUTPUT_PKG}/listers" "$@" fi if [ "${GENS}" = "all" ] || grep -qw "informer" <<<"${GENS}"; then echo "Generating informers for ${GROUPS_WITH_VERSIONS} at ${OUTPUT_PKG}/informers" - "${GOPATH}/bin/informer-gen" \ + "${gobin}/informer-gen" \ --input-dirs "$(codegen::join , "${FQ_APIS[@]}")" \ --versioned-clientset-package "${OUTPUT_PKG}/${CLIENTSET_PKG_NAME:-clientset}/${CLIENTSET_NAME_VERSIONED:-versioned}" \ --listers-package "${OUTPUT_PKG}/listers" \ diff --git a/vendor/k8s.io/code-generator/go.mod b/vendor/k8s.io/code-generator/go.mod index 891f72ef5..71e2d47b0 100644 --- a/vendor/k8s.io/code-generator/go.mod +++ b/vendor/k8s.io/code-generator/go.mod @@ -2,26 +2,24 @@ module k8s.io/code-generator -go 1.12 +go 1.13 require ( github.com/emicklei/go-restful v2.9.5+incompatible // indirect github.com/go-openapi/jsonreference v0.19.3 // indirect github.com/go-openapi/spec v0.19.3 // indirect - github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d + github.com/gogo/protobuf v1.3.1 + github.com/google/go-cmp v0.3.0 // indirect github.com/json-iterator/go v1.1.8 // indirect github.com/mailru/easyjson v0.7.0 // indirect - github.com/modern-go/reflect2 v1.0.1 // indirect github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.4.0 // indirect golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 // indirect golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72 // indirect - gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 - gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e // indirect - gopkg.in/yaml.v2 v2.2.8 // indirect - k8s.io/gengo v0.0.0-20190822140433-26a664648505 + k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 k8s.io/klog v1.0.0 - k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a + k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 // release-1.18 + sigs.k8s.io/yaml v1.2.0 // indirect ) replace ( diff --git a/vendor/k8s.io/code-generator/go.sum b/vendor/k8s.io/code-generator/go.sum index afc21aae5..22863c266 100644 --- a/vendor/k8s.io/code-generator/go.sum +++ b/vendor/k8s.io/code-generator/go.sum @@ -1,4 +1,3 @@ -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= @@ -6,7 +5,6 @@ github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbt github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -16,12 +14,10 @@ github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= @@ -29,17 +25,17 @@ github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nA github.com/go-openapi/spec v0.19.3 h1:0XRyw8kguri6Yw4SxhsQA/atC88yqrk0+G4YhI2wabc= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.2 h1:jvO6bCMBEilGwMfHhrd61zIID4oIFdwb76V17SM88dE= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= +github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= @@ -52,41 +48,30 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= -github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495 h1:I6A9Ag9FpEKOjcKrRNjQkPHawoXIhKyTGfvvjFAiiAk= -golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -103,32 +88,22 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7 h1:PVCvyir09Xgta5zksNZDkrL+eSm/Y+gQxRG3IfqNQ3A= golang.org/x/tools v0.0.0-20190821162956-65e3620a7ae7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 h1:OB/uP/Puiu5vS5QMRPrXCDWUPb+kt8f1KW8oQzFejQw= -gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= -gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e h1:jRyg0XfpwWlhEV8mDfdNGBeSJM2fuyh9Yjrnd8kF2Ts= -gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6 h1:4s3/R4+OYYYUKptXPhZKjQ04WJ6EhQQVFdjOFvCazDk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/gengo v0.0.0-20190822140433-26a664648505 h1:ZY6yclUKVbZ+SdWnkfY+Je5vrMpKOxmGeKRbsXVmqYM= -k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 h1:RPscN6KhmG54S33L+lr3GS+oD1jmchIU0ll519K6FA4= +k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= -modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= -modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= -modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= -modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6 h1:Oh3Mzx5pJ+yIumsAD0MOECPVeXsVot0UkiaCGVyfGQY= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= +sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= diff --git a/vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go b/vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go new file mode 100644 index 000000000..73c648d5b --- /dev/null +++ b/vendor/k8s.io/code-generator/pkg/util/plural_exceptions.go @@ -0,0 +1,37 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package util + +import ( + "fmt" + "strings" +) + +// PluralExceptionListToMapOrDie converts the list in "Type:PluralType" to map[string]string. +// This is used for pluralizer. +// If the format is wrong, this function will panic. +func PluralExceptionListToMapOrDie(pluralExceptions []string) map[string]string { + pluralExceptionMap := make(map[string]string, len(pluralExceptions)) + for i := range pluralExceptions { + parts := strings.Split(pluralExceptions[i], ":") + if len(parts) != 2 { + panic(fmt.Sprintf("invalid plural exception definition: %s", pluralExceptions[i])) + } + pluralExceptionMap[parts[0]] = parts[1] + } + return pluralExceptionMap +} diff --git a/vendor/knative.dev/pkg/apis/duck/README.md b/vendor/knative.dev/pkg/apis/duck/README.md index ab9a59030..688f54246 100644 --- a/vendor/knative.dev/pkg/apis/duck/README.md +++ b/vendor/knative.dev/pkg/apis/duck/README.md @@ -1,8 +1,9 @@ # Duck Types Knative leverages duck-typing to interact with resources inside of Kubernetes -without explicit knowlage of the full resource shape. `knative/pkg` defines two -duck types that are used throughout Knative: `Addressable` and `Source`. +without explicit knowledge of the full resource shape. `knative/pkg` defines +three duck types that are used throughout Knative: `Addressable`, `Binding`, and +`Source`. For APIs leveraging `ObjectReference`, the context of the resource in question identifies the duck-type. To enable the case where no `ObjectRefrence` is used, diff --git a/vendor/knative.dev/pkg/apis/duck/cached.go b/vendor/knative.dev/pkg/apis/duck/cached.go index 67aebc6d7..e0958f1bb 100644 --- a/vendor/knative.dev/pkg/apis/duck/cached.go +++ b/vendor/knative.dev/pkg/apis/duck/cached.go @@ -17,6 +17,7 @@ limitations under the License. package duck import ( + "context" "sync" "k8s.io/apimachinery/pkg/runtime/schema" @@ -36,7 +37,7 @@ type CachedInformerFactory struct { var _ InformerFactory = (*CachedInformerFactory)(nil) // Get implements InformerFactory. -func (cif *CachedInformerFactory) Get(gvr schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) { +func (cif *CachedInformerFactory) Get(ctx context.Context, gvr schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) { cif.m.Lock() if cif.cache == nil { @@ -57,7 +58,7 @@ func (cif *CachedInformerFactory) Get(gvr schema.GroupVersionResource) (cache.Sh return } - ic.inf, ic.lister, ic.err = cif.Delegate.Get(gvr) + ic.inf, ic.lister, ic.err = cif.Delegate.Get(ctx, gvr) } cif.cache[gvr] = ic } diff --git a/vendor/knative.dev/pkg/apis/duck/enqueue.go b/vendor/knative.dev/pkg/apis/duck/enqueue.go index 1ef966ec7..ec5026f5f 100644 --- a/vendor/knative.dev/pkg/apis/duck/enqueue.go +++ b/vendor/knative.dev/pkg/apis/duck/enqueue.go @@ -17,6 +17,8 @@ limitations under the License. package duck import ( + "context" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" ) @@ -33,8 +35,8 @@ type EnqueueInformerFactory struct { var _ InformerFactory = (*EnqueueInformerFactory)(nil) // Get implements InformerFactory. -func (cif *EnqueueInformerFactory) Get(gvr schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) { - inf, lister, err := cif.Delegate.Get(gvr) +func (cif *EnqueueInformerFactory) Get(ctx context.Context, gvr schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) { + inf, lister, err := cif.Delegate.Get(ctx, gvr) if err != nil { return nil, nil, err } diff --git a/vendor/knative.dev/pkg/apis/duck/interface.go b/vendor/knative.dev/pkg/apis/duck/interface.go index 99cf4ac29..6adc58bf9 100644 --- a/vendor/knative.dev/pkg/apis/duck/interface.go +++ b/vendor/knative.dev/pkg/apis/duck/interface.go @@ -17,6 +17,8 @@ limitations under the License. package duck import ( + "context" + "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/cache" "knative.dev/pkg/kmeta" @@ -26,7 +28,7 @@ import ( // InformerFactory is used to create Informer/Lister pairs for a schema.GroupVersionResource type InformerFactory interface { // Get returns a synced Informer/Lister pair for the provided schema.GroupVersionResource. - Get(schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) + Get(context.Context, schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) } // OneOfOurs is the union of our Accessor interface and the OwnerRefable interface diff --git a/vendor/knative.dev/pkg/apis/duck/typed.go b/vendor/knative.dev/pkg/apis/duck/typed.go index d6fa03451..a43defadf 100644 --- a/vendor/knative.dev/pkg/apis/duck/typed.go +++ b/vendor/knative.dev/pkg/apis/duck/typed.go @@ -17,6 +17,7 @@ limitations under the License. package duck import ( + "context" "fmt" "net/http" "time" @@ -45,17 +46,17 @@ type TypedInformerFactory struct { var _ InformerFactory = (*TypedInformerFactory)(nil) // Get implements InformerFactory. -func (dif *TypedInformerFactory) Get(gvr schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) { +func (dif *TypedInformerFactory) Get(ctx context.Context, gvr schema.GroupVersionResource) (cache.SharedIndexInformer, cache.GenericLister, error) { // Avoid error cases, like the GVR does not exist. // It is not a full check. Some RBACs might sneak by, but the window is very small. - if _, err := dif.Client.Resource(gvr).List(metav1.ListOptions{}); err != nil { + if _, err := dif.Client.Resource(gvr).List(ctx, metav1.ListOptions{}); err != nil { return nil, nil, err } listObj := dif.Type.GetListType() lw := &cache.ListWatch{ - ListFunc: asStructuredLister(dif.Client.Resource(gvr).List, listObj), - WatchFunc: AsStructuredWatcher(dif.Client.Resource(gvr).Watch, dif.Type), + ListFunc: asStructuredLister(ctx, dif.Client.Resource(gvr).List, listObj), + WatchFunc: AsStructuredWatcher(ctx, dif.Client.Resource(gvr).Watch, dif.Type), } inf := cache.NewSharedIndexInformer(lw, dif.Type, dif.ResyncPeriod, cache.Indexers{ cache.NamespaceIndex: cache.MetaNamespaceIndexFunc, @@ -72,11 +73,11 @@ func (dif *TypedInformerFactory) Get(gvr schema.GroupVersionResource) (cache.Sha return inf, lister, nil } -type unstructuredLister func(metav1.ListOptions) (*unstructured.UnstructuredList, error) +type unstructuredLister func(context.Context, metav1.ListOptions) (*unstructured.UnstructuredList, error) -func asStructuredLister(ulist unstructuredLister, listObj runtime.Object) cache.ListFunc { +func asStructuredLister(ctx context.Context, ulist unstructuredLister, listObj runtime.Object) cache.ListFunc { return func(opts metav1.ListOptions) (runtime.Object, error) { - ul, err := ulist(opts) + ul, err := ulist(ctx, opts) if err != nil { return nil, err } @@ -88,11 +89,13 @@ func asStructuredLister(ulist unstructuredLister, listObj runtime.Object) cache. } } +type structuredWatcher func(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + // AsStructuredWatcher is public for testing only. // TODO(mattmoor): Move tests for this to `package duck` and make private. -func AsStructuredWatcher(wf cache.WatchFunc, obj runtime.Object) cache.WatchFunc { +func AsStructuredWatcher(ctx context.Context, wf structuredWatcher, obj runtime.Object) cache.WatchFunc { return func(lo metav1.ListOptions) (watch.Interface, error) { - uw, err := wf(lo) + uw, err := wf(ctx, lo) if err != nil { return nil, err } diff --git a/vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go b/vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go index 9c247b030..fe0f5d171 100644 --- a/vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go +++ b/vendor/knative.dev/pkg/apis/duck/v1beta1/destination.go @@ -107,9 +107,8 @@ func ValidateDestination(dest Destination, allowDeprecatedFields bool) *apis.Fie if ref != nil && dest.URI == nil { if dest.Ref != nil { return validateDestinationRef(*ref).ViaField("ref") - } else { - return validateDestinationRef(*ref) } + return validateDestinationRef(*ref) } return nil } diff --git a/vendor/knative.dev/pkg/apis/field_error.go b/vendor/knative.dev/pkg/apis/field_error.go index cc353b58b..3997b5944 100644 --- a/vendor/knative.dev/pkg/apis/field_error.go +++ b/vendor/knative.dev/pkg/apis/field_error.go @@ -103,7 +103,7 @@ func (fe *FieldError) ViaKey(key string) *FieldError { } // ViaFieldKey is the short way to chain: err.ViaKey(bar).ViaField(foo) -func (fe *FieldError) ViaFieldKey(field string, key string) *FieldError { +func (fe *FieldError) ViaFieldKey(field, key string) *FieldError { return fe.ViaKey(key).ViaField(field) } diff --git a/vendor/knative.dev/pkg/configmap/parse.go b/vendor/knative.dev/pkg/configmap/parse.go index eba04a11c..d4fa5e875 100644 --- a/vendor/knative.dev/pkg/configmap/parse.go +++ b/vendor/knative.dev/pkg/configmap/parse.go @@ -45,7 +45,9 @@ func AsString(key string, target *string) ParseFunc { func AsBool(key string, target *bool) ParseFunc { return func(data map[string]string) error { if raw, ok := data[key]; ok { - *target = strings.EqualFold(raw, "true") + val, err := strconv.ParseBool(raw) + *target = val // If err != nil — this is always false. + return err } return nil } diff --git a/vendor/knative.dev/pkg/kmeta/names.go b/vendor/knative.dev/pkg/kmeta/names.go index c59090b52..43d12de80 100644 --- a/vendor/knative.dev/pkg/kmeta/names.go +++ b/vendor/knative.dev/pkg/kmeta/names.go @@ -17,7 +17,7 @@ limitations under the license. package kmeta import ( - "crypto/md5" + "crypto/md5" // nolint:gosec // No strong cryptography needed. "fmt" "strings" ) @@ -42,6 +42,7 @@ func ChildName(parent, suffix string) string { // If the suffix is longer than the longest allowed suffix, then // we hash the whole combined string and use that as the suffix. if head-len(suffix) <= 0 { + // nolint:gosec // No strong cryptography needed. h := md5.Sum([]byte(parent + suffix)) // 1. trim parent, if needed if head < len(parent) { @@ -58,6 +59,7 @@ func ChildName(parent, suffix string) string { // remove it. return strings.TrimRight(ret, "-") } + // nolint:gosec // No strong cryptography needed. n = fmt.Sprintf("%s%x", parent[:head-len(suffix)], md5.Sum([]byte(parent))) } return n + suffix diff --git a/vendor/knative.dev/pkg/kmp/diff.go b/vendor/knative.dev/pkg/kmp/diff.go index 09c041446..791c9d1d4 100644 --- a/vendor/knative.dev/pkg/kmp/diff.go +++ b/vendor/knative.dev/pkg/kmp/diff.go @@ -73,7 +73,7 @@ func SafeEqual(x, y interface{}, opts ...cmp.Option) (equal bool, err error) { // CompareSetFields returns a list of field names that differ between // x and y. Uses SafeEqual for comparison. func CompareSetFields(x, y interface{}, opts ...cmp.Option) ([]string, error) { - r := new(FieldListReporter) + r := new(fieldListReporter) opts = append(opts, cmp.Reporter(r)) _, err := SafeEqual(x, y, opts...) return r.Fields(), err @@ -82,7 +82,7 @@ func CompareSetFields(x, y interface{}, opts ...cmp.Option) ([]string, error) { // ShortDiff returns a zero-context, unified human-readable diff. // Uses SafeEqual for comparison. func ShortDiff(prev, cur interface{}, opts ...cmp.Option) (string, error) { - r := new(ShortDiffReporter) + r := new(shortDiffReporter) opts = append(opts, cmp.Reporter(r)) var err error if _, err = SafeEqual(prev, cur, opts...); err != nil { diff --git a/vendor/knative.dev/pkg/kmp/reporters.go b/vendor/knative.dev/pkg/kmp/reporters.go index 5586f90bc..6f8ba0145 100644 --- a/vendor/knative.dev/pkg/kmp/reporters.go +++ b/vendor/knative.dev/pkg/kmp/reporters.go @@ -25,42 +25,41 @@ import ( "github.com/google/go-cmp/cmp" ) -// FieldListReporter implements the cmp.Reporter interface. It keeps +// fieldListReporter implements the cmp.Reporter interface. It keeps // track of the field names that differ between two structs and reports // them through the Fields() function. -type FieldListReporter struct { +type fieldListReporter struct { path cmp.Path fieldNames []string } // PushStep implements the cmp.Reporter. -func (r *FieldListReporter) PushStep(ps cmp.PathStep) { +func (r *fieldListReporter) PushStep(ps cmp.PathStep) { r.path = append(r.path, ps) } // fieldName returns a readable name for the field. If the field has JSON annotations it // returns the JSON key. If the field does not have JSON annotations or the JSON annotation // marks the field as ignored it returns the field's go name -func (r *FieldListReporter) fieldName() string { +func (r *fieldListReporter) fieldName() string { if len(r.path) < 2 { return r.path.Index(0).String() - } else { - fieldName := strings.TrimPrefix(r.path.Index(1).String(), ".") - // Prefer JSON name to fieldName if it exists - structField, exists := r.path.Index(0).Type().FieldByName(fieldName) - if exists { - tag := structField.Tag.Get("json") - if tag != "" && tag != "-" { - return strings.SplitN(tag, ",", 2)[0] - } - + } + fieldName := strings.TrimPrefix(r.path.Index(1).String(), ".") + // Prefer JSON name to fieldName if it exists + structField, exists := r.path.Index(0).Type().FieldByName(fieldName) + if exists { + tag := structField.Tag.Get("json") + if tag != "" && tag != "-" { + return strings.SplitN(tag, ",", 2)[0] } - return fieldName } + + return fieldName } // Report implements the cmp.Reporter. -func (r *FieldListReporter) Report(rs cmp.Result) { +func (r *fieldListReporter) Report(rs cmp.Result) { if rs.Equal() { return } @@ -75,72 +74,70 @@ func (r *FieldListReporter) Report(rs cmp.Result) { } // PopStep implements cmp.Reporter. -func (r *FieldListReporter) PopStep() { +func (r *fieldListReporter) PopStep() { r.path = r.path[:len(r.path)-1] } // Fields returns the field names that differed between the two // objects after calling cmp.Equal with the FieldListReporter. Field names // are returned in alphabetical order. -func (r *FieldListReporter) Fields() []string { +func (r *fieldListReporter) Fields() []string { sort.Strings(r.fieldNames) return r.fieldNames } -// ShortDiffReporter implements the cmp.Reporter interface. It reports +// shortDiffReporter implements the cmp.Reporter interface. It reports // on fields which have diffing values in a short zero-context, unified diff // format. -type ShortDiffReporter struct { +type shortDiffReporter struct { path cmp.Path diffs []string err error } // PushStep implements the cmp.Reporter. -func (r *ShortDiffReporter) PushStep(ps cmp.PathStep) { +func (r *shortDiffReporter) PushStep(ps cmp.PathStep) { r.path = append(r.path, ps) } // Report implements the cmp.Reporter. -func (r *ShortDiffReporter) Report(rs cmp.Result) { +func (r *shortDiffReporter) Report(rs cmp.Result) { if rs.Equal() { return } cur := r.path.Last() vx, vy := cur.Values() t := cur.Type() - var diff string // Prefix struct values with the types to add clarity in output if !vx.IsValid() && !vy.IsValid() { r.err = fmt.Errorf("unable to diff %+v and %+v on path %#v", vx, vy, r.path) - } else { - diff = fmt.Sprintf("%#v:\n", r.path) - if vx.IsValid() { - diff += r.diffString("-", t, vx) - } - if vy.IsValid() { - diff += r.diffString("+", t, vy) - } + return + } + diff := fmt.Sprintf("%#v:\n", r.path) + if vx.IsValid() { + diff += r.diffString("-", t, vx) + } + if vy.IsValid() { + diff += r.diffString("+", t, vy) } r.diffs = append(r.diffs, diff) } -func (r *ShortDiffReporter) diffString(diffType string, t reflect.Type, v reflect.Value) string { +func (r *shortDiffReporter) diffString(diffType string, t reflect.Type, v reflect.Value) string { if t.Kind() == reflect.Struct { return fmt.Sprintf("\t%s: %+v: \"%+v\"\n", diffType, t, v) - } else { - return fmt.Sprintf("\t%s: \"%+v\"\n", diffType, v) } + return fmt.Sprintf("\t%s: \"%+v\"\n", diffType, v) } // PopStep implements the cmp.Reporter. -func (r *ShortDiffReporter) PopStep() { +func (r *shortDiffReporter) PopStep() { r.path = r.path[:len(r.path)-1] } // Diff returns the generated short diff for this object. // cmp.Equal should be called before this method. -func (r *ShortDiffReporter) Diff() (string, error) { +func (r *shortDiffReporter) Diff() (string, error) { if r.err != nil { return "", r.err } diff --git a/vendor/modules.txt b/vendor/modules.txt index 1d75b537d..5d6e4e662 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -17,9 +17,11 @@ github.com/PuerkitoBio/purell github.com/PuerkitoBio/urlesc # github.com/beorn7/perks v1.0.1 github.com/beorn7/perks/quantile +# github.com/blang/semver v3.5.1+incompatible +github.com/blang/semver # github.com/cespare/xxhash/v2 v2.1.1 github.com/cespare/xxhash/v2 -# github.com/coreos/prometheus-operator v0.38.0 +# github.com/coreos/prometheus-operator v0.38.1-0.20200424145508-7e176fda06cc github.com/coreos/prometheus-operator/pkg/apis/monitoring github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1 github.com/coreos/prometheus-operator/pkg/client/versioned/scheme @@ -31,13 +33,15 @@ github.com/dgrijalva/jwt-go # github.com/emicklei/go-restful v2.9.5+incompatible github.com/emicklei/go-restful github.com/emicklei/go-restful/log -# github.com/evanphx/json-patch v4.5.0+incompatible +# github.com/evanphx/json-patch v4.9.0+incompatible github.com/evanphx/json-patch # github.com/fsnotify/fsnotify v1.4.9 github.com/fsnotify/fsnotify # github.com/ghodss/yaml v1.0.1-0.20190212211648-25d852aebe32 +## explicit github.com/ghodss/yaml # github.com/go-logr/logr v0.2.0 => github.com/go-logr/logr v0.1.0 +## explicit github.com/go-logr/logr # github.com/go-logr/zapr v0.1.1 github.com/go-logr/zapr @@ -46,6 +50,7 @@ github.com/go-openapi/jsonpointer # github.com/go-openapi/jsonreference v0.19.3 github.com/go-openapi/jsonreference # github.com/go-openapi/spec v0.19.6 +## explicit github.com/go-openapi/spec # github.com/go-openapi/swag v0.19.7 github.com/go-openapi/swag @@ -93,7 +98,7 @@ github.com/imdario/mergo github.com/inconshreveable/mousetrap # github.com/joho/godotenv v1.3.0 github.com/joho/godotenv -# github.com/json-iterator/go v1.1.9 +# github.com/json-iterator/go v1.1.10 github.com/json-iterator/go # github.com/konsorten/go-windows-terminal-sequences v1.0.3 github.com/konsorten/go-windows-terminal-sequences @@ -118,6 +123,7 @@ github.com/nxadm/tail/util github.com/nxadm/tail/watch github.com/nxadm/tail/winfile # github.com/onsi/ginkgo v1.12.1 +## explicit github.com/onsi/ginkgo github.com/onsi/ginkgo/config github.com/onsi/ginkgo/internal/codelocation @@ -137,8 +143,10 @@ github.com/onsi/ginkgo/reporters/stenographer/support/go-colorable github.com/onsi/ginkgo/reporters/stenographer/support/go-isatty github.com/onsi/ginkgo/types # github.com/onsi/gomega v1.10.1 +## explicit github.com/onsi/gomega github.com/onsi/gomega/format +github.com/onsi/gomega/gstruct/errors github.com/onsi/gomega/internal/assertion github.com/onsi/gomega/internal/asyncassertion github.com/onsi/gomega/internal/oraclematcher @@ -149,12 +157,21 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/operator-framework/operator-sdk v0.17.0 +# github.com/operator-framework/api v0.3.8 +github.com/operator-framework/api/pkg/lib/version +github.com/operator-framework/api/pkg/operators +# github.com/operator-framework/operator-registry v1.12.6-0.20200611222234-275301b779f8 +github.com/operator-framework/operator-registry/pkg/api +github.com/operator-framework/operator-registry/pkg/image +github.com/operator-framework/operator-registry/pkg/registry +# github.com/operator-framework/operator-sdk v0.18.2 +## explicit github.com/operator-framework/operator-sdk/internal/scaffold github.com/operator-framework/operator-sdk/internal/scaffold/input github.com/operator-framework/operator-sdk/internal/scaffold/internal/deps github.com/operator-framework/operator-sdk/internal/util/fileutil github.com/operator-framework/operator-sdk/internal/util/k8sutil +github.com/operator-framework/operator-sdk/internal/util/kubebuilder github.com/operator-framework/operator-sdk/internal/util/projutil github.com/operator-framework/operator-sdk/pkg/k8sutil github.com/operator-framework/operator-sdk/pkg/kube-metrics @@ -167,12 +184,15 @@ github.com/operator-framework/operator-sdk/version # github.com/pborman/uuid v1.2.0 github.com/pborman/uuid # github.com/pkg/errors v0.9.1 +## explicit github.com/pkg/errors # github.com/prometheus/client_golang v1.6.0 +## explicit github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promhttp # github.com/prometheus/client_model v0.2.0 +## explicit github.com/prometheus/client_model/go # github.com/prometheus/common v0.9.1 github.com/prometheus/common/expfmt @@ -194,8 +214,10 @@ github.com/spf13/afero/mem # github.com/spf13/cobra v1.0.0 github.com/spf13/cobra # github.com/spf13/pflag v1.0.5 +## explicit github.com/spf13/pflag -# github.com/tektoncd/pipeline v0.17.1 +# github.com/tektoncd/pipeline v0.17.1-0.20201006183654-d5df1c164a48 +## explicit github.com/tektoncd/pipeline/pkg/apis/config github.com/tektoncd/pipeline/pkg/apis/pipeline github.com/tektoncd/pipeline/pkg/apis/pipeline/pod @@ -227,7 +249,7 @@ golang.org/x/crypto/ssh/terminal # golang.org/x/mod v0.3.0 golang.org/x/mod/module golang.org/x/mod/semver -# golang.org/x/net v0.0.0-20200822124328-c89045814202 +# golang.org/x/net v0.0.0-20200904194848-62affa334b73 golang.org/x/net/context golang.org/x/net/context/ctxhttp golang.org/x/net/html @@ -237,13 +259,15 @@ golang.org/x/net/http/httpguts golang.org/x/net/http2 golang.org/x/net/http2/hpack golang.org/x/net/idna +golang.org/x/net/internal/timeseries +golang.org/x/net/trace # golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/oauth2 golang.org/x/oauth2/google golang.org/x/oauth2/internal golang.org/x/oauth2/jws golang.org/x/oauth2/jwt -# golang.org/x/sys v0.0.0-20200828081204-131dc92a58d5 +# golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f golang.org/x/sys/internal/unsafeheader golang.org/x/sys/unix golang.org/x/sys/windows @@ -271,7 +295,7 @@ golang.org/x/text/unicode/norm golang.org/x/text/width # golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e golang.org/x/time/rate -# golang.org/x/tools v0.0.0-20200828013309-97019fc2e64b +# golang.org/x/tools v0.0.0-20200828161849-5deb26317202 golang.org/x/tools/go/ast/astutil golang.org/x/tools/imports golang.org/x/tools/internal/event @@ -287,31 +311,6 @@ golang.org/x/xerrors golang.org/x/xerrors/internal # gomodules.xyz/jsonpatch/v2 v2.1.0 gomodules.xyz/jsonpatch/v2 -# gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485 -gonum.org/v1/gonum/blas -gonum.org/v1/gonum/blas/blas64 -gonum.org/v1/gonum/blas/cblas128 -gonum.org/v1/gonum/blas/gonum -gonum.org/v1/gonum/floats -gonum.org/v1/gonum/graph -gonum.org/v1/gonum/graph/internal/linear -gonum.org/v1/gonum/graph/internal/ordered -gonum.org/v1/gonum/graph/internal/set -gonum.org/v1/gonum/graph/internal/uid -gonum.org/v1/gonum/graph/iterator -gonum.org/v1/gonum/graph/simple -gonum.org/v1/gonum/graph/topo -gonum.org/v1/gonum/graph/traverse -gonum.org/v1/gonum/internal/asm/c128 -gonum.org/v1/gonum/internal/asm/c64 -gonum.org/v1/gonum/internal/asm/f32 -gonum.org/v1/gonum/internal/asm/f64 -gonum.org/v1/gonum/internal/cmplx64 -gonum.org/v1/gonum/internal/math32 -gonum.org/v1/gonum/lapack -gonum.org/v1/gonum/lapack/gonum -gonum.org/v1/gonum/lapack/lapack64 -gonum.org/v1/gonum/mat # google.golang.org/appengine v1.6.6 google.golang.org/appengine google.golang.org/appengine/internal @@ -323,6 +322,50 @@ google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch +# google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d +google.golang.org/genproto/googleapis/rpc/status +# google.golang.org/grpc v1.31.1 +google.golang.org/grpc +google.golang.org/grpc/attributes +google.golang.org/grpc/backoff +google.golang.org/grpc/balancer +google.golang.org/grpc/balancer/base +google.golang.org/grpc/balancer/grpclb/state +google.golang.org/grpc/balancer/roundrobin +google.golang.org/grpc/binarylog/grpc_binarylog_v1 +google.golang.org/grpc/codes +google.golang.org/grpc/connectivity +google.golang.org/grpc/credentials +google.golang.org/grpc/credentials/internal +google.golang.org/grpc/encoding +google.golang.org/grpc/encoding/proto +google.golang.org/grpc/grpclog +google.golang.org/grpc/internal +google.golang.org/grpc/internal/backoff +google.golang.org/grpc/internal/balancerload +google.golang.org/grpc/internal/binarylog +google.golang.org/grpc/internal/buffer +google.golang.org/grpc/internal/channelz +google.golang.org/grpc/internal/credentials +google.golang.org/grpc/internal/envconfig +google.golang.org/grpc/internal/grpclog +google.golang.org/grpc/internal/grpcrand +google.golang.org/grpc/internal/grpcsync +google.golang.org/grpc/internal/grpcutil +google.golang.org/grpc/internal/resolver/dns +google.golang.org/grpc/internal/resolver/passthrough +google.golang.org/grpc/internal/serviceconfig +google.golang.org/grpc/internal/status +google.golang.org/grpc/internal/syscall +google.golang.org/grpc/internal/transport +google.golang.org/grpc/keepalive +google.golang.org/grpc/metadata +google.golang.org/grpc/peer +google.golang.org/grpc/resolver +google.golang.org/grpc/serviceconfig +google.golang.org/grpc/stats +google.golang.org/grpc/status +google.golang.org/grpc/tap # google.golang.org/protobuf v1.25.0 google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire @@ -353,15 +396,14 @@ google.golang.org/protobuf/runtime/protoimpl google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/timestamppb -# gopkg.in/fsnotify.v1 v1.4.7 -gopkg.in/fsnotify.v1 # gopkg.in/inf.v0 v0.9.1 gopkg.in/inf.v0 # gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 gopkg.in/tomb.v1 # gopkg.in/yaml.v2 v2.3.0 gopkg.in/yaml.v2 -# k8s.io/api v0.18.7-rc.0 +# k8s.io/api v0.18.10 +## explicit k8s.io/api/admission/v1 k8s.io/api/admission/v1beta1 k8s.io/api/admissionregistration/v1 @@ -410,7 +452,8 @@ k8s.io/apiextensions-apiserver/pkg/apis/apiextensions k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1 k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme -# k8s.io/apimachinery v0.19.0 => k8s.io/apimachinery v0.17.6 +# k8s.io/apimachinery v0.19.0 => k8s.io/apimachinery v0.18.10 +## explicit k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -458,7 +501,8 @@ k8s.io/apimachinery/pkg/version k8s.io/apimachinery/pkg/watch k8s.io/apimachinery/third_party/forked/golang/json k8s.io/apimachinery/third_party/forked/golang/reflect -# k8s.io/client-go v12.0.0+incompatible => k8s.io/client-go v0.17.4 +# k8s.io/client-go v12.0.0+incompatible => k8s.io/client-go v0.18.10 +## explicit k8s.io/client-go/discovery k8s.io/client-go/discovery/cached k8s.io/client-go/discovery/cached/memory @@ -636,7 +680,8 @@ k8s.io/client-go/util/jsonpath k8s.io/client-go/util/keyutil k8s.io/client-go/util/retry k8s.io/client-go/util/workqueue -# k8s.io/code-generator v0.18.6 => k8s.io/code-generator v0.17.4 +# k8s.io/code-generator v0.18.10 => k8s.io/code-generator v0.18.10 +## explicit k8s.io/code-generator k8s.io/code-generator/cmd/client-gen k8s.io/code-generator/cmd/client-gen/args @@ -686,6 +731,7 @@ k8s.io/klog # k8s.io/klog/v2 v2.0.0 k8s.io/klog/v2 # k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 => k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 +## explicit k8s.io/kube-openapi/cmd/openapi-gen/args k8s.io/kube-openapi/pkg/common k8s.io/kube-openapi/pkg/generators @@ -695,14 +741,17 @@ k8s.io/kube-openapi/pkg/util/sets # k8s.io/kube-state-metrics v1.7.2 k8s.io/kube-state-metrics/pkg/metric k8s.io/kube-state-metrics/pkg/metrics_store -# k8s.io/kubectl v0.17.4 +# k8s.io/kubectl v0.18.10 +## explicit k8s.io/kubectl/pkg/scheme # k8s.io/utils v0.0.0-20200603063816-c1c6865ac451 +## explicit k8s.io/utils/buffer k8s.io/utils/integer k8s.io/utils/pointer k8s.io/utils/trace -# knative.dev/pkg v0.0.0-20200831162708-14fb2347fb77 +# knative.dev/pkg v0.0.0-20201026165741-2f75016c1368 +## explicit knative.dev/pkg/apis knative.dev/pkg/apis/duck knative.dev/pkg/apis/duck/ducktypes @@ -712,7 +761,8 @@ knative.dev/pkg/configmap knative.dev/pkg/kmeta knative.dev/pkg/kmp knative.dev/pkg/tracker -# sigs.k8s.io/controller-runtime v0.6.1 => sigs.k8s.io/controller-runtime v0.5.2 +# sigs.k8s.io/controller-runtime v0.6.1 => sigs.k8s.io/controller-runtime v0.6.1 +## explicit sigs.k8s.io/controller-runtime/pkg/cache sigs.k8s.io/controller-runtime/pkg/cache/internal sigs.k8s.io/controller-runtime/pkg/client @@ -745,5 +795,20 @@ sigs.k8s.io/controller-runtime/pkg/webhook sigs.k8s.io/controller-runtime/pkg/webhook/admission sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics +# sigs.k8s.io/kubebuilder v1.0.9-0.20200513134826-f07a0146a40b +sigs.k8s.io/kubebuilder/pkg/model/config +# sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba +sigs.k8s.io/structured-merge-diff/v3/value # sigs.k8s.io/yaml v1.2.0 +## explicit sigs.k8s.io/yaml +# github.com/Azure/go-autorest => github.com/Azure/go-autorest v13.3.2+incompatible +# github.com/Sirupsen/logrus => github.com/sirupsen/logrus v1.7.0 +# github.com/docker/distribution => github.com/docker/distribution v0.0.0-20191216044856-a8371794149d +# github.com/docker/docker => github.com/docker/docker v1.4.2-0.20200203170920-46ec8731fbce +# github.com/go-logr/logr => github.com/go-logr/logr v0.1.0 +# k8s.io/apimachinery => k8s.io/apimachinery v0.18.10 +# k8s.io/client-go => k8s.io/client-go v0.18.10 +# k8s.io/code-generator => k8s.io/code-generator v0.18.10 +# k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 +# sigs.k8s.io/controller-runtime => sigs.k8s.io/controller-runtime v0.6.1 diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go index 2e4c23bd8..0d7bdd849 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/cache.go @@ -17,6 +17,7 @@ limitations under the License. package cache import ( + "context" "fmt" "time" @@ -51,11 +52,11 @@ type Cache interface { type Informers interface { // GetInformer fetches or constructs an informer for the given object that corresponds to a single // API kind and resource. - GetInformer(obj runtime.Object) (Informer, error) + GetInformer(ctx context.Context, obj runtime.Object) (Informer, error) // GetInformerForKind is similar to GetInformer, except that it takes a group-version-kind, instead // of the underlying object. - GetInformerForKind(gvk schema.GroupVersionKind) (Informer, error) + GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (Informer, error) // Start runs all the informers known to this cache until the given channel is closed. // It blocks. diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informer_cache.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informer_cache.go index 5b2d1ee1f..043c295f0 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informer_cache.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/informer_cache.go @@ -131,16 +131,14 @@ func (ip *informerCache) objectTypeForListObject(list runtime.Object) (*schema.G } // GetInformerForKind returns the informer for the GroupVersionKind -func (ip *informerCache) GetInformerForKind(gvk schema.GroupVersionKind) (Informer, error) { +func (ip *informerCache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (Informer, error) { // Map the gvk to an object obj, err := ip.Scheme.New(gvk) if err != nil { return nil, err } - // TODO(djzager): before a context can be passed down, the Informers interface - // must be updated to accept a context when getting an informer - _, i, err := ip.InformersMap.Get(context.TODO(), gvk, obj) + _, i, err := ip.InformersMap.Get(ctx, gvk, obj) if err != nil { return nil, err } @@ -148,15 +146,13 @@ func (ip *informerCache) GetInformerForKind(gvk schema.GroupVersionKind) (Inform } // GetInformer returns the informer for the obj -func (ip *informerCache) GetInformer(obj runtime.Object) (Informer, error) { +func (ip *informerCache) GetInformer(ctx context.Context, obj runtime.Object) (Informer, error) { gvk, err := apiutil.GVKForObject(obj, ip.Scheme) if err != nil { return nil, err } - // TODO(djzager): before a context can be passed down, the Informers interface - // must be updated to accept a context when getting an informer - _, i, err := ip.InformersMap.Get(context.TODO(), gvk, obj) + _, i, err := ip.InformersMap.Get(ctx, gvk, obj) if err != nil { return nil, err } @@ -174,8 +170,8 @@ func (ip *informerCache) NeedLeaderElection() bool { // to List. For one-to-one compatibility with "normal" field selectors, only return one value. // The values may be anything. They will automatically be prefixed with the namespace of the // given object, if present. The objects passed are guaranteed to be objects of the correct type. -func (ip *informerCache) IndexField(obj runtime.Object, field string, extractValue client.IndexerFunc) error { - informer, err := ip.GetInformer(obj) +func (ip *informerCache) IndexField(ctx context.Context, obj runtime.Object, field string, extractValue client.IndexerFunc) error { + informer, err := ip.GetInformer(ctx, obj) if err != nil { return err } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go index 167a195e7..1068a1738 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/internal/informers_map.go @@ -245,12 +245,15 @@ func createStructuredListWatch(gvk schema.GroupVersionKind, ip *specificInformer return nil, err } + // TODO: the functions that make use of this ListWatch should be adapted to + // pass in their own contexts instead of relying on this fixed one here. + ctx := context.TODO() // Create a new ListWatch for the obj return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { res := listObj.DeepCopyObject() isNamespaceScoped := ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot - err := client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Do().Into(res) + err := client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Do(ctx).Into(res) return res, err }, // Setup the watch function @@ -258,7 +261,7 @@ func createStructuredListWatch(gvk schema.GroupVersionKind, ip *specificInformer // Watch needs to be set to true separately opts.Watch = true isNamespaceScoped := ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot - return client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Watch() + return client.Get().NamespaceIfScoped(ip.namespace, isNamespaceScoped).Resource(mapping.Resource.Resource).VersionedParams(&opts, ip.paramCodec).Watch(ctx) }, }, nil } @@ -275,22 +278,25 @@ func createUnstructuredListWatch(gvk schema.GroupVersionKind, ip *specificInform return nil, err } + // TODO: the functions that make use of this ListWatch should be adapted to + // pass in their own contexts instead of relying on this fixed one here. + ctx := context.TODO() // Create a new ListWatch for the obj return &cache.ListWatch{ ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) { if ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot { - return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).List(opts) + return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).List(ctx, opts) } - return dynamicClient.Resource(mapping.Resource).List(opts) + return dynamicClient.Resource(mapping.Resource).List(ctx, opts) }, // Setup the watch function WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) { // Watch needs to be set to true separately opts.Watch = true if ip.namespace != "" && mapping.Scope.Name() != meta.RESTScopeNameRoot { - return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).Watch(opts) + return dynamicClient.Resource(mapping.Resource).Namespace(ip.namespace).Watch(ctx, opts) } - return dynamicClient.Resource(mapping.Resource).Watch(opts) + return dynamicClient.Resource(mapping.Resource).Watch(ctx, opts) }, }, nil } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/multi_namespace_cache.go b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/multi_namespace_cache.go index e6a540f94..175437d9b 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/cache/multi_namespace_cache.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/cache/multi_namespace_cache.go @@ -70,10 +70,10 @@ type multiNamespaceCache struct { var _ Cache = &multiNamespaceCache{} // Methods for multiNamespaceCache to conform to the Informers interface -func (c *multiNamespaceCache) GetInformer(obj runtime.Object) (Informer, error) { +func (c *multiNamespaceCache) GetInformer(ctx context.Context, obj runtime.Object) (Informer, error) { informers := map[string]Informer{} for ns, cache := range c.namespaceToCache { - informer, err := cache.GetInformer(obj) + informer, err := cache.GetInformer(ctx, obj) if err != nil { return nil, err } @@ -82,10 +82,10 @@ func (c *multiNamespaceCache) GetInformer(obj runtime.Object) (Informer, error) return &multiNamespaceInformer{namespaceToInformer: informers}, nil } -func (c *multiNamespaceCache) GetInformerForKind(gvk schema.GroupVersionKind) (Informer, error) { +func (c *multiNamespaceCache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (Informer, error) { informers := map[string]Informer{} for ns, cache := range c.namespaceToCache { - informer, err := cache.GetInformerForKind(gvk) + informer, err := cache.GetInformerForKind(ctx, gvk) if err != nil { return nil, err } @@ -117,9 +117,9 @@ func (c *multiNamespaceCache) WaitForCacheSync(stop <-chan struct{}) bool { return synced } -func (c *multiNamespaceCache) IndexField(obj runtime.Object, field string, extractValue client.IndexerFunc) error { +func (c *multiNamespaceCache) IndexField(ctx context.Context, obj runtime.Object, field string, extractValue client.IndexerFunc) error { for _, cache := range c.namespaceToCache { - if err := cache.IndexField(obj, field, extractValue); err != nil { + if err := cache.IndexField(ctx, obj, field, extractValue); err != nil { return err } } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/apimachinery.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/apimachinery.go index 157f11f7c..9fe32b21f 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/apimachinery.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/apiutil/apimachinery.go @@ -53,7 +53,7 @@ func GVKForObject(obj runtime.Object, scheme *runtime.Scheme) (schema.GroupVersi return schema.GroupVersionKind{}, err } if isUnversioned { - return schema.GroupVersionKind{}, fmt.Errorf("cannot create a new informer for the unversioned type %T", obj) + return schema.GroupVersionKind{}, fmt.Errorf("cannot create group-version-kind for unversioned type %T", obj) } if len(gvks) < 1 { diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/config/config.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/config/config.go index 7719417a7..0a31419ef 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/config/config.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/config/config.go @@ -133,11 +133,8 @@ func loadConfig(context string) (*rest.Config, error) { } loadingRules.Precedence = append(loadingRules.Precedence, path.Join(u.HomeDir, clientcmd.RecommendedHomeDir, clientcmd.RecommendedFileName)) } - if c, err := loadConfigWithContext(apiServerURL, loadingRules, context); err == nil { - return c, nil - } - return nil, fmt.Errorf("could not locate a kubeconfig") + return loadConfigWithContext(apiServerURL, loadingRules, context) } func loadConfigWithContext(apiServerURL string, loader clientcmd.ClientConfigLoader, context string) (*rest.Config, error) { diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/dryrun.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/dryrun.go new file mode 100644 index 000000000..ced0548b1 --- /dev/null +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/dryrun.go @@ -0,0 +1,95 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package client + +import ( + "context" + + "k8s.io/apimachinery/pkg/runtime" +) + +// NewDryRunClient wraps an existing client and enforces DryRun mode +// on all mutating api calls. +func NewDryRunClient(c Client) Client { + return &dryRunClient{client: c} +} + +var _ Client = &dryRunClient{} + +// dryRunClient is a Client that wraps another Client in order to enforce DryRun mode. +type dryRunClient struct { + client Client +} + +// Create implements client.Client +func (c *dryRunClient) Create(ctx context.Context, obj runtime.Object, opts ...CreateOption) error { + return c.client.Create(ctx, obj, append(opts, DryRunAll)...) +} + +// Update implements client.Client +func (c *dryRunClient) Update(ctx context.Context, obj runtime.Object, opts ...UpdateOption) error { + return c.client.Update(ctx, obj, append(opts, DryRunAll)...) +} + +// Delete implements client.Client +func (c *dryRunClient) Delete(ctx context.Context, obj runtime.Object, opts ...DeleteOption) error { + return c.client.Delete(ctx, obj, append(opts, DryRunAll)...) +} + +// DeleteAllOf implements client.Client +func (c *dryRunClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts ...DeleteAllOfOption) error { + return c.client.DeleteAllOf(ctx, obj, append(opts, DryRunAll)...) +} + +// Patch implements client.Client +func (c *dryRunClient) Patch(ctx context.Context, obj runtime.Object, patch Patch, opts ...PatchOption) error { + return c.client.Patch(ctx, obj, patch, append(opts, DryRunAll)...) +} + +// Get implements client.Client +func (c *dryRunClient) Get(ctx context.Context, key ObjectKey, obj runtime.Object) error { + return c.client.Get(ctx, key, obj) +} + +// List implements client.Client +func (c *dryRunClient) List(ctx context.Context, obj runtime.Object, opts ...ListOption) error { + return c.client.List(ctx, obj, opts...) +} + +// Status implements client.StatusClient +func (c *dryRunClient) Status() StatusWriter { + return &dryRunStatusWriter{client: c.client.Status()} +} + +// ensure dryRunStatusWriter implements client.StatusWriter +var _ StatusWriter = &dryRunStatusWriter{} + +// dryRunStatusWriter is client.StatusWriter that writes status subresource with dryRun mode +// enforced. +type dryRunStatusWriter struct { + client StatusWriter +} + +// Update implements client.StatusWriter +func (sw *dryRunStatusWriter) Update(ctx context.Context, obj runtime.Object, opts ...UpdateOption) error { + return sw.client.Update(ctx, obj, append(opts, DryRunAll)...) +} + +// Patch implements client.StatusWriter +func (sw *dryRunStatusWriter) Patch(ctx context.Context, obj runtime.Object, patch Patch, opts ...PatchOption) error { + return sw.client.Patch(ctx, obj, patch, append(opts, DryRunAll)...) +} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go index 00b43caee..9c96947f8 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/interfaces.go @@ -122,7 +122,7 @@ type FieldIndexer interface { // and "equality" in the field selector means that at least one key matches the value. // The FieldIndexer will automatically take care of indexing over namespace // and supporting efficient all-namespace queries. - IndexField(obj runtime.Object, field string, extractValue IndexerFunc) error + IndexField(ctx context.Context, obj runtime.Object, field string, extractValue IndexerFunc) error } // IgnoreNotFound returns nil on NotFound errors. diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go index c3c4a52e9..131bdc2a0 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/options.go @@ -71,28 +71,43 @@ var DryRunAll = dryRunAll{} type dryRunAll struct{} +// ApplyToCreate applies this configuration to the given create options. func (dryRunAll) ApplyToCreate(opts *CreateOptions) { opts.DryRun = []string{metav1.DryRunAll} } + +// ApplyToUpdate applies this configuration to the given update options. func (dryRunAll) ApplyToUpdate(opts *UpdateOptions) { opts.DryRun = []string{metav1.DryRunAll} } + +// ApplyToPatch applies this configuration to the given patch options. func (dryRunAll) ApplyToPatch(opts *PatchOptions) { opts.DryRun = []string{metav1.DryRunAll} } + +// ApplyToPatch applies this configuration to the given delete options. func (dryRunAll) ApplyToDelete(opts *DeleteOptions) { opts.DryRun = []string{metav1.DryRunAll} } +func (dryRunAll) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { + opts.DryRun = []string{metav1.DryRunAll} +} // FieldOwner set the field manager name for the given server-side apply patch. type FieldOwner string +// ApplyToPatch applies this configuration to the given patch options. func (f FieldOwner) ApplyToPatch(opts *PatchOptions) { opts.FieldManager = string(f) } + +// ApplyToCreate applies this configuration to the given create options. func (f FieldOwner) ApplyToCreate(opts *CreateOptions) { opts.FieldManager = string(f) } + +// ApplyToUpdate applies this configuration to the given update options. func (f FieldOwner) ApplyToUpdate(opts *UpdateOptions) { opts.FieldManager = string(f) } @@ -252,33 +267,49 @@ func (o *DeleteOptions) ApplyToDelete(do *DeleteOptions) { // to the given number of seconds. type GracePeriodSeconds int64 +// ApplyToDelete applies this configuration to the given delete options. func (s GracePeriodSeconds) ApplyToDelete(opts *DeleteOptions) { secs := int64(s) opts.GracePeriodSeconds = &secs } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (s GracePeriodSeconds) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { s.ApplyToDelete(&opts.DeleteOptions) } +// Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out. type Preconditions metav1.Preconditions +// ApplyToDelete applies this configuration to the given delete options. func (p Preconditions) ApplyToDelete(opts *DeleteOptions) { preconds := metav1.Preconditions(p) opts.Preconditions = &preconds } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (p Preconditions) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { p.ApplyToDelete(&opts.DeleteOptions) } +// PropagationPolicy determined whether and how garbage collection will be +// performed. Either this field or OrphanDependents may be set, but not both. +// The default policy is decided by the existing finalizer set in the +// metadata.finalizers and the resource-specific default policy. +// Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - +// allow the garbage collector to delete the dependents in the background; +// 'Foreground' - a cascading policy that deletes all dependents in the +// foreground. type PropagationPolicy metav1.DeletionPropagation +// ApplyToDelete applies the given delete options on these options. +// It will propagate to the dependents of the object to let the garbage collector handle it. func (p PropagationPolicy) ApplyToDelete(opts *DeleteOptions) { policy := metav1.DeletionPropagation(p) opts.PropagationPolicy = &policy } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (p PropagationPolicy) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { p.ApplyToDelete(&opts.DeleteOptions) } @@ -379,12 +410,14 @@ func (o *ListOptions) ApplyOptions(opts []ListOption) *ListOptions { // MatchingLabels filters the list/delete operation on the given set of labels. type MatchingLabels map[string]string +// ApplyToList applies this configuration to the given list options. func (m MatchingLabels) ApplyToList(opts *ListOptions) { // TODO(directxman12): can we avoid reserializing this over and over? - sel := labels.SelectorFromSet(map[string]string(m)) + sel := labels.SelectorFromValidatedSet(map[string]string(m)) opts.LabelSelector = sel } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (m MatchingLabels) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { m.ApplyToList(&opts.ListOptions) } @@ -393,6 +426,7 @@ func (m MatchingLabels) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { // without checking their values. type HasLabels []string +// ApplyToList applies this configuration to the given list options. func (m HasLabels) ApplyToList(opts *ListOptions) { sel := labels.NewSelector() for _, label := range m { @@ -404,6 +438,7 @@ func (m HasLabels) ApplyToList(opts *ListOptions) { opts.LabelSelector = sel } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (m HasLabels) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { m.ApplyToList(&opts.ListOptions) } @@ -415,10 +450,12 @@ type MatchingLabelsSelector struct { labels.Selector } +// ApplyToList applies this configuration to the given list options. func (m MatchingLabelsSelector) ApplyToList(opts *ListOptions) { opts.LabelSelector = m } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (m MatchingLabelsSelector) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { m.ApplyToList(&opts.ListOptions) } @@ -435,12 +472,14 @@ func MatchingField(name, val string) MatchingFields { // (or index in the case of cached lists). type MatchingFields fields.Set +// ApplyToList applies this configuration to the given list options. func (m MatchingFields) ApplyToList(opts *ListOptions) { // TODO(directxman12): can we avoid re-serializing this? sel := fields.Set(m).AsSelector() opts.FieldSelector = sel } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (m MatchingFields) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { m.ApplyToList(&opts.ListOptions) } @@ -452,10 +491,12 @@ type MatchingFieldsSelector struct { fields.Selector } +// ApplyToList applies this configuration to the given list options. func (m MatchingFieldsSelector) ApplyToList(opts *ListOptions) { opts.FieldSelector = m } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (m MatchingFieldsSelector) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { m.ApplyToList(&opts.ListOptions) } @@ -463,10 +504,12 @@ func (m MatchingFieldsSelector) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { // InNamespace restricts the list/delete operation to the given namespace. type InNamespace string +// ApplyToList applies this configuration to the given list options. func (n InNamespace) ApplyToList(opts *ListOptions) { opts.Namespace = string(n) } +// ApplyToDeleteAllOf applies this configuration to the given an List options. func (n InNamespace) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { n.ApplyToList(&opts.ListOptions) } @@ -476,6 +519,7 @@ func (n InNamespace) ApplyToDeleteAllOf(opts *DeleteAllOfOptions) { // does not support setting it for deletecollection operations. type Limit int64 +// ApplyToList applies this configuration to the given an list options. func (l Limit) ApplyToList(opts *ListOptions) { opts.Limit = int64(l) } @@ -485,6 +529,7 @@ func (l Limit) ApplyToList(opts *ListOptions) { // does not support setting it for deletecollection operations. type Continue string +// ApplyToList applies this configuration to the given an List options. func (c Continue) ApplyToList(opts *ListOptions) { opts.Continue = string(c) } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/patch.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/patch.go index 5260b6fde..22a093cab 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/patch.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/patch.go @@ -17,7 +17,11 @@ limitations under the License. package client import ( + "fmt" + jsonpatch "github.com/evanphx/json-patch" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/json" @@ -59,8 +63,39 @@ func ConstantPatch(patchType types.PatchType, data []byte) Patch { return RawPatch(patchType, data) } +// MergeFromWithOptimisticLock can be used if clients want to make sure a patch +// is being applied to the latest resource version of an object. +// +// The behavior is similar to what an Update would do, without the need to send the +// whole object. Usually this method is useful if you might have multiple clients +// acting on the same object and the same API version, but with different versions of the Go structs. +// +// For example, an "older" copy of a Widget that has fields A and B, and a "newer" copy with A, B, and C. +// Sending an update using the older struct definition results in C being dropped, whereas using a patch does not. +type MergeFromWithOptimisticLock struct{} + +// ApplyToMergeFrom applies this configuration to the given patch options. +func (m MergeFromWithOptimisticLock) ApplyToMergeFrom(in *MergeFromOptions) { + in.OptimisticLock = true +} + +// MergeFromOption is some configuration that modifies options for a merge-from patch data. +type MergeFromOption interface { + // ApplyToMergeFrom applies this configuration to the given patch options. + ApplyToMergeFrom(*MergeFromOptions) +} + +// MergeFromOptions contains options to generate a merge-from patch data. +type MergeFromOptions struct { + // OptimisticLock, when true, includes `metadata.resourceVersion` into the final + // patch data. If the `resourceVersion` field doesn't match what's stored, + // the operation results in a conflict and clients will need to try again. + OptimisticLock bool +} + type mergeFromPatch struct { from runtime.Object + opts MergeFromOptions } // Type implements patch. @@ -80,12 +115,47 @@ func (s *mergeFromPatch) Data(obj runtime.Object) ([]byte, error) { return nil, err } - return jsonpatch.CreateMergePatch(originalJSON, modifiedJSON) + data, err := jsonpatch.CreateMergePatch(originalJSON, modifiedJSON) + if err != nil { + return nil, err + } + + if s.opts.OptimisticLock { + dataMap := map[string]interface{}{} + if err := json.Unmarshal(data, &dataMap); err != nil { + return nil, err + } + fromMeta, ok := s.from.(metav1.Object) + if !ok { + return nil, fmt.Errorf("cannot use OptimisticLock, from object %q is not a valid metav1.Object", s.from) + } + resourceVersion := fromMeta.GetResourceVersion() + if len(resourceVersion) == 0 { + return nil, fmt.Errorf("cannot use OptimisticLock, from object %q does not have any resource version we can use", s.from) + } + u := &unstructured.Unstructured{Object: dataMap} + u.SetResourceVersion(resourceVersion) + data, err = json.Marshal(u) + if err != nil { + return nil, err + } + } + + return data, nil } // MergeFrom creates a Patch that patches using the merge-patch strategy with the given object as base. func MergeFrom(obj runtime.Object) Patch { - return &mergeFromPatch{obj} + return &mergeFromPatch{from: obj} +} + +// MergeFromWithOptions creates a Patch that patches using the merge-patch strategy with the given object as base. +func MergeFromWithOptions(obj runtime.Object, opts ...MergeFromOption) Patch { + options := &MergeFromOptions{} + for _, opt := range opts { + opt.ApplyToMergeFrom(options) + } + return &mergeFromPatch{from: obj, opts: *options} } // mergePatch uses a raw merge strategy to patch the object. diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/typed_client.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/typed_client.go index c95da09da..d65f04fe9 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/typed_client.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/typed_client.go @@ -43,8 +43,7 @@ func (c *typedClient) Create(ctx context.Context, obj runtime.Object, opts ...Cr Resource(o.resource()). Body(obj). VersionedParams(createOpts.AsCreateOptions(), c.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -63,8 +62,7 @@ func (c *typedClient) Update(ctx context.Context, obj runtime.Object, opts ...Up Name(o.GetName()). Body(obj). VersionedParams(updateOpts.AsUpdateOptions(), c.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -83,8 +81,7 @@ func (c *typedClient) Delete(ctx context.Context, obj runtime.Object, opts ...De Resource(o.resource()). Name(o.GetName()). Body(deleteOpts.AsDeleteOptions()). - Context(ctx). - Do(). + Do(ctx). Error() } @@ -103,8 +100,7 @@ func (c *typedClient) DeleteAllOf(ctx context.Context, obj runtime.Object, opts Resource(o.resource()). VersionedParams(deleteAllOfOpts.AsListOptions(), c.paramCodec). Body(deleteAllOfOpts.AsDeleteOptions()). - Context(ctx). - Do(). + Do(ctx). Error() } @@ -127,8 +123,7 @@ func (c *typedClient) Patch(ctx context.Context, obj runtime.Object, patch Patch Name(o.GetName()). VersionedParams(patchOpts.ApplyOptions(opts).AsPatchOptions(), c.paramCodec). Body(data). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -141,8 +136,7 @@ func (c *typedClient) Get(ctx context.Context, key ObjectKey, obj runtime.Object return r.Get(). NamespaceIfScoped(key.Namespace, r.isNamespaced()). Resource(r.resource()). - Context(ctx). - Name(key.Name).Do().Into(obj) + Name(key.Name).Do(ctx).Into(obj) } // List implements client.Client @@ -157,8 +151,7 @@ func (c *typedClient) List(ctx context.Context, obj runtime.Object, opts ...List NamespaceIfScoped(listOpts.Namespace, r.isNamespaced()). Resource(r.resource()). VersionedParams(listOpts.AsListOptions(), c.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -179,8 +172,7 @@ func (c *typedClient) UpdateStatus(ctx context.Context, obj runtime.Object, opts SubResource("status"). Body(obj). VersionedParams((&UpdateOptions{}).ApplyOptions(opts).AsUpdateOptions(), c.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -204,7 +196,6 @@ func (c *typedClient) PatchStatus(ctx context.Context, obj runtime.Object, patch SubResource("status"). Body(data). VersionedParams(patchOpts.ApplyOptions(opts).AsPatchOptions(), c.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/client/unstructured_client.go b/vendor/sigs.k8s.io/controller-runtime/pkg/client/unstructured_client.go index 06e410cb5..5613791b9 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/client/unstructured_client.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/client/unstructured_client.go @@ -53,8 +53,7 @@ func (uc *unstructuredClient) Create(ctx context.Context, obj runtime.Object, op Resource(o.resource()). Body(obj). VersionedParams(createOpts.AsCreateOptions(), uc.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) u.SetGroupVersionKind(gvk) @@ -83,8 +82,7 @@ func (uc *unstructuredClient) Update(ctx context.Context, obj runtime.Object, op Name(o.GetName()). Body(obj). VersionedParams(updateOpts.AsUpdateOptions(), uc.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) u.SetGroupVersionKind(gvk) @@ -110,8 +108,7 @@ func (uc *unstructuredClient) Delete(ctx context.Context, obj runtime.Object, op Resource(o.resource()). Name(o.GetName()). Body(deleteOpts.AsDeleteOptions()). - Context(ctx). - Do(). + Do(ctx). Error() } @@ -134,8 +131,7 @@ func (uc *unstructuredClient) DeleteAllOf(ctx context.Context, obj runtime.Objec Resource(o.resource()). VersionedParams(deleteAllOfOpts.AsListOptions(), uc.paramCodec). Body(deleteAllOfOpts.AsDeleteOptions()). - Context(ctx). - Do(). + Do(ctx). Error() } @@ -163,8 +159,7 @@ func (uc *unstructuredClient) Patch(ctx context.Context, obj runtime.Object, pat Name(o.GetName()). VersionedParams(patchOpts.ApplyOptions(opts).AsPatchOptions(), uc.paramCodec). Body(data). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -185,9 +180,8 @@ func (uc *unstructuredClient) Get(ctx context.Context, key ObjectKey, obj runtim result := r.Get(). NamespaceIfScoped(key.Namespace, r.isNamespaced()). Resource(r.resource()). - Context(ctx). Name(key.Name). - Do(). + Do(ctx). Into(obj) u.SetGroupVersionKind(gvk) @@ -219,8 +213,7 @@ func (uc *unstructuredClient) List(ctx context.Context, obj runtime.Object, opts NamespaceIfScoped(listOpts.Namespace, r.isNamespaced()). Resource(r.resource()). VersionedParams(listOpts.AsListOptions(), uc.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -242,8 +235,7 @@ func (uc *unstructuredClient) UpdateStatus(ctx context.Context, obj runtime.Obje SubResource("status"). Body(obj). VersionedParams((&UpdateOptions{}).ApplyOptions(opts).AsUpdateOptions(), uc.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(obj) } @@ -273,8 +265,7 @@ func (uc *unstructuredClient) PatchStatus(ctx context.Context, obj runtime.Objec SubResource("status"). Body(data). VersionedParams(patchOpts.ApplyOptions(opts).AsPatchOptions(), uc.paramCodec). - Context(ctx). - Do(). + Do(ctx). Into(u) u.SetGroupVersionKind(gvk) diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controller.go b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controller.go index e75f13b90..720da25f9 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controller.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controller.go @@ -22,6 +22,7 @@ import ( "k8s.io/client-go/util/workqueue" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/internal/controller" + "sigs.k8s.io/controller-runtime/pkg/internal/log" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/ratelimiter" @@ -67,6 +68,18 @@ type Controller interface { // New returns a new Controller registered with the Manager. The Manager will ensure that shared Caches have // been synced before the Controller is Started. func New(name string, mgr manager.Manager, options Options) (Controller, error) { + c, err := NewUnmanaged(name, mgr, options) + if err != nil { + return nil, err + } + + // Add the controller as a Manager components + return c, mgr.Add(c) +} + +// NewUnmanaged returns a new controller without adding it to the manager. The +// caller is responsible for starting the returned controller. +func NewUnmanaged(name string, mgr manager.Manager, options Options) (Controller, error) { if options.Reconciler == nil { return nil, fmt.Errorf("must specify Reconciler") } @@ -90,19 +103,15 @@ func New(name string, mgr manager.Manager, options Options) (Controller, error) // Create controller with dependencies set c := &controller.Controller{ - Do: options.Reconciler, - Cache: mgr.GetCache(), - Config: mgr.GetConfig(), - Scheme: mgr.GetScheme(), - Client: mgr.GetClient(), - Recorder: mgr.GetEventRecorderFor(name), + Do: options.Reconciler, MakeQueue: func() workqueue.RateLimitingInterface { return workqueue.NewNamedRateLimitingQueue(options.RateLimiter, name) }, MaxConcurrentReconciles: options.MaxConcurrentReconciles, + SetFields: mgr.SetFields, Name: name, + Log: log.RuntimeLog.WithName("controller").WithValues("controller", name), } - // Add the controller as a Manager components - return c, mgr.Add(c) + return c, nil } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil/controllerutil.go b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil/controllerutil.go index a804ee4a0..9c8ec2576 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil/controllerutil.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/controller/controllerutil/controllerutil.go @@ -96,7 +96,7 @@ func SetOwnerReference(owner, object metav1.Object, scheme *runtime.Scheme) erro // Validate the owner. ro, ok := owner.(runtime.Object) if !ok { - return fmt.Errorf("%T is not a runtime.Object, cannot call SetControllerReference", owner) + return fmt.Errorf("%T is not a runtime.Object, cannot call SetOwnerReference", owner) } if err := validateOwner(owner, object); err != nil { return err @@ -237,8 +237,8 @@ func mutate(f MutateFn, key client.ObjectKey, obj runtime.Object) error { // MutateFn is a function which mutates the existing object into it's desired state. type MutateFn func() error -// AddFinalizer accepts a metav1 object and adds the provided finalizer if not present. -func AddFinalizer(o metav1.Object, finalizer string) { +// AddFinalizer accepts an Object and adds the provided finalizer if not present. +func AddFinalizer(o Object, finalizer string) { f := o.GetFinalizers() for _, e := range f { if e == finalizer { @@ -250,21 +250,24 @@ func AddFinalizer(o metav1.Object, finalizer string) { // AddFinalizerWithError tries to convert a runtime object to a metav1 object and add the provided finalizer. // It returns an error if the provided object cannot provide an accessor. +// +// Deprecated: Use AddFinalizer instead. Check is performing on compile time. func AddFinalizerWithError(o runtime.Object, finalizer string) error { m, err := meta.Accessor(o) if err != nil { return err } - AddFinalizer(m, finalizer) + AddFinalizer(m.(Object), finalizer) return nil } -// RemoveFinalizer accepts a metav1 object and removes the provided finalizer if present. -func RemoveFinalizer(o metav1.Object, finalizer string) { +// RemoveFinalizer accepts an Object and removes the provided finalizer if present. +func RemoveFinalizer(o Object, finalizer string) { f := o.GetFinalizers() - for i, e := range f { - if e == finalizer { + for i := 0; i < len(f); i++ { + if f[i] == finalizer { f = append(f[:i], f[i+1:]...) + i-- } } o.SetFinalizers(f) @@ -272,11 +275,31 @@ func RemoveFinalizer(o metav1.Object, finalizer string) { // RemoveFinalizerWithError tries to convert a runtime object to a metav1 object and remove the provided finalizer. // It returns an error if the provided object cannot provide an accessor. +// +// Deprecated: Use RemoveFinalizer instead. Check is performing on compile time. func RemoveFinalizerWithError(o runtime.Object, finalizer string) error { m, err := meta.Accessor(o) if err != nil { return err } - RemoveFinalizer(m, finalizer) + RemoveFinalizer(m.(Object), finalizer) return nil } + +// ContainsFinalizer checks an Object that the provided finalizer is present. +func ContainsFinalizer(o Object, finalizer string) bool { + f := o.GetFinalizers() + for _, e := range f { + if e == finalizer { + return true + } + } + return false +} + +// Object allows functions to work indistinctly with any resource that +// implements both Object interfaces. +type Object interface { + metav1.Object + runtime.Object +} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go b/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go index 946ef8285..2fc6a749d 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go @@ -21,25 +21,18 @@ import ( "sync" "time" - "k8s.io/apimachinery/pkg/runtime" + "github.com/go-logr/logr" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/record" "k8s.io/client-go/util/workqueue" - "sigs.k8s.io/controller-runtime/pkg/cache" - "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" ctrlmetrics "sigs.k8s.io/controller-runtime/pkg/internal/controller/metrics" - logf "sigs.k8s.io/controller-runtime/pkg/internal/log" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/source" ) -var log = logf.RuntimeLog.WithName("controller") - var _ inject.Injector = &Controller{} // Controller implements controller.Controller @@ -55,19 +48,6 @@ type Controller struct { // Defaults to the DefaultReconcileFunc. Do reconcile.Reconciler - // Client is a lazily initialized Client. The controllerManager will initialize this when Start is called. - Client client.Client - - // Scheme is injected by the controllerManager when controllerManager.Start is called - Scheme *runtime.Scheme - - // informers are injected by the controllerManager when controllerManager.Start is called - Cache cache.Cache - - // Config is the rest.Config used to talk to the apiserver. Defaults to one of in-cluster, environment variable - // specified, or the ~/.kube/Config. - Config *rest.Config - // MakeQueue constructs the queue for this controller once the controller is ready to start. // This exists because the standard Kubernetes workqueues start themselves immediately, which // leads to goroutine leaks if something calls controller.New repeatedly. @@ -86,21 +66,16 @@ type Controller struct { // JitterPeriod allows tests to reduce the JitterPeriod so they complete faster JitterPeriod time.Duration - // WaitForCacheSync allows tests to mock out the WaitForCacheSync function to return an error - // defaults to Cache.WaitForCacheSync - WaitForCacheSync func(stopCh <-chan struct{}) bool - // Started is true if the Controller has been Started Started bool - // Recorder is an event recorder for recording Event resources to the - // Kubernetes API. - Recorder record.EventRecorder - // TODO(community): Consider initializing a logger with the Controller Name as the tag // watches maintains a list of sources, handlers, and predicates to start when the controller is started. watches []watchDescription + + // Log is used to log messages to users during reconciliation, or for example when a watch is started. + Log logr.Logger } // watchDescription contains all the information necessary to start a watch. @@ -135,7 +110,7 @@ func (c *Controller) Watch(src source.Source, evthdler handler.EventHandler, prc c.watches = append(c.watches, watchDescription{src: src, handler: evthdler, predicates: prct}) if c.Started { - log.Info("Starting EventSource", "controller", c.Name, "source", src) + c.Log.Info("Starting EventSource", "source", src) return src.Start(evthdler, c.Queue, prct...) } @@ -161,25 +136,27 @@ func (c *Controller) Start(stop <-chan struct{}) error { // caches to sync so that they have a chance to register their intendeded // caches. for _, watch := range c.watches { - log.Info("Starting EventSource", "controller", c.Name, "source", watch.src) + c.Log.Info("Starting EventSource", "source", watch.src) if err := watch.src.Start(watch.handler, c.Queue, watch.predicates...); err != nil { return err } } // Start the SharedIndexInformer factories to begin populating the SharedIndexInformer caches - log.Info("Starting Controller", "controller", c.Name) + c.Log.Info("Starting Controller") - // Wait for the caches to be synced before starting workers - if c.WaitForCacheSync == nil { - c.WaitForCacheSync = c.Cache.WaitForCacheSync - } - if ok := c.WaitForCacheSync(stop); !ok { - // This code is unreachable right now since WaitForCacheSync will never return an error - // Leaving it here because that could happen in the future - err := fmt.Errorf("failed to wait for %s caches to sync", c.Name) - log.Error(err, "Could not wait for Cache to sync", "controller", c.Name) - return err + for _, watch := range c.watches { + syncingSource, ok := watch.src.(source.SyncingSource) + if !ok { + continue + } + if err := syncingSource.WaitForSync(stop); err != nil { + // This code is unreachable in case of kube watches since WaitForCacheSync will never return an error + // Leaving it here because that could happen in the future + err := fmt.Errorf("failed to wait for %s caches to sync: %w", c.Name, err) + c.Log.Error(err, "Could not wait for Cache to sync") + return err + } } if c.JitterPeriod == 0 { @@ -187,7 +164,7 @@ func (c *Controller) Start(stop <-chan struct{}) error { } // Launch workers to process resources - log.Info("Starting workers", "controller", c.Name, "worker count", c.MaxConcurrentReconciles) + c.Log.Info("Starting workers", "worker count", c.MaxConcurrentReconciles) for i := 0; i < c.MaxConcurrentReconciles; i++ { // Process work items go wait.Until(c.worker, c.JitterPeriod, stop) @@ -201,7 +178,7 @@ func (c *Controller) Start(stop <-chan struct{}) error { } <-stop - log.Info("Stopping workers", "controller", c.Name) + c.Log.Info("Stopping workers") return nil } @@ -239,23 +216,23 @@ func (c *Controller) reconcileHandler(obj interface{}) bool { c.updateMetrics(time.Since(reconcileStartTS)) }() - var req reconcile.Request - var ok bool - if req, ok = obj.(reconcile.Request); !ok { + // Make sure that the the object is a valid request. + req, ok := obj.(reconcile.Request) + if !ok { // As the item in the workqueue is actually invalid, we call // Forget here else we'd go into a loop of attempting to // process a work item that is invalid. c.Queue.Forget(obj) - log.Error(nil, "Queue item was not a Request", - "controller", c.Name, "type", fmt.Sprintf("%T", obj), "value", obj) + c.Log.Error(nil, "Queue item was not a Request", "type", fmt.Sprintf("%T", obj), "value", obj) // Return true, don't take a break return true } + // RunInformersAndControllers the syncHandler, passing it the namespace/Name string of the // resource to be synced. if result, err := c.Do.Reconcile(req); err != nil { c.Queue.AddRateLimited(req) - log.Error(err, "Reconciler error", "controller", c.Name, "request", req) + c.Log.Error(err, "Reconciler error", "name", req.Name, "namespace", req.Namespace) ctrlmetrics.ReconcileErrors.WithLabelValues(c.Name).Inc() ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, "error").Inc() return false @@ -279,7 +256,7 @@ func (c *Controller) reconcileHandler(obj interface{}) bool { c.Queue.Forget(obj) // TODO(directxman12): What does 1 mean? Do we want level constants? Do we want levels at all? - log.V(1).Info("Successfully Reconciled", "controller", c.Name, "request", req) + c.Log.V(1).Info("Successfully Reconciled", "name", req.Name, "namespace", req.Namespace) ctrlmetrics.ReconcileTotal.WithLabelValues(c.Name, "success").Inc() // Return true, don't take a break diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/flags.go b/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/flags.go index e4af1ec22..bd4fa6f1b 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/flags.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/flags.go @@ -81,7 +81,7 @@ func newConsoleEncoder() zapcore.Encoder { } type levelFlag struct { - setFunc func(zap.AtomicLevel) + setFunc func(zapcore.LevelEnabler) value string } @@ -115,7 +115,7 @@ func (ev *levelFlag) Type() string { } type stackTraceFlag struct { - setFunc func(zap.AtomicLevel) + setFunc func(zapcore.LevelEnabler) value string } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/kube_helpers.go b/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/kube_helpers.go index 2c0d88386..e37df1aed 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/kube_helpers.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/kube_helpers.go @@ -105,7 +105,9 @@ func (k *KubeAwareEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Fie // intercept stringer fields that happen to be Kubernetes runtime.Object or // types.NamespacedName values (Kubernetes runtime.Objects commonly // implement String, apparently). - if field.Type == zapcore.StringerType { + // *unstructured.Unstructured does NOT implement fmt.Striger interface. + // We have handle it specially. + if field.Type == zapcore.StringerType || field.Type == zapcore.ReflectType { switch val := field.Interface.(type) { case runtime.Object: fields[i] = zapcore.Field{ diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/zap.go b/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/zap.go index fd8ae0d52..f240928c3 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/zap.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/log/zap/zap.go @@ -100,7 +100,7 @@ func Encoder(encoder zapcore.Encoder) func(o *Options) { // Level sets the the minimum enabled logging level e.g Debug, Info // See Options.Level -func Level(level *zap.AtomicLevel) func(o *Options) { +func Level(level zapcore.LevelEnabler) func(o *Options) { return func(o *Options) { o.Level = level } @@ -109,7 +109,7 @@ func Level(level *zap.AtomicLevel) func(o *Options) { // StacktraceLevel configures the logger to record a stack trace for all messages at // or above a given level. // See Options.StacktraceLevel -func StacktraceLevel(stacktraceLevel *zap.AtomicLevel) func(o *Options) { +func StacktraceLevel(stacktraceLevel zapcore.LevelEnabler) func(o *Options) { return func(o *Options) { o.StacktraceLevel = stacktraceLevel } @@ -137,11 +137,11 @@ type Options struct { DestWritter io.Writer // Level configures the verbosity of the logging. Defaults to Debug when // Development is true and Info otherwise - Level *zap.AtomicLevel + Level zapcore.LevelEnabler // StacktraceLevel is the level at and above which stacktraces will // be recorded for all messages. Defaults to Warn when Development // is true and Error otherwise - StacktraceLevel *zap.AtomicLevel + StacktraceLevel zapcore.LevelEnabler // ZapOpts allows passing arbitrary zap.Options to configure on the // underlying Zap logger. ZapOpts []zap.Option @@ -204,7 +204,7 @@ func NewRaw(opts ...Opts) *zap.Logger { sink := zapcore.AddSync(o.DestWritter) o.ZapOpts = append(o.ZapOpts, zap.AddCallerSkip(1), zap.ErrorOutput(sink)) - log := zap.New(zapcore.NewCore(&KubeAwareEncoder{Encoder: o.Encoder, Verbose: o.Development}, sink, *o.Level)) + log := zap.New(zapcore.NewCore(&KubeAwareEncoder{Encoder: o.Encoder, Verbose: o.Development}, sink, o.Level)) log = log.WithOptions(o.ZapOpts...) return log } @@ -232,8 +232,8 @@ func (o *Options) BindFlags(fs *flag.FlagSet) { // Set the Log Level var levelVal levelFlag - levelVal.setFunc = func(fromFlag zap.AtomicLevel) { - o.Level = &fromFlag + levelVal.setFunc = func(fromFlag zapcore.LevelEnabler) { + o.Level = fromFlag } fs.Var(&levelVal, "zap-log-level", "Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', "+ @@ -241,8 +241,8 @@ func (o *Options) BindFlags(fs *flag.FlagSet) { // Set the StrackTrace Level var stackVal stackTraceFlag - stackVal.setFunc = func(fromFlag zap.AtomicLevel) { - o.StacktraceLevel = &fromFlag + stackVal.setFunc = func(fromFlag zapcore.LevelEnabler) { + o.StacktraceLevel = fromFlag } fs.Var(&stackVal, "zap-stacktrace-level", "Zap Level at and above which stacktraces are captured (one of 'warn' or 'error')") diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/manager/internal.go b/vendor/sigs.k8s.io/controller-runtime/pkg/manager/internal.go index 2f969fcd3..42fad7614 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/manager/internal.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/manager/internal.go @@ -50,6 +50,7 @@ const ( defaultReadinessEndpoint = "/readyz" defaultLivenessEndpoint = "/healthz" + defaultMetricsEndpoint = "/metrics" ) var log = logf.RuntimeLog.WithName("manager") @@ -95,6 +96,9 @@ type controllerManager struct { // metricsListener is used to serve prometheus metrics metricsListener net.Listener + // metricsExtraHandlers contains extra handlers to register on http server that serves metrics. + metricsExtraHandlers map[string]http.Handler + // healthProbeListener is used to serve liveness probe healthProbeListener net.Listener @@ -130,6 +134,11 @@ type controllerManager struct { // It and `internalStop` should point to the same channel. internalStopper chan<- struct{} + // elected is closed when this manager becomes the leader of a group of + // managers, either because it won a leader election or because no leader + // election was configured. + elected chan struct{} + startCache func(stop <-chan struct{}) error // port is the port that the webhook server serves at. @@ -146,7 +155,7 @@ type controllerManager struct { // leaseDuration is the duration that non-leader candidates will // wait to force acquire leadership. leaseDuration time.Duration - // renewDeadline is the duration that the acting master will retry + // renewDeadline is the duration that the acting controlplane will retry // refreshing leadership before giving up. renewDeadline time.Duration // retryPeriod is the duration the LeaderElector clients should wait @@ -260,6 +269,25 @@ func (cm *controllerManager) SetFields(i interface{}) error { return nil } +// AddMetricsExtraHandler adds extra handler served on path to the http server that serves metrics. +func (cm *controllerManager) AddMetricsExtraHandler(path string, handler http.Handler) error { + if path == defaultMetricsEndpoint { + return fmt.Errorf("overriding builtin %s endpoint is not allowed", defaultMetricsEndpoint) + } + + cm.mu.Lock() + defer cm.mu.Unlock() + + _, found := cm.metricsExtraHandlers[path] + if found { + return fmt.Errorf("can't register extra handler by duplicate path %q on metrics http server", path) + } + + cm.metricsExtraHandlers[path] = handler + log.V(2).Info("Registering metrics http server extra handler", "path", path) + return nil +} + // AddHealthzCheck allows you to add Healthz checker func (cm *controllerManager) AddHealthzCheck(name string, check healthz.Checker) error { cm.mu.Lock() @@ -341,19 +369,28 @@ func (cm *controllerManager) GetWebhookServer() *webhook.Server { } func (cm *controllerManager) serveMetrics(stop <-chan struct{}) { - var metricsPath = "/metrics" handler := promhttp.HandlerFor(metrics.Registry, promhttp.HandlerOpts{ ErrorHandling: promhttp.HTTPErrorOnError, }) // TODO(JoelSpeed): Use existing Kubernetes machinery for serving metrics mux := http.NewServeMux() - mux.Handle(metricsPath, handler) + mux.Handle(defaultMetricsEndpoint, handler) + + func() { + cm.mu.Lock() + defer cm.mu.Unlock() + + for path, extraHandler := range cm.metricsExtraHandlers { + mux.Handle(path, extraHandler) + } + }() + server := http.Server{ Handler: mux, } // Run the server go func() { - log.Info("starting metrics server", "path", metricsPath) + log.Info("starting metrics server", "path", defaultMetricsEndpoint) if err := server.Serve(cm.metricsListener); err != nil && err != http.ErrServerClosed { cm.errSignal.SignalError(err) } @@ -367,6 +404,8 @@ func (cm *controllerManager) serveMetrics(stop <-chan struct{}) { } func (cm *controllerManager) serveHealthProbes(stop <-chan struct{}) { + // TODO(hypnoglow): refactor locking to use anonymous func in the similar way + // it's done in serveMetrics. cm.mu.Lock() mux := http.NewServeMux() @@ -423,6 +462,8 @@ func (cm *controllerManager) Start(stop <-chan struct{}) error { return err } } else { + // Treat not having leader election enabled the same as being elected. + close(cm.elected) go cm.startLeaderElectionRunnables() } @@ -511,6 +552,7 @@ func (cm *controllerManager) startLeaderElection() (err error) { RetryPeriod: cm.retryPeriod, Callbacks: leaderelection.LeaderCallbacks{ OnStartedLeading: func(_ context.Context) { + close(cm.elected) cm.startLeaderElectionRunnables() }, OnStoppedLeading: func() { @@ -538,3 +580,7 @@ func (cm *controllerManager) startLeaderElection() (err error) { go l.Run(ctx) return nil } + +func (cm *controllerManager) Elected() <-chan struct{} { + return cm.elected +} diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/manager/manager.go b/vendor/sigs.k8s.io/controller-runtime/pkg/manager/manager.go index 852eb787b..73e4b94ad 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/manager/manager.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/manager/manager.go @@ -19,6 +19,7 @@ package manager import ( "fmt" "net" + "net/http" "time" "github.com/go-logr/logr" @@ -50,10 +51,22 @@ type Manager interface { // non-leaderelection mode (always running) or leader election mode (managed by leader election if enabled). Add(Runnable) error + // Elected is closed when this manager is elected leader of a group of + // managers, either because it won a leader election or because no leader + // election was configured. + Elected() <-chan struct{} + // SetFields will set any dependencies on an object for which the object has implemented the inject // interface - e.g. inject.Client. SetFields(interface{}) error + // AddMetricsExtraHandler adds an extra handler served on path to the http server that serves metrics. + // Might be useful to register some diagnostic endpoints e.g. pprof. Note that these endpoints meant to be + // sensitive and shouldn't be exposed publicly. + // If the simple path -> handler mapping offered here is not enough, a new http server/listener should be added as + // Runnable to the manager via Add method. + AddMetricsExtraHandler(path string, handler http.Handler) error + // AddHealthzCheck allows you to add Healthz checker AddHealthzCheck(name string, check healthz.Checker) error @@ -131,7 +144,7 @@ type Options struct { // wait to force acquire leadership. This is measured against time of // last observed ack. Default is 15 seconds. LeaseDuration *time.Duration - // RenewDeadline is the duration that the acting master will retry + // RenewDeadline is the duration that the acting controlplane will retry // refreshing leadership before giving up. Default is 10 seconds. RenewDeadline *time.Duration // RetryPeriod is the duration the LeaderElector clients should wait @@ -184,6 +197,10 @@ type Options struct { // use the cache for reads and the client for writes. NewClient NewClientFunc + // DryRunClient specifies whether the client should be configured to enforce + // dryRun mode. + DryRunClient bool + // EventBroadcaster records Events emitted by the manager and sends them to the Kubernetes API // Use this to customize the event correlator and spam filter EventBroadcaster record.EventBroadcaster @@ -257,6 +274,11 @@ func New(config *rest.Config, options Options) (Manager, error) { if err != nil { return nil, err } + + if options.DryRunClient { + writeObj = client.NewDryRunClient(writeObj) + } + // Create the recorder provider to inject event recorders for the components. // TODO(directxman12): the log for the event provider should have a context (name, tags, etc) specific // to the particular controller that it's being injected into, rather than a generic one like is here. @@ -282,6 +304,9 @@ func New(config *rest.Config, options Options) (Manager, error) { return nil, err } + // By default we have no extra endpoints to expose on metrics http server. + metricsExtraHandlers := make(map[string]http.Handler) + // Create health probes listener. This will throw an error if the bind // address is invalid or already in use. healthProbeListener, err := options.newHealthProbeListener(options.HealthProbeBindAddress) @@ -302,8 +327,10 @@ func New(config *rest.Config, options Options) (Manager, error) { resourceLock: resourceLock, mapper: mapper, metricsListener: metricsListener, + metricsExtraHandlers: metricsExtraHandlers, internalStop: stop, internalStopper: stop, + elected: make(chan struct{}), port: options.Port, host: options.Host, certDir: options.CertDir, @@ -316,8 +343,8 @@ func New(config *rest.Config, options Options) (Manager, error) { }, nil } -// defaultNewClient creates the default caching client -func defaultNewClient(cache cache.Cache, config *rest.Config, options client.Options) (client.Client, error) { +// DefaultNewClient creates the default caching client +func DefaultNewClient(cache cache.Cache, config *rest.Config, options client.Options) (client.Client, error) { // Create the Client for Write operations. c, err := client.New(config, options) if err != nil { @@ -362,7 +389,7 @@ func setOptionsDefaults(options Options) Options { // Allow newClient to be mocked if options.NewClient == nil { - options.NewClient = defaultNewClient + options.NewClient = DefaultNewClient } // Allow newCache to be mocked diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go b/vendor/sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go index ae4c62a45..17d3eccd2 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/metrics/client_go_adapter.go @@ -130,7 +130,10 @@ func registerClientMetrics() { Registry.MustRegister(requestResult) // register the metrics with client-go - clientmetrics.Register(&latencyAdapter{metric: requestLatency}, &resultAdapter{metric: requestResult}) + clientmetrics.Register(clientmetrics.RegisterOpts{ + RequestLatency: &latencyAdapter{metric: requestLatency}, + RequestResult: &resultAdapter{metric: requestResult}, + }) } // registerReflectorMetrics sets up reflector (reconcile) loop metrics diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go b/vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go index fbdec1087..50dea3615 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/reconcile/reconcile.go @@ -52,7 +52,7 @@ Deleting Kubernetes objects) or external Events (GitHub Webhooks, polling extern Example reconcile Logic: - * Reader an object and all the Pods it owns. + * Read an object and all the Pods it owns. * Observe that the object spec specifies 5 replicas but actual cluster contains only 1 Pod replica. * Create 4 Pods and set their OwnerReferences to the object. diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/runtime/inject/inject.go b/vendor/sigs.k8s.io/controller-runtime/pkg/runtime/inject/inject.go index b47a91d04..9af45b93f 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/runtime/inject/inject.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/runtime/inject/inject.go @@ -33,7 +33,7 @@ type Cache interface { } // CacheInto will set informers on i and return the result if it implements Cache. Returns -//// false if i does not implement Cache. +// false if i does not implement Cache. func CacheInto(c cache.Cache, i interface{}) (bool, error) { if s, ok := i.(Cache); ok { return true, s.InjectCache(c) @@ -62,7 +62,7 @@ type Config interface { } // ConfigInto will set config on i and return the result if it implements Config. Returns -//// false if i does not implement Config. +// false if i does not implement Config. func ConfigInto(config *rest.Config, i interface{}) (bool, error) { if s, ok := i.(Config); ok { return true, s.InjectConfig(config) diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/scheme/scheme.go b/vendor/sigs.k8s.io/controller-runtime/pkg/scheme/scheme.go index cd6031967..871cd441f 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/scheme/scheme.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/scheme/scheme.go @@ -36,13 +36,13 @@ limitations under the License. // ) // // This also true of the built-in Kubernetes types. Then, in the entrypoint for -// your manager, assemble the scheme containing exactly the types you need. -// For instance, if our controller needs types from the core/v1 API group (e.g. Pod), -// plus types from my.api.group/v1: +// your manager, assemble the scheme containing exactly the types you need, +// panicing if scheme registration failed. For instance, if our controller needs +// types from the core/v1 API group (e.g. Pod), plus types from my.api.group/v1: // // func init() { -// myapigroupv1.AddToScheme(scheme) -// kubernetesscheme.AddToScheme(scheme) +// utilruntime.Must(myapigroupv1.AddToScheme(scheme)) +// utilruntime.Must(kubernetesscheme.AddToScheme(scheme)) // } // // func main() { diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/source/internal/eventsource.go b/vendor/sigs.k8s.io/controller-runtime/pkg/source/internal/eventsource.go index 8558e2736..e5963079d 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/source/internal/eventsource.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/source/internal/eventsource.go @@ -35,7 +35,7 @@ var log = logf.RuntimeLog.WithName("source").WithName("EventHandler") var _ cache.ResourceEventHandler = EventHandler{} -// EventHandler adapts a eventhandler.EventHandler interface to a cache.ResourceEventHandler interface +// EventHandler adapts a handler.EventHandler interface to a cache.ResourceEventHandler interface type EventHandler struct { EventHandler handler.EventHandler Queue workqueue.RateLimitingInterface diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go b/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go index 7251cea77..b2c6b2bbc 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/source/source.go @@ -17,6 +17,8 @@ limitations under the License. package source import ( + "context" + "errors" "fmt" "sync" @@ -55,10 +57,17 @@ type Source interface { Start(handler.EventHandler, workqueue.RateLimitingInterface, ...predicate.Predicate) error } +// SyncingSource is a source that needs syncing prior to being usable. The controller +// will call its WaitForSync prior to starting workers. +type SyncingSource interface { + Source + WaitForSync(stop <-chan struct{}) error +} + // NewKindWithCache creates a Source without InjectCache, so that it is assured that the given cache is used // and not overwritten. It can be used to watch objects in a different cluster by passing the cache // from that other cluster -func NewKindWithCache(object runtime.Object, cache cache.Cache) Source { +func NewKindWithCache(object runtime.Object, cache cache.Cache) SyncingSource { return &kindWithCache{kind: Kind{Type: object, cache: cache}} } @@ -71,6 +80,10 @@ func (ks *kindWithCache) Start(handler handler.EventHandler, queue workqueue.Rat return ks.kind.Start(handler, queue, prct...) } +func (ks *kindWithCache) WaitForSync(stop <-chan struct{}) error { + return ks.kind.WaitForSync(stop) +} + // Kind is used to provide a source of events originating inside the cluster from Watches (e.g. Pod Create) type Kind struct { // Type is the type of object to watch. e.g. &v1.Pod{} @@ -80,7 +93,7 @@ type Kind struct { cache cache.Cache } -var _ Source = &Kind{} +var _ SyncingSource = &Kind{} // Start is internal and should be called only by the Controller to register an EventHandler with the Informer // to enqueue reconcile.Requests. @@ -98,7 +111,7 @@ func (ks *Kind) Start(handler handler.EventHandler, queue workqueue.RateLimiting } // Lookup the Informer from the Cache and add an EventHandler which populates the Queue - i, err := ks.cache.GetInformer(ks.Type) + i, err := ks.cache.GetInformer(context.TODO(), ks.Type) if err != nil { if kindMatchErr, ok := err.(*meta.NoKindMatchError); ok { log.Error(err, "if kind is a CRD, it should be installed before calling Start", @@ -117,6 +130,16 @@ func (ks *Kind) String() string { return fmt.Sprintf("kind source: unknown GVK") } +// WaitForSync implements SyncingSource to allow controllers to wait with starting +// workers until the cache is synced. +func (ks *Kind) WaitForSync(stop <-chan struct{}) error { + if !ks.cache.WaitForCacheSync(stop) { + // Would be great to return something more informative here + return errors.New("cache did not sync") + } + return nil +} + var _ inject.Cache = &Kind{} // InjectCache is internal should be called only by the Controller. InjectCache is used to inject @@ -282,6 +305,8 @@ func (is *Informer) String() string { return fmt.Sprintf("informer source: %p", is.Informer) } +var _ Source = Func(nil) + // Func is a function that implements Source type Func func(handler.EventHandler, workqueue.RateLimitingInterface, ...predicate.Predicate) error diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher/certwatcher.go b/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher/certwatcher.go index fbe757cc7..bd797fd73 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher/certwatcher.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher/certwatcher.go @@ -20,7 +20,7 @@ import ( "crypto/tls" "sync" - "gopkg.in/fsnotify.v1" + "github.com/fsnotify/fsnotify" logf "sigs.k8s.io/controller-runtime/pkg/internal/log" ) diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics/metrics.go b/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics/metrics.go index bd19a3a8d..a29643b24 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics/metrics.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics/metrics.go @@ -32,9 +32,30 @@ var ( }, []string{"webhook"}, ) + + // RequestTotal is a prometheus metric which is a counter of the total processed admission requests. + RequestTotal = func() *prometheus.CounterVec { + return prometheus.NewCounterVec( + prometheus.CounterOpts{ + Name: "controller_runtime_webhook_requests_total", + Help: "Total number of admission requests by HTTP status code.", + }, + []string{"webhook", "code"}, + ) + }() + + // RequestInFlight is a prometheus metric which is a gauge of the in-flight admission requests. + RequestInFlight = func() *prometheus.GaugeVec { + return prometheus.NewGaugeVec( + prometheus.GaugeOpts{ + Name: "controller_runtime_webhook_requests_in_flight", + Help: "Current number of admission requests being served.", + }, + []string{"webhook"}, + ) + }() ) func init() { - metrics.Registry.MustRegister( - RequestLatency) + metrics.Registry.MustRegister(RequestLatency, RequestTotal, RequestInFlight) } diff --git a/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/server.go b/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/server.go index d542f2de4..e771a936c 100644 --- a/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/server.go +++ b/vendor/sigs.k8s.io/controller-runtime/pkg/webhook/server.go @@ -28,8 +28,9 @@ import ( "path/filepath" "strconv" "sync" - "time" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promhttp" "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/webhook/internal/certwatcher" "sigs.k8s.io/controller-runtime/pkg/webhook/internal/metrics" @@ -123,13 +124,23 @@ func (s *Server) Register(path string, hook http.Handler) { // instrumentedHook adds some instrumentation on top of the given webhook. func instrumentedHook(path string, hookRaw http.Handler) http.Handler { - return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) { - startTS := time.Now() - defer func() { metrics.RequestLatency.WithLabelValues(path).Observe(time.Since(startTS).Seconds()) }() - hookRaw.ServeHTTP(resp, req) - - // TODO(directxman12): add back in metric about total requests broken down by result? - }) + lbl := prometheus.Labels{"webhook": path} + + lat := metrics.RequestLatency.MustCurryWith(lbl) + cnt := metrics.RequestTotal.MustCurryWith(lbl) + gge := metrics.RequestInFlight.With(lbl) + + // Initialize the most likely HTTP status codes. + cnt.WithLabelValues("200") + cnt.WithLabelValues("500") + + return promhttp.InstrumentHandlerDuration( + lat, + promhttp.InstrumentHandlerCounter( + cnt, + promhttp.InstrumentHandlerInFlight(gge, hookRaw), + ), + ) } // Start runs the server. diff --git a/vendor/sigs.k8s.io/kubebuilder/LICENSE b/vendor/sigs.k8s.io/kubebuilder/LICENSE new file mode 100644 index 000000000..9c8f3ea08 --- /dev/null +++ b/vendor/sigs.k8s.io/kubebuilder/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/vendor/sigs.k8s.io/kubebuilder/pkg/model/config/config.go b/vendor/sigs.k8s.io/kubebuilder/pkg/model/config/config.go new file mode 100644 index 000000000..88cf54652 --- /dev/null +++ b/vendor/sigs.k8s.io/kubebuilder/pkg/model/config/config.go @@ -0,0 +1,218 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package config + +import ( + "fmt" + "strings" + + "sigs.k8s.io/yaml" +) + +// Scaffolding versions +const ( + Version1 = "1" + Version2 = "2" + Version3Alpha = "3-alpha" +) + +// Config is the unmarshalled representation of the configuration file +type Config struct { + // Version is the project version, defaults to "1" (backwards compatibility) + Version string `json:"version,omitempty"` + + // Domain is the domain associated with the project and used for API groups + Domain string `json:"domain,omitempty"` + + // Repo is the go package name of the project root + Repo string `json:"repo,omitempty"` + + // Resources tracks scaffolded resources in the project + // This info is tracked only in project with version 2 + Resources []GVK `json:"resources,omitempty"` + + // Multigroup tracks if the project has more than one group + MultiGroup bool `json:"multigroup,omitempty"` + + // Layout contains a key specifying which plugin created a project. + Layout string `json:"layout,omitempty"` + + // Plugins is an arbitrary YAML blob that can be used by external + // plugins for plugin-specific configuration. + Plugins map[string]interface{} `json:"plugins,omitempty"` +} + +// IsV1 returns true if it is a v1 project +func (c Config) IsV1() bool { + return c.Version == Version1 +} + +// IsV2 returns true if it is a v2 project +func (c Config) IsV2() bool { + return c.Version == Version2 +} + +// IsV3 returns true if it is a v3 project +func (c Config) IsV3() bool { + return c.Version == Version3Alpha +} + +// HasResource returns true if API resource is already tracked +func (c Config) HasResource(target GVK) bool { + // Return true if the target resource is found in the tracked resources + for _, r := range c.Resources { + if r.isEqualTo(target) { + return true + } + } + + // Return false otherwise + return false +} + +// AddResource appends the provided resource to the tracked ones +// It returns if the configuration was modified +// NOTE: in v1 resources are not tracked, so we return false +func (c *Config) AddResource(gvk GVK) bool { + // Short-circuit v1 + if c.IsV1() { + return false + } + + // No-op if the resource was already tracked, return false + if c.HasResource(gvk) { + return false + } + + // Append the resource to the tracked ones, return true + c.Resources = append(c.Resources, gvk) + return true +} + +// HasGroup returns true if group is already tracked +func (c Config) HasGroup(group string) bool { + // Return true if the target group is found in the tracked resources + for _, r := range c.Resources { + if strings.EqualFold(group, r.Group) { + return true + } + } + + // Return false otherwise + return false +} + +// GVK contains information about scaffolded resources +type GVK struct { + Group string `json:"group,omitempty"` + Version string `json:"version,omitempty"` + Kind string `json:"kind,omitempty"` +} + +// isEqualTo compares it with another resource +func (r GVK) isEqualTo(other GVK) bool { + return r.Group == other.Group && + r.Version == other.Version && + r.Kind == other.Kind +} + +// Marshal returns the bytes of c. +func (c Config) Marshal() ([]byte, error) { + // Ignore extra fields at first. + cfg := c + cfg.Plugins = nil + content, err := yaml.Marshal(cfg) + if err != nil { + return nil, fmt.Errorf("error marshalling project configuration: %v", err) + } + // Empty config strings are "{}" due to the map field. + if strings.TrimSpace(string(content)) == "{}" { + content = []byte{} + } + // Append extra fields to put them at the config's bottom, unless the + // project is v1 which does not support extra fields. + if !cfg.IsV1() && len(c.Plugins) != 0 { + pluginConfigBytes, err := yaml.Marshal(Config{Plugins: c.Plugins}) + if err != nil { + return nil, fmt.Errorf("error marshalling project configuration extra fields: %v", err) + } + content = append(content, pluginConfigBytes...) + } + return content, nil +} + +// Unmarshal unmarshals the bytes of a Config into c. +func (c *Config) Unmarshal(b []byte) error { + if err := yaml.UnmarshalStrict(b, c); err != nil { + return fmt.Errorf("error unmarshalling project configuration: %v", err) + } + // v1 projects do not support extra fields. + if c.IsV1() { + c.Plugins = nil + } + return nil +} + +// EncodePluginConfig encodes a config object into c by overwriting the existing +// object stored under key. This method is intended to be used for custom +// configuration objects. +func (c *Config) EncodePluginConfig(key string, configObj interface{}) error { + // Short-circuit v1 + if c.IsV1() { + return fmt.Errorf("v1 project configs do not have extra fields") + } + + // Get object's bytes and set them under key in extra fields. + b, err := yaml.Marshal(configObj) + if err != nil { + return fmt.Errorf("failed to convert %T object to bytes: %s", configObj, err) + } + var fields map[string]interface{} + if err := yaml.Unmarshal(b, &fields); err != nil { + return fmt.Errorf("failed to unmarshal %T object bytes: %s", configObj, err) + } + if c.Plugins == nil { + c.Plugins = make(map[string]interface{}) + } + c.Plugins[key] = fields + return nil +} + +// DecodePluginConfig decodes a plugin config stored in c into configObj. This +// method is intended to be used for custom configuration objects. +// configObj must be a pointer. +func (c Config) DecodePluginConfig(key string, configObj interface{}) error { + // Short-circuit v1 + if c.IsV1() { + return fmt.Errorf("v1 project configs do not have extra fields") + } + if len(c.Plugins) == 0 { + return nil + } + + // Get the object blob by key and unmarshal into the object. + if pluginConfig, hasKey := c.Plugins[key]; hasKey { + b, err := yaml.Marshal(pluginConfig) + if err != nil { + return fmt.Errorf("failed to convert extra fields object to bytes: %s", err) + } + if err := yaml.Unmarshal(b, configObj); err != nil { + return fmt.Errorf("failed to unmarshal extra fields object: %s", err) + } + } + return nil +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/LICENSE b/vendor/sigs.k8s.io/structured-merge-diff/v3/LICENSE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/allocator.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/allocator.go new file mode 100644 index 000000000..f70cd4167 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/allocator.go @@ -0,0 +1,203 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +// Allocator provides a value object allocation strategy. +// Value objects can be allocated by passing an allocator to the "Using" +// receiver functions on the value interfaces, e.g. Map.ZipUsing(allocator, ...). +// Value objects returned from "Using" functions should be given back to the allocator +// once longer needed by calling Allocator.Free(Value). +type Allocator interface { + // Free gives the allocator back any value objects returned by the "Using" + // receiver functions on the value interfaces. + // interface{} may be any of: Value, Map, List or Range. + Free(interface{}) + + // The unexported functions are for "Using" receiver functions of the value types + // to request what they need from the allocator. + allocValueUnstructured() *valueUnstructured + allocListUnstructuredRange() *listUnstructuredRange + allocValueReflect() *valueReflect + allocMapReflect() *mapReflect + allocStructReflect() *structReflect + allocListReflect() *listReflect + allocListReflectRange() *listReflectRange +} + +// HeapAllocator simply allocates objects to the heap. It is the default +// allocator used receiver functions on the value interfaces that do not accept +// an allocator and should be used whenever allocating objects that will not +// be given back to an allocator by calling Allocator.Free(Value). +var HeapAllocator = &heapAllocator{} + +type heapAllocator struct{} + +func (p *heapAllocator) allocValueUnstructured() *valueUnstructured { + return &valueUnstructured{} +} + +func (p *heapAllocator) allocListUnstructuredRange() *listUnstructuredRange { + return &listUnstructuredRange{vv: &valueUnstructured{}} +} + +func (p *heapAllocator) allocValueReflect() *valueReflect { + return &valueReflect{} +} + +func (p *heapAllocator) allocStructReflect() *structReflect { + return &structReflect{} +} + +func (p *heapAllocator) allocMapReflect() *mapReflect { + return &mapReflect{} +} + +func (p *heapAllocator) allocListReflect() *listReflect { + return &listReflect{} +} + +func (p *heapAllocator) allocListReflectRange() *listReflectRange { + return &listReflectRange{vr: &valueReflect{}} +} + +func (p *heapAllocator) Free(_ interface{}) {} + +// NewFreelistAllocator creates freelist based allocator. +// This allocator provides fast allocation and freeing of short lived value objects. +// +// The freelists are bounded in size by freelistMaxSize. If more than this amount of value objects is +// allocated at once, the excess will be returned to the heap for garbage collection when freed. +// +// This allocator is unsafe and must not be accessed concurrently by goroutines. +// +// This allocator works well for traversal of value data trees. Typical usage is to acquire +// a freelist at the beginning of the traversal and use it through out +// for all temporary value access. +func NewFreelistAllocator() Allocator { + return &freelistAllocator{ + valueUnstructured: &freelist{new: func() interface{} { + return &valueUnstructured{} + }}, + listUnstructuredRange: &freelist{new: func() interface{} { + return &listUnstructuredRange{vv: &valueUnstructured{}} + }}, + valueReflect: &freelist{new: func() interface{} { + return &valueReflect{} + }}, + mapReflect: &freelist{new: func() interface{} { + return &mapReflect{} + }}, + structReflect: &freelist{new: func() interface{} { + return &structReflect{} + }}, + listReflect: &freelist{new: func() interface{} { + return &listReflect{} + }}, + listReflectRange: &freelist{new: func() interface{} { + return &listReflectRange{vr: &valueReflect{}} + }}, + } +} + +// Bound memory usage of freelists. This prevents the processing of very large lists from leaking memory. +// This limit is large enough for endpoints objects containing 1000 IP address entries. Freed objects +// that don't fit into the freelist are orphaned on the heap to be garbage collected. +const freelistMaxSize = 1000 + +type freelistAllocator struct { + valueUnstructured *freelist + listUnstructuredRange *freelist + valueReflect *freelist + mapReflect *freelist + structReflect *freelist + listReflect *freelist + listReflectRange *freelist +} + +type freelist struct { + list []interface{} + new func() interface{} +} + +func (f *freelist) allocate() interface{} { + var w2 interface{} + if n := len(f.list); n > 0 { + w2, f.list = f.list[n-1], f.list[:n-1] + } else { + w2 = f.new() + } + return w2 +} + +func (f *freelist) free(v interface{}) { + if len(f.list) < freelistMaxSize { + f.list = append(f.list, v) + } +} + +func (w *freelistAllocator) Free(value interface{}) { + switch v := value.(type) { + case *valueUnstructured: + v.Value = nil // don't hold references to unstructured objects + w.valueUnstructured.free(v) + case *listUnstructuredRange: + v.vv.Value = nil // don't hold references to unstructured objects + w.listUnstructuredRange.free(v) + case *valueReflect: + v.ParentMapKey = nil + v.ParentMap = nil + w.valueReflect.free(v) + case *mapReflect: + w.mapReflect.free(v) + case *structReflect: + w.structReflect.free(v) + case *listReflect: + w.listReflect.free(v) + case *listReflectRange: + v.vr.ParentMapKey = nil + v.vr.ParentMap = nil + w.listReflectRange.free(v) + } +} + +func (w *freelistAllocator) allocValueUnstructured() *valueUnstructured { + return w.valueUnstructured.allocate().(*valueUnstructured) +} + +func (w *freelistAllocator) allocListUnstructuredRange() *listUnstructuredRange { + return w.listUnstructuredRange.allocate().(*listUnstructuredRange) +} + +func (w *freelistAllocator) allocValueReflect() *valueReflect { + return w.valueReflect.allocate().(*valueReflect) +} + +func (w *freelistAllocator) allocStructReflect() *structReflect { + return w.structReflect.allocate().(*structReflect) +} + +func (w *freelistAllocator) allocMapReflect() *mapReflect { + return w.mapReflect.allocate().(*mapReflect) +} + +func (w *freelistAllocator) allocListReflect() *listReflect { + return w.listReflect.allocate().(*listReflect) +} + +func (w *freelistAllocator) allocListReflectRange() *listReflectRange { + return w.listReflectRange.allocate().(*listReflectRange) +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/doc.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/doc.go new file mode 100644 index 000000000..84d7f0f3f --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package value defines types for an in-memory representation of yaml or json +// objects, organized for convenient comparison with a schema (as defined by +// the sibling schema package). Functions for reading and writing the objects +// are also provided. +package value diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/fields.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/fields.go new file mode 100644 index 000000000..be3c67249 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/fields.go @@ -0,0 +1,97 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "sort" + "strings" +) + +// Field is an individual key-value pair. +type Field struct { + Name string + Value Value +} + +// FieldList is a list of key-value pairs. Each field is expected to +// have a different name. +type FieldList []Field + +// Sort sorts the field list by Name. +func (f FieldList) Sort() { + if len(f) < 2 { + return + } + if len(f) == 2 { + if f[1].Name < f[0].Name { + f[0], f[1] = f[1], f[0] + } + return + } + sort.SliceStable(f, func(i, j int) bool { + return f[i].Name < f[j].Name + }) +} + +// Less compares two lists lexically. +func (f FieldList) Less(rhs FieldList) bool { + return f.Compare(rhs) == -1 +} + +// Compare compares two lists lexically. The result will be 0 if f==rhs, -1 +// if f < rhs, and +1 if f > rhs. +func (f FieldList) Compare(rhs FieldList) int { + i := 0 + for { + if i >= len(f) && i >= len(rhs) { + // Maps are the same length and all items are equal. + return 0 + } + if i >= len(f) { + // F is shorter. + return -1 + } + if i >= len(rhs) { + // RHS is shorter. + return 1 + } + if c := strings.Compare(f[i].Name, rhs[i].Name); c != 0 { + return c + } + if c := Compare(f[i].Value, rhs[i].Value); c != 0 { + return c + } + // The items are equal; continue. + i++ + } +} + +// Equals returns true if the two fieldslist are equals, false otherwise. +func (f FieldList) Equals(rhs FieldList) bool { + if len(f) != len(rhs) { + return false + } + for i := range f { + if f[i].Name != rhs[i].Name { + return false + } + if !Equals(f[i].Value, rhs[i].Value) { + return false + } + } + return true +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/jsontagutil.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/jsontagutil.go new file mode 100644 index 000000000..d4adb8fc9 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/jsontagutil.go @@ -0,0 +1,91 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "fmt" + "reflect" + "strings" +) + +// TODO: This implements the same functionality as https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go#L236 +// but is based on the highly efficient approach from https://golang.org/src/encoding/json/encode.go + +func lookupJsonTags(f reflect.StructField) (name string, omit bool, inline bool, omitempty bool) { + tag := f.Tag.Get("json") + if tag == "-" { + return "", true, false, false + } + name, opts := parseTag(tag) + if name == "" { + name = f.Name + } + return name, false, opts.Contains("inline"), opts.Contains("omitempty") +} + +func isZero(v reflect.Value) bool { + switch v.Kind() { + case reflect.Array, reflect.Map, reflect.Slice, reflect.String: + return v.Len() == 0 + case reflect.Bool: + return !v.Bool() + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return v.Int() == 0 + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: + return v.Uint() == 0 + case reflect.Float32, reflect.Float64: + return v.Float() == 0 + case reflect.Interface, reflect.Ptr: + return v.IsNil() + case reflect.Chan, reflect.Func: + panic(fmt.Sprintf("unsupported type: %v", v.Type())) + } + return false +} + +type tagOptions string + +// parseTag splits a struct field's json tag into its name and +// comma-separated options. +func parseTag(tag string) (string, tagOptions) { + if idx := strings.Index(tag, ","); idx != -1 { + return tag[:idx], tagOptions(tag[idx+1:]) + } + return tag, tagOptions("") +} + +// Contains reports whether a comma-separated list of options +// contains a particular substr flag. substr must be surrounded by a +// string boundary or commas. +func (o tagOptions) Contains(optionName string) bool { + if len(o) == 0 { + return false + } + s := string(o) + for s != "" { + var next string + i := strings.Index(s, ",") + if i >= 0 { + s, next = s[:i], s[i+1:] + } + if s == optionName { + return true + } + s = next + } + return false +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/list.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/list.go new file mode 100644 index 000000000..0748f18e8 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/list.go @@ -0,0 +1,139 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +// List represents a list object. +type List interface { + // Length returns how many items can be found in the map. + Length() int + // At returns the item at the given position in the map. It will + // panic if the index is out of range. + At(int) Value + // AtUsing uses the provided allocator and returns the item at the given + // position in the map. It will panic if the index is out of range. + // The returned Value should be given back to the Allocator when no longer needed + // by calling Allocator.Free(Value). + AtUsing(Allocator, int) Value + // Range returns a ListRange for iterating over the items in the list. + Range() ListRange + // RangeUsing uses the provided allocator and returns a ListRange for + // iterating over the items in the list. + // The returned Range should be given back to the Allocator when no longer needed + // by calling Allocator.Free(Value). + RangeUsing(Allocator) ListRange + // Equals compares the two lists, and return true if they are the same, false otherwise. + // Implementations can use ListEquals as a general implementation for this methods. + Equals(List) bool + // EqualsUsing uses the provided allocator and compares the two lists, and return true if + // they are the same, false otherwise. Implementations can use ListEqualsUsing as a general + // implementation for this methods. + EqualsUsing(Allocator, List) bool +} + +// ListRange represents a single iteration across the items of a list. +type ListRange interface { + // Next increments to the next item in the range, if there is one, and returns true, or returns false if there are no more items. + Next() bool + // Item returns the index and value of the current item in the range. or panics if there is no current item. + // For efficiency, Item may reuse the values returned by previous Item calls. Callers should be careful avoid holding + // pointers to the value returned by Item() that escape the iteration loop since they become invalid once either + // Item() or Allocator.Free() is called. + Item() (index int, value Value) +} + +var EmptyRange = &emptyRange{} + +type emptyRange struct{} + +func (_ *emptyRange) Next() bool { + return false +} + +func (_ *emptyRange) Item() (index int, value Value) { + panic("Item called on empty ListRange") +} + +// ListEquals compares two lists lexically. +// WARN: This is a naive implementation, calling lhs.Equals(rhs) is typically the most efficient. +func ListEquals(lhs, rhs List) bool { + return ListEqualsUsing(HeapAllocator, lhs, rhs) +} + +// ListEqualsUsing uses the provided allocator and compares two lists lexically. +// WARN: This is a naive implementation, calling lhs.EqualsUsing(allocator, rhs) is typically the most efficient. +func ListEqualsUsing(a Allocator, lhs, rhs List) bool { + if lhs.Length() != rhs.Length() { + return false + } + + lhsRange := lhs.RangeUsing(a) + defer a.Free(lhsRange) + rhsRange := rhs.RangeUsing(a) + defer a.Free(rhsRange) + + for lhsRange.Next() && rhsRange.Next() { + _, lv := lhsRange.Item() + _, rv := rhsRange.Item() + if !EqualsUsing(a, lv, rv) { + return false + } + } + return true +} + +// ListLess compares two lists lexically. +func ListLess(lhs, rhs List) bool { + return ListCompare(lhs, rhs) == -1 +} + +// ListCompare compares two lists lexically. The result will be 0 if l==rhs, -1 +// if l < rhs, and +1 if l > rhs. +func ListCompare(lhs, rhs List) int { + return ListCompareUsing(HeapAllocator, lhs, rhs) +} + +// ListCompareUsing uses the provided allocator and compares two lists lexically. The result will be 0 if l==rhs, -1 +// if l < rhs, and +1 if l > rhs. +func ListCompareUsing(a Allocator, lhs, rhs List) int { + lhsRange := lhs.RangeUsing(a) + defer a.Free(lhsRange) + rhsRange := rhs.RangeUsing(a) + defer a.Free(rhsRange) + + for { + lhsOk := lhsRange.Next() + rhsOk := rhsRange.Next() + if !lhsOk && !rhsOk { + // Lists are the same length and all items are equal. + return 0 + } + if !lhsOk { + // LHS is shorter. + return -1 + } + if !rhsOk { + // RHS is shorter. + return 1 + } + _, lv := lhsRange.Item() + _, rv := rhsRange.Item() + if c := CompareUsing(a, lv, rv); c != 0 { + return c + } + // The items are equal; continue. + } +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/listreflect.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/listreflect.go new file mode 100644 index 000000000..197d4c921 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/listreflect.go @@ -0,0 +1,98 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "reflect" +) + +type listReflect struct { + Value reflect.Value +} + +func (r listReflect) Length() int { + val := r.Value + return val.Len() +} + +func (r listReflect) At(i int) Value { + val := r.Value + return mustWrapValueReflect(val.Index(i), nil, nil) +} + +func (r listReflect) AtUsing(a Allocator, i int) Value { + val := r.Value + return a.allocValueReflect().mustReuse(val.Index(i), nil, nil, nil) +} + +func (r listReflect) Unstructured() interface{} { + l := r.Length() + result := make([]interface{}, l) + for i := 0; i < l; i++ { + result[i] = r.At(i).Unstructured() + } + return result +} + +func (r listReflect) Range() ListRange { + return r.RangeUsing(HeapAllocator) +} + +func (r listReflect) RangeUsing(a Allocator) ListRange { + length := r.Value.Len() + if length == 0 { + return EmptyRange + } + rr := a.allocListReflectRange() + rr.list = r.Value + rr.i = -1 + rr.entry = TypeReflectEntryOf(r.Value.Type().Elem()) + return rr +} + +func (r listReflect) Equals(other List) bool { + return r.EqualsUsing(HeapAllocator, other) +} +func (r listReflect) EqualsUsing(a Allocator, other List) bool { + if otherReflectList, ok := other.(*listReflect); ok { + return reflect.DeepEqual(r.Value.Interface(), otherReflectList.Value.Interface()) + } + return ListEqualsUsing(a, &r, other) +} + +type listReflectRange struct { + list reflect.Value + vr *valueReflect + i int + entry *TypeReflectCacheEntry +} + +func (r *listReflectRange) Next() bool { + r.i += 1 + return r.i < r.list.Len() +} + +func (r *listReflectRange) Item() (index int, value Value) { + if r.i < 0 { + panic("Item() called before first calling Next()") + } + if r.i >= r.list.Len() { + panic("Item() called on ListRange with no more items") + } + v := r.list.Index(r.i) + return r.i, r.vr.mustReuse(v, r.entry, nil, nil) +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/listunstructured.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/listunstructured.go new file mode 100644 index 000000000..64cd8e7c0 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/listunstructured.go @@ -0,0 +1,74 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +type listUnstructured []interface{} + +func (l listUnstructured) Length() int { + return len(l) +} + +func (l listUnstructured) At(i int) Value { + return NewValueInterface(l[i]) +} + +func (l listUnstructured) AtUsing(a Allocator, i int) Value { + return a.allocValueUnstructured().reuse(l[i]) +} + +func (l listUnstructured) Equals(other List) bool { + return l.EqualsUsing(HeapAllocator, other) +} + +func (l listUnstructured) EqualsUsing(a Allocator, other List) bool { + return ListEqualsUsing(a, &l, other) +} + +func (l listUnstructured) Range() ListRange { + return l.RangeUsing(HeapAllocator) +} + +func (l listUnstructured) RangeUsing(a Allocator) ListRange { + if len(l) == 0 { + return EmptyRange + } + r := a.allocListUnstructuredRange() + r.list = l + r.i = -1 + return r +} + +type listUnstructuredRange struct { + list listUnstructured + vv *valueUnstructured + i int +} + +func (r *listUnstructuredRange) Next() bool { + r.i += 1 + return r.i < len(r.list) +} + +func (r *listUnstructuredRange) Item() (index int, value Value) { + if r.i < 0 { + panic("Item() called before first calling Next()") + } + if r.i >= len(r.list) { + panic("Item() called on ListRange with no more items") + } + return r.i, r.vv.reuse(r.list[r.i]) +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/map.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/map.go new file mode 100644 index 000000000..168b9fa08 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/map.go @@ -0,0 +1,270 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "sort" +) + +// Map represents a Map or go structure. +type Map interface { + // Set changes or set the value of the given key. + Set(key string, val Value) + // Get returns the value for the given key, if present, or (nil, false) otherwise. + Get(key string) (Value, bool) + // GetUsing uses the provided allocator and returns the value for the given key, + // if present, or (nil, false) otherwise. + // The returned Value should be given back to the Allocator when no longer needed + // by calling Allocator.Free(Value). + GetUsing(a Allocator, key string) (Value, bool) + // Has returns true if the key is present, or false otherwise. + Has(key string) bool + // Delete removes the key from the map. + Delete(key string) + // Equals compares the two maps, and return true if they are the same, false otherwise. + // Implementations can use MapEquals as a general implementation for this methods. + Equals(other Map) bool + // EqualsUsing uses the provided allocator and compares the two maps, and return true if + // they are the same, false otherwise. Implementations can use MapEqualsUsing as a general + // implementation for this methods. + EqualsUsing(a Allocator, other Map) bool + // Iterate runs the given function for each key/value in the + // map. Returning false in the closure prematurely stops the + // iteration. + Iterate(func(key string, value Value) bool) bool + // IterateUsing uses the provided allocator and runs the given function for each key/value + // in the map. Returning false in the closure prematurely stops the iteration. + IterateUsing(Allocator, func(key string, value Value) bool) bool + // Length returns the number of items in the map. + Length() int + // Empty returns true if the map is empty. + Empty() bool + // Zip iterates over the entries of two maps together. If both maps contain a value for a given key, fn is called + // with the values from both maps, otherwise it is called with the value of the map that contains the key and nil + // for the map that does not contain the key. Returning false in the closure prematurely stops the iteration. + Zip(other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool + // ZipUsing uses the provided allocator and iterates over the entries of two maps together. If both maps + // contain a value for a given key, fn is called with the values from both maps, otherwise it is called with + // the value of the map that contains the key and nil for the map that does not contain the key. Returning + // false in the closure prematurely stops the iteration. + ZipUsing(a Allocator, other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool +} + +// MapTraverseOrder defines the map traversal ordering available. +type MapTraverseOrder int + +const ( + // Unordered indicates that the map traversal has no ordering requirement. + Unordered = iota + // LexicalKeyOrder indicates that the map traversal is ordered by key, lexically. + LexicalKeyOrder +) + +// MapZip iterates over the entries of two maps together. If both maps contain a value for a given key, fn is called +// with the values from both maps, otherwise it is called with the value of the map that contains the key and nil +// for the other map. Returning false in the closure prematurely stops the iteration. +func MapZip(lhs, rhs Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return MapZipUsing(HeapAllocator, lhs, rhs, order, fn) +} + +// MapZipUsing uses the provided allocator and iterates over the entries of two maps together. If both maps +// contain a value for a given key, fn is called with the values from both maps, otherwise it is called with +// the value of the map that contains the key and nil for the other map. Returning false in the closure +// prematurely stops the iteration. +func MapZipUsing(a Allocator, lhs, rhs Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + if lhs != nil { + return lhs.ZipUsing(a, rhs, order, fn) + } + if rhs != nil { + return rhs.ZipUsing(a, lhs, order, func(key string, rhs, lhs Value) bool { // arg positions of lhs and rhs deliberately swapped + return fn(key, lhs, rhs) + }) + } + return true +} + +// defaultMapZip provides a default implementation of Zip for implementations that do not need to provide +// their own optimized implementation. +func defaultMapZip(a Allocator, lhs, rhs Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + switch order { + case Unordered: + return unorderedMapZip(a, lhs, rhs, fn) + case LexicalKeyOrder: + return lexicalKeyOrderedMapZip(a, lhs, rhs, fn) + default: + panic("Unsupported map order") + } +} + +func unorderedMapZip(a Allocator, lhs, rhs Map, fn func(key string, lhs, rhs Value) bool) bool { + if (lhs == nil || lhs.Empty()) && (rhs == nil || rhs.Empty()) { + return true + } + + if lhs != nil { + ok := lhs.IterateUsing(a, func(key string, lhsValue Value) bool { + var rhsValue Value + if rhs != nil { + if item, ok := rhs.GetUsing(a, key); ok { + rhsValue = item + defer a.Free(rhsValue) + } + } + return fn(key, lhsValue, rhsValue) + }) + if !ok { + return false + } + } + if rhs != nil { + return rhs.IterateUsing(a, func(key string, rhsValue Value) bool { + if lhs == nil || !lhs.Has(key) { + return fn(key, nil, rhsValue) + } + return true + }) + } + return true +} + +func lexicalKeyOrderedMapZip(a Allocator, lhs, rhs Map, fn func(key string, lhs, rhs Value) bool) bool { + var lhsLength, rhsLength int + var orderedLength int // rough estimate of length of union of map keys + if lhs != nil { + lhsLength = lhs.Length() + orderedLength = lhsLength + } + if rhs != nil { + rhsLength = rhs.Length() + if rhsLength > orderedLength { + orderedLength = rhsLength + } + } + if lhsLength == 0 && rhsLength == 0 { + return true + } + + ordered := make([]string, 0, orderedLength) + if lhs != nil { + lhs.IterateUsing(a, func(key string, _ Value) bool { + ordered = append(ordered, key) + return true + }) + } + if rhs != nil { + rhs.IterateUsing(a, func(key string, _ Value) bool { + if lhs == nil || !lhs.Has(key) { + ordered = append(ordered, key) + } + return true + }) + } + sort.Strings(ordered) + for _, key := range ordered { + var litem, ritem Value + if lhs != nil { + litem, _ = lhs.GetUsing(a, key) + } + if rhs != nil { + ritem, _ = rhs.GetUsing(a, key) + } + ok := fn(key, litem, ritem) + if litem != nil { + a.Free(litem) + } + if ritem != nil { + a.Free(ritem) + } + if !ok { + return false + } + } + return true +} + +// MapLess compares two maps lexically. +func MapLess(lhs, rhs Map) bool { + return MapCompare(lhs, rhs) == -1 +} + +// MapCompare compares two maps lexically. +func MapCompare(lhs, rhs Map) int { + return MapCompareUsing(HeapAllocator, lhs, rhs) +} + +// MapCompareUsing uses the provided allocator and compares two maps lexically. +func MapCompareUsing(a Allocator, lhs, rhs Map) int { + c := 0 + var llength, rlength int + if lhs != nil { + llength = lhs.Length() + } + if rhs != nil { + rlength = rhs.Length() + } + if llength == 0 && rlength == 0 { + return 0 + } + i := 0 + MapZipUsing(a, lhs, rhs, LexicalKeyOrder, func(key string, lhs, rhs Value) bool { + switch { + case i == llength: + c = -1 + case i == rlength: + c = 1 + case lhs == nil: + c = 1 + case rhs == nil: + c = -1 + default: + c = CompareUsing(a, lhs, rhs) + } + i++ + return c == 0 + }) + return c +} + +// MapEquals returns true if lhs == rhs, false otherwise. This function +// acts on generic types and should not be used by callers, but can help +// implement Map.Equals. +// WARN: This is a naive implementation, calling lhs.Equals(rhs) is typically the most efficient. +func MapEquals(lhs, rhs Map) bool { + return MapEqualsUsing(HeapAllocator, lhs, rhs) +} + +// MapEqualsUsing uses the provided allocator and returns true if lhs == rhs, +// false otherwise. This function acts on generic types and should not be used +// by callers, but can help implement Map.Equals. +// WARN: This is a naive implementation, calling lhs.EqualsUsing(allocator, rhs) is typically the most efficient. +func MapEqualsUsing(a Allocator, lhs, rhs Map) bool { + if lhs == nil && rhs == nil { + return true + } + if lhs == nil || rhs == nil { + return false + } + if lhs.Length() != rhs.Length() { + return false + } + return MapZipUsing(a, lhs, rhs, Unordered, func(key string, lhs, rhs Value) bool { + if lhs == nil || rhs == nil { + return false + } + return EqualsUsing(a, lhs, rhs) + }) +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapreflect.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapreflect.go new file mode 100644 index 000000000..dc8b8c720 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapreflect.go @@ -0,0 +1,209 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "reflect" +) + +type mapReflect struct { + valueReflect +} + +func (r mapReflect) Length() int { + val := r.Value + return val.Len() +} + +func (r mapReflect) Empty() bool { + val := r.Value + return val.Len() == 0 +} + +func (r mapReflect) Get(key string) (Value, bool) { + return r.GetUsing(HeapAllocator, key) +} + +func (r mapReflect) GetUsing(a Allocator, key string) (Value, bool) { + k, v, ok := r.get(key) + if !ok { + return nil, false + } + return a.allocValueReflect().mustReuse(v, nil, &r.Value, &k), true +} + +func (r mapReflect) get(k string) (key, value reflect.Value, ok bool) { + mapKey := r.toMapKey(k) + val := r.Value.MapIndex(mapKey) + return mapKey, val, val.IsValid() && val != reflect.Value{} +} + +func (r mapReflect) Has(key string) bool { + var val reflect.Value + val = r.Value.MapIndex(r.toMapKey(key)) + if !val.IsValid() { + return false + } + return val != reflect.Value{} +} + +func (r mapReflect) Set(key string, val Value) { + r.Value.SetMapIndex(r.toMapKey(key), reflect.ValueOf(val.Unstructured())) +} + +func (r mapReflect) Delete(key string) { + val := r.Value + val.SetMapIndex(r.toMapKey(key), reflect.Value{}) +} + +// TODO: Do we need to support types that implement json.Marshaler and are used as string keys? +func (r mapReflect) toMapKey(key string) reflect.Value { + val := r.Value + return reflect.ValueOf(key).Convert(val.Type().Key()) +} + +func (r mapReflect) Iterate(fn func(string, Value) bool) bool { + return r.IterateUsing(HeapAllocator, fn) +} + +func (r mapReflect) IterateUsing(a Allocator, fn func(string, Value) bool) bool { + if r.Value.Len() == 0 { + return true + } + v := a.allocValueReflect() + defer a.Free(v) + return eachMapEntry(r.Value, func(e *TypeReflectCacheEntry, key reflect.Value, value reflect.Value) bool { + return fn(key.String(), v.mustReuse(value, e, &r.Value, &key)) + }) +} + +func eachMapEntry(val reflect.Value, fn func(*TypeReflectCacheEntry, reflect.Value, reflect.Value) bool) bool { + iter := val.MapRange() + entry := TypeReflectEntryOf(val.Type().Elem()) + for iter.Next() { + next := iter.Value() + if !next.IsValid() { + continue + } + if !fn(entry, iter.Key(), next) { + return false + } + } + return true +} + +func (r mapReflect) Unstructured() interface{} { + result := make(map[string]interface{}, r.Length()) + r.Iterate(func(s string, value Value) bool { + result[s] = value.Unstructured() + return true + }) + return result +} + +func (r mapReflect) Equals(m Map) bool { + return r.EqualsUsing(HeapAllocator, m) +} + +func (r mapReflect) EqualsUsing(a Allocator, m Map) bool { + lhsLength := r.Length() + rhsLength := m.Length() + if lhsLength != rhsLength { + return false + } + if lhsLength == 0 { + return true + } + vr := a.allocValueReflect() + defer a.Free(vr) + entry := TypeReflectEntryOf(r.Value.Type().Elem()) + return m.Iterate(func(key string, value Value) bool { + _, lhsVal, ok := r.get(key) + if !ok { + return false + } + return Equals(vr.mustReuse(lhsVal, entry, nil, nil), value) + }) +} + +func (r mapReflect) Zip(other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return r.ZipUsing(HeapAllocator, other, order, fn) +} + +func (r mapReflect) ZipUsing(a Allocator, other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + if otherMapReflect, ok := other.(*mapReflect); ok && order == Unordered { + return r.unorderedReflectZip(a, otherMapReflect, fn) + } + return defaultMapZip(a, &r, other, order, fn) +} + +// unorderedReflectZip provides an optimized unordered zip for mapReflect types. +func (r mapReflect) unorderedReflectZip(a Allocator, other *mapReflect, fn func(key string, lhs, rhs Value) bool) bool { + if r.Empty() && (other == nil || other.Empty()) { + return true + } + + lhs := r.Value + lhsEntry := TypeReflectEntryOf(lhs.Type().Elem()) + + // map lookup via reflection is expensive enough that it is better to keep track of visited keys + visited := map[string]struct{}{} + + vlhs, vrhs := a.allocValueReflect(), a.allocValueReflect() + defer a.Free(vlhs) + defer a.Free(vrhs) + + if other != nil { + rhs := other.Value + rhsEntry := TypeReflectEntryOf(rhs.Type().Elem()) + iter := rhs.MapRange() + + for iter.Next() { + key := iter.Key() + keyString := key.String() + next := iter.Value() + if !next.IsValid() { + continue + } + rhsVal := vrhs.mustReuse(next, rhsEntry, &rhs, &key) + visited[keyString] = struct{}{} + var lhsVal Value + if _, v, ok := r.get(keyString); ok { + lhsVal = vlhs.mustReuse(v, lhsEntry, &lhs, &key) + } + if !fn(keyString, lhsVal, rhsVal) { + return false + } + } + } + + iter := lhs.MapRange() + for iter.Next() { + key := iter.Key() + if _, ok := visited[key.String()]; ok { + continue + } + next := iter.Value() + if !next.IsValid() { + continue + } + if !fn(key.String(), vlhs.mustReuse(next, lhsEntry, &lhs, &key), nil) { + return false + } + } + return true +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapunstructured.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapunstructured.go new file mode 100644 index 000000000..d8e208628 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/mapunstructured.go @@ -0,0 +1,190 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +type mapUnstructuredInterface map[interface{}]interface{} + +func (m mapUnstructuredInterface) Set(key string, val Value) { + m[key] = val.Unstructured() +} + +func (m mapUnstructuredInterface) Get(key string) (Value, bool) { + return m.GetUsing(HeapAllocator, key) +} + +func (m mapUnstructuredInterface) GetUsing(a Allocator, key string) (Value, bool) { + if v, ok := m[key]; !ok { + return nil, false + } else { + return a.allocValueUnstructured().reuse(v), true + } +} + +func (m mapUnstructuredInterface) Has(key string) bool { + _, ok := m[key] + return ok +} + +func (m mapUnstructuredInterface) Delete(key string) { + delete(m, key) +} + +func (m mapUnstructuredInterface) Iterate(fn func(key string, value Value) bool) bool { + return m.IterateUsing(HeapAllocator, fn) +} + +func (m mapUnstructuredInterface) IterateUsing(a Allocator, fn func(key string, value Value) bool) bool { + if len(m) == 0 { + return true + } + vv := a.allocValueUnstructured() + defer a.Free(vv) + for k, v := range m { + if ks, ok := k.(string); !ok { + continue + } else { + if !fn(ks, vv.reuse(v)) { + return false + } + } + } + return true +} + +func (m mapUnstructuredInterface) Length() int { + return len(m) +} + +func (m mapUnstructuredInterface) Empty() bool { + return len(m) == 0 +} + +func (m mapUnstructuredInterface) Equals(other Map) bool { + return m.EqualsUsing(HeapAllocator, other) +} + +func (m mapUnstructuredInterface) EqualsUsing(a Allocator, other Map) bool { + lhsLength := m.Length() + rhsLength := other.Length() + if lhsLength != rhsLength { + return false + } + if lhsLength == 0 { + return true + } + vv := a.allocValueUnstructured() + defer a.Free(vv) + return other.Iterate(func(key string, value Value) bool { + lhsVal, ok := m[key] + if !ok { + return false + } + return Equals(vv.reuse(lhsVal), value) + }) +} + +func (m mapUnstructuredInterface) Zip(other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return m.ZipUsing(HeapAllocator, other, order, fn) +} + +func (m mapUnstructuredInterface) ZipUsing(a Allocator, other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return defaultMapZip(a, m, other, order, fn) +} + +type mapUnstructuredString map[string]interface{} + +func (m mapUnstructuredString) Set(key string, val Value) { + m[key] = val.Unstructured() +} + +func (m mapUnstructuredString) Get(key string) (Value, bool) { + return m.GetUsing(HeapAllocator, key) +} +func (m mapUnstructuredString) GetUsing(a Allocator, key string) (Value, bool) { + if v, ok := m[key]; !ok { + return nil, false + } else { + return a.allocValueUnstructured().reuse(v), true + } +} + +func (m mapUnstructuredString) Has(key string) bool { + _, ok := m[key] + return ok +} + +func (m mapUnstructuredString) Delete(key string) { + delete(m, key) +} + +func (m mapUnstructuredString) Iterate(fn func(key string, value Value) bool) bool { + return m.IterateUsing(HeapAllocator, fn) +} + +func (m mapUnstructuredString) IterateUsing(a Allocator, fn func(key string, value Value) bool) bool { + if len(m) == 0 { + return true + } + vv := a.allocValueUnstructured() + defer a.Free(vv) + for k, v := range m { + if !fn(k, vv.reuse(v)) { + return false + } + } + return true +} + +func (m mapUnstructuredString) Length() int { + return len(m) +} + +func (m mapUnstructuredString) Equals(other Map) bool { + return m.EqualsUsing(HeapAllocator, other) +} + +func (m mapUnstructuredString) EqualsUsing(a Allocator, other Map) bool { + lhsLength := m.Length() + rhsLength := other.Length() + if lhsLength != rhsLength { + return false + } + if lhsLength == 0 { + return true + } + vv := a.allocValueUnstructured() + defer a.Free(vv) + return other.Iterate(func(key string, value Value) bool { + lhsVal, ok := m[key] + if !ok { + return false + } + return Equals(vv.reuse(lhsVal), value) + }) +} + +func (m mapUnstructuredString) Zip(other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return m.ZipUsing(HeapAllocator, other, order, fn) +} + +func (m mapUnstructuredString) ZipUsing(a Allocator, other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return defaultMapZip(a, m, other, order, fn) +} + +func (m mapUnstructuredString) Empty() bool { + return len(m) == 0 +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/reflectcache.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/reflectcache.go new file mode 100644 index 000000000..49e6dd169 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/reflectcache.go @@ -0,0 +1,463 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "sort" + "sync" + "sync/atomic" +) + +// UnstructuredConverter defines how a type can be converted directly to unstructured. +// Types that implement json.Marshaler may also optionally implement this interface to provide a more +// direct and more efficient conversion. All types that choose to implement this interface must still +// implement this same conversion via json.Marshaler. +type UnstructuredConverter interface { + json.Marshaler // require that json.Marshaler is implemented + + // ToUnstructured returns the unstructured representation. + ToUnstructured() interface{} +} + +// TypeReflectCacheEntry keeps data gathered using reflection about how a type is converted to/from unstructured. +type TypeReflectCacheEntry struct { + isJsonMarshaler bool + ptrIsJsonMarshaler bool + isJsonUnmarshaler bool + ptrIsJsonUnmarshaler bool + isStringConvertable bool + ptrIsStringConvertable bool + + structFields map[string]*FieldCacheEntry + orderedStructFields []*FieldCacheEntry +} + +// FieldCacheEntry keeps data gathered using reflection about how the field of a struct is converted to/from +// unstructured. +type FieldCacheEntry struct { + // JsonName returns the name of the field according to the json tags on the struct field. + JsonName string + // isOmitEmpty is true if the field has the json 'omitempty' tag. + isOmitEmpty bool + // fieldPath is a list of field indices (see FieldByIndex) to lookup the value of + // a field in a reflect.Value struct. The field indices in the list form a path used + // to traverse through intermediary 'inline' fields. + fieldPath [][]int + + fieldType reflect.Type + TypeEntry *TypeReflectCacheEntry +} + +func (f *FieldCacheEntry) CanOmit(fieldVal reflect.Value) bool { + return f.isOmitEmpty && (safeIsNil(fieldVal) || isZero(fieldVal)) +} + +// GetUsing returns the field identified by this FieldCacheEntry from the provided struct. +func (f *FieldCacheEntry) GetFrom(structVal reflect.Value) reflect.Value { + // field might be nested within 'inline' structs + for _, elem := range f.fieldPath { + structVal = structVal.FieldByIndex(elem) + } + return structVal +} + +var marshalerType = reflect.TypeOf(new(json.Marshaler)).Elem() +var unmarshalerType = reflect.TypeOf(new(json.Unmarshaler)).Elem() +var unstructuredConvertableType = reflect.TypeOf(new(UnstructuredConverter)).Elem() +var defaultReflectCache = newReflectCache() + +// TypeReflectEntryOf returns the TypeReflectCacheEntry of the provided reflect.Type. +func TypeReflectEntryOf(t reflect.Type) *TypeReflectCacheEntry { + cm := defaultReflectCache.get() + if record, ok := cm[t]; ok { + return record + } + updates := reflectCacheMap{} + result := typeReflectEntryOf(cm, t, updates) + if len(updates) > 0 { + defaultReflectCache.update(updates) + } + return result +} + +// TypeReflectEntryOf returns all updates needed to add provided reflect.Type, and the types its fields transitively +// depend on, to the cache. +func typeReflectEntryOf(cm reflectCacheMap, t reflect.Type, updates reflectCacheMap) *TypeReflectCacheEntry { + if record, ok := cm[t]; ok { + return record + } + if record, ok := updates[t]; ok { + return record + } + typeEntry := &TypeReflectCacheEntry{ + isJsonMarshaler: t.Implements(marshalerType), + ptrIsJsonMarshaler: reflect.PtrTo(t).Implements(marshalerType), + isJsonUnmarshaler: reflect.PtrTo(t).Implements(unmarshalerType), + isStringConvertable: t.Implements(unstructuredConvertableType), + ptrIsStringConvertable: reflect.PtrTo(t).Implements(unstructuredConvertableType), + } + if t.Kind() == reflect.Struct { + fieldEntries := map[string]*FieldCacheEntry{} + buildStructCacheEntry(t, fieldEntries, nil) + typeEntry.structFields = fieldEntries + sortedByJsonName := make([]*FieldCacheEntry, len(fieldEntries)) + i := 0 + for _, entry := range fieldEntries { + sortedByJsonName[i] = entry + i++ + } + sort.Slice(sortedByJsonName, func(i, j int) bool { + return sortedByJsonName[i].JsonName < sortedByJsonName[j].JsonName + }) + typeEntry.orderedStructFields = sortedByJsonName + } + + // cyclic type references are allowed, so we must add the typeEntry to the updates map before resolving + // the field.typeEntry references, or creating them if they are not already in the cache + updates[t] = typeEntry + + for _, field := range typeEntry.structFields { + if field.TypeEntry == nil { + field.TypeEntry = typeReflectEntryOf(cm, field.fieldType, updates) + } + } + return typeEntry +} + +func buildStructCacheEntry(t reflect.Type, infos map[string]*FieldCacheEntry, fieldPath [][]int) { + for i := 0; i < t.NumField(); i++ { + field := t.Field(i) + jsonName, omit, isInline, isOmitempty := lookupJsonTags(field) + if omit { + continue + } + if isInline { + buildStructCacheEntry(field.Type, infos, append(fieldPath, field.Index)) + continue + } + info := &FieldCacheEntry{JsonName: jsonName, isOmitEmpty: isOmitempty, fieldPath: append(fieldPath, field.Index), fieldType: field.Type} + infos[jsonName] = info + } +} + +// Fields returns a map of JSON field name to FieldCacheEntry for structs, or nil for non-structs. +func (e TypeReflectCacheEntry) Fields() map[string]*FieldCacheEntry { + return e.structFields +} + +// Fields returns a map of JSON field name to FieldCacheEntry for structs, or nil for non-structs. +func (e TypeReflectCacheEntry) OrderedFields() []*FieldCacheEntry { + return e.orderedStructFields +} + +// CanConvertToUnstructured returns true if this TypeReflectCacheEntry can convert values of its type to unstructured. +func (e TypeReflectCacheEntry) CanConvertToUnstructured() bool { + return e.isJsonMarshaler || e.ptrIsJsonMarshaler || e.isStringConvertable || e.ptrIsStringConvertable +} + +// ToUnstructured converts the provided value to unstructured and returns it. +func (e TypeReflectCacheEntry) ToUnstructured(sv reflect.Value) (interface{}, error) { + // This is based on https://github.com/kubernetes/kubernetes/blob/82c9e5c814eb7acc6cc0a090c057294d0667ad66/staging/src/k8s.io/apimachinery/pkg/runtime/converter.go#L505 + // and is intended to replace it. + + // Check if the object has a custom string converter and use it if available, since it is much more efficient + // than round tripping through json. + if converter, ok := e.getUnstructuredConverter(sv); ok { + return converter.ToUnstructured(), nil + } + // Check if the object has a custom JSON marshaller/unmarshaller. + if marshaler, ok := e.getJsonMarshaler(sv); ok { + if sv.Kind() == reflect.Ptr && sv.IsNil() { + // We're done - we don't need to store anything. + return nil, nil + } + + data, err := marshaler.MarshalJSON() + if err != nil { + return nil, err + } + switch { + case len(data) == 0: + return nil, fmt.Errorf("error decoding from json: empty value") + + case bytes.Equal(data, nullBytes): + // We're done - we don't need to store anything. + return nil, nil + + case bytes.Equal(data, trueBytes): + return true, nil + + case bytes.Equal(data, falseBytes): + return false, nil + + case data[0] == '"': + var result string + err := unmarshal(data, &result) + if err != nil { + return nil, fmt.Errorf("error decoding string from json: %v", err) + } + return result, nil + + case data[0] == '{': + result := make(map[string]interface{}) + err := unmarshal(data, &result) + if err != nil { + return nil, fmt.Errorf("error decoding object from json: %v", err) + } + return result, nil + + case data[0] == '[': + result := make([]interface{}, 0) + err := unmarshal(data, &result) + if err != nil { + return nil, fmt.Errorf("error decoding array from json: %v", err) + } + return result, nil + + default: + var ( + resultInt int64 + resultFloat float64 + err error + ) + if err = unmarshal(data, &resultInt); err == nil { + return resultInt, nil + } else if err = unmarshal(data, &resultFloat); err == nil { + return resultFloat, nil + } else { + return nil, fmt.Errorf("error decoding number from json: %v", err) + } + } + } + + return nil, fmt.Errorf("provided type cannot be converted: %v", sv.Type()) +} + +// CanConvertFromUnstructured returns true if this TypeReflectCacheEntry can convert objects of the type from unstructured. +func (e TypeReflectCacheEntry) CanConvertFromUnstructured() bool { + return e.isJsonUnmarshaler +} + +// FromUnstructured converts the provided source value from unstructured into the provided destination value. +func (e TypeReflectCacheEntry) FromUnstructured(sv, dv reflect.Value) error { + // TODO: this could be made much more efficient using direct conversions like + // UnstructuredConverter.ToUnstructured provides. + st := dv.Type() + data, err := json.Marshal(sv.Interface()) + if err != nil { + return fmt.Errorf("error encoding %s to json: %v", st.String(), err) + } + if unmarshaler, ok := e.getJsonUnmarshaler(dv); ok { + return unmarshaler.UnmarshalJSON(data) + } + return fmt.Errorf("unable to unmarshal %v into %v", sv.Type(), dv.Type()) +} + +var ( + nullBytes = []byte("null") + trueBytes = []byte("true") + falseBytes = []byte("false") +) + +func (e TypeReflectCacheEntry) getJsonMarshaler(v reflect.Value) (json.Marshaler, bool) { + if e.isJsonMarshaler { + return v.Interface().(json.Marshaler), true + } + if e.ptrIsJsonMarshaler { + // Check pointer receivers if v is not a pointer + if v.Kind() != reflect.Ptr && v.CanAddr() { + v = v.Addr() + return v.Interface().(json.Marshaler), true + } + } + return nil, false +} + +func (e TypeReflectCacheEntry) getJsonUnmarshaler(v reflect.Value) (json.Unmarshaler, bool) { + if !e.isJsonUnmarshaler { + return nil, false + } + return v.Addr().Interface().(json.Unmarshaler), true +} + +func (e TypeReflectCacheEntry) getUnstructuredConverter(v reflect.Value) (UnstructuredConverter, bool) { + if e.isStringConvertable { + return v.Interface().(UnstructuredConverter), true + } + if e.ptrIsStringConvertable { + // Check pointer receivers if v is not a pointer + if v.CanAddr() { + v = v.Addr() + return v.Interface().(UnstructuredConverter), true + } + } + return nil, false +} + +type typeReflectCache struct { + // use an atomic and copy-on-write since there are a fixed (typically very small) number of structs compiled into any + // go program using this cache + value atomic.Value + // mu is held by writers when performing load/modify/store operations on the cache, readers do not need to hold a + // read-lock since the atomic value is always read-only + mu sync.Mutex +} + +func newReflectCache() *typeReflectCache { + cache := &typeReflectCache{} + cache.value.Store(make(reflectCacheMap)) + return cache +} + +type reflectCacheMap map[reflect.Type]*TypeReflectCacheEntry + +// get returns the reflectCacheMap. +func (c *typeReflectCache) get() reflectCacheMap { + return c.value.Load().(reflectCacheMap) +} + +// update merges the provided updates into the cache. +func (c *typeReflectCache) update(updates reflectCacheMap) { + c.mu.Lock() + defer c.mu.Unlock() + + currentCacheMap := c.value.Load().(reflectCacheMap) + + hasNewEntries := false + for t := range updates { + if _, ok := currentCacheMap[t]; !ok { + hasNewEntries = true + break + } + } + if !hasNewEntries { + // Bail if the updates have been set while waiting for lock acquisition. + // This is safe since setting entries is idempotent. + return + } + + newCacheMap := make(reflectCacheMap, len(currentCacheMap)+len(updates)) + for k, v := range currentCacheMap { + newCacheMap[k] = v + } + for t, update := range updates { + newCacheMap[t] = update + } + c.value.Store(newCacheMap) +} + +// Below json Unmarshal is fromk8s.io/apimachinery/pkg/util/json +// to handle number conversions as expected by Kubernetes + +// limit recursive depth to prevent stack overflow errors +const maxDepth = 10000 + +// unmarshal unmarshals the given data +// If v is a *map[string]interface{}, numbers are converted to int64 or float64 +func unmarshal(data []byte, v interface{}) error { + switch v := v.(type) { + case *map[string]interface{}: + // Build a decoder from the given data + decoder := json.NewDecoder(bytes.NewBuffer(data)) + // Preserve numbers, rather than casting to float64 automatically + decoder.UseNumber() + // Run the decode + if err := decoder.Decode(v); err != nil { + return err + } + // If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64 + return convertMapNumbers(*v, 0) + + case *[]interface{}: + // Build a decoder from the given data + decoder := json.NewDecoder(bytes.NewBuffer(data)) + // Preserve numbers, rather than casting to float64 automatically + decoder.UseNumber() + // Run the decode + if err := decoder.Decode(v); err != nil { + return err + } + // If the decode succeeds, post-process the map to convert json.Number objects to int64 or float64 + return convertSliceNumbers(*v, 0) + + default: + return json.Unmarshal(data, v) + } +} + +// convertMapNumbers traverses the map, converting any json.Number values to int64 or float64. +// values which are map[string]interface{} or []interface{} are recursively visited +func convertMapNumbers(m map[string]interface{}, depth int) error { + if depth > maxDepth { + return fmt.Errorf("exceeded max depth of %d", maxDepth) + } + + var err error + for k, v := range m { + switch v := v.(type) { + case json.Number: + m[k], err = convertNumber(v) + case map[string]interface{}: + err = convertMapNumbers(v, depth+1) + case []interface{}: + err = convertSliceNumbers(v, depth+1) + } + if err != nil { + return err + } + } + return nil +} + +// convertSliceNumbers traverses the slice, converting any json.Number values to int64 or float64. +// values which are map[string]interface{} or []interface{} are recursively visited +func convertSliceNumbers(s []interface{}, depth int) error { + if depth > maxDepth { + return fmt.Errorf("exceeded max depth of %d", maxDepth) + } + + var err error + for i, v := range s { + switch v := v.(type) { + case json.Number: + s[i], err = convertNumber(v) + case map[string]interface{}: + err = convertMapNumbers(v, depth+1) + case []interface{}: + err = convertSliceNumbers(v, depth+1) + } + if err != nil { + return err + } + } + return nil +} + +// convertNumber converts a json.Number to an int64 or float64, or returns an error +func convertNumber(n json.Number) (interface{}, error) { + // Attempt to convert to an int64 first + if i, err := n.Int64(); err == nil { + return i, nil + } + // Return a float64 (default json.Decode() behavior) + // An overflow will return an error + return n.Float64() +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/scalar.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/scalar.go new file mode 100644 index 000000000..c78a4c18d --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/scalar.go @@ -0,0 +1,50 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +// Compare compares floats. The result will be 0 if lhs==rhs, -1 if f < +// rhs, and +1 if f > rhs. +func FloatCompare(lhs, rhs float64) int { + if lhs > rhs { + return 1 + } else if lhs < rhs { + return -1 + } + return 0 +} + +// IntCompare compares integers. The result will be 0 if i==rhs, -1 if i < +// rhs, and +1 if i > rhs. +func IntCompare(lhs, rhs int64) int { + if lhs > rhs { + return 1 + } else if lhs < rhs { + return -1 + } + return 0 +} + +// Compare compares booleans. The result will be 0 if b==rhs, -1 if b < +// rhs, and +1 if b > rhs. +func BoolCompare(lhs, rhs bool) int { + if lhs == rhs { + return 0 + } else if lhs == false { + return -1 + } + return 1 +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/structreflect.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/structreflect.go new file mode 100644 index 000000000..4a7bb5c6e --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/structreflect.go @@ -0,0 +1,208 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "fmt" + "reflect" +) + +type structReflect struct { + valueReflect +} + +func (r structReflect) Length() int { + i := 0 + eachStructField(r.Value, func(_ *TypeReflectCacheEntry, s string, value reflect.Value) bool { + i++ + return true + }) + return i +} + +func (r structReflect) Empty() bool { + return eachStructField(r.Value, func(_ *TypeReflectCacheEntry, s string, value reflect.Value) bool { + return false // exit early if the struct is non-empty + }) +} + +func (r structReflect) Get(key string) (Value, bool) { + return r.GetUsing(HeapAllocator, key) +} + +func (r structReflect) GetUsing(a Allocator, key string) (Value, bool) { + if val, ok := r.findJsonNameField(key); ok { + return a.allocValueReflect().mustReuse(val, nil, nil, nil), true + } + return nil, false +} + +func (r structReflect) Has(key string) bool { + _, ok := r.findJsonNameField(key) + return ok +} + +func (r structReflect) Set(key string, val Value) { + fieldEntry, ok := TypeReflectEntryOf(r.Value.Type()).Fields()[key] + if !ok { + panic(fmt.Sprintf("key %s may not be set on struct %T: field does not exist", key, r.Value.Interface())) + } + oldVal := fieldEntry.GetFrom(r.Value) + newVal := reflect.ValueOf(val.Unstructured()) + r.update(fieldEntry, key, oldVal, newVal) +} + +func (r structReflect) Delete(key string) { + fieldEntry, ok := TypeReflectEntryOf(r.Value.Type()).Fields()[key] + if !ok { + panic(fmt.Sprintf("key %s may not be deleted on struct %T: field does not exist", key, r.Value.Interface())) + } + oldVal := fieldEntry.GetFrom(r.Value) + if oldVal.Kind() != reflect.Ptr && !fieldEntry.isOmitEmpty { + panic(fmt.Sprintf("key %s may not be deleted on struct: %T: value is neither a pointer nor an omitempty field", key, r.Value.Interface())) + } + r.update(fieldEntry, key, oldVal, reflect.Zero(oldVal.Type())) +} + +func (r structReflect) update(fieldEntry *FieldCacheEntry, key string, oldVal, newVal reflect.Value) { + if oldVal.CanSet() { + oldVal.Set(newVal) + return + } + + // map items are not addressable, so if a struct is contained in a map, the only way to modify it is + // to write a replacement fieldEntry into the map. + if r.ParentMap != nil { + if r.ParentMapKey == nil { + panic("ParentMapKey must not be nil if ParentMap is not nil") + } + replacement := reflect.New(r.Value.Type()).Elem() + fieldEntry.GetFrom(replacement).Set(newVal) + r.ParentMap.SetMapIndex(*r.ParentMapKey, replacement) + return + } + + // This should never happen since NewValueReflect ensures that the root object reflected on is a pointer and map + // item replacement is handled above. + panic(fmt.Sprintf("key %s may not be modified on struct: %T: struct is not settable", key, r.Value.Interface())) +} + +func (r structReflect) Iterate(fn func(string, Value) bool) bool { + return r.IterateUsing(HeapAllocator, fn) +} + +func (r structReflect) IterateUsing(a Allocator, fn func(string, Value) bool) bool { + vr := a.allocValueReflect() + defer a.Free(vr) + return eachStructField(r.Value, func(e *TypeReflectCacheEntry, s string, value reflect.Value) bool { + return fn(s, vr.mustReuse(value, e, nil, nil)) + }) +} + +func eachStructField(structVal reflect.Value, fn func(*TypeReflectCacheEntry, string, reflect.Value) bool) bool { + for _, fieldCacheEntry := range TypeReflectEntryOf(structVal.Type()).OrderedFields() { + fieldVal := fieldCacheEntry.GetFrom(structVal) + if fieldCacheEntry.CanOmit(fieldVal) { + // omit it + continue + } + ok := fn(fieldCacheEntry.TypeEntry, fieldCacheEntry.JsonName, fieldVal) + if !ok { + return false + } + } + return true +} + +func (r structReflect) Unstructured() interface{} { + // Use number of struct fields as a cheap way to rough estimate map size + result := make(map[string]interface{}, r.Value.NumField()) + r.Iterate(func(s string, value Value) bool { + result[s] = value.Unstructured() + return true + }) + return result +} + +func (r structReflect) Equals(m Map) bool { + return r.EqualsUsing(HeapAllocator, m) +} + +func (r structReflect) EqualsUsing(a Allocator, m Map) bool { + // MapEquals uses zip and is fairly efficient for structReflect + return MapEqualsUsing(a, &r, m) +} + +func (r structReflect) findJsonNameFieldAndNotEmpty(jsonName string) (reflect.Value, bool) { + structCacheEntry, ok := TypeReflectEntryOf(r.Value.Type()).Fields()[jsonName] + if !ok { + return reflect.Value{}, false + } + fieldVal := structCacheEntry.GetFrom(r.Value) + return fieldVal, !structCacheEntry.CanOmit(fieldVal) +} + +func (r structReflect) findJsonNameField(jsonName string) (val reflect.Value, ok bool) { + structCacheEntry, ok := TypeReflectEntryOf(r.Value.Type()).Fields()[jsonName] + if !ok { + return reflect.Value{}, false + } + fieldVal := structCacheEntry.GetFrom(r.Value) + return fieldVal, !structCacheEntry.CanOmit(fieldVal) +} + +func (r structReflect) Zip(other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + return r.ZipUsing(HeapAllocator, other, order, fn) +} + +func (r structReflect) ZipUsing(a Allocator, other Map, order MapTraverseOrder, fn func(key string, lhs, rhs Value) bool) bool { + if otherStruct, ok := other.(*structReflect); ok && r.Value.Type() == otherStruct.Value.Type() { + lhsvr, rhsvr := a.allocValueReflect(), a.allocValueReflect() + defer a.Free(lhsvr) + defer a.Free(rhsvr) + return r.structZip(otherStruct, lhsvr, rhsvr, fn) + } + return defaultMapZip(a, &r, other, order, fn) +} + +// structZip provides an optimized zip for structReflect types. The zip is always lexical key ordered since there is +// no additional cost to ordering the zip for structured types. +func (r structReflect) structZip(other *structReflect, lhsvr, rhsvr *valueReflect, fn func(key string, lhs, rhs Value) bool) bool { + lhsVal := r.Value + rhsVal := other.Value + + for _, fieldCacheEntry := range TypeReflectEntryOf(lhsVal.Type()).OrderedFields() { + lhsFieldVal := fieldCacheEntry.GetFrom(lhsVal) + rhsFieldVal := fieldCacheEntry.GetFrom(rhsVal) + lhsOmit := fieldCacheEntry.CanOmit(lhsFieldVal) + rhsOmit := fieldCacheEntry.CanOmit(rhsFieldVal) + if lhsOmit && rhsOmit { + continue + } + var lhsVal, rhsVal Value + if !lhsOmit { + lhsVal = lhsvr.mustReuse(lhsFieldVal, fieldCacheEntry.TypeEntry, nil, nil) + } + if !rhsOmit { + rhsVal = rhsvr.mustReuse(rhsFieldVal, fieldCacheEntry.TypeEntry, nil, nil) + } + if !fn(fieldCacheEntry.JsonName, lhsVal, rhsVal) { + return false + } + } + return true +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/value.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/value.go new file mode 100644 index 000000000..ea79e3a00 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/value.go @@ -0,0 +1,347 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "bytes" + "fmt" + "io" + "strings" + + jsoniter "github.com/json-iterator/go" + "gopkg.in/yaml.v2" +) + +var ( + readPool = jsoniter.NewIterator(jsoniter.ConfigCompatibleWithStandardLibrary).Pool() + writePool = jsoniter.NewStream(jsoniter.ConfigCompatibleWithStandardLibrary, nil, 1024).Pool() +) + +// A Value corresponds to an 'atom' in the schema. It should return true +// for at least one of the IsXXX methods below, or the value is +// considered "invalid" +type Value interface { + // IsMap returns true if the Value is a Map, false otherwise. + IsMap() bool + // IsList returns true if the Value is a List, false otherwise. + IsList() bool + // IsBool returns true if the Value is a bool, false otherwise. + IsBool() bool + // IsInt returns true if the Value is a int64, false otherwise. + IsInt() bool + // IsFloat returns true if the Value is a float64, false + // otherwise. + IsFloat() bool + // IsString returns true if the Value is a string, false + // otherwise. + IsString() bool + // IsMap returns true if the Value is null, false otherwise. + IsNull() bool + + // AsMap converts the Value into a Map (or panic if the type + // doesn't allow it). + AsMap() Map + // AsMapUsing uses the provided allocator and converts the Value + // into a Map (or panic if the type doesn't allow it). + AsMapUsing(Allocator) Map + // AsList converts the Value into a List (or panic if the type + // doesn't allow it). + AsList() List + // AsListUsing uses the provided allocator and converts the Value + // into a List (or panic if the type doesn't allow it). + AsListUsing(Allocator) List + // AsBool converts the Value into a bool (or panic if the type + // doesn't allow it). + AsBool() bool + // AsInt converts the Value into an int64 (or panic if the type + // doesn't allow it). + AsInt() int64 + // AsFloat converts the Value into a float64 (or panic if the type + // doesn't allow it). + AsFloat() float64 + // AsString converts the Value into a string (or panic if the type + // doesn't allow it). + AsString() string + + // Unstructured converts the Value into an Unstructured interface{}. + Unstructured() interface{} +} + +// FromJSON is a helper function for reading a JSON document. +func FromJSON(input []byte) (Value, error) { + return FromJSONFast(input) +} + +// FromJSONFast is a helper function for reading a JSON document. +func FromJSONFast(input []byte) (Value, error) { + iter := readPool.BorrowIterator(input) + defer readPool.ReturnIterator(iter) + return ReadJSONIter(iter) +} + +// ToJSON is a helper function for producing a JSon document. +func ToJSON(v Value) ([]byte, error) { + buf := bytes.Buffer{} + stream := writePool.BorrowStream(&buf) + defer writePool.ReturnStream(stream) + WriteJSONStream(v, stream) + b := stream.Buffer() + err := stream.Flush() + // Help jsoniter manage its buffers--without this, the next + // use of the stream is likely to require an allocation. Look + // at the jsoniter stream code to understand why. They were probably + // optimizing for folks using the buffer directly. + stream.SetBuffer(b[:0]) + return buf.Bytes(), err +} + +// ReadJSONIter reads a Value from a JSON iterator. +func ReadJSONIter(iter *jsoniter.Iterator) (Value, error) { + v := iter.Read() + if iter.Error != nil && iter.Error != io.EOF { + return nil, iter.Error + } + return NewValueInterface(v), nil +} + +// WriteJSONStream writes a value into a JSON stream. +func WriteJSONStream(v Value, stream *jsoniter.Stream) { + stream.WriteVal(v.Unstructured()) +} + +// ToYAML marshals a value as YAML. +func ToYAML(v Value) ([]byte, error) { + return yaml.Marshal(v.Unstructured()) +} + +// Equals returns true iff the two values are equal. +func Equals(lhs, rhs Value) bool { + return EqualsUsing(HeapAllocator, lhs, rhs) +} + +// EqualsUsing uses the provided allocator and returns true iff the two values are equal. +func EqualsUsing(a Allocator, lhs, rhs Value) bool { + if lhs.IsFloat() || rhs.IsFloat() { + var lf float64 + if lhs.IsFloat() { + lf = lhs.AsFloat() + } else if lhs.IsInt() { + lf = float64(lhs.AsInt()) + } else { + return false + } + var rf float64 + if rhs.IsFloat() { + rf = rhs.AsFloat() + } else if rhs.IsInt() { + rf = float64(rhs.AsInt()) + } else { + return false + } + return lf == rf + } + if lhs.IsInt() { + if rhs.IsInt() { + return lhs.AsInt() == rhs.AsInt() + } + return false + } else if rhs.IsInt() { + return false + } + if lhs.IsString() { + if rhs.IsString() { + return lhs.AsString() == rhs.AsString() + } + return false + } else if rhs.IsString() { + return false + } + if lhs.IsBool() { + if rhs.IsBool() { + return lhs.AsBool() == rhs.AsBool() + } + return false + } else if rhs.IsBool() { + return false + } + if lhs.IsList() { + if rhs.IsList() { + lhsList := lhs.AsListUsing(a) + defer a.Free(lhsList) + rhsList := rhs.AsListUsing(a) + defer a.Free(rhsList) + return lhsList.EqualsUsing(a, rhsList) + } + return false + } else if rhs.IsList() { + return false + } + if lhs.IsMap() { + if rhs.IsMap() { + lhsList := lhs.AsMapUsing(a) + defer a.Free(lhsList) + rhsList := rhs.AsMapUsing(a) + defer a.Free(rhsList) + return lhsList.EqualsUsing(a, rhsList) + } + return false + } else if rhs.IsMap() { + return false + } + if lhs.IsNull() { + if rhs.IsNull() { + return true + } + return false + } else if rhs.IsNull() { + return false + } + // No field is set, on either objects. + return true +} + +// ToString returns a human-readable representation of the value. +func ToString(v Value) string { + if v.IsNull() { + return "null" + } + switch { + case v.IsFloat(): + return fmt.Sprintf("%v", v.AsFloat()) + case v.IsInt(): + return fmt.Sprintf("%v", v.AsInt()) + case v.IsString(): + return fmt.Sprintf("%q", v.AsString()) + case v.IsBool(): + return fmt.Sprintf("%v", v.AsBool()) + case v.IsList(): + strs := []string{} + list := v.AsList() + for i := 0; i < list.Length(); i++ { + strs = append(strs, ToString(list.At(i))) + } + return "[" + strings.Join(strs, ",") + "]" + case v.IsMap(): + strs := []string{} + v.AsMap().Iterate(func(k string, v Value) bool { + strs = append(strs, fmt.Sprintf("%v=%v", k, ToString(v))) + return true + }) + return strings.Join(strs, "") + } + // No field is set, on either objects. + return "{{undefined}}" +} + +// Less provides a total ordering for Value (so that they can be sorted, even +// if they are of different types). +func Less(lhs, rhs Value) bool { + return Compare(lhs, rhs) == -1 +} + +// Compare provides a total ordering for Value (so that they can be +// sorted, even if they are of different types). The result will be 0 if +// v==rhs, -1 if v < rhs, and +1 if v > rhs. +func Compare(lhs, rhs Value) int { + return CompareUsing(HeapAllocator, lhs, rhs) +} + +// CompareUsing uses the provided allocator and provides a total +// ordering for Value (so that they can be sorted, even if they +// are of different types). The result will be 0 if v==rhs, -1 +// if v < rhs, and +1 if v > rhs. +func CompareUsing(a Allocator, lhs, rhs Value) int { + if lhs.IsFloat() { + if !rhs.IsFloat() { + // Extra: compare floats and ints numerically. + if rhs.IsInt() { + return FloatCompare(lhs.AsFloat(), float64(rhs.AsInt())) + } + return -1 + } + return FloatCompare(lhs.AsFloat(), rhs.AsFloat()) + } else if rhs.IsFloat() { + // Extra: compare floats and ints numerically. + if lhs.IsInt() { + return FloatCompare(float64(lhs.AsInt()), rhs.AsFloat()) + } + return 1 + } + + if lhs.IsInt() { + if !rhs.IsInt() { + return -1 + } + return IntCompare(lhs.AsInt(), rhs.AsInt()) + } else if rhs.IsInt() { + return 1 + } + + if lhs.IsString() { + if !rhs.IsString() { + return -1 + } + return strings.Compare(lhs.AsString(), rhs.AsString()) + } else if rhs.IsString() { + return 1 + } + + if lhs.IsBool() { + if !rhs.IsBool() { + return -1 + } + return BoolCompare(lhs.AsBool(), rhs.AsBool()) + } else if rhs.IsBool() { + return 1 + } + + if lhs.IsList() { + if !rhs.IsList() { + return -1 + } + lhsList := lhs.AsListUsing(a) + defer a.Free(lhsList) + rhsList := rhs.AsListUsing(a) + defer a.Free(rhsList) + return ListCompareUsing(a, lhsList, rhsList) + } else if rhs.IsList() { + return 1 + } + if lhs.IsMap() { + if !rhs.IsMap() { + return -1 + } + lhsMap := lhs.AsMapUsing(a) + defer a.Free(lhsMap) + rhsMap := rhs.AsMapUsing(a) + defer a.Free(rhsMap) + return MapCompareUsing(a, lhsMap, rhsMap) + } else if rhs.IsMap() { + return 1 + } + if lhs.IsNull() { + if !rhs.IsNull() { + return -1 + } + return 0 + } else if rhs.IsNull() { + return 1 + } + + // Invalid Value-- nothing is set. + return 0 +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/valuereflect.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/valuereflect.go new file mode 100644 index 000000000..05e70deba --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/valuereflect.go @@ -0,0 +1,294 @@ +/* +Copyright 2019 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "encoding/base64" + "fmt" + "reflect" +) + +// NewValueReflect creates a Value backed by an "interface{}" type, +// typically an structured object in Kubernetes world that is uses reflection to expose. +// The provided "interface{}" value must be a pointer so that the value can be modified via reflection. +// The provided "interface{}" may contain structs and types that are converted to Values +// by the jsonMarshaler interface. +func NewValueReflect(value interface{}) (Value, error) { + if value == nil { + return NewValueInterface(nil), nil + } + v := reflect.ValueOf(value) + if v.Kind() != reflect.Ptr { + // The root value to reflect on must be a pointer so that map.Set() and map.Delete() operations are possible. + return nil, fmt.Errorf("value provided to NewValueReflect must be a pointer") + } + return wrapValueReflect(v, nil, nil) +} + +// wrapValueReflect wraps the provide reflect.Value as a value. If parent in the data tree is a map, parentMap +// and parentMapKey must be provided so that the returned value may be set and deleted. +func wrapValueReflect(value reflect.Value, parentMap, parentMapKey *reflect.Value) (Value, error) { + val := HeapAllocator.allocValueReflect() + return val.reuse(value, nil, parentMap, parentMapKey) +} + +// wrapValueReflect wraps the provide reflect.Value as a value, and panics if there is an error. If parent in the data +// tree is a map, parentMap and parentMapKey must be provided so that the returned value may be set and deleted. +func mustWrapValueReflect(value reflect.Value, parentMap, parentMapKey *reflect.Value) Value { + v, err := wrapValueReflect(value, parentMap, parentMapKey) + if err != nil { + panic(err) + } + return v +} + +// the value interface doesn't care about the type for value.IsNull, so we can use a constant +var nilType = reflect.TypeOf(&struct{}{}) + +// reuse replaces the value of the valueReflect. If parent in the data tree is a map, parentMap and parentMapKey +// must be provided so that the returned value may be set and deleted. +func (r *valueReflect) reuse(value reflect.Value, cacheEntry *TypeReflectCacheEntry, parentMap, parentMapKey *reflect.Value) (Value, error) { + if cacheEntry == nil { + cacheEntry = TypeReflectEntryOf(value.Type()) + } + if cacheEntry.CanConvertToUnstructured() { + u, err := cacheEntry.ToUnstructured(value) + if err != nil { + return nil, err + } + if u == nil { + value = reflect.Zero(nilType) + } else { + value = reflect.ValueOf(u) + } + } + r.Value = dereference(value) + r.ParentMap = parentMap + r.ParentMapKey = parentMapKey + r.kind = kind(r.Value) + return r, nil +} + +// mustReuse replaces the value of the valueReflect and panics if there is an error. If parent in the data tree is a +// map, parentMap and parentMapKey must be provided so that the returned value may be set and deleted. +func (r *valueReflect) mustReuse(value reflect.Value, cacheEntry *TypeReflectCacheEntry, parentMap, parentMapKey *reflect.Value) Value { + v, err := r.reuse(value, cacheEntry, parentMap, parentMapKey) + if err != nil { + panic(err) + } + return v +} + +func dereference(val reflect.Value) reflect.Value { + kind := val.Kind() + if (kind == reflect.Interface || kind == reflect.Ptr) && !safeIsNil(val) { + return val.Elem() + } + return val +} + +type valueReflect struct { + ParentMap *reflect.Value + ParentMapKey *reflect.Value + Value reflect.Value + kind reflectType +} + +func (r valueReflect) IsMap() bool { + return r.kind == mapType || r.kind == structMapType +} + +func (r valueReflect) IsList() bool { + return r.kind == listType +} + +func (r valueReflect) IsBool() bool { + return r.kind == boolType +} + +func (r valueReflect) IsInt() bool { + return r.kind == intType || r.kind == uintType +} + +func (r valueReflect) IsFloat() bool { + return r.kind == floatType +} + +func (r valueReflect) IsString() bool { + return r.kind == stringType || r.kind == byteStringType +} + +func (r valueReflect) IsNull() bool { + return r.kind == nullType +} + +type reflectType = int + +const ( + mapType = iota + structMapType + listType + intType + uintType + floatType + stringType + byteStringType + boolType + nullType +) + +func kind(v reflect.Value) reflectType { + typ := v.Type() + rk := typ.Kind() + switch rk { + case reflect.Map: + if v.IsNil() { + return nullType + } + return mapType + case reflect.Struct: + return structMapType + case reflect.Int, reflect.Int64, reflect.Int32, reflect.Int16, reflect.Int8: + return intType + case reflect.Uint, reflect.Uint32, reflect.Uint16, reflect.Uint8: + // Uint64 deliberately excluded, see valueUnstructured.Int. + return uintType + case reflect.Float64, reflect.Float32: + return floatType + case reflect.String: + return stringType + case reflect.Bool: + return boolType + case reflect.Slice: + if v.IsNil() { + return nullType + } + elemKind := typ.Elem().Kind() + if elemKind == reflect.Uint8 { + return byteStringType + } + return listType + case reflect.Chan, reflect.Func, reflect.Ptr, reflect.UnsafePointer, reflect.Interface: + if v.IsNil() { + return nullType + } + panic(fmt.Sprintf("unsupported type: %v", v.Type())) + default: + panic(fmt.Sprintf("unsupported type: %v", v.Type())) + } +} + +// TODO find a cleaner way to avoid panics from reflect.IsNil() +func safeIsNil(v reflect.Value) bool { + k := v.Kind() + switch k { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return v.IsNil() + } + return false +} + +func (r valueReflect) AsMap() Map { + return r.AsMapUsing(HeapAllocator) +} + +func (r valueReflect) AsMapUsing(a Allocator) Map { + switch r.kind { + case structMapType: + v := a.allocStructReflect() + v.valueReflect = r + return v + case mapType: + v := a.allocMapReflect() + v.valueReflect = r + return v + default: + panic("value is not a map or struct") + } +} + +func (r valueReflect) AsList() List { + return r.AsListUsing(HeapAllocator) +} + +func (r valueReflect) AsListUsing(a Allocator) List { + if r.IsList() { + v := a.allocListReflect() + v.Value = r.Value + return v + } + panic("value is not a list") +} + +func (r valueReflect) AsBool() bool { + if r.IsBool() { + return r.Value.Bool() + } + panic("value is not a bool") +} + +func (r valueReflect) AsInt() int64 { + if r.kind == intType { + return r.Value.Int() + } + if r.kind == uintType { + return int64(r.Value.Uint()) + } + + panic("value is not an int") +} + +func (r valueReflect) AsFloat() float64 { + if r.IsFloat() { + return r.Value.Float() + } + panic("value is not a float") +} + +func (r valueReflect) AsString() string { + switch r.kind { + case stringType: + return r.Value.String() + case byteStringType: + return base64.StdEncoding.EncodeToString(r.Value.Bytes()) + } + panic("value is not a string") +} + +func (r valueReflect) Unstructured() interface{} { + val := r.Value + switch { + case r.IsNull(): + return nil + case val.Kind() == reflect.Struct: + return structReflect{r}.Unstructured() + case val.Kind() == reflect.Map: + return mapReflect{valueReflect: r}.Unstructured() + case r.IsList(): + return listReflect{r.Value}.Unstructured() + case r.IsString(): + return r.AsString() + case r.IsInt(): + return r.AsInt() + case r.IsBool(): + return r.AsBool() + case r.IsFloat(): + return r.AsFloat() + default: + panic(fmt.Sprintf("value of type %s is not a supported by value reflector", val.Type())) + } +} diff --git a/vendor/sigs.k8s.io/structured-merge-diff/v3/value/valueunstructured.go b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/valueunstructured.go new file mode 100644 index 000000000..ac5a92628 --- /dev/null +++ b/vendor/sigs.k8s.io/structured-merge-diff/v3/value/valueunstructured.go @@ -0,0 +1,178 @@ +/* +Copyright 2018 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package value + +import ( + "fmt" +) + +// NewValueInterface creates a Value backed by an "interface{}" type, +// typically an unstructured object in Kubernetes world. +// interface{} must be one of: map[string]interface{}, map[interface{}]interface{}, []interface{}, int types, float types, +// string or boolean. Nested interface{} must also be one of these types. +func NewValueInterface(v interface{}) Value { + return Value(HeapAllocator.allocValueUnstructured().reuse(v)) +} + +type valueUnstructured struct { + Value interface{} +} + +// reuse replaces the value of the valueUnstructured. +func (vi *valueUnstructured) reuse(value interface{}) Value { + vi.Value = value + return vi +} + +func (v valueUnstructured) IsMap() bool { + if _, ok := v.Value.(map[string]interface{}); ok { + return true + } + if _, ok := v.Value.(map[interface{}]interface{}); ok { + return true + } + return false +} + +func (v valueUnstructured) AsMap() Map { + return v.AsMapUsing(HeapAllocator) +} + +func (v valueUnstructured) AsMapUsing(_ Allocator) Map { + if v.Value == nil { + panic("invalid nil") + } + switch t := v.Value.(type) { + case map[string]interface{}: + return mapUnstructuredString(t) + case map[interface{}]interface{}: + return mapUnstructuredInterface(t) + } + panic(fmt.Errorf("not a map: %#v", v)) +} + +func (v valueUnstructured) IsList() bool { + if v.Value == nil { + return false + } + _, ok := v.Value.([]interface{}) + return ok +} + +func (v valueUnstructured) AsList() List { + return v.AsListUsing(HeapAllocator) +} + +func (v valueUnstructured) AsListUsing(_ Allocator) List { + return listUnstructured(v.Value.([]interface{})) +} + +func (v valueUnstructured) IsFloat() bool { + if v.Value == nil { + return false + } else if _, ok := v.Value.(float64); ok { + return true + } else if _, ok := v.Value.(float32); ok { + return true + } + return false +} + +func (v valueUnstructured) AsFloat() float64 { + if f, ok := v.Value.(float32); ok { + return float64(f) + } + return v.Value.(float64) +} + +func (v valueUnstructured) IsInt() bool { + if v.Value == nil { + return false + } else if _, ok := v.Value.(int); ok { + return true + } else if _, ok := v.Value.(int8); ok { + return true + } else if _, ok := v.Value.(int16); ok { + return true + } else if _, ok := v.Value.(int32); ok { + return true + } else if _, ok := v.Value.(int64); ok { + return true + } else if _, ok := v.Value.(uint); ok { + return true + } else if _, ok := v.Value.(uint8); ok { + return true + } else if _, ok := v.Value.(uint16); ok { + return true + } else if _, ok := v.Value.(uint32); ok { + return true + } + return false +} + +func (v valueUnstructured) AsInt() int64 { + if i, ok := v.Value.(int); ok { + return int64(i) + } else if i, ok := v.Value.(int8); ok { + return int64(i) + } else if i, ok := v.Value.(int16); ok { + return int64(i) + } else if i, ok := v.Value.(int32); ok { + return int64(i) + } else if i, ok := v.Value.(uint); ok { + return int64(i) + } else if i, ok := v.Value.(uint8); ok { + return int64(i) + } else if i, ok := v.Value.(uint16); ok { + return int64(i) + } else if i, ok := v.Value.(uint32); ok { + return int64(i) + } + return v.Value.(int64) +} + +func (v valueUnstructured) IsString() bool { + if v.Value == nil { + return false + } + _, ok := v.Value.(string) + return ok +} + +func (v valueUnstructured) AsString() string { + return v.Value.(string) +} + +func (v valueUnstructured) IsBool() bool { + if v.Value == nil { + return false + } + _, ok := v.Value.(bool) + return ok +} + +func (v valueUnstructured) AsBool() bool { + return v.Value.(bool) +} + +func (v valueUnstructured) IsNull() bool { + return v.Value == nil +} + +func (v valueUnstructured) Unstructured() interface{} { + return v.Value +} From 8148e514660537fa29ed97487e20009515da8b1f Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Mon, 2 Nov 2020 17:46:35 -0500 Subject: [PATCH 2/6] make generate - Generate new clientsets. Context introduced in v0.18 - Generate new fakes --- .../build/clientset/versioned/clientset.go | 2 +- .../versioned/typed/build/v1alpha1/build.go | 72 ++++----- .../typed/build/v1alpha1/buildrun.go | 72 ++++----- .../typed/build/v1alpha1/buildstrategy.go | 72 ++++----- .../build/v1alpha1/clusterbuildstrategy.go | 72 ++++----- .../typed/build/v1alpha1/fake/fake_build.go | 22 +-- .../build/v1alpha1/fake/fake_buildrun.go | 22 +-- .../build/v1alpha1/fake/fake_buildstrategy.go | 22 +-- .../fake/fake_clusterbuildstrategy.go | 22 +-- pkg/controller/fakes/manager.go | 142 ++++++++++++++++++ 10 files changed, 343 insertions(+), 177 deletions(-) diff --git a/pkg/client/build/clientset/versioned/clientset.go b/pkg/client/build/clientset/versioned/clientset.go index ee6bc6947..06f458217 100644 --- a/pkg/client/build/clientset/versioned/clientset.go +++ b/pkg/client/build/clientset/versioned/clientset.go @@ -47,7 +47,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { configShallowCopy := *c if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 { if configShallowCopy.Burst <= 0 { - return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") + return nil, fmt.Errorf("burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0") } configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst) } diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/build.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/build.go index 0ad53f5b5..e9360fcfc 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/build.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/build.go @@ -7,6 +7,7 @@ package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" @@ -25,15 +26,15 @@ type BuildsGetter interface { // BuildInterface has methods to work with Build resources. type BuildInterface interface { - Create(*v1alpha1.Build) (*v1alpha1.Build, error) - Update(*v1alpha1.Build) (*v1alpha1.Build, error) - UpdateStatus(*v1alpha1.Build) (*v1alpha1.Build, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.Build, error) - List(opts v1.ListOptions) (*v1alpha1.BuildList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Build, err error) + Create(ctx context.Context, build *v1alpha1.Build, opts v1.CreateOptions) (*v1alpha1.Build, error) + Update(ctx context.Context, build *v1alpha1.Build, opts v1.UpdateOptions) (*v1alpha1.Build, error) + UpdateStatus(ctx context.Context, build *v1alpha1.Build, opts v1.UpdateOptions) (*v1alpha1.Build, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.Build, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BuildList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Build, err error) BuildExpansion } @@ -52,20 +53,20 @@ func newBuilds(c *BuildV1alpha1Client, namespace string) *builds { } // Get takes name of the build, and returns the corresponding build object, and an error if there is any. -func (c *builds) Get(name string, options v1.GetOptions) (result *v1alpha1.Build, err error) { +func (c *builds) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Build, err error) { result = &v1alpha1.Build{} err = c.client.Get(). Namespace(c.ns). Resource("builds"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of Builds that match those selectors. -func (c *builds) List(opts v1.ListOptions) (result *v1alpha1.BuildList, err error) { +func (c *builds) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BuildList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -76,13 +77,13 @@ func (c *builds) List(opts v1.ListOptions) (result *v1alpha1.BuildList, err erro Resource("builds"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested builds. -func (c *builds) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *builds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -93,87 +94,90 @@ func (c *builds) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("builds"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any. -func (c *builds) Create(build *v1alpha1.Build) (result *v1alpha1.Build, err error) { +func (c *builds) Create(ctx context.Context, build *v1alpha1.Build, opts v1.CreateOptions) (result *v1alpha1.Build, err error) { result = &v1alpha1.Build{} err = c.client.Post(). Namespace(c.ns). Resource("builds"). + VersionedParams(&opts, scheme.ParameterCodec). Body(build). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any. -func (c *builds) Update(build *v1alpha1.Build) (result *v1alpha1.Build, err error) { +func (c *builds) Update(ctx context.Context, build *v1alpha1.Build, opts v1.UpdateOptions) (result *v1alpha1.Build, err error) { result = &v1alpha1.Build{} err = c.client.Put(). Namespace(c.ns). Resource("builds"). Name(build.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(build). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *builds) UpdateStatus(build *v1alpha1.Build) (result *v1alpha1.Build, err error) { +func (c *builds) UpdateStatus(ctx context.Context, build *v1alpha1.Build, opts v1.UpdateOptions) (result *v1alpha1.Build, err error) { result = &v1alpha1.Build{} err = c.client.Put(). Namespace(c.ns). Resource("builds"). Name(build.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(build). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the build and deletes it. Returns an error if one occurs. -func (c *builds) Delete(name string, options *v1.DeleteOptions) error { +func (c *builds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("builds"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *builds) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *builds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("builds"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched build. -func (c *builds) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Build, err error) { +func (c *builds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Build, err error) { result = &v1alpha1.Build{} err = c.client.Patch(pt). Namespace(c.ns). Resource("builds"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildrun.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildrun.go index 201b0c62f..9f1d094e8 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildrun.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildrun.go @@ -7,6 +7,7 @@ package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" @@ -25,15 +26,15 @@ type BuildRunsGetter interface { // BuildRunInterface has methods to work with BuildRun resources. type BuildRunInterface interface { - Create(*v1alpha1.BuildRun) (*v1alpha1.BuildRun, error) - Update(*v1alpha1.BuildRun) (*v1alpha1.BuildRun, error) - UpdateStatus(*v1alpha1.BuildRun) (*v1alpha1.BuildRun, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.BuildRun, error) - List(opts v1.ListOptions) (*v1alpha1.BuildRunList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BuildRun, err error) + Create(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.CreateOptions) (*v1alpha1.BuildRun, error) + Update(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.UpdateOptions) (*v1alpha1.BuildRun, error) + UpdateStatus(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.UpdateOptions) (*v1alpha1.BuildRun, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BuildRun, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BuildRunList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BuildRun, err error) BuildRunExpansion } @@ -52,20 +53,20 @@ func newBuildRuns(c *BuildV1alpha1Client, namespace string) *buildRuns { } // Get takes name of the buildRun, and returns the corresponding buildRun object, and an error if there is any. -func (c *buildRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.BuildRun, err error) { +func (c *buildRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BuildRun, err error) { result = &v1alpha1.BuildRun{} err = c.client.Get(). Namespace(c.ns). Resource("buildruns"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of BuildRuns that match those selectors. -func (c *buildRuns) List(opts v1.ListOptions) (result *v1alpha1.BuildRunList, err error) { +func (c *buildRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BuildRunList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -76,13 +77,13 @@ func (c *buildRuns) List(opts v1.ListOptions) (result *v1alpha1.BuildRunList, er Resource("buildruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested buildRuns. -func (c *buildRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *buildRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -93,87 +94,90 @@ func (c *buildRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("buildruns"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a buildRun and creates it. Returns the server's representation of the buildRun, and an error, if there is any. -func (c *buildRuns) Create(buildRun *v1alpha1.BuildRun) (result *v1alpha1.BuildRun, err error) { +func (c *buildRuns) Create(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.CreateOptions) (result *v1alpha1.BuildRun, err error) { result = &v1alpha1.BuildRun{} err = c.client.Post(). Namespace(c.ns). Resource("buildruns"). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildRun). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a buildRun and updates it. Returns the server's representation of the buildRun, and an error, if there is any. -func (c *buildRuns) Update(buildRun *v1alpha1.BuildRun) (result *v1alpha1.BuildRun, err error) { +func (c *buildRuns) Update(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.UpdateOptions) (result *v1alpha1.BuildRun, err error) { result = &v1alpha1.BuildRun{} err = c.client.Put(). Namespace(c.ns). Resource("buildruns"). Name(buildRun.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildRun). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *buildRuns) UpdateStatus(buildRun *v1alpha1.BuildRun) (result *v1alpha1.BuildRun, err error) { +func (c *buildRuns) UpdateStatus(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.UpdateOptions) (result *v1alpha1.BuildRun, err error) { result = &v1alpha1.BuildRun{} err = c.client.Put(). Namespace(c.ns). Resource("buildruns"). Name(buildRun.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildRun). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the buildRun and deletes it. Returns an error if one occurs. -func (c *buildRuns) Delete(name string, options *v1.DeleteOptions) error { +func (c *buildRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("buildruns"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *buildRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *buildRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("buildruns"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched buildRun. -func (c *buildRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BuildRun, err error) { +func (c *buildRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BuildRun, err error) { result = &v1alpha1.BuildRun{} err = c.client.Patch(pt). Namespace(c.ns). Resource("buildruns"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildstrategy.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildstrategy.go index 5b5567d61..979e3a6f3 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildstrategy.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/buildstrategy.go @@ -7,6 +7,7 @@ package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" @@ -25,15 +26,15 @@ type BuildStrategiesGetter interface { // BuildStrategyInterface has methods to work with BuildStrategy resources. type BuildStrategyInterface interface { - Create(*v1alpha1.BuildStrategy) (*v1alpha1.BuildStrategy, error) - Update(*v1alpha1.BuildStrategy) (*v1alpha1.BuildStrategy, error) - UpdateStatus(*v1alpha1.BuildStrategy) (*v1alpha1.BuildStrategy, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.BuildStrategy, error) - List(opts v1.ListOptions) (*v1alpha1.BuildStrategyList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BuildStrategy, err error) + Create(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.CreateOptions) (*v1alpha1.BuildStrategy, error) + Update(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.UpdateOptions) (*v1alpha1.BuildStrategy, error) + UpdateStatus(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.UpdateOptions) (*v1alpha1.BuildStrategy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.BuildStrategy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.BuildStrategyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BuildStrategy, err error) BuildStrategyExpansion } @@ -52,20 +53,20 @@ func newBuildStrategies(c *BuildV1alpha1Client, namespace string) *buildStrategi } // Get takes name of the buildStrategy, and returns the corresponding buildStrategy object, and an error if there is any. -func (c *buildStrategies) Get(name string, options v1.GetOptions) (result *v1alpha1.BuildStrategy, err error) { +func (c *buildStrategies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BuildStrategy, err error) { result = &v1alpha1.BuildStrategy{} err = c.client.Get(). Namespace(c.ns). Resource("buildstrategies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of BuildStrategies that match those selectors. -func (c *buildStrategies) List(opts v1.ListOptions) (result *v1alpha1.BuildStrategyList, err error) { +func (c *buildStrategies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BuildStrategyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -76,13 +77,13 @@ func (c *buildStrategies) List(opts v1.ListOptions) (result *v1alpha1.BuildStrat Resource("buildstrategies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested buildStrategies. -func (c *buildStrategies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *buildStrategies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -93,87 +94,90 @@ func (c *buildStrategies) Watch(opts v1.ListOptions) (watch.Interface, error) { Resource("buildstrategies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a buildStrategy and creates it. Returns the server's representation of the buildStrategy, and an error, if there is any. -func (c *buildStrategies) Create(buildStrategy *v1alpha1.BuildStrategy) (result *v1alpha1.BuildStrategy, err error) { +func (c *buildStrategies) Create(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.CreateOptions) (result *v1alpha1.BuildStrategy, err error) { result = &v1alpha1.BuildStrategy{} err = c.client.Post(). Namespace(c.ns). Resource("buildstrategies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildStrategy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a buildStrategy and updates it. Returns the server's representation of the buildStrategy, and an error, if there is any. -func (c *buildStrategies) Update(buildStrategy *v1alpha1.BuildStrategy) (result *v1alpha1.BuildStrategy, err error) { +func (c *buildStrategies) Update(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.UpdateOptions) (result *v1alpha1.BuildStrategy, err error) { result = &v1alpha1.BuildStrategy{} err = c.client.Put(). Namespace(c.ns). Resource("buildstrategies"). Name(buildStrategy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildStrategy). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *buildStrategies) UpdateStatus(buildStrategy *v1alpha1.BuildStrategy) (result *v1alpha1.BuildStrategy, err error) { +func (c *buildStrategies) UpdateStatus(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.UpdateOptions) (result *v1alpha1.BuildStrategy, err error) { result = &v1alpha1.BuildStrategy{} err = c.client.Put(). Namespace(c.ns). Resource("buildstrategies"). Name(buildStrategy.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(buildStrategy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the buildStrategy and deletes it. Returns an error if one occurs. -func (c *buildStrategies) Delete(name string, options *v1.DeleteOptions) error { +func (c *buildStrategies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("buildstrategies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *buildStrategies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *buildStrategies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Namespace(c.ns). Resource("buildstrategies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched buildStrategy. -func (c *buildStrategies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BuildStrategy, err error) { +func (c *buildStrategies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BuildStrategy, err error) { result = &v1alpha1.BuildStrategy{} err = c.client.Patch(pt). Namespace(c.ns). Resource("buildstrategies"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/clusterbuildstrategy.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/clusterbuildstrategy.go index b46ecf41c..f4ea69da5 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/clusterbuildstrategy.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/clusterbuildstrategy.go @@ -7,6 +7,7 @@ package v1alpha1 import ( + "context" "time" v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" @@ -25,15 +26,15 @@ type ClusterBuildStrategiesGetter interface { // ClusterBuildStrategyInterface has methods to work with ClusterBuildStrategy resources. type ClusterBuildStrategyInterface interface { - Create(*v1alpha1.ClusterBuildStrategy) (*v1alpha1.ClusterBuildStrategy, error) - Update(*v1alpha1.ClusterBuildStrategy) (*v1alpha1.ClusterBuildStrategy, error) - UpdateStatus(*v1alpha1.ClusterBuildStrategy) (*v1alpha1.ClusterBuildStrategy, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.ClusterBuildStrategy, error) - List(opts v1.ListOptions) (*v1alpha1.ClusterBuildStrategyList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterBuildStrategy, err error) + Create(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.CreateOptions) (*v1alpha1.ClusterBuildStrategy, error) + Update(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.UpdateOptions) (*v1alpha1.ClusterBuildStrategy, error) + UpdateStatus(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.UpdateOptions) (*v1alpha1.ClusterBuildStrategy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterBuildStrategy, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterBuildStrategyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterBuildStrategy, err error) ClusterBuildStrategyExpansion } @@ -50,19 +51,19 @@ func newClusterBuildStrategies(c *BuildV1alpha1Client) *clusterBuildStrategies { } // Get takes name of the clusterBuildStrategy, and returns the corresponding clusterBuildStrategy object, and an error if there is any. -func (c *clusterBuildStrategies) Get(name string, options v1.GetOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *clusterBuildStrategies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { result = &v1alpha1.ClusterBuildStrategy{} err = c.client.Get(). Resource("clusterbuildstrategies"). Name(name). VersionedParams(&options, scheme.ParameterCodec). - Do(). + Do(ctx). Into(result) return } // List takes label and field selectors, and returns the list of ClusterBuildStrategies that match those selectors. -func (c *clusterBuildStrategies) List(opts v1.ListOptions) (result *v1alpha1.ClusterBuildStrategyList, err error) { +func (c *clusterBuildStrategies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterBuildStrategyList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -72,13 +73,13 @@ func (c *clusterBuildStrategies) List(opts v1.ListOptions) (result *v1alpha1.Clu Resource("clusterbuildstrategies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Do(). + Do(ctx). Into(result) return } // Watch returns a watch.Interface that watches the requested clusterBuildStrategies. -func (c *clusterBuildStrategies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *clusterBuildStrategies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second @@ -88,81 +89,84 @@ func (c *clusterBuildStrategies) Watch(opts v1.ListOptions) (watch.Interface, er Resource("clusterbuildstrategies"). VersionedParams(&opts, scheme.ParameterCodec). Timeout(timeout). - Watch() + Watch(ctx) } // Create takes the representation of a clusterBuildStrategy and creates it. Returns the server's representation of the clusterBuildStrategy, and an error, if there is any. -func (c *clusterBuildStrategies) Create(clusterBuildStrategy *v1alpha1.ClusterBuildStrategy) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *clusterBuildStrategies) Create(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.CreateOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { result = &v1alpha1.ClusterBuildStrategy{} err = c.client.Post(). Resource("clusterbuildstrategies"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterBuildStrategy). - Do(). + Do(ctx). Into(result) return } // Update takes the representation of a clusterBuildStrategy and updates it. Returns the server's representation of the clusterBuildStrategy, and an error, if there is any. -func (c *clusterBuildStrategies) Update(clusterBuildStrategy *v1alpha1.ClusterBuildStrategy) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *clusterBuildStrategies) Update(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.UpdateOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { result = &v1alpha1.ClusterBuildStrategy{} err = c.client.Put(). Resource("clusterbuildstrategies"). Name(clusterBuildStrategy.Name). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterBuildStrategy). - Do(). + Do(ctx). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). - -func (c *clusterBuildStrategies) UpdateStatus(clusterBuildStrategy *v1alpha1.ClusterBuildStrategy) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *clusterBuildStrategies) UpdateStatus(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.UpdateOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { result = &v1alpha1.ClusterBuildStrategy{} err = c.client.Put(). Resource("clusterbuildstrategies"). Name(clusterBuildStrategy.Name). SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). Body(clusterBuildStrategy). - Do(). + Do(ctx). Into(result) return } // Delete takes name of the clusterBuildStrategy and deletes it. Returns an error if one occurs. -func (c *clusterBuildStrategies) Delete(name string, options *v1.DeleteOptions) error { +func (c *clusterBuildStrategies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { return c.client.Delete(). Resource("clusterbuildstrategies"). Name(name). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // DeleteCollection deletes a collection of objects. -func (c *clusterBuildStrategies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { +func (c *clusterBuildStrategies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { var timeout time.Duration - if listOptions.TimeoutSeconds != nil { - timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second } return c.client.Delete(). Resource("clusterbuildstrategies"). - VersionedParams(&listOptions, scheme.ParameterCodec). + VersionedParams(&listOpts, scheme.ParameterCodec). Timeout(timeout). - Body(options). - Do(). + Body(&opts). + Do(ctx). Error() } // Patch applies the patch and returns the patched clusterBuildStrategy. -func (c *clusterBuildStrategies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *clusterBuildStrategies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterBuildStrategy, err error) { result = &v1alpha1.ClusterBuildStrategy{} err = c.client.Patch(pt). Resource("clusterbuildstrategies"). - SubResource(subresources...). Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). Body(data). - Do(). + Do(ctx). Into(result) return } diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_build.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_build.go index e31f2a459..3d189f3a3 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_build.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_build.go @@ -7,6 +7,8 @@ package fake import ( + "context" + v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -27,7 +29,7 @@ var buildsResource = schema.GroupVersionResource{Group: "build.dev", Version: "v var buildsKind = schema.GroupVersionKind{Group: "build.dev", Version: "v1alpha1", Kind: "Build"} // Get takes name of the build, and returns the corresponding build object, and an error if there is any. -func (c *FakeBuilds) Get(name string, options v1.GetOptions) (result *v1alpha1.Build, err error) { +func (c *FakeBuilds) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.Build, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(buildsResource, c.ns, name), &v1alpha1.Build{}) @@ -38,7 +40,7 @@ func (c *FakeBuilds) Get(name string, options v1.GetOptions) (result *v1alpha1.B } // List takes label and field selectors, and returns the list of Builds that match those selectors. -func (c *FakeBuilds) List(opts v1.ListOptions) (result *v1alpha1.BuildList, err error) { +func (c *FakeBuilds) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BuildList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(buildsResource, buildsKind, c.ns, opts), &v1alpha1.BuildList{}) @@ -60,14 +62,14 @@ func (c *FakeBuilds) List(opts v1.ListOptions) (result *v1alpha1.BuildList, err } // Watch returns a watch.Interface that watches the requested builds. -func (c *FakeBuilds) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeBuilds) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(buildsResource, c.ns, opts)) } // Create takes the representation of a build and creates it. Returns the server's representation of the build, and an error, if there is any. -func (c *FakeBuilds) Create(build *v1alpha1.Build) (result *v1alpha1.Build, err error) { +func (c *FakeBuilds) Create(ctx context.Context, build *v1alpha1.Build, opts v1.CreateOptions) (result *v1alpha1.Build, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(buildsResource, c.ns, build), &v1alpha1.Build{}) @@ -78,7 +80,7 @@ func (c *FakeBuilds) Create(build *v1alpha1.Build) (result *v1alpha1.Build, err } // Update takes the representation of a build and updates it. Returns the server's representation of the build, and an error, if there is any. -func (c *FakeBuilds) Update(build *v1alpha1.Build) (result *v1alpha1.Build, err error) { +func (c *FakeBuilds) Update(ctx context.Context, build *v1alpha1.Build, opts v1.UpdateOptions) (result *v1alpha1.Build, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(buildsResource, c.ns, build), &v1alpha1.Build{}) @@ -90,7 +92,7 @@ func (c *FakeBuilds) Update(build *v1alpha1.Build) (result *v1alpha1.Build, err // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBuilds) UpdateStatus(build *v1alpha1.Build) (*v1alpha1.Build, error) { +func (c *FakeBuilds) UpdateStatus(ctx context.Context, build *v1alpha1.Build, opts v1.UpdateOptions) (*v1alpha1.Build, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(buildsResource, "status", c.ns, build), &v1alpha1.Build{}) @@ -101,7 +103,7 @@ func (c *FakeBuilds) UpdateStatus(build *v1alpha1.Build) (*v1alpha1.Build, error } // Delete takes name of the build and deletes it. Returns an error if one occurs. -func (c *FakeBuilds) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeBuilds) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(buildsResource, c.ns, name), &v1alpha1.Build{}) @@ -109,15 +111,15 @@ func (c *FakeBuilds) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeBuilds) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(buildsResource, c.ns, listOptions) +func (c *FakeBuilds) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(buildsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BuildList{}) return err } // Patch applies the patch and returns the patched build. -func (c *FakeBuilds) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Build, err error) { +func (c *FakeBuilds) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.Build, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(buildsResource, c.ns, name, pt, data, subresources...), &v1alpha1.Build{}) diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildrun.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildrun.go index 157182456..3f03d3ab9 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildrun.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildrun.go @@ -7,6 +7,8 @@ package fake import ( + "context" + v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -27,7 +29,7 @@ var buildrunsResource = schema.GroupVersionResource{Group: "build.dev", Version: var buildrunsKind = schema.GroupVersionKind{Group: "build.dev", Version: "v1alpha1", Kind: "BuildRun"} // Get takes name of the buildRun, and returns the corresponding buildRun object, and an error if there is any. -func (c *FakeBuildRuns) Get(name string, options v1.GetOptions) (result *v1alpha1.BuildRun, err error) { +func (c *FakeBuildRuns) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BuildRun, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(buildrunsResource, c.ns, name), &v1alpha1.BuildRun{}) @@ -38,7 +40,7 @@ func (c *FakeBuildRuns) Get(name string, options v1.GetOptions) (result *v1alpha } // List takes label and field selectors, and returns the list of BuildRuns that match those selectors. -func (c *FakeBuildRuns) List(opts v1.ListOptions) (result *v1alpha1.BuildRunList, err error) { +func (c *FakeBuildRuns) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BuildRunList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(buildrunsResource, buildrunsKind, c.ns, opts), &v1alpha1.BuildRunList{}) @@ -60,14 +62,14 @@ func (c *FakeBuildRuns) List(opts v1.ListOptions) (result *v1alpha1.BuildRunList } // Watch returns a watch.Interface that watches the requested buildRuns. -func (c *FakeBuildRuns) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeBuildRuns) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(buildrunsResource, c.ns, opts)) } // Create takes the representation of a buildRun and creates it. Returns the server's representation of the buildRun, and an error, if there is any. -func (c *FakeBuildRuns) Create(buildRun *v1alpha1.BuildRun) (result *v1alpha1.BuildRun, err error) { +func (c *FakeBuildRuns) Create(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.CreateOptions) (result *v1alpha1.BuildRun, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(buildrunsResource, c.ns, buildRun), &v1alpha1.BuildRun{}) @@ -78,7 +80,7 @@ func (c *FakeBuildRuns) Create(buildRun *v1alpha1.BuildRun) (result *v1alpha1.Bu } // Update takes the representation of a buildRun and updates it. Returns the server's representation of the buildRun, and an error, if there is any. -func (c *FakeBuildRuns) Update(buildRun *v1alpha1.BuildRun) (result *v1alpha1.BuildRun, err error) { +func (c *FakeBuildRuns) Update(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.UpdateOptions) (result *v1alpha1.BuildRun, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(buildrunsResource, c.ns, buildRun), &v1alpha1.BuildRun{}) @@ -90,7 +92,7 @@ func (c *FakeBuildRuns) Update(buildRun *v1alpha1.BuildRun) (result *v1alpha1.Bu // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBuildRuns) UpdateStatus(buildRun *v1alpha1.BuildRun) (*v1alpha1.BuildRun, error) { +func (c *FakeBuildRuns) UpdateStatus(ctx context.Context, buildRun *v1alpha1.BuildRun, opts v1.UpdateOptions) (*v1alpha1.BuildRun, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(buildrunsResource, "status", c.ns, buildRun), &v1alpha1.BuildRun{}) @@ -101,7 +103,7 @@ func (c *FakeBuildRuns) UpdateStatus(buildRun *v1alpha1.BuildRun) (*v1alpha1.Bui } // Delete takes name of the buildRun and deletes it. Returns an error if one occurs. -func (c *FakeBuildRuns) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeBuildRuns) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(buildrunsResource, c.ns, name), &v1alpha1.BuildRun{}) @@ -109,15 +111,15 @@ func (c *FakeBuildRuns) Delete(name string, options *v1.DeleteOptions) error { } // DeleteCollection deletes a collection of objects. -func (c *FakeBuildRuns) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(buildrunsResource, c.ns, listOptions) +func (c *FakeBuildRuns) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(buildrunsResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BuildRunList{}) return err } // Patch applies the patch and returns the patched buildRun. -func (c *FakeBuildRuns) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BuildRun, err error) { +func (c *FakeBuildRuns) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BuildRun, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(buildrunsResource, c.ns, name, pt, data, subresources...), &v1alpha1.BuildRun{}) diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildstrategy.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildstrategy.go index ad440091c..e7fbb5cad 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildstrategy.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_buildstrategy.go @@ -7,6 +7,8 @@ package fake import ( + "context" + v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -27,7 +29,7 @@ var buildstrategiesResource = schema.GroupVersionResource{Group: "build.dev", Ve var buildstrategiesKind = schema.GroupVersionKind{Group: "build.dev", Version: "v1alpha1", Kind: "BuildStrategy"} // Get takes name of the buildStrategy, and returns the corresponding buildStrategy object, and an error if there is any. -func (c *FakeBuildStrategies) Get(name string, options v1.GetOptions) (result *v1alpha1.BuildStrategy, err error) { +func (c *FakeBuildStrategies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.BuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewGetAction(buildstrategiesResource, c.ns, name), &v1alpha1.BuildStrategy{}) @@ -38,7 +40,7 @@ func (c *FakeBuildStrategies) Get(name string, options v1.GetOptions) (result *v } // List takes label and field selectors, and returns the list of BuildStrategies that match those selectors. -func (c *FakeBuildStrategies) List(opts v1.ListOptions) (result *v1alpha1.BuildStrategyList, err error) { +func (c *FakeBuildStrategies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.BuildStrategyList, err error) { obj, err := c.Fake. Invokes(testing.NewListAction(buildstrategiesResource, buildstrategiesKind, c.ns, opts), &v1alpha1.BuildStrategyList{}) @@ -60,14 +62,14 @@ func (c *FakeBuildStrategies) List(opts v1.ListOptions) (result *v1alpha1.BuildS } // Watch returns a watch.Interface that watches the requested buildStrategies. -func (c *FakeBuildStrategies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeBuildStrategies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewWatchAction(buildstrategiesResource, c.ns, opts)) } // Create takes the representation of a buildStrategy and creates it. Returns the server's representation of the buildStrategy, and an error, if there is any. -func (c *FakeBuildStrategies) Create(buildStrategy *v1alpha1.BuildStrategy) (result *v1alpha1.BuildStrategy, err error) { +func (c *FakeBuildStrategies) Create(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.CreateOptions) (result *v1alpha1.BuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewCreateAction(buildstrategiesResource, c.ns, buildStrategy), &v1alpha1.BuildStrategy{}) @@ -78,7 +80,7 @@ func (c *FakeBuildStrategies) Create(buildStrategy *v1alpha1.BuildStrategy) (res } // Update takes the representation of a buildStrategy and updates it. Returns the server's representation of the buildStrategy, and an error, if there is any. -func (c *FakeBuildStrategies) Update(buildStrategy *v1alpha1.BuildStrategy) (result *v1alpha1.BuildStrategy, err error) { +func (c *FakeBuildStrategies) Update(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.UpdateOptions) (result *v1alpha1.BuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewUpdateAction(buildstrategiesResource, c.ns, buildStrategy), &v1alpha1.BuildStrategy{}) @@ -90,7 +92,7 @@ func (c *FakeBuildStrategies) Update(buildStrategy *v1alpha1.BuildStrategy) (res // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeBuildStrategies) UpdateStatus(buildStrategy *v1alpha1.BuildStrategy) (*v1alpha1.BuildStrategy, error) { +func (c *FakeBuildStrategies) UpdateStatus(ctx context.Context, buildStrategy *v1alpha1.BuildStrategy, opts v1.UpdateOptions) (*v1alpha1.BuildStrategy, error) { obj, err := c.Fake. Invokes(testing.NewUpdateSubresourceAction(buildstrategiesResource, "status", c.ns, buildStrategy), &v1alpha1.BuildStrategy{}) @@ -101,7 +103,7 @@ func (c *FakeBuildStrategies) UpdateStatus(buildStrategy *v1alpha1.BuildStrategy } // Delete takes name of the buildStrategy and deletes it. Returns an error if one occurs. -func (c *FakeBuildStrategies) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeBuildStrategies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewDeleteAction(buildstrategiesResource, c.ns, name), &v1alpha1.BuildStrategy{}) @@ -109,15 +111,15 @@ func (c *FakeBuildStrategies) Delete(name string, options *v1.DeleteOptions) err } // DeleteCollection deletes a collection of objects. -func (c *FakeBuildStrategies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewDeleteCollectionAction(buildstrategiesResource, c.ns, listOptions) +func (c *FakeBuildStrategies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(buildstrategiesResource, c.ns, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.BuildStrategyList{}) return err } // Patch applies the patch and returns the patched buildStrategy. -func (c *FakeBuildStrategies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.BuildStrategy, err error) { +func (c *FakeBuildStrategies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.BuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(buildstrategiesResource, c.ns, name, pt, data, subresources...), &v1alpha1.BuildStrategy{}) diff --git a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_clusterbuildstrategy.go b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_clusterbuildstrategy.go index fb8f2a3d1..39101b53d 100644 --- a/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_clusterbuildstrategy.go +++ b/pkg/client/build/clientset/versioned/typed/build/v1alpha1/fake/fake_clusterbuildstrategy.go @@ -7,6 +7,8 @@ package fake import ( + "context" + v1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" @@ -26,7 +28,7 @@ var clusterbuildstrategiesResource = schema.GroupVersionResource{Group: "build.d var clusterbuildstrategiesKind = schema.GroupVersionKind{Group: "build.dev", Version: "v1alpha1", Kind: "ClusterBuildStrategy"} // Get takes name of the clusterBuildStrategy, and returns the corresponding clusterBuildStrategy object, and an error if there is any. -func (c *FakeClusterBuildStrategies) Get(name string, options v1.GetOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *FakeClusterBuildStrategies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewRootGetAction(clusterbuildstrategiesResource, name), &v1alpha1.ClusterBuildStrategy{}) if obj == nil { @@ -36,7 +38,7 @@ func (c *FakeClusterBuildStrategies) Get(name string, options v1.GetOptions) (re } // List takes label and field selectors, and returns the list of ClusterBuildStrategies that match those selectors. -func (c *FakeClusterBuildStrategies) List(opts v1.ListOptions) (result *v1alpha1.ClusterBuildStrategyList, err error) { +func (c *FakeClusterBuildStrategies) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterBuildStrategyList, err error) { obj, err := c.Fake. Invokes(testing.NewRootListAction(clusterbuildstrategiesResource, clusterbuildstrategiesKind, opts), &v1alpha1.ClusterBuildStrategyList{}) if obj == nil { @@ -57,13 +59,13 @@ func (c *FakeClusterBuildStrategies) List(opts v1.ListOptions) (result *v1alpha1 } // Watch returns a watch.Interface that watches the requested clusterBuildStrategies. -func (c *FakeClusterBuildStrategies) Watch(opts v1.ListOptions) (watch.Interface, error) { +func (c *FakeClusterBuildStrategies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { return c.Fake. InvokesWatch(testing.NewRootWatchAction(clusterbuildstrategiesResource, opts)) } // Create takes the representation of a clusterBuildStrategy and creates it. Returns the server's representation of the clusterBuildStrategy, and an error, if there is any. -func (c *FakeClusterBuildStrategies) Create(clusterBuildStrategy *v1alpha1.ClusterBuildStrategy) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *FakeClusterBuildStrategies) Create(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.CreateOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewRootCreateAction(clusterbuildstrategiesResource, clusterBuildStrategy), &v1alpha1.ClusterBuildStrategy{}) if obj == nil { @@ -73,7 +75,7 @@ func (c *FakeClusterBuildStrategies) Create(clusterBuildStrategy *v1alpha1.Clust } // Update takes the representation of a clusterBuildStrategy and updates it. Returns the server's representation of the clusterBuildStrategy, and an error, if there is any. -func (c *FakeClusterBuildStrategies) Update(clusterBuildStrategy *v1alpha1.ClusterBuildStrategy) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *FakeClusterBuildStrategies) Update(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.UpdateOptions) (result *v1alpha1.ClusterBuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewRootUpdateAction(clusterbuildstrategiesResource, clusterBuildStrategy), &v1alpha1.ClusterBuildStrategy{}) if obj == nil { @@ -84,7 +86,7 @@ func (c *FakeClusterBuildStrategies) Update(clusterBuildStrategy *v1alpha1.Clust // UpdateStatus was generated because the type contains a Status member. // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). -func (c *FakeClusterBuildStrategies) UpdateStatus(clusterBuildStrategy *v1alpha1.ClusterBuildStrategy) (*v1alpha1.ClusterBuildStrategy, error) { +func (c *FakeClusterBuildStrategies) UpdateStatus(ctx context.Context, clusterBuildStrategy *v1alpha1.ClusterBuildStrategy, opts v1.UpdateOptions) (*v1alpha1.ClusterBuildStrategy, error) { obj, err := c.Fake. Invokes(testing.NewRootUpdateSubresourceAction(clusterbuildstrategiesResource, "status", clusterBuildStrategy), &v1alpha1.ClusterBuildStrategy{}) if obj == nil { @@ -94,22 +96,22 @@ func (c *FakeClusterBuildStrategies) UpdateStatus(clusterBuildStrategy *v1alpha1 } // Delete takes name of the clusterBuildStrategy and deletes it. Returns an error if one occurs. -func (c *FakeClusterBuildStrategies) Delete(name string, options *v1.DeleteOptions) error { +func (c *FakeClusterBuildStrategies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { _, err := c.Fake. Invokes(testing.NewRootDeleteAction(clusterbuildstrategiesResource, name), &v1alpha1.ClusterBuildStrategy{}) return err } // DeleteCollection deletes a collection of objects. -func (c *FakeClusterBuildStrategies) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(clusterbuildstrategiesResource, listOptions) +func (c *FakeClusterBuildStrategies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterbuildstrategiesResource, listOpts) _, err := c.Fake.Invokes(action, &v1alpha1.ClusterBuildStrategyList{}) return err } // Patch applies the patch and returns the patched clusterBuildStrategy. -func (c *FakeClusterBuildStrategies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterBuildStrategy, err error) { +func (c *FakeClusterBuildStrategies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterBuildStrategy, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(clusterbuildstrategiesResource, name, pt, data, subresources...), &v1alpha1.ClusterBuildStrategy{}) if obj == nil { diff --git a/pkg/controller/fakes/manager.go b/pkg/controller/fakes/manager.go index 45f771e25..0185098a2 100644 --- a/pkg/controller/fakes/manager.go +++ b/pkg/controller/fakes/manager.go @@ -5,6 +5,7 @@ package fakes import ( + "net/http" "sync" "k8s.io/apimachinery/pkg/api/meta" @@ -42,6 +43,18 @@ type FakeManager struct { addHealthzCheckReturnsOnCall map[int]struct { result1 error } + AddMetricsExtraHandlerStub func(string, http.Handler) error + addMetricsExtraHandlerMutex sync.RWMutex + addMetricsExtraHandlerArgsForCall []struct { + arg1 string + arg2 http.Handler + } + addMetricsExtraHandlerReturns struct { + result1 error + } + addMetricsExtraHandlerReturnsOnCall map[int]struct { + result1 error + } AddReadyzCheckStub func(string, healthz.Checker) error addReadyzCheckMutex sync.RWMutex addReadyzCheckArgsForCall []struct { @@ -54,6 +67,16 @@ type FakeManager struct { addReadyzCheckReturnsOnCall map[int]struct { result1 error } + ElectedStub func() <-chan struct{} + electedMutex sync.RWMutex + electedArgsForCall []struct { + } + electedReturns struct { + result1 <-chan struct{} + } + electedReturnsOnCall map[int]struct { + result1 <-chan struct{} + } GetAPIReaderStub func() client.Reader getAPIReaderMutex sync.RWMutex getAPIReaderArgsForCall []struct { @@ -294,6 +317,68 @@ func (fake *FakeManager) AddHealthzCheckReturnsOnCall(i int, result1 error) { }{result1} } +func (fake *FakeManager) AddMetricsExtraHandler(arg1 string, arg2 http.Handler) error { + fake.addMetricsExtraHandlerMutex.Lock() + ret, specificReturn := fake.addMetricsExtraHandlerReturnsOnCall[len(fake.addMetricsExtraHandlerArgsForCall)] + fake.addMetricsExtraHandlerArgsForCall = append(fake.addMetricsExtraHandlerArgsForCall, struct { + arg1 string + arg2 http.Handler + }{arg1, arg2}) + stub := fake.AddMetricsExtraHandlerStub + fakeReturns := fake.addMetricsExtraHandlerReturns + fake.recordInvocation("AddMetricsExtraHandler", []interface{}{arg1, arg2}) + fake.addMetricsExtraHandlerMutex.Unlock() + if stub != nil { + return stub(arg1, arg2) + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeManager) AddMetricsExtraHandlerCallCount() int { + fake.addMetricsExtraHandlerMutex.RLock() + defer fake.addMetricsExtraHandlerMutex.RUnlock() + return len(fake.addMetricsExtraHandlerArgsForCall) +} + +func (fake *FakeManager) AddMetricsExtraHandlerCalls(stub func(string, http.Handler) error) { + fake.addMetricsExtraHandlerMutex.Lock() + defer fake.addMetricsExtraHandlerMutex.Unlock() + fake.AddMetricsExtraHandlerStub = stub +} + +func (fake *FakeManager) AddMetricsExtraHandlerArgsForCall(i int) (string, http.Handler) { + fake.addMetricsExtraHandlerMutex.RLock() + defer fake.addMetricsExtraHandlerMutex.RUnlock() + argsForCall := fake.addMetricsExtraHandlerArgsForCall[i] + return argsForCall.arg1, argsForCall.arg2 +} + +func (fake *FakeManager) AddMetricsExtraHandlerReturns(result1 error) { + fake.addMetricsExtraHandlerMutex.Lock() + defer fake.addMetricsExtraHandlerMutex.Unlock() + fake.AddMetricsExtraHandlerStub = nil + fake.addMetricsExtraHandlerReturns = struct { + result1 error + }{result1} +} + +func (fake *FakeManager) AddMetricsExtraHandlerReturnsOnCall(i int, result1 error) { + fake.addMetricsExtraHandlerMutex.Lock() + defer fake.addMetricsExtraHandlerMutex.Unlock() + fake.AddMetricsExtraHandlerStub = nil + if fake.addMetricsExtraHandlerReturnsOnCall == nil { + fake.addMetricsExtraHandlerReturnsOnCall = make(map[int]struct { + result1 error + }) + } + fake.addMetricsExtraHandlerReturnsOnCall[i] = struct { + result1 error + }{result1} +} + func (fake *FakeManager) AddReadyzCheck(arg1 string, arg2 healthz.Checker) error { fake.addReadyzCheckMutex.Lock() ret, specificReturn := fake.addReadyzCheckReturnsOnCall[len(fake.addReadyzCheckArgsForCall)] @@ -356,6 +441,59 @@ func (fake *FakeManager) AddReadyzCheckReturnsOnCall(i int, result1 error) { }{result1} } +func (fake *FakeManager) Elected() <-chan struct{} { + fake.electedMutex.Lock() + ret, specificReturn := fake.electedReturnsOnCall[len(fake.electedArgsForCall)] + fake.electedArgsForCall = append(fake.electedArgsForCall, struct { + }{}) + stub := fake.ElectedStub + fakeReturns := fake.electedReturns + fake.recordInvocation("Elected", []interface{}{}) + fake.electedMutex.Unlock() + if stub != nil { + return stub() + } + if specificReturn { + return ret.result1 + } + return fakeReturns.result1 +} + +func (fake *FakeManager) ElectedCallCount() int { + fake.electedMutex.RLock() + defer fake.electedMutex.RUnlock() + return len(fake.electedArgsForCall) +} + +func (fake *FakeManager) ElectedCalls(stub func() <-chan struct{}) { + fake.electedMutex.Lock() + defer fake.electedMutex.Unlock() + fake.ElectedStub = stub +} + +func (fake *FakeManager) ElectedReturns(result1 <-chan struct{}) { + fake.electedMutex.Lock() + defer fake.electedMutex.Unlock() + fake.ElectedStub = nil + fake.electedReturns = struct { + result1 <-chan struct{} + }{result1} +} + +func (fake *FakeManager) ElectedReturnsOnCall(i int, result1 <-chan struct{}) { + fake.electedMutex.Lock() + defer fake.electedMutex.Unlock() + fake.ElectedStub = nil + if fake.electedReturnsOnCall == nil { + fake.electedReturnsOnCall = make(map[int]struct { + result1 <-chan struct{} + }) + } + fake.electedReturnsOnCall[i] = struct { + result1 <-chan struct{} + }{result1} +} + func (fake *FakeManager) GetAPIReader() client.Reader { fake.getAPIReaderMutex.Lock() ret, specificReturn := fake.getAPIReaderReturnsOnCall[len(fake.getAPIReaderArgsForCall)] @@ -970,8 +1108,12 @@ func (fake *FakeManager) Invocations() map[string][][]interface{} { defer fake.addMutex.RUnlock() fake.addHealthzCheckMutex.RLock() defer fake.addHealthzCheckMutex.RUnlock() + fake.addMetricsExtraHandlerMutex.RLock() + defer fake.addMetricsExtraHandlerMutex.RUnlock() fake.addReadyzCheckMutex.RLock() defer fake.addReadyzCheckMutex.RUnlock() + fake.electedMutex.RLock() + defer fake.electedMutex.RUnlock() fake.getAPIReaderMutex.RLock() defer fake.getAPIReaderMutex.RUnlock() fake.getCacheMutex.RLock() From ff935ee78343b04e2d2cb3aa120b8c4db1df5760 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Mon, 2 Nov 2020 18:08:04 -0500 Subject: [PATCH 3/6] update integration tests - Add context to all client calls - Add additional client options --- test/e2e/samples.go | 2 +- test/integration/utils/buildruns.go | 18 ++++++++++-------- test/integration/utils/builds.go | 10 ++++++---- test/integration/utils/buildstrategies.go | 10 ++++++++-- .../utils/clusterbuildstrategies.go | 6 ++++-- test/integration/utils/namespaces.go | 6 ++++-- test/integration/utils/secrets.go | 5 ++++- test/integration/utils/service_accounts.go | 10 ++++++---- 8 files changed, 43 insertions(+), 24 deletions(-) diff --git a/test/e2e/samples.go b/test/e2e/samples.go index 0cf19dc47..740619ce7 100644 --- a/test/e2e/samples.go +++ b/test/e2e/samples.go @@ -192,7 +192,7 @@ func printTestFailureDebugInfo(namespace string, buildRunName string) { Follow: false, }) - podLogs, err := req.Stream() + podLogs, err := req.Stream(context.TODO()) if err != nil { Logf("Failed to retrieve the logs of container %s: %v", container.Name, err) continue diff --git a/test/integration/utils/buildruns.go b/test/integration/utils/buildruns.go index d1a2f4c7c..a8ee1b1e6 100644 --- a/test/integration/utils/buildruns.go +++ b/test/integration/utils/buildruns.go @@ -5,6 +5,8 @@ package utils import ( + "context" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" @@ -18,7 +20,7 @@ import ( func (t *TestBuild) CreateBR(buildRun *v1alpha1.BuildRun) error { brInterface := t.BuildClientSet.BuildV1alpha1().BuildRuns(t.Namespace) - _, err := brInterface.Create(buildRun) + _, err := brInterface.Create(context.TODO(), buildRun, metav1.CreateOptions{}) if err != nil { return err } @@ -29,7 +31,7 @@ func (t *TestBuild) CreateBR(buildRun *v1alpha1.BuildRun) error { func (t *TestBuild) GetBR(name string) (*v1alpha1.BuildRun, error) { brInterface := t.BuildClientSet.BuildV1alpha1().BuildRuns(t.Namespace) - br, err := brInterface.Get(name, metav1.GetOptions{}) + br, err := brInterface.Get(context.TODO(), name, metav1.GetOptions{}) if err != nil { return nil, err } @@ -40,7 +42,7 @@ func (t *TestBuild) GetBR(name string) (*v1alpha1.BuildRun, error) { func (t *TestBuild) DeleteBR(name string) error { brInterface := t.BuildClientSet.BuildV1alpha1().BuildRuns(t.Namespace) - if err := brInterface.Delete(name, &metav1.DeleteOptions{}); err != nil { + if err := brInterface.Delete(context.TODO(), name, metav1.DeleteOptions{}); err != nil { return err } @@ -66,7 +68,7 @@ func (t *TestBuild) GetBRTillCompletion(name string) (*v1alpha1.BuildRun, error) bInterface := t.BuildClientSet.BuildV1alpha1().BuildRuns(t.Namespace) - buildRun, err := bInterface.Get(name, metav1.GetOptions{}) + buildRun, err := bInterface.Get(context.TODO(), name, metav1.GetOptions{}) if err != nil && !apierrors.IsNotFound(err) { return false, err } @@ -85,7 +87,7 @@ func (t *TestBuild) GetBRTillCompletion(name string) (*v1alpha1.BuildRun, error) return nil, err } - return brInterface.Get(name, metav1.GetOptions{}) + return brInterface.Get(context.TODO(), name, metav1.GetOptions{}) } // GetBRTillStartTime returns a BuildRun that have a StartTime set. @@ -98,7 +100,7 @@ func (t *TestBuild) GetBRTillStartTime(name string) (*v1alpha1.BuildRun, error) bInterface := t.BuildClientSet.BuildV1alpha1().BuildRuns(t.Namespace) - buildRun, err := bInterface.Get(name, metav1.GetOptions{}) + buildRun, err := bInterface.Get(context.TODO(), name, metav1.GetOptions{}) if err != nil && !apierrors.IsNotFound(err) { return false, err } @@ -117,7 +119,7 @@ func (t *TestBuild) GetBRTillStartTime(name string) (*v1alpha1.BuildRun, error) return nil, err } - return brInterface.Get(name, metav1.GetOptions{}) + return brInterface.Get(context.TODO(), name, metav1.GetOptions{}) } // GetBRTillDesiredReason polls until a BuildRun gets a particular Reason @@ -156,7 +158,7 @@ func (t *TestBuild) GetBRTillDeletion(name string) (bool, error) { bInterface := t.BuildClientSet.BuildV1alpha1().BuildRuns(t.Namespace) - _, err := bInterface.Get(name, metav1.GetOptions{}) + _, err := bInterface.Get(context.TODO(), name, metav1.GetOptions{}) if apierrors.IsNotFound(err) { return true, nil } diff --git a/test/integration/utils/builds.go b/test/integration/utils/builds.go index 4c14ea9e2..08ba9fa60 100644 --- a/test/integration/utils/builds.go +++ b/test/integration/utils/builds.go @@ -5,6 +5,8 @@ package utils import ( + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -17,7 +19,7 @@ import ( func (t *TestBuild) CreateBuild(build *v1alpha1.Build) error { bInterface := t.BuildClientSet.BuildV1alpha1().Builds(t.Namespace) - _, err := bInterface.Create(build) + _, err := bInterface.Create(context.TODO(), build, metav1.CreateOptions{}) return err } @@ -25,7 +27,7 @@ func (t *TestBuild) CreateBuild(build *v1alpha1.Build) error { func (t *TestBuild) DeleteBuild(name string) error { bInterface := t.BuildClientSet.BuildV1alpha1().Builds(t.Namespace) - err := bInterface.Delete(name, &metav1.DeleteOptions{}) + err := bInterface.Delete(context.TODO(), name, metav1.DeleteOptions{}) return err } @@ -35,7 +37,7 @@ func (t *TestBuild) GetBuild(name string) (*v1alpha1.Build, error) { return t.BuildClientSet. BuildV1alpha1(). Builds(t.Namespace). - Get(name, metav1.GetOptions{}) + Get(context.TODO(), name, metav1.GetOptions{}) } // PatchBuild patches an existing Build using the merge patch type @@ -46,7 +48,7 @@ func (t *TestBuild) PatchBuild(buildName string, data []byte) (*v1alpha1.Build, // PatchBuildWithPatchType patches an existing Build and allows specifying the patch type func (t *TestBuild) PatchBuildWithPatchType(buildName string, data []byte, pt types.PatchType) (*v1alpha1.Build, error) { bInterface := t.BuildClientSet.BuildV1alpha1().Builds(t.Namespace) - b, err := bInterface.Patch(buildName, pt, data) + b, err := bInterface.Patch(context.TODO(), buildName, pt, data, metav1.PatchOptions{}) if err != nil { return nil, err } diff --git a/test/integration/utils/buildstrategies.go b/test/integration/utils/buildstrategies.go index cbbf2bc9c..dc433e769 100644 --- a/test/integration/utils/buildstrategies.go +++ b/test/integration/utils/buildstrategies.go @@ -4,7 +4,13 @@ package utils -import "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" +) // This class is intended to host all CRUD calls for testing BuildStrategy CRDs resources @@ -12,7 +18,7 @@ import "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" func (t *TestBuild) CreateBuildStrategy(bs *v1alpha1.BuildStrategy) error { bsInterface := t.BuildClientSet.BuildV1alpha1().BuildStrategies(t.Namespace) - _, err := bsInterface.Create(bs) + _, err := bsInterface.Create(context.TODO(), bs, metav1.CreateOptions{}) if err != nil { return err } diff --git a/test/integration/utils/clusterbuildstrategies.go b/test/integration/utils/clusterbuildstrategies.go index bbb933f77..8cb3c9696 100644 --- a/test/integration/utils/clusterbuildstrategies.go +++ b/test/integration/utils/clusterbuildstrategies.go @@ -5,6 +5,8 @@ package utils import ( + "context" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" @@ -16,7 +18,7 @@ import ( func (t *TestBuild) CreateClusterBuildStrategy(cbs *v1alpha1.ClusterBuildStrategy) error { cbsInterface := t.BuildClientSet.BuildV1alpha1().ClusterBuildStrategies() - _, err := cbsInterface.Create(cbs) + _, err := cbsInterface.Create(context.TODO(), cbs, metav1.CreateOptions{}) if err != nil { return err } @@ -27,7 +29,7 @@ func (t *TestBuild) CreateClusterBuildStrategy(cbs *v1alpha1.ClusterBuildStrateg func (t *TestBuild) DeleteClusterBuildStrategy(name string) error { cbsInterface := t.BuildClientSet.BuildV1alpha1().ClusterBuildStrategies() - err := cbsInterface.Delete(name, &metav1.DeleteOptions{}) + err := cbsInterface.Delete(context.TODO(), name, metav1.DeleteOptions{}) if err != nil { return err } diff --git a/test/integration/utils/namespaces.go b/test/integration/utils/namespaces.go index 394dac3bb..1930017d2 100644 --- a/test/integration/utils/namespaces.go +++ b/test/integration/utils/namespaces.go @@ -5,6 +5,8 @@ package utils import ( + "context" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -19,7 +21,7 @@ func (t *TestBuild) CreateNamespace() error { Name: t.Namespace, }, } - _, err := client.Create(ns) + _, err := client.Create(context.TODO(), ns, metav1.CreateOptions{}) if err != nil { return err } @@ -31,7 +33,7 @@ func (t *TestBuild) DeleteNamespaces(nsList []string) error { client := t.Clientset.CoreV1().Namespaces() for _, ns := range nsList { - err := client.Delete(ns, &metav1.DeleteOptions{}) + err := client.Delete(context.TODO(), ns, metav1.DeleteOptions{}) if err != nil { return err } diff --git a/test/integration/utils/secrets.go b/test/integration/utils/secrets.go index da16d8ccd..5821aadab 100644 --- a/test/integration/utils/secrets.go +++ b/test/integration/utils/secrets.go @@ -5,7 +5,10 @@ package utils import ( + "context" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // This class is intended to host all CRUD calls for testing secrets primitive resources @@ -13,7 +16,7 @@ import ( // CreateSecret generates a Secret on the current test namespace func (t *TestBuild) CreateSecret(ns string, secret *corev1.Secret) error { client := t.Clientset.CoreV1().Secrets(ns) - _, err := client.Create(secret) + _, err := client.Create(context.TODO(), secret, metav1.CreateOptions{}) if err != nil { return err } diff --git a/test/integration/utils/service_accounts.go b/test/integration/utils/service_accounts.go index 8f1a93f54..ddfedc03d 100644 --- a/test/integration/utils/service_accounts.go +++ b/test/integration/utils/service_accounts.go @@ -5,6 +5,8 @@ package utils import ( + "context" + corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -16,7 +18,7 @@ import ( // CreateSAFromName creates a simple ServiceAccount with the provided name if it does not exist. func (t *TestBuild) CreateSAFromName(saName string) error { client := t.Clientset.CoreV1().ServiceAccounts(t.Namespace) - _, err := client.Get(saName, metav1.GetOptions{}) + _, err := client.Get(context.TODO(), saName, metav1.GetOptions{}) // If the service account already exists, no error is returned if err == nil { return nil @@ -24,17 +26,17 @@ func (t *TestBuild) CreateSAFromName(saName string) error { if !apierrors.IsNotFound(err) { return err } - _, err = client.Create(&corev1.ServiceAccount{ + _, err = client.Create(context.TODO(), &corev1.ServiceAccount{ ObjectMeta: metav1.ObjectMeta{ Name: saName, - }}) + }}, metav1.CreateOptions{}) return err } // GetSA retrieves an existing service-account by name func (t *TestBuild) GetSA(saName string) (*v1.ServiceAccount, error) { client := t.Clientset.CoreV1().ServiceAccounts(t.Namespace) - sa, err := client.Get(saName, metav1.GetOptions{}) + sa, err := client.Get(context.TODO(), saName, metav1.GetOptions{}) if err != nil { return nil, err } From 1ba87349f8c2037f558371aabdc6fd123d4f0ae7 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Mon, 2 Nov 2020 19:08:20 -0500 Subject: [PATCH 4/6] Update operator-sdk to v0.18.2 - Re-generate crds. - Replace --local flag with local command. --- Makefile | 4 ++-- hack/install-operator-sdk.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8311058b9..dcc68b812 100644 --- a/Makefile +++ b/Makefile @@ -190,11 +190,11 @@ install-strategies: install-apis local: install-strategies build OPERATOR_NAME=build-operator \ - operator-sdk run --local --operator-flags="$(ZAP_FLAGS)" + operator-sdk run local --operator-flags="$(ZAP_FLAGS)" local-plain: build-plain OPERATOR_NAME=build-operator \ - operator-sdk run --local --operator-flags="$(ZAP_FLAGS)" + operator-sdk run local --operator-flags="$(ZAP_FLAGS)" clean: rm -rf $(OUTPUT_DIR) diff --git a/hack/install-operator-sdk.sh b/hack/install-operator-sdk.sh index 0d6b06d0f..41c25e6ff 100755 --- a/hack/install-operator-sdk.sh +++ b/hack/install-operator-sdk.sh @@ -10,7 +10,7 @@ set -eu -SDK_VERSION="${SDK_VERSION:-v0.17.0}" +SDK_VERSION="${SDK_VERSION:-v0.18.2}" SDK_HOST="github.com" SDK_HOST_PATH="operator-framework/operator-sdk/releases/download" From 8f54809e5e233b5ece77991d5c878d77df4748e0 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Mon, 2 Nov 2020 19:09:08 -0500 Subject: [PATCH 5/6] Update kind - Use kind v0.8.0 and k8s 1.18.2 - Run kind registry on its own network, fix default name --- hack/install-kind.sh | 4 ++-- hack/install-registry.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hack/install-kind.sh b/hack/install-kind.sh index c17d28f71..c1e34c42c 100755 --- a/hack/install-kind.sh +++ b/hack/install-kind.sh @@ -11,7 +11,7 @@ set -eu # kind version -KIND_VERSION="${KIND_VERSION:-v0.7.0}" +KIND_VERSION="${KIND_VERSION:-v0.8.0}" if [ ! -f "${GOPATH}/bin/kind" ] ; then echo "# Installing KinD..." @@ -25,7 +25,7 @@ kind --version KIND_CLUSTER_NAME="${KIND_CLUSTER_NAME:-kind}" # kind cluster version -KIND_CLUSTER_VERSION="${KIND_CLUSTER_VERSION:-v1.17.0}" +KIND_CLUSTER_VERSION="${KIND_CLUSTER_VERSION:-v1.18.2}" echo "# Creating a new Kubernetes cluster..." kind create cluster --quiet --name="${KIND_CLUSTER_NAME}" --image="kindest/node:${KIND_CLUSTER_VERSION}" --wait=120s diff --git a/hack/install-registry.sh b/hack/install-registry.sh index 45f685ada..e87f94995 100755 --- a/hack/install-registry.sh +++ b/hack/install-registry.sh @@ -22,7 +22,7 @@ if [[ ! -z "${ACTION}" ]] && [[ "${ACTION}" != "show" ]] ; then fi # contrainer registry name -REGISTRY_NAME="${REGISTRY_NAME:-registry}" +REGISTRY_NAME="${REGISTRY_NAME:-kind-registry}" # container registry port REGISTRY_PORT="${REGISTRY_PORT:-5000}" @@ -41,6 +41,7 @@ function start_registry () { --publish="${REGISTRY_PORT}:5000" \ --restart="always" \ --detach \ + --net=kind \ registry:2 cat << EOS @@ -51,7 +52,7 @@ EOS } function show_ipaddr () { - docker inspect --format='{{ .NetworkSettings.IPAddress }}' "${REGISTRY_NAME}" + docker inspect --format='{{ .NetworkSettings.Networks.kind.IPAddress }}' "${REGISTRY_NAME}" } if [ "${ACTION}" == "" ] ; then From 7febc70c60de51738bebcee91ed0588d4f3e3994 Mon Sep 17 00:00:00 2001 From: Adam Kaplan Date: Mon, 2 Nov 2020 21:38:00 -0500 Subject: [PATCH 6/6] tekton bump changes - Update taskruns wrapper --- test/integration/utils/taskruns.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/integration/utils/taskruns.go b/test/integration/utils/taskruns.go index fc5dfa5b6..c4939c8f0 100644 --- a/test/integration/utils/taskruns.go +++ b/test/integration/utils/taskruns.go @@ -5,6 +5,7 @@ package utils import ( + "context" "errors" "fmt" @@ -23,7 +24,7 @@ func (t *TestBuild) GetTaskRunFromBuildRun(buildRunName string) (*v1beta1.TaskRu trInterface := t.PipelineClientSet.TektonV1beta1().TaskRuns(t.Namespace) - trList, err := trInterface.List(metav1.ListOptions{ + trList, err := trInterface.List(context.TODO(), metav1.ListOptions{ LabelSelector: taskRunLabelSelector, }) if err != nil { @@ -41,7 +42,7 @@ func (t *TestBuild) GetTaskRunFromBuildRun(buildRunName string) (*v1beta1.TaskRu func (t *TestBuild) UpdateTaskRun(tr *v1beta1.TaskRun) (*v1beta1.TaskRun, error) { trInterface := t.PipelineClientSet.TektonV1beta1().TaskRuns(t.Namespace) - return trInterface.Update(tr) + return trInterface.Update(context.TODO(), tr, metav1.UpdateOptions{}) } // GetTRReason returns the Reason of the Succeeded condition